QR.Flutter is a Flutter library for simple and fast QR code rendering via a Widget or custom painter.
- Built on QR - Dart
- Supports QR code versions 1 - 40
- Error correction / redundancy
- Configurable output size, padding, background and foreground colors
- Export to image data to save to file or use in memory
- No internet connection required
You can install the package by adding the following lines to your
dependencies: qr_flutter: ^1.1.6
After adding the dependency to your
pubspec.yaml you can run:
flutter packages get or update your packages using
To start, import the dependency in your code:
Next, to render a basic QR code you can use the following code (or something like it):
new QrImage( data: "1234567890", size: 200.0, ),
Depending on your data requirements you may want to tweak the QR code output. The following options are available:
|int||A value between 1 and 40. See http://www.qrcode.com/en/about/version.html for details.|
|int||A value defined on |
|double||The (square) size of the image. If not given, will auto size using shortest size constraint.|
|EdgeInsets||Padding surrounding the QR code data|
|Color||The background color (default is none)|
|Color||The foreground color (default is black)|
|bool||Adds an extra pixel in size to prevent gaps|
example directory for a basic working example.
Has it been tested in production? Can I use it in production?
Yep! It's stable and ready to rock. It's currently in use in quite a few production applications including:
Thanks to Kevin Moore for his awesome QR - Dart library. It's the core of this library.
For author/contributor information, see the
QR.Flutter is released under a modified MIT license. See
LICENSE for details.
- Built-in types and core primitives for a Flutter application. [...]
- Support for asynchronous programming, with classes such as Future and Stream. [...]
- Classes and utilities that supplement the collection support in dart:core. [...]
- Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
- Built-in types, collections, and other core functionality for every Dart program. [...]
- Interact with developer tools such as the debugger and inspector. [...]
- Mathematical constants and functions, plus a random number generator. [...]
- Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]
- File, socket, HTTP, and other I/O support for non-web applications. [...]
- Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]