- Include fill on text delegate thanks to R4F43Lv.
Controller
is exposed out of library. As a result of exposing, it has been renamed toImagePainterController
in order to avoid conflict with otherController
name objects.width
andheight
parameters are now required forImagePainter.Signature()
constructor.GlobalKey
is no longer required to extract the image. It can be done through theImagePainterController
instance now.
/// Previously:
final _imageKey = GlobalKey<ImagePainterState>();
/// Provide key to the painter.
ImagePainter.network("https://sample_image.png",
key: _imageKey,scalable: true),
/// Export the image:
Uint8List byteArray = await _imageKey.currentState.exportImage();
/// Now you use `Uint8List` data and convert it to file.
File imgFile = new File('directoryPath/fileName.png');
imgFile.writeAsBytesSync(image);
/// Current:
final imagePainterController = ImagePainterController();
/// Provide controller to the painter.
ImagePainter.network("https://sample_image.png",
controller: imagePainterController,scalable: true),
///Export the image:
Uint8List byteArray = await imagePainterController.exportImage();
//Now you use `Uint8List` data and convert it to file.
File imgFile = new File('directoryPath/fileName.png');
imgFile.writeAsBytesSync(image);
- Parameters
initialPaintMode
,initialStrokeWidth
,initialColor
has been removed. They can be set while initializing the controller.
final ipController = ImagePainterController(
color: Colors.green,
strokeWidth: 4,
mode: PaintMode.line,
);
- Added parameters for hardcoded values thanks to eduardokuhn.
- Added the ability to hide controls thanks to ousvat.
- Added fill support.
- Refactored lots of methods.
- Added support for flutter web.
- Refactored unnecessary null calls.
- Refactored signature painter into it's own custompainter class.
- Bug Fixes.
- Refactored controller to act as listenable for canvas repaint.
- Removed dependency on depreciated copy of
InteractiveViewer
. - Removed vector math dependency.
- Bug fixes.
- Minor improvements
- Added text delegates thanks to avinath1998. Check example for implementation.
- Minor fixes.
- Fixed signature field initialization issue.
- Added parameters for setting initial values.
- Changed values are now emitted which can be saved for later use.
- Fixed signature field drawings.
- Fixed scalable on
ImagePainter.network
constructor.
- Migrate to null safety.
- Added
initialPaintMode
.
- Bumped up dependencies.
- Generated dartdoc api documentation.
- Fix static analysis
Breaking Changes:
Controller
is no longer required to pass as the editor will handle it manually.- No need to configure controls options. Package provides control bar with all the needed features like change mode, color, undo, clear etc.
- Text mode is available now. After adding text, it can be moved freely around until next operation.
- The
PaintMode
enums are now lowercases following dart conventions.
- Fixed issue with image parsing failing when used with file.
- Added exceptions to the image conversion failures.
- Fixed lint issues.
- Smoother look for signature mode.
- Local InteractiveViewer for future flutter version issues.
- Added dynamic strokeMultiplier to compensate strokewidth for high resolution image.
- Pan or moving around image is available to use when mode is
PaintMode.none
. - Performance improvements and lint fixes.
- Improved example.
- ByteArray on memory constructor now returns itself without conversion back if no action is performed on it.
- Code refactors.
- Breaking Change: Controller is immutable and can only be overridden with copyWith Constructor.
- Added PaintStyle in constructor.
- Code refactor.
- Fixed ImagePainter.memory constructor taking ui.Image while it should be taking Uint8List.
- Added signature field.
- Fixed scaling issues.
- Added example for signature field.
- Added documentation to the class and functions.
- Improved docs and readMe.
Initial version of image_painter library.
- Includes 7 modes of paint styles i.e. Line, Box/Rectangle, Circle, FreeStyle or Signature, Arrow, Dash/Dotted Lines and Text
- Includes controls for color and StrokeWidth.