123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import 'package:flutter/foundation.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter_spinkit/flutter_spinkit.dart';
- import 'package:native_vision_example/doc_scan_page.dart';
- import 'package:native_vision_example/loading_overlay.dart';
- void main() {
- if (kReleaseMode) {
- debugPrint = (String? message, {int? wrapWidth}) {};
- }
- 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
- void initState() {
- super.initState();
- }
- @override
- Widget build(BuildContext context) {
- return const MaterialApp(
- home: HomePage(),
- );
- }
- }
- class HomePage extends StatefulWidget {
- const HomePage({Key? key}) : super(key: key);
- @override
- State<StatefulWidget> createState() {
- return HomePageState();
- }
- }
- class HomePageState extends State {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: const Text("首页"),
- ),
- body: Center(
- child: TextButton(
- style: TextButton.styleFrom(backgroundColor: Colors.blueAccent),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) =>
- const LoadingOverlay(child: DocScanPage())),
- );
- },
- child: const Text(
- "文档实时扫描",
- style: TextStyle(fontSize: 24, color: Colors.yellow),
- ),
- )),
- );
- }
- }
|