ScribbleState.drawing constructor
const
ScribbleState.drawing({
- required Sketch sketch,
- SketchLine? activeLine,
- @Default(ScribblePointerMode.all) ScribblePointerMode allowedPointersMode,
- @Default([]) List<
int> activePointerIds, - Point? pointerPosition,
- @Default(0xFF000000) int selectedColor,
- @Default(5) double selectedWidth,
- @Default(1) double scaleFactor,
- @Default(0) double simplificationTolerance,
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,
/// {@template view.state.scribble_state.simplification_tolerance}
/// The current tolerance of simplification, in pixels.
///
/// Lines will be simplified when they are finished. A value of 0 (default)
/// will mean no simplification.
/// {@endtemplate}
@Default(0) double simplificationTolerance,
}) = Drawing;