flutter_desktop: fix global envet stream shading && refactor platform ffi

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2022-08-03 22:03:31 +08:00
parent d3bc0ca073
commit 7a2de5d280
20 changed files with 476 additions and 398 deletions

View file

@ -20,7 +20,12 @@ class PlatformFFI {
context.callMethod('setByName', [name, value]);
}
static Future<Null> init() async {
PlatformFFI._();
static final PlatformFFI instance = PlatformFFI._();
static get localeName => window.navigator.language;
static Future<Null> init(String _appType) async {
isWeb = true;
isWebDesktop = !context.callMethod('isMobile');
context.callMethod('init');
@ -68,5 +73,3 @@ class PlatformFFI {
return true;
}
}
final localeName = window.navigator.language;