multiplebarcode 0.0.16 multiplebarcode: ^0.0.16 copied to clipboard
A Flutter Plugin For Read multiple barcodes and QR codes.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:multiplebarcode/multiplebarcode.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
List<dynamic> _scanCodes = List<dynamic>();
Future<void> initPlatformState() async {
List<dynamic> scanResults;
try {
scanResults = await Multiplebarcode.startScan(context);
} on PlatformException { }
if (!mounted) return;
setState(() {
_scanCodes = scanResults;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(brightness: Brightness.dark),
home: Scaffold(
appBar: AppBar(
title: const Text('Multiple Scan example app'),
),
body: Center(
child: Column(
children: <Widget>[
Text('Scanned Codes are: $_scanCodes\n',style: TextStyle(fontSize: 18.0),),
RaisedButton(child: Text("Scan"),onPressed: (){
initPlatformState();
} ,)
],
),
),
),
);
}
}