Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: await Sytem launch

appflowy2781809f871d
diff --git a/frontend/app_flowy/lib/main.dart b/frontend/app_flowy/lib/main.dart
index 3c17924567..6b85925542 100644
--- a/frontend/app_flowy/lib/main.dart
+++ b/frontend/app_flowy/lib/main.dart
@@ -14,5 +14,5 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized();
- System.run(FlowyApp());
+ await System.run(FlowyApp());
}
diff --git a/frontend/app_flowy/lib/startup/startup.dart b/frontend/app_flowy/lib/startup/startup.dart
index ab94b7eb1c..74dd0768b4 100644
--- a/frontend/app_flowy/lib/startup/startup.dart
+++ b/frontend/app_flowy/lib/startup/startup.dart
@@ -33,7 +33,7 @@ abstract class EntryPoint {
}
class System {
- static void run(EntryPoint f) {
+ static Future<void> run(EntryPoint f) async {
// Specify the env
const env = IntegrationEnv.dev;
@@ -94,7 +94,7 @@ class AppLauncher {
tasks.add(task);
}
- void launch() async {
+ Future<void> launch() async {
final context = LaunchContext(getIt, env);
for (var task in tasks) {
await task.initialize(context);
diff --git a/frontend/app_flowy/lib/startup/tasks/init_sdk.dart b/frontend/app_flowy/lib/startup/tasks/init_sdk.dart
index e94289c576..2d89f2a076 100644
--- a/frontend/app_flowy/lib/startup/tasks/init_sdk.dart
+++ b/frontend/app_flowy/lib/startup/tasks/init_sdk.dart
@@ -2,7 +2,6 @@ import 'dart:io';
import 'package:app_flowy/startup/startup.dart';
import 'package:path_provider/path_provider.dart';
import 'package:flowy_sdk/flowy_sdk.dart';
-import 'package:flutter/material.dart';
class InitRustSDKTask extends LaunchTask {
@override
@@ -10,8 +9,6 @@ class InitRustSDKTask extends LaunchTask {
@override
Future<void> initialize(LaunchContext context) async {
- WidgetsFlutterBinding.ensureInitialized();
-
Directory directory = await getApplicationDocumentsDirectory();
final documentPath = directory.path;
diff --git a/frontend/app_flowy/test/util/test_env.dart b/frontend/app_flowy/test/util/test_env.dart
index 34070894c8..5fab07d919 100644
--- a/frontend/app_flowy/test/util/test_env.dart
+++ b/frontend/app_flowy/test/util/test_env.dart
@@ -1,17 +1,16 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/user/infrastructure/repos/auth_repo.dart';
-import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/uuid.dart';
-import 'package:flowy_sdk/log.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
class FlowyTest {
static Future<FlowyTest> setup() async {
- WidgetsFlutterBinding.ensureInitialized();
+ TestWidgetsFlutterBinding.ensureInitialized();
// await EasyLocalization.ensureInitialized();
- System.run(FlowyTestApp());
+ await System.run(FlowyTestApp());
return FlowyTest();
}