chore: 清理项目中多余的示例、依赖和资源文件
本次提交删除了大量冗余的平台配置文件、示例项目构建产物、测试资源文件以及第三方插件的无关代码,包括: 1. 移除了fluttertoast、liquid_glass_easy等插件的全量示例项目文件 2. 删除了本地依赖的ohos模块缓存和构建配置 3. 清理了各种平台的图标、资源文件和gitignore配置 4. 调整了主项目安卓最小SDK版本配置 5. 添加了macos运行需要的权限配置
This commit is contained in:
@@ -11,8 +11,6 @@ import 'dart:isolate' if (dart.library.js) 'core/utils/isolate_stub.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:catcher_2/catcher_2.dart';
|
||||
import 'package:catcher_2/model/platform_type.dart';
|
||||
import 'package:liquid_glass_widgets/liquid_glass_widgets.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
@@ -32,6 +30,7 @@ import 'core/utils/logger.dart';
|
||||
import 'core/utils/platform_utils.dart' as pu;
|
||||
import 'core/registry/page_registry.dart';
|
||||
import 'core/router/app_router.dart';
|
||||
import 'core/services/catcher2_config_service.dart';
|
||||
import 'editor/services/3d/platform_3d_service.dart';
|
||||
import 'features/tool_center/inspiration/services/chat_migration_service.dart';
|
||||
|
||||
@@ -214,52 +213,25 @@ void main() async {
|
||||
Log.i('🟢 [OHOS] 所有服务初始化完成,准备 runApp (liquidGlass=$_liquidGlassReady)');
|
||||
const app = ProviderScope(child: XianyanApp());
|
||||
if (_liquidGlassReady) {
|
||||
Catcher2(
|
||||
Catcher2ConfigService.instance.init(
|
||||
runAppFunction: () {
|
||||
runApp(LiquidGlassWidgets.wrap(child: app));
|
||||
},
|
||||
debugConfig: Catcher2Options(
|
||||
SilentReportMode(),
|
||||
[_RateLimitedHandler()],
|
||||
localizationOptions: [
|
||||
LocalizationOptions.buildDefaultChineseOptions(),
|
||||
],
|
||||
),
|
||||
releaseConfig: Catcher2Options(SilentReportMode(), []),
|
||||
profileConfig: Catcher2Options(SilentReportMode(), []),
|
||||
);
|
||||
} else {
|
||||
Catcher2(
|
||||
Catcher2ConfigService.instance.init(
|
||||
runAppFunction: () {
|
||||
runApp(app);
|
||||
},
|
||||
debugConfig: Catcher2Options(
|
||||
SilentReportMode(),
|
||||
[_RateLimitedHandler()],
|
||||
localizationOptions: [
|
||||
LocalizationOptions.buildDefaultChineseOptions(),
|
||||
],
|
||||
),
|
||||
releaseConfig: Catcher2Options(SilentReportMode(), []),
|
||||
profileConfig: Catcher2Options(SilentReportMode(), []),
|
||||
);
|
||||
}
|
||||
Log.i('🟢 [OHOS] runApp() 已调用');
|
||||
} else {
|
||||
Catcher2(
|
||||
Catcher2ConfigService.instance.init(
|
||||
runAppFunction: () {
|
||||
const app = ProviderScope(child: XianyanApp());
|
||||
runApp(LiquidGlassWidgets.wrap(child: app));
|
||||
},
|
||||
debugConfig: Catcher2Options(
|
||||
SilentReportMode(),
|
||||
[_RateLimitedHandler()],
|
||||
localizationOptions: [
|
||||
LocalizationOptions.buildDefaultChineseOptions(),
|
||||
],
|
||||
),
|
||||
releaseConfig: Catcher2Options(SilentReportMode(), []),
|
||||
profileConfig: Catcher2Options(SilentReportMode(), []),
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -269,27 +241,6 @@ void main() async {
|
||||
);
|
||||
}
|
||||
|
||||
class _RateLimitedHandler extends ReportHandler {
|
||||
DateTime? _lastLog;
|
||||
static const _cooldown = Duration(seconds: 5);
|
||||
|
||||
@override
|
||||
Future<bool> handle(Report report, BuildContext? context) async {
|
||||
final now = DateTime.now();
|
||||
if (_lastLog == null || now.difference(_lastLog!) > _cooldown) {
|
||||
_lastLog = now;
|
||||
Log.e('Catcher2: ${report.error}');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@override
|
||||
List<PlatformType> getSupportedPlatforms() => PlatformType.values.toList();
|
||||
|
||||
@override
|
||||
bool isContextRequired() => false;
|
||||
}
|
||||
|
||||
void _validatePageRegistry() {
|
||||
final errors = PageRegistry.validateAll();
|
||||
if (errors.isNotEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user