ai_barcode 0.3.3
ai_barcode: ^0.3.3 copied to clipboard
Android and IOS recognize the one-dimensional bar code and two-dimensional bar code, and support the Scanner embedded in Flutter pages
example/lib/main.dart
import 'package:ai_barcode_example/task_next_page.dart';
import 'package:ai_barcode_example/task_scanner_page.dart';
import 'package:flutter/material.dart';
import 'package:airoute/airoute.dart';
import 'creator_page.dart';
void main() => runApp(
Airoute.createMaterialApp(
home: App(),
routes: <String, AirouteBuilder>{
"/TaskScannerPage": () => TaskScannerPage(),
"/TaskNextPage": () => TaskNextPage(),
"/CreatorPage": () => CreatorPage(),
},
),
);
///
/// App
class App extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _AppState();
}
}
///
/// _AppState
class _AppState extends State<App> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("条码扫描"),
),
body: Center(
child: Column(
children: <Widget>[
MaterialButton(
onPressed: () {
/*
跳转页面
*/
Airoute.pushNamed(
routeName: "/TaskScannerPage",
);
},
textColor: Colors.white,
color: Colors.blue,
child: Text("启动相机"),
),
MaterialButton(
onPressed: () {
//跳转页面
Airoute.pushNamed(
routeName: "/CreatorPage",
);
},
textColor: Colors.white,
color: Colors.blue,
child: Text("生成二维码"),
),
],
),
),
);
}
}