super_qr_reader 2.1.5 copy "super_qr_reader: ^2.1.5" to clipboard
super_qr_reader: ^2.1.5 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.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:flutter/cupertino.dart';

import 'package:super_qr_reader/super_qr_reader.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: HomePage());
  }
}

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

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

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

  @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(
                  context,
                  MaterialPageRoute(
                    builder: (context) => ScanView(
                      hasLightSwitch: false,
                      hasHintText: false,
                      hasImagePicker: false,
                    ),
                  ),
                );

                if (results != null) {
                  setState(() {
                    result = results;
                  });
                }
              },
              child: Text("扫码/tap to scan"),
            ),
            Text(result),
          ],
        ),
      ),
    );
  }
}
17
likes
30
pub points
55%
popularity

Publisher

unverified uploader

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

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, image_picker, permission_handler

More

Packages that depend on super_qr_reader