oto/lib/framework/core/application.dart
toki e865f7dc8b Internalize dart_framework: remove external git dependency
- Copy all used dart_framework files into lib/framework/
- Replace all package:dart_framework/ imports with package:oto_cli/framework/
- Add yaml, archive, ftpconnect as explicit direct dependencies
- Remove dart_framework git dependency from pubspec.yaml

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 11:20:27 +09:00

20 lines
564 B
Dart

import 'dart:async';
import 'package:oto_cli/framework/log/log.dart';
import 'package:oto_cli/framework/utils/system_util.dart' as system;
class Application {
Function(Object, StackTrace)? writeLog;
Application(String name, String appID, Function() func,
Function(Object, StackTrace) errorListener) {
runZonedGuarded(() {
system.initialize(name, appID);
writeLog = (error, stack) => logError('$error:\n$stack');
func();
}, (error, stack) {
writeLog?.call(error, stack);
errorListener(error, stack);
});
}
}