image_painter 0.1.1 copy "image_painter: ^0.1.1" to clipboard
image_painter: ^0.1.1 copied to clipboard

outdated

A flutter package for drawing over images. Supports color, strokeWidth, different paintModes and exporting image.

image_painter #

A flutter implementation of painting over image.

OverView #

demo!

Features #

  • Seven available paint modes. Line, Box/Rectangle, Circle, Freestyle/Signature, Dotted Line, Arrow and Text.
  • Four constructors for adding image from Network Url, Asset Image, Image from file and from memory.
  • Controls from constructors like strokeWidth and Colors.
  • Export image as memory bytes which can be converted to image. Implementation provided on example
  • Ability to undo and clear drawings.

Getting started #

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  image_painter:

In your library add the following import:

import 'package:image_painter/image_painter.dart';

For help getting started with Flutter, view the online documentation.

Using the library #

Check out the example

Basic usage of the libary:

  • ImagePainter.network: Painting over url from network.
///Initialize the controller
Controller imageController = Controller();
///Provide controller to the painter.
ImagePainter.network("https://sample_image.png",
                  key: _imageKey, controller: imageController, scalable: true),
///To change color, strokewidth or paint mode: 
setState((){
    imageController.color = Colors.red;
    imageController.mode = PaintMode.Arrow;
    imageController.strokeWidth = 10.0;
})
///Export the image:
Uint8List image = await _imageKey.currentState.exportImage();
///Now you use [Uint8List] image to convert it to file.
File imgFile = new File('myFilePath/sample.png');
    imgFile.writeAsBytesSync(image);
193
likes
0
pub points
94%
popularity

Publisher

unverified uploader

A flutter package for drawing over images. Supports color, strokeWidth, different paintModes and exporting image.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on image_painter