- 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>
20 lines
564 B
Dart
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);
|
|
});
|
|
}
|
|
}
|