flutter_plugin_qrcode 2.0.0 copy "flutter_plugin_qrcode: ^2.0.0" to clipboard
flutter_plugin_qrcode: ^2.0.0 copied to clipboard

the flutter qr code scanning plugin supports android and ios

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:flutter_plugin_qrcode/flutter_plugin_qrcode.dart';

void main() => runApp(MyApp());

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

class _MyAppState extends State<MyApp> {
  String _qrcode = '二维码扫描';

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


  Future<void> getQrcodeState() async {
    String qrcode;
    try {
      qrcode = await FlutterPluginQrcode.getQRCode;
    } on PlatformException {
      qrcode = 'Failed to get platform version.';
    }

    if (!mounted) return;
    setState(() {
      _qrcode = qrcode;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flutter QRCode Plugin example app'),
        ),
        body: Center(

          child: FlatButton(onPressed: (){
            getQrcodeState();

          },
              child: Text('$_qrcode')),
        ),
      ),
    );
  }
}
3
likes
25
points
34
downloads

Publisher

unverified uploader

Weekly Downloads

the flutter qr code scanning plugin supports android and ios

Repository (GitHub)

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_plugin_qrcode