image_painter_rotate 1.0.4 copy "image_painter_rotate: ^1.0.4" to clipboard
image_painter_rotate: ^1.0.4 copied to clipboard

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

image_painter_rotate #

pub package style: effective dart Platform Badge License: MIT

This project is a fork of the image_painter package, with added features and improvements.

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.
  • Export image as memory bytes which can be converted to image. Implementation provided on example
  • Ability to undo and clear drawings.
  • Built in control bar.
  • Support rotation by quarterTurns

[Note] Tested and working only on flutter stable channel. Please make sure you are on stable channel of flutter before using the package.

Getting started #

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

dependencies:
  ...
  image_painter_rotate: latest

In your library add the following import:

import 'package:image_painter_rotate/image_painter_rotate.dart';

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

Using the library #

Check out the example

Basic usage of the library:

  • ImagePainter.network: Painting over image from network url.
/// Initialize `ImagePainterController`. 
final imagePainterController = ImagePainterController();

/// Provide controller to the painter.
ImagePainter.network(
  "https://sample_image.png",
  controller: imagePainterController,
  scalable: true,
  quarterTurns: 1, // rotate 45 degree
),

///Export the image:
Uint8List byteArray = await imagePainterController.exportImage();

/// Create a file or create a File instance of existing file. 
File imgFile =  File('directoryPath/fileName.png');

/// Now you use `Uint8List` data and write it into the file.
imgFile.writeAsBytesSync(image);

For more thorough implementation guide, check the example.

Issues and Support. #

For any issues or support please visit the Issues.

0
likes
150
points
462
downloads

Publisher

verified publishersatoyan.net

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on image_painter_rotate