UDocShape.create constructor

UDocShape.create({
  1. required UDocShapeKind kind,
  2. required List<Offset> points,
  3. required Color strokeColor,
  4. int pageIndex = -1,
  5. int blockIndex = -1,
  6. Color? fillColor,
  7. double strokeWidth = 0.004,
  8. double opacity = 1,
  9. bool dashed = false,
  10. String text = "",
  11. double fontSize = 0.028,
  12. bool bold = false,
  13. int? startMs,
  14. 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,
  );
}