twitter_qr_scanner 1.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 87

QR Code Scanner #

QR Code scan page like Twitter.

Example #

Installation #

To use this plugin, add twitter_qr_scanner as a dependency in your pubspec.yaml file.

twitter_qr_scanner: any

Getting Started #

Check out the example app using twitter_qr_scanner.

Android Integration #

This plugin work only level greater then sdk version 21.

iOS Integration #

In order to use this plugin, add the following to your Info.plist file:

<key>io.flutter.embedded_views_preview</key>
<true/>

Flutter #

İnit:

  GlobalKey qrKey = GlobalKey();
  QRViewController controller;

Widget:

QRView(
          key: qrKey,
          overlay: QrScannerOverlayShape(
              borderRadius: 16,
              borderColor: Colors.white,
              borderLength: 120,
              borderWidth: 10,
              cutOutSize: 250),
          onQRViewCreated: _onQRViewCreate,
          data: "QR TEXT",// Showing qr code data
        )

Scan:

  void _onQRViewCreate(QRViewController controller) {
    this.controller = controller;
    controller.scannedDataStream.listen((scanData) {
      setState(() {
        print("QRCode: $scanData");
      });
    });
  }

Dispose:

   @override
  void dispose() {
    controller?.dispose();
    super.dispose();
  }

License #

Apache

[0.0.1] - 13 January 2020 #

  • Twitter qr code scan package for flutter.

[0.0.2] - 13 January 2020 #

  • Updated readme

[0.0.3] - 13 January 2020 #

  • Updated readme

[0.0.4] - 13 January 2020 #

  • QrScannerOverlayShape Added##

[0.0.5] - 13 January 2020 #

  • unregistered type: com.anka.twitter_qr_scanner/qrview bug fixed

[0.0.6] - 13 January 2020 #

  • unregistered type: com.anka.twitter_qr_scanner/qrview bug fixed

[1.0.0] - 29 January 2020 #

  • Release version published

[1.0.1] - 29 January 2020 #

  • Files formatted

[1.0.2] - 29 January 2020 #

  • İnitial mode added

[1.0.3] - 29 January 2020 #

  • initial mode bug fixed

[1.0.4] - 29 January 2020 #

  • initial mode bug fixed

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:twitter_qr_scanner/twitter_qr_scanner.dart';
import 'package:twitter_qr_scanner/QrScannerOverlayShape.dart';

void main() => runApp(MaterialApp(home: MyApp()));

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: RaisedButton(
          child: Text('Scan'),
          onPressed: (){
            Navigator.of(context).push(MaterialPageRoute(builder: (context) => QRExample()));
          },
        ),
      ),
    );
  }
}



class QRExample extends StatefulWidget {
  QRExample({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _QRExampleState createState() => _QRExampleState();
}

class _QRExampleState extends State<QRExample> {
  GlobalKey qrKey = GlobalKey();
  QRViewController controller;
  var qrText = "  Henüz tarama yapmadın";

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.black,
        body: QRView(
          key: qrKey,
          overlay: QrScannerOverlayShape(
              borderRadius: 16,
              borderColor: Colors.white,
              borderLength: 120,
              borderWidth: 10,
              cutOutSize: 250),
          onQRViewCreated: _onQRViewCreate,
          data: "QR TEXT",
        ));
  }

  @override
  void dispose() {
    controller?.dispose();
    super.dispose();
  }

  void _onQRViewCreate(QRViewController controller) {
    this.controller = controller;
    controller.scannedDataStream.listen((scanData) {
      setState(() {
        print("QRCode: $scanData");
      });
    });
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  twitter_qr_scanner: ^1.0.4

2. Install it

You can install packages from the command line:

with Flutter:


$ 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:


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

We analyzed this package on Mar 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Format lib/twitter_qr_scanner.dart.

Run flutter format to format lib/twitter_qr_scanner.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
carousel_slider ^1.4.1 1.4.1
flare_flutter ^2.0.1 2.0.1
flutter 0.0.0
qr_flutter ^3.2.0 3.2.0
Transitive dependencies
collection 1.14.11 1.14.12
flare_dart 2.3.3
meta 1.1.8
qr 1.2.0
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test