chore: set main isolate port even earlier

This commit is contained in:
Christian Kußowski 2025-11-11 16:24:51 +01:00
parent 92fcfacfc4
commit ae11d5b47f
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -18,11 +18,6 @@ import 'widgets/fluffy_chat_app.dart';
ReceivePort? mainIsolateReceivePort;
void main() async {
// Our background push shared isolate accesses flutter-internal things very early in the startup proccess
// To make sure that the parts of flutter needed are started up already, we need to ensure that the
// widget bindings are initialized already.
WidgetsFlutterBinding.ensureInitialized();
if (PlatformInfos.isAndroid) {
final port = mainIsolateReceivePort = ReceivePort();
IsolateNameServer.registerPortWithName(
@ -31,6 +26,11 @@ void main() async {
);
}
// Our background push shared isolate accesses flutter-internal things very early in the startup proccess
// To make sure that the parts of flutter needed are started up already, we need to ensure that the
// widget bindings are initialized already.
WidgetsFlutterBinding.ensureInitialized();
final store = await AppSettings.init();
Logs().i('Welcome to ${AppSettings.applicationName.value} <3');