recognition_qrcode 1.0.1 copy "recognition_qrcode: ^1.0.1" to clipboard
recognition_qrcode: ^1.0.1 copied to clipboard

outdated

The flutter plugin that identifies the QR code in the imagenflu.

example/lib/main.dart

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

import 'package:image_picker/image_picker.dart';
import 'package:recognition_qrcode/recognition_qrcode.dart';

void main() {
  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: CupertinoButton(
              child: Text("识别图片"),
              onPressed: () {
                final picker = ImagePicker();
                picker.getImage(source: ImageSource.gallery).then((value) {
                  RecognitionQrcode.recognition(value.path).then((result) {
                    print("RecognitionQrcode: $result");
                  });
                }); //
              }),
        ),
      ),
    );
  }
}
3
likes
0
pub points
85%
popularity

Publisher

unverified uploader

The flutter plugin that identifies the QR code in the imagenflu.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on recognition_qrcode