mvbarcodescan 0.0.4 copy "mvbarcodescan: ^0.0.4" to clipboard
mvbarcodescan: ^0.0.4 copied to clipboard

outdated

A new Flutter plugin to scan barcode and qrcodes using Google Mobile vision & Apple AVFoundation

example/lib/main.dart

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

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

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

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

class _MyAppState extends State<MyApp> {
  String _scannedBarCode = '';

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

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> scanBarCode() async {
    String barCode;
    try {
      barCode = await Mvbarcodescan.scan;
    } on PlatformException {
      barCode = '';
    }

    setState(() {
      _scannedBarCode = barCode;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            scanBarCode();
          },
          child: Icon(Icons.camera),
        ),
        appBar: AppBar(
          title: const Text('Barcode Scan'),
        ),
        body: Center(
          child: Text('Scanned Barcode : $_scannedBarCode\n'),
        ),
      ),
    );
  }
}
2
likes
0
pub points
5%
popularity

Publisher

verified publisherandroid-pratap.blogspot.com

A new Flutter plugin to scan barcode and qrcodes using Google Mobile vision & Apple AVFoundation

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on mvbarcodescan