flutter_qr_code_scaner 2.0.1 copy "flutter_qr_code_scaner: ^2.0.1" to clipboard
flutter_qr_code_scaner: ^2.0.1 copied to clipboard

This package allows user to read or get the data by scan or read QRCode from other object(like wall) or the local image file. This package is available thanks to @hetian9288's work.

This is a forked package from flutter_qr_code_scaner

flutter_qr_code_scaner #

Pub Awesome Flutter Awesome Flutter License

QR code (scan code / picture) recognition (AndroidView/UiKitView)

features: #

  • place the code inside the square frame to get the information from QR code
  • select QR code from your local library from the image picker inside the ScanView

Getting Started #

import 'package:flutter_qr_code_scaner/scan_view.dart';

class HomePage extends StatefulWidget {
  HomePage({Key key}) : super(key: key);

  @override
  _HomePageState createState() => new _HomePageState();
}

class _HomePageState extends State<HomePage> {
  String result = '';

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Package example app'),
      ),
      body: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 16),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
            RaisedButton(
              onPressed: () async {
                String results = await Navigator.push( // waiting for the scan results
                  context,
                  MaterialPageRoute(
                    builder: (context) => ScanView(), // open the scan view
                  ),
                );

                if (results != null) {
                  setState(() {
                    result = results;
                  });
                }
              },
              child: Text("扫码/tap to scan"),
            ),
            Text(result), // display the scan results
          ],
        ),
      ),
    );
  }
} 

For IOS #

Opt-in to the embedded views preview by adding a boolean property to the app's Info.plist file with the key io.flutter.embedded_views_preview and the value YES.

<key>io.flutter.embedded_views_preview</key>
<string>YES</string>

And you will need provide the description of camera's permission to work properly, otherwise will crash your app.

  <key>NSCameraUsageDescription</key>
	<string>The porpuse explaining why you will use the camera</string>
8
likes
95
pub points
57%
popularity

Publisher

verified publishertoutao.cloud

This package allows user to read or get the data by scan or read QRCode from other object(like wall) or the local image file. This package is available thanks to @hetian9288's work.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, image_picker, permission_handler

More

Packages that depend on flutter_qr_code_scaner