twitter_qr_scanner 1.0.4
twitter_qr_scanner: ^1.0.4

Flutter Android iOS

Twitter qr code scan package for flutter.Qr code scanner and qr code generator plugin

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");
      });
    });
  }
}
8
likes
70
pub points
79%
popularity

Twitter qr code scan package for flutter.Qr code scanner and qr code generator plugin

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

furkan.kayali@bil.omu.edu.tr

License

unknown (LICENSE)

Dependencies

carousel_slider, flare_flutter, flutter, qr_flutter

More

Packages that depend on twitter_qr_scanner