mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
35 lines
737 B
Dart
35 lines
737 B
Dart
import 'package:app_flowy/startup/launch.dart';
|
|
import 'package:app_flowy/startup/tasks/prelude.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get_it/get_it.dart';
|
|
import 'deps_inject/prelude.dart';
|
|
|
|
final getIt = GetIt.instance;
|
|
enum IntegrationEnv {
|
|
dev,
|
|
pro,
|
|
}
|
|
|
|
abstract class AppFactory {
|
|
Widget create();
|
|
}
|
|
|
|
class App {
|
|
static void run(AppFactory f) {
|
|
// Specify the evn
|
|
const env = IntegrationEnv.dev;
|
|
|
|
// Config the deps graph
|
|
getIt.registerFactory<AppFactory>(() => f);
|
|
|
|
resolveDependencies(env);
|
|
|
|
// add task
|
|
getIt<AppLauncher>().addTask(RustSDKInitTask());
|
|
getIt<AppLauncher>().addTask(AppWidgetTask());
|
|
|
|
// execute the tasks
|
|
getIt<AppLauncher>().launch();
|
|
}
|
|
}
|