ImagePainter class

ImagePainter widget.

Inheritance
Annotations

Constructors

ImagePainter.asset(String path, {required ImagePainterController controller, Key? key, double? height, double? width, bool? scalable, Widget? placeholderWidget, List<Color>? colors, Widget? brushIcon, Widget? undoIcon, Widget? clearAllIcon, Widget? colorIcon, ValueChanged<PaintMode>? onPaintModeChanged, ValueChanged<Color>? onColorChanged, ValueChanged<double>? onStrokeWidthChanged, TextDelegate? textDelegate, bool? controlsAtTop, bool? showControls, Color? controlsBackgroundColor, Color? selectedColor, Color? unselectedColor, Color? optionColor, VoidCallback? onUndo, VoidCallback? onClear})
Constructor for loading image from assetPath.
factory
ImagePainter.file(File file, {required ImagePainterController controller, Key? key, double? height, double? width, bool? scalable, Widget? placeholderWidget, List<Color>? colors, Widget? brushIcon, Widget? undoIcon, Widget? clearAllIcon, Widget? colorIcon, ValueChanged<PaintMode>? onPaintModeChanged, ValueChanged<Color>? onColorChanged, ValueChanged<double>? onStrokeWidthChanged, TextDelegate? textDelegate, bool? controlsAtTop, bool? showControls, Color? controlsBackgroundColor, Color? selectedColor, Color? unselectedColor, Color? optionColor, VoidCallback? onUndo, VoidCallback? onClear})
Constructor for loading image from File.
factory
ImagePainter.memory(Uint8List byteArray, {required ImagePainterController controller, Key? key, double? height, double? width, bool? scalable, Widget? placeholderWidget, List<Color>? colors, Widget? brushIcon, Widget? undoIcon, Widget? clearAllIcon, Widget? colorIcon, ValueChanged<PaintMode>? onPaintModeChanged, ValueChanged<Color>? onColorChanged, ValueChanged<double>? onStrokeWidthChanged, TextDelegate? textDelegate, bool? controlsAtTop, bool? showControls, Color? controlsBackgroundColor, Color? selectedColor, Color? unselectedColor, Color? optionColor, VoidCallback? onUndo, VoidCallback? onClear})
Constructor for loading image from memory.
factory
ImagePainter.network(String url, {required ImagePainterController controller, Key? key, double? height, double? width, Widget? placeholderWidget, bool? scalable, List<Color>? colors, Widget? brushIcon, Widget? undoIcon, Widget? clearAllIcon, Widget? colorIcon, ValueChanged<PaintMode>? onPaintModeChanged, ValueChanged<Color>? onColorChanged, ValueChanged<double>? onStrokeWidthChanged, TextDelegate? textDelegate, bool? controlsAtTop, bool? showControls, Color? controlsBackgroundColor, Color? selectedColor, Color? unselectedColor, Color? optionColor, VoidCallback? onUndo, VoidCallback? onClear})
Constructor for loading image from network url.
factory
ImagePainter.signature({required ImagePainterController controller, required double height, required double width, Key? key, Color? signatureBgColor, List<Color>? colors, Widget? brushIcon, Widget? undoIcon, Widget? clearAllIcon, Widget? colorIcon, ValueChanged<PaintMode>? onPaintModeChanged, ValueChanged<Color>? onColorChanged, ValueChanged<double>? onStrokeWidthChanged, TextDelegate? textDelegate, bool? controlsAtTop, bool? showControls, Color? controlsBackgroundColor, Color? selectedColor, Color? unselectedColor, Color? optionColor, VoidCallback? onUndo, VoidCallback? onClear})
Constructor for signature painting.
factory

Properties

assetPath String?
Only accessible through ImagePainter.asset constructor.
final
brushIcon Widget?
Icon Widget of strokeWidth.
final
byteArray Uint8List?
Only accessible through ImagePainter.memory constructor.
final
clearAllIcon Widget?
Widget for clearing all actions on control bar.
final
colorIcon Widget?
Widget of Color Icon in control bar.
final
colors List<Color>?
List of colors for color selection If not provided, default colors are used.
final
controller ImagePainterController
Class that holds the controller and it's methods.
final
controlsAtTop bool
Define where the controls is located. true represents top.
final
controlsBackgroundColor Color?
final
file File?
Only accessible through ImagePainter.file constructor.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
Height of the Widget. Image is subjected to fit within the given height.
final
isScalable bool?
Defines whether the widget should be scaled or not. Defaults to false.
final
isSignature bool
Flag to determine signature or image;
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
networkUrl String?
Only accessible through ImagePainter.network constructor.
final
onClear VoidCallback?
final
onColorChanged ValueChanged<Color>?
final
onPaintModeChanged ValueChanged<PaintMode>?
final
onStrokeWidthChanged ValueChanged<double>?
final
onUndo VoidCallback?
final
optionColor Color?
final
optionSelectedColor Color?
final
optionUnselectedColor Color?
final
placeHolder Widget?
Widget to be shown during the conversion of provided image to ui.Image.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showControls bool
It will control displaying the Control Bar
final
signatureBackgroundColor Color
Signature mode background color
final
textDelegate TextDelegate?
final
undoIcon Widget?
Widget for Undo last action on control bar.
final
width double?
Width of the widget. Image is subjected to fit within the given width.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() ImagePainterState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited