rustdesk/lib/web_model.dart
2022-01-31 16:22:05 +08:00

32 lines
753 B
Dart

import 'dart:typed_data';
import 'dart:js' as js;
import 'common.dart';
class PlatformFFI {
static void clearRgbaFrame() {}
static Uint8List getRgba() {
return js.context.callMethod('getRgba');
}
static Future<String> getVersion() async {
return getByName('version');
}
static String getByName(String name, [String arg = '']) {
return js.context.callMethod('getByName', [name, arg]);
}
static void setByName(String name, [String value = '']) {
js.context.callMethod('setByName', [name, value]);
}
static Future<Null> init() async {
isWeb = true;
isDesktop = !js.context.callMethod('isMobile');
js.context.callMethod('init');
}
}
final localeName = js.context.callMethod('getLanguage') as String;