sunmi_scan 0.0.2
sunmi_scan: ^0.0.2 copied to clipboard
a sunmi scan sdk package [ only support android ] base on official documentation.
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:sunmi_scan/sunmi_scan.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
builder: BotToastInit(),
navigatorObservers: [BotToastNavigatorObserver()],
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
void initState() {
super.initState();
SunmiScan.init();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
SunmiScan.scan().then(
(value) => BotToast.showText(
text: value.toString(),
),
);
},
),
);
}
}