-
Notifications
You must be signed in to change notification settings - Fork 80
/
main.dart
87 lines (82 loc) · 2.45 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import 'package:ai_barcode_example/full_screen_scanner_page.dart';
import 'package:ai_barcode_example/task_next_page.dart';
import 'package:airoute/airoute.dart';
import 'package:flutter/material.dart';
import 'creator_page.dart';
import 'custom_size_scanner_page.dart';
import 'select_scanner_style_page.dart';
void main() => runApp(
Airoute.createMaterialApp(
home: App(),
routes: <String, WidgetBuilder>{
"/SelectScannerStylePage": (_) => SelectScannerStylePage(),
"/CustomSizeScannerPage": (_) => CustomSizeScannerPage(),
"/FullScreenScannerPage": (_) => FullScreenScannerPage(),
"/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("1D barcode/QR code"),
),
body: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
MaterialButton(
onPressed: () {
//跳转页面=扫描二维码
Airoute.pushNamed(
routeName: "/SelectScannerStylePage",
);
},
textColor: Colors.white,
color: Colors.blue,
child: Text("Scan 1D barcode/QR code"),
),
],
),
),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
MaterialButton(
onPressed: () {
//跳转页面=生成二维码
Airoute.pushNamed(
routeName: "/CreatorPage",
);
},
textColor: Colors.white,
color: Colors.blue,
child: Text("Create QR code"),
),
],
),
),
],
),
),
);
}
}