If you're using Flutter 1.2+ or the master/beta channel then you will need to use version
2.0.0 or higher as Flutter 1.2 is not compatible with earlier versions of the Flutter framework.
dependencies: qr_flutter: ^2.0.0
If you're using an older Flutter version (< 1.2.1), you must use version
1.1.6 if you cannot upgrade to the latest version of Flutter:
dependencies: qr_flutter: ^1.1.6
Note: If you're using the Flutter
master channel, if you encounter build issues, or want to try the latest and greatest then you should use the
master branch and not a specific release version. To do so, use the following configuration in your
dependencies: qr_flutter: git: url: git://github.com/lukef/qr.flutter.git
Keep in mind the
master branch could be unstable.
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 (default is true)|
example directory for a basic working example.
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.
gaplessoption is now
qr.dartis now exported so you don't need a second
test/painter_tests.dartfor an example)
A new Flutter project.
For help getting started with Flutter, view our online documentation.
Add this to your package's pubspec.yaml file:
dependencies: qr_flutter: ^2.1.0+55
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.
Now in your Dart code, you can use:
|2.1.0+55||Jun 6, 2019|
|2.0.0+51||Feb 26, 2019|
|1.1.6||Jan 16, 2019|
|1.1.5||Oct 31, 2018|
|1.1.3||Aug 9, 2018|
|1.1.2||Aug 6, 2018|
|1.1.1||Apr 20, 2018|
|1.1.0||Apr 20, 2018|
|1.0.0||Mar 4, 2018|
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 Jun 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.
flutter format to format
flutter format to format
Support latest dependencies. (-5 points)
The version constraint in
pubspec.yaml does not support the latest published versions for 1 dependency.