fix mobile build

This commit is contained in:
csf 2022-08-23 14:12:30 +08:00
parent 75b04b9af1
commit 91f2106037
2 changed files with 8 additions and 5 deletions

View File

@ -27,7 +27,7 @@ Future<Null> main(List<String> args) async {
print("launch args: $args");
if (!isDesktop) {
runMainApp(false);
runMobileApp();
return;
}
// main window
@ -72,9 +72,6 @@ Future<void> initEnv(String appType) async {
// focus on multi-ffi on desktop first
await initGlobalFFI();
// await Firebase.initializeApp();
if (isAndroid) {
toAndroidChannelInit();
}
refreshCurrentUser();
}
@ -96,6 +93,12 @@ void runMainApp(bool startService) async {
runApp(App());
}
void runMobileApp() async {
await initEnv(kAppTypeMain);
if (isAndroid) androidChannelInit();
runApp(App());
}
void runRemoteScreen(Map<String, dynamic> argument) async {
await initEnv(kAppTypeDesktopRemote);
runApp(GetMaterialApp(

View File

@ -510,7 +510,7 @@ Widget clientInfo(Client client) {
]));
}
void toAndroidChannelInit() {
void androidChannelInit() {
gFFI.setMethodCallHandler((method, arguments) {
debugPrint("flutter got android msg,$method,$arguments");
try {