UDocShape.create constructor
UDocShape.create({
- required UDocShapeKind kind,
- required List<
Offset> points, - required Color strokeColor,
- int pageIndex = -1,
- int blockIndex = -1,
- Color? fillColor,
- double strokeWidth = 0.004,
- double opacity = 1,
- bool dashed = false,
- String text = "",
- double fontSize = 0.028,
- bool bold = false,
- int? startMs,
- int? endMs,
Implementation
factory UDocShape.create({
required UDocShapeKind kind,
required List<Offset> points,
required Color strokeColor,
int pageIndex = -1,
int blockIndex = -1,
Color? fillColor,
double strokeWidth = 0.004,
double opacity = 1,
bool dashed = false,
String text = "",
double fontSize = 0.028,
bool bold = false,
int? startMs,
int? endMs,
}) {
final DateTime now = DateTime.now();
return UDocShape(
id: _shapeId(),
kind: kind,
points: points,
strokeColor: strokeColor,
pageIndex: pageIndex,
blockIndex: blockIndex,
fillColor: fillColor,
strokeWidth: strokeWidth,
opacity: opacity,
dashed: dashed,
text: text,
fontSize: fontSize,
bold: bold,
startMs: startMs,
endMs: endMs,
createdAt: now,
updatedAt: now,
);
}