A Flutter plugin providing performance optimized signature canvas with ability to set custom style, boundaries and initial state. This is native flutter implementation, so it supports all platforms.
In time of creation of this plugin, there was no available solution that had:
- required performance on wide range of devices
- ability to set canvas boundaries
- ability to initialize using previously saved state
To use this plugin, add
signature as a dependency in your
// IMPORT PACKAGE import 'package:signature/signature.dart'; // INITIALIZE. RESULT IS A WIDGET, SO IT CAN BE DIRECTLY USED IN BUILD METHOD var _signatureCanvas = Signature( width: 300, height: 300, backgroundColor: Colors.lightBlueAccent, ); // CLEAR CANVAS _signatureCanvas.clear(); // EXPORT BYTES (EXPORTING FORMAT IS PNG) _signatureCanvas.exportBytes(); // isEmpty/isNotEmpty CAN BE USED TO CHECK IF SIGNATURE HAS BEEN PROVIDED _signatureCanvas.isNotEmpty; //true if signature has been provided _signatureCanvas.isEmpty; //true if signature has NOT been provided // EXPORT POINTS (2D POINTS ROUGHLY REPRESENTING WHAT IS VISIBLE ON CANVAS) var exportedPoints = _signatureCanvas.exportPoints(); //EXPORTED POINTS CAN BE USED TO INITIALIZE PREVIOUS STATE VIA CONSTRUCTOR var _signatureCanvas = Signature( points: exportedPoints, width: 300, height: 300, backgroundColor: Colors.lightBlueAccent, );
Contribution and Support #
- Contributions are welcome!
- If you want to contribute code please create a PR
- If you find a bug or want a feature, please fill an issue
- Migration from
androidxpackages that allows this library to be used with flutter projects that use
androidx. If you need to stay on
android.supportfor whatever reason, don't upgrade as it may break your build. See more.
- Fixed breaking change in Picture.toImage in latest flutter
- New properties isEmpty and isNotEmpty at Signature class for validation purposes
- fixed bug where canvas was not writable in case of specific boundary setup
- removed debug statements and cleanup
- README modifications and code reformat
- Initial release
Demonstrates how to use the signature plugin.
Getting Started #
For help getting started with Flutter, view our online documentation.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: signature: ^2.0.0
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Sep 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.5.0
- pana: 0.12.21
- Flutter: 1.9.1+hotfix.2
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.
flutter format to format