import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import '../../core/routes/app_router.dart'; /// 首页 class HomeScreen extends StatelessWidget { const HomeScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Mobile EDA'), actions: [ IconButton( icon: const Icon(Icons.folder_open), onPressed: () => context.go(AppRoutes.projects), tooltip: '项目列表', ), IconButton( icon: const Icon(Icons.category), onPressed: () => context.go(AppRoutes.components), tooltip: '元件库', ), ], ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const Icon( Icons.memory, size: 120, color: Color(0xFF1976D2), ), const SizedBox(height: 24), const Text( 'Mobile EDA', style: TextStyle( fontSize: 32, fontWeight: FontWeight.bold, ), ), const SizedBox(height: 8), const Text( '移动端原理图编辑工具', style: TextStyle( fontSize: 16, color: Colors.grey, ), ), const SizedBox(height: 48), ElevatedButton.icon( onPressed: () => _createNewProject(context), icon: const Icon(Icons.add), label: const Text('新建项目'), style: ElevatedButton.styleFrom( padding: const EdgeInsets.symmetric( horizontal: 32, vertical: 16, ), ), ), ], ), ), ); } void _createNewProject(BuildContext context) { // TODO: 实现新建项目逻辑 ScaffoldMessenger.of(context).showSnackBar( const SnackBar(content: Text('新建项目功能开发中...')), ); } }