qr_flutter 1.1.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 93

QR.Flutter is a QR code generation and rendering library for Flutter.

Features

  • Built on QR - Dart
  • Supports QR code versions 1 - 40
  • Error correction / redundancy
  • Configurable output size, padding, background and foreground colors
  • No internet connection required

Installing

You can install the package by adding the following lines to your pubspec.yaml:

dependencies:
  qr_flutter: ^1.1.1

After adding the dependency to your pubspec.yaml you can run: pub get or flutter packages get if you're using Flutter.

Getting started

To start, import the dependency in your code:

import 'package:qr_flutter/qr_flutter.dart';

Next, to render a basic QR code you can do as such:

new QrImage(
  data: "1234567890",
  size: 200.0,
),

Depending on your data requirements you may want to tweak the QR code output:

PropertyTypeDescription
versionintA value between 1 and 40. See http://www.qrcode.com/en/about/version.html for details.
errorCorrectionLevelintA value defined on QrErrorCorrectLevel. e.g.: QrErrorCorrectLevel.L.
sizedoubleThe (square) size of the image
paddingEdgeInsetsPadding surrounding the QR code data
backgroundColorColorThe background color (default is none)
foregroundColorColorThe foreground color (default is black)

Demo

See the example directory for a basic working example.

Authors

1.1.1

  • Fixes and issue where the QR image won't get repainted even though the data has changed

1.1.0

  • Update to 1.0 release of the dart qr library

1.0.0

  • Initial release

example/lib/main.dart

import 'package:flutter/material.dart';

import 'screens/main.screen.dart';

void main() => runApp(new App());

class App extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'QR code demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MainScreen(),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  qr_flutter: "^1.1.1"

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


      import 'package:qr_flutter/qr_flutter.dart';
  
Version Uploaded Documentation Archive
1.1.1 Apr 20, 2018 Go to the documentation of qr_flutter 1.1.1 Download qr_flutter 1.1.1 archive
1.1.0 Apr 20, 2018 Go to the documentation of qr_flutter 1.1.0 Download qr_flutter 1.1.0 archive
1.0.0 Mar 4, 2018 Go to the documentation of qr_flutter 1.0.0 Download qr_flutter 1.0.0 archive

Analysis

We analyzed this package on May 22, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.54.0
  • pana: 0.11.1
  • Flutter: 0.4.4

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
88 / 100
Health:
Code health derived from static analysis. [more]
96 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
93
Learn more about scoring.

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 3 hints.

    Run flutter format to format lib/qr_flutter.dart.

    Run flutter format to format lib/src/qr_image.dart.

    Similar analysis of the following files failed:

    • lib/src/qr_painter.dart (hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
flutter 0.0.0
qr ^1.0.0 1.0.0
Transitive dependencies
collection 1.14.6 1.14.9
meta 1.1.5
sky_engine 0.0.99
typed_data 1.1.5
vector_math 2.0.6 2.0.7