import 'package:flutter/material.dart'; import 'screens/camera_screen.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'AISee Camera', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue), useMaterial3: true, ), home: const HomeScreen(), debugShowCheckedModeBanner: false, ); } } class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('AISee'), backgroundColor: Theme.of(context).colorScheme.inversePrimary, ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const Icon( Icons.visibility, size: 100, color: Colors.blue, ), const SizedBox(height: 24), const Text( 'AISee 视觉辅助', style: TextStyle( fontSize: 28, fontWeight: FontWeight.bold, ), ), const SizedBox(height: 8), const Text( '实时相机图像传输演示', style: TextStyle( fontSize: 16, color: Colors.grey, ), ), const SizedBox(height: 48), ElevatedButton.icon( onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => const CameraScreen(), ), ); }, icon: const Icon(Icons.camera_alt, size: 28), label: const Text( '打开相机', style: TextStyle(fontSize: 18), ), style: ElevatedButton.styleFrom( padding: const EdgeInsets.symmetric( horizontal: 32, vertical: 16, ), ), ), const SizedBox(height: 24), const Padding( padding: EdgeInsets.symmetric(horizontal: 32), child: Text( '功能说明:\n' '• 拍照分析:拍摄单张照片并上传分析\n' '• 开始传输:每 500ms 自动捕获并上传\n' '• 切换:切换前后摄像头', textAlign: TextAlign.left, style: TextStyle( fontSize: 14, color: Colors.black87, height: 1.5, ), ), ), ], ), ), ); } }