mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: await Sytem launch
This commit is contained in:
parent
6fc8197468
commit
2781809f87
@ -14,5 +14,5 @@ void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await EasyLocalization.ensureInitialized();
|
||||
|
||||
System.run(FlowyApp());
|
||||
await System.run(FlowyApp());
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user