refactor: 清理未使用的倒计时状态变量并优化初始化日志
fix: 移除mini_card_page中未使用的_isCountdownActive变量 style: 在app_service和main中添加详细的初始化日志 chore: 删除fluttertoast_ohos相关的废弃文件
This commit is contained in:
@@ -24,7 +24,9 @@ import 'package:mom_kitchen/src/utils/app_logger.dart';
|
||||
|
||||
void main() async {
|
||||
// 确保 Flutter 引擎初始化
|
||||
debugPrint('🚀 开始初始化 Flutter 引擎...');
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
debugPrint('✅ Flutter 引擎初始化完成');
|
||||
|
||||
FlutterError.onError = (FlutterErrorDetails details) {
|
||||
FlutterError.presentError(details);
|
||||
@@ -34,22 +36,33 @@ void main() async {
|
||||
};
|
||||
|
||||
// 初始化所有服务
|
||||
await AppService.instance.init();
|
||||
debugPrint('📱 开始初始化应用服务...');
|
||||
try {
|
||||
await AppService.instance.init();
|
||||
debugPrint('✅ 应用服务初始化完成');
|
||||
} catch (e) {
|
||||
debugPrint('❌ 应用服务初始化失败: $e');
|
||||
rethrow;
|
||||
}
|
||||
|
||||
// 📋 页面注册入口 - 在此处调用注册所有页面
|
||||
if (kDebugMode) {
|
||||
AppLogger.i('📋 开始注册页面...');
|
||||
debugPrint('📋 开始注册页面...');
|
||||
AppRoutes.registerAllPages();
|
||||
AppLogger.i('✅ 页面注册完成,共注册 ${PageRegistry.pageCount} 个页面');
|
||||
debugPrint('✅ 页面注册完成,共注册 ${PageRegistry.pageCount} 个页面');
|
||||
|
||||
final config = PageRegistry.exportConfig();
|
||||
AppLogger.d('📊 页面配置: $config');
|
||||
debugPrint('📊 页面配置: $config');
|
||||
}
|
||||
|
||||
debugPrint('🔄 解锁屏幕方向...');
|
||||
await OrientationService().unlockOrientation();
|
||||
debugPrint('✅ 屏幕方向解锁完成');
|
||||
|
||||
// 运行应用
|
||||
debugPrint('🎯 启动应用...');
|
||||
runApp(const MyApp());
|
||||
debugPrint('✅ 应用启动完成');
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user