fix: 修复 Flutter Web 无法打开的关键问题

关键修复:
1.  修复 main.dart 路由配置冲突
   - 移除重复的 home 属性
   - 仅使用 initialRoute + routes 配置

2.  添加缺失的依赖
   - 添加 flutter_animate: ^4.5.0
   - 修复运行时依赖错误

3.  重新构建 Web 应用
   - 清理旧构建文件
   - 完整重新编译

影响:
- 修复应用无法启动的问题
- 修复路由混乱问题
- 确保所有依赖正确安装

测试:
- flutter analyze: 通过(0 errors)
- flutter build web: 成功
- main.dart.js: 生成正常(3.2MB)
This commit is contained in:
2026-03-25 09:51:32 +08:00
parent fe6d71dfca
commit 1d8ecbbd4a
4 changed files with 394 additions and 2 deletions

View File

@@ -121,7 +121,6 @@ class MyApp extends StatelessWidget {
'/login': (context) => const LoginPage(),
'/main': (context) => const MainPage(),
},
home: _buildHome(),
);
}