ImagePainter.file constructor
ImagePainter.file(
- File file, {
- required Key key,
- double? height,
- double? width,
- bool? scalable,
- Widget? placeholderWidget,
- List<
Color> ? colors, - Widget? brushIcon,
- Widget? undoIcon,
- Widget? clearAllIcon,
- Widget? colorIcon,
- PaintMode? initialPaintMode,
- double? initialStrokeWidth,
- Color? initialColor,
- 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.
Implementation
factory ImagePainter.file(
File file, {
required Key key,
double? height,
double? width,
bool? scalable,
Widget? placeholderWidget,
List<Color>? colors,
Widget? brushIcon,
Widget? undoIcon,
Widget? clearAllIcon,
Widget? colorIcon,
PaintMode? initialPaintMode,
double? initialStrokeWidth,
Color? initialColor,
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,
}) {
return ImagePainter._(
key: key,
file: file,
height: height,
width: width,
placeHolder: placeholderWidget,
colors: colors,
isScalable: scalable ?? false,
brushIcon: brushIcon,
undoIcon: undoIcon,
colorIcon: colorIcon,
clearAllIcon: clearAllIcon,
initialPaintMode: initialPaintMode,
initialColor: initialColor,
initialStrokeWidth: initialStrokeWidth,
onPaintModeChanged: onPaintModeChanged,
onColorChanged: onColorChanged,
onStrokeWidthChanged: onStrokeWidthChanged,
textDelegate: textDelegate,
controlsAtTop: controlsAtTop ?? true,
showControls: showControls ?? true,
controlsBackgroundColor: controlsBackgroundColor,
optionSelectedColor: selectedColor,
optionUnselectedColor: unselectedColor,
optionColor: optionColor,
onUndo: onUndo,
onClear: onClear,
);
}