ScribbleState.drawing constructor

const ScribbleState.drawing({
  1. required Sketch sketch,
  2. SketchLine? activeLine,
  3. @Default(ScribblePointerMode.all) ScribblePointerMode allowedPointersMode,
  4. @Default([]) List<int> activePointerIds,
  5. Point? pointerPosition,
  6. @Default(0xFF000000) int selectedColor,
  7. @Default(5) double selectedWidth,
  8. @Default(1) double scaleFactor,
})

The state of the scribble widget when it is being drawn on.

Implementation

const factory ScribbleState.drawing({
  /// The current state of the sketch
  required Sketch sketch,

  /// The line that is currently being drawn
  SketchLine? activeLine,

  /// Which pointers are allowed for drawing and will be captured by the
  /// scribble widget.
  @Default(ScribblePointerMode.all) ScribblePointerMode allowedPointersMode,

  /// The ids of all supported pointers that are currently interacting with
  /// the widget.
  @Default([]) List<int> activePointerIds,

  /// The current position of the pointer
  Point? pointerPosition,

  /// The color that is currently being drawn with
  @Default(0xFF000000) int selectedColor,

  /// The current width of the pen
  @Default(5) double selectedWidth,

  /// {@template view.state.scribble_state.scale_factor}
  /// How much the widget is scaled at the moment.
  ///
  /// Can be used if zoom functionality is needed
  /// (e.g. through InteractiveViewer) so that the pen width remains the same.
  /// {@endtemplate}
  @Default(1) double scaleFactor,
}) = Drawing;