From 95589740805d0a42fb1b474710ac9554d4f16b56 Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 22 Mar 2024 13:16:37 +0800 Subject: [PATCH] Refact. Build flutter web (#7472) * Refact. Build flutter web Signed-off-by: fufesou * Refact. Flutter web, wrap Platform.xx Signed-off-by: fufesou --------- Signed-off-by: fufesou --- flutter/.gitignore | 1 - flutter/lib/common.dart | 51 +- flutter/lib/main.dart | 7 +- .../lib/models/desktop_render_texture.dart | 4 +- flutter/lib/models/model.dart | 4 +- flutter/lib/models/platform_model.dart | 3 +- flutter/lib/models/web_model.dart | 96 +- flutter/lib/native/common.dart | 10 + flutter/lib/native/win32.dart | 41 + flutter/lib/web/bridge.dart | 1414 +++++++++++++++++ flutter/lib/web/common.dart | 9 + flutter/lib/web/plugin/handlers.dart | 14 + flutter/lib/web/texture_rgba_renderer.dart | 20 + flutter/lib/web/win32.dart | 5 + 14 files changed, 1625 insertions(+), 54 deletions(-) create mode 100644 flutter/lib/native/common.dart create mode 100644 flutter/lib/native/win32.dart create mode 100644 flutter/lib/web/bridge.dart create mode 100644 flutter/lib/web/common.dart create mode 100644 flutter/lib/web/plugin/handlers.dart create mode 100644 flutter/lib/web/texture_rgba_renderer.dart create mode 100644 flutter/lib/web/win32.dart diff --git a/flutter/.gitignore b/flutter/.gitignore index 9c7e52c12..ee7e42c6c 100644 --- a/flutter/.gitignore +++ b/flutter/.gitignore @@ -32,7 +32,6 @@ /build/ # Web related -lib/generated_plugin_registrant.dart # Symbolication related app.*.symbols diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index a031d45d6..611cdecb3 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1,12 +1,10 @@ import 'dart:async'; import 'dart:convert'; -import 'dart:ffi' hide Size; import 'dart:io'; import 'dart:math'; import 'package:back_button_interceptor/back_button_interceptor.dart'; import 'package:desktop_multi_window/desktop_multi_window.dart'; -import 'package:ffi/ffi.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; @@ -25,7 +23,6 @@ import 'package:get/get.dart'; import 'package:uni_links/uni_links.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:uuid/uuid.dart'; -import 'package:win32/win32.dart' as win32; import 'package:window_manager/window_manager.dart'; import 'package:window_size/window_size.dart' as window_size; @@ -37,16 +34,24 @@ import 'models/input_model.dart'; import 'models/model.dart'; import 'models/platform_model.dart'; +import 'package:flutter_hbb/native/win32.dart' + if (dart.library.html) 'package:flutter_hbb/web/win32.dart'; +import 'package:flutter_hbb/native/common.dart' + if (dart.library.html) 'package:flutter_hbb/web/common.dart'; + final globalKey = GlobalKey(); final navigationBarKey = GlobalKey(); -final isAndroid = Platform.isAndroid; -final isIOS = Platform.isIOS; -final isDesktop = Platform.isWindows || Platform.isMacOS || Platform.isLinux; -var isWeb = false; +final isAndroid = isAndroid_; +final isIOS = isIOS_; +final isWindows = isWindows_; +final isMacOS = isMacOS_; +final isLinux = isLinux_; +final isDesktop = isDesktop_; +final isWeb = isWeb_; var isWebDesktop = false; var isMobile = isAndroid || isIOS; -var version = ""; +var version = ''; int androidVersion = 0; /// only available for Windows target @@ -2317,35 +2322,7 @@ WindowsTarget getWindowsTarget(int buildNumber) { /// [Note] /// Please use this function wrapped with `Platform.isWindows`. int getWindowsTargetBuildNumber() { - final rtlGetVersion = DynamicLibrary.open('ntdll.dll').lookupFunction< - Void Function(Pointer), - void Function(Pointer)>('RtlGetVersion'); - final osVersionInfo = getOSVERSIONINFOEXPointer(); - rtlGetVersion(osVersionInfo); - int buildNumber = osVersionInfo.ref.dwBuildNumber; - calloc.free(osVersionInfo); - return buildNumber; -} - -/// Get Windows OS version pointer -/// -/// [Note] -/// Please use this function wrapped with `Platform.isWindows`. -Pointer getOSVERSIONINFOEXPointer() { - final pointer = calloc(); - pointer.ref - ..dwOSVersionInfoSize = sizeOf() - ..dwBuildNumber = 0 - ..dwMajorVersion = 0 - ..dwMinorVersion = 0 - ..dwPlatformId = 0 - ..szCSDVersion = '' - ..wServicePackMajor = 0 - ..wServicePackMinor = 0 - ..wSuiteMask = 0 - ..wProductType = 0 - ..wReserved = 0; - return pointer; + return getWindowsTargetBuildNumber_(); } /// Indicating we need to use compatible ui mode. diff --git a/flutter/lib/main.dart b/flutter/lib/main.dart index dc2d97a47..e1632184e 100644 --- a/flutter/lib/main.dart +++ b/flutter/lib/main.dart @@ -14,21 +14,21 @@ import 'package:flutter_hbb/desktop/screen/desktop_port_forward_screen.dart'; import 'package:flutter_hbb/desktop/screen/desktop_remote_screen.dart'; import 'package:flutter_hbb/desktop/widgets/refresh_wrapper.dart'; import 'package:flutter_hbb/models/state_model.dart'; -import 'package:flutter_hbb/plugin/handlers.dart'; import 'package:flutter_hbb/utils/multi_window_manager.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:window_manager/window_manager.dart'; -// import 'package:window_manager/window_manager.dart'; - import 'common.dart'; import 'consts.dart'; import 'mobile/pages/home_page.dart'; import 'mobile/pages/server_page.dart'; import 'models/platform_model.dart'; +import 'package:flutter_hbb/plugin/handlers.dart' + if (dart.library.html) 'package:flutter_hbb/web/plugin/handlers.dart'; + /// Basic window and launch properties. int? kWindowId; WindowType? kWindowType; @@ -36,6 +36,7 @@ late List kBootArgs; Future main(List args) async { WidgetsFlutterBinding.ensureInitialized(); + debugPrint("launch args: $args"); kBootArgs = List.from(args); diff --git a/flutter/lib/models/desktop_render_texture.dart b/flutter/lib/models/desktop_render_texture.dart index a54042f06..e56ba5e16 100644 --- a/flutter/lib/models/desktop_render_texture.dart +++ b/flutter/lib/models/desktop_render_texture.dart @@ -3,11 +3,13 @@ import 'package:flutter_gpu_texture_renderer/flutter_gpu_texture_renderer.dart'; import 'package:flutter_hbb/consts.dart'; import 'package:flutter_hbb/models/model.dart'; import 'package:get/get.dart'; -import 'package:texture_rgba_renderer/texture_rgba_renderer.dart'; import '../../common.dart'; import './platform_model.dart'; +import 'package:texture_rgba_renderer/texture_rgba_renderer.dart' + if (dart.library.html) 'package:flutter_hbb/web/texture_rgba_renderer.dart'; + // Feature flutter_texture_render need to be enabled if feature gpucodec is enabled. final useTextureRender = bind.mainHasPixelbufferTextureRender() || bind.mainHasGpuTextureRender(); diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index fee48765f..1e3136e94 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -9,7 +9,6 @@ import 'package:desktop_multi_window/desktop_multi_window.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_hbb/consts.dart'; -import 'package:flutter_hbb/generated_bridge.dart'; import 'package:flutter_hbb/models/ab_model.dart'; import 'package:flutter_hbb/models/chat_model.dart'; import 'package:flutter_hbb/models/cm_file_model.dart'; @@ -39,6 +38,9 @@ import '../common/widgets/dialog.dart'; import 'input_model.dart'; import 'platform_model.dart'; +import 'package:flutter_hbb/generated_bridge.dart' + if (dart.library.html) 'package:flutter_hbb/web/bridge.dart'; + typedef HandleMsgBox = Function(Map evt, String id); typedef ReconnectHandle = Function(OverlayDialogManager, SessionID, bool); final _constSessionId = Uuid().v4obj(); diff --git a/flutter/lib/models/platform_model.dart b/flutter/lib/models/platform_model.dart index d2b8fa765..6bc770ff6 100644 --- a/flutter/lib/models/platform_model.dart +++ b/flutter/lib/models/platform_model.dart @@ -1,5 +1,6 @@ -import 'package:flutter_hbb/generated_bridge.dart'; import 'native_model.dart' if (dart.library.html) 'web_model.dart'; +import 'package:flutter_hbb/generated_bridge.dart' + if (dart.library.html) 'package:flutter_hbb/web/bridge.dart'; final platformFFI = PlatformFFI.instance; final localeName = PlatformFFI.localeName; diff --git a/flutter/lib/models/web_model.dart b/flutter/lib/models/web_model.dart index 3c7de06c2..d8c8491c9 100644 --- a/flutter/lib/models/web_model.dart +++ b/flutter/lib/models/web_model.dart @@ -3,15 +3,23 @@ import 'dart:convert'; import 'dart:typed_data'; import 'dart:js'; - -import '../common.dart'; import 'dart:html'; import 'dart:async'; +import 'package:flutter/foundation.dart'; + +import 'package:flutter_hbb/web/bridge.dart'; +import 'package:flutter_hbb/common.dart'; + final List> mouseListeners = []; final List> keyListeners = []; +typedef HandleEvent = Future Function(Map evt); + class PlatformFFI { + final _eventHandlers = >{}; + late RustdeskImpl _ffiBind; + static String getByName(String name, [String arg = '']) { return context.callMethod('getByName', [name, arg]); } @@ -24,15 +32,78 @@ class PlatformFFI { static final PlatformFFI instance = PlatformFFI._(); static get localeName => window.navigator.language; + RustdeskImpl get ffiBind => _ffiBind; - static Future init(String appType) async { - isWeb = true; + static Future getVersion() async { + throw UnimplementedError(); + } + + bool registerEventHandler( + String eventName, String handlerName, HandleEvent handler) { + debugPrint('registerEventHandler $eventName $handlerName'); + var handlers = _eventHandlers[eventName]; + if (handlers == null) { + _eventHandlers[eventName] = {handlerName: handler}; + return true; + } else { + if (handlers.containsKey(handlerName)) { + return false; + } else { + handlers[handlerName] = handler; + return true; + } + } + } + + void unregisterEventHandler(String eventName, String handlerName) { + debugPrint('unregisterEventHandler $eventName $handlerName'); + var handlers = _eventHandlers[eventName]; + if (handlers != null) { + handlers.remove(handlerName); + } + } + + Future tryHandle(Map evt) async { + final name = evt['name']; + if (name != null) { + final handlers = _eventHandlers[name]; + if (handlers != null) { + if (handlers.isNotEmpty) { + for (var handler in handlers.values) { + await handler(evt); + } + return true; + } + } + } + return false; + } + + String translate(String name, String locale) => + _ffiBind.translate(name: name, locale: locale); + + Uint8List? getRgba(SessionID sessionId, int display, int bufSize) { + throw UnimplementedError(); + } + + int getRgbaSize(SessionID sessionId, int display) => + _ffiBind.sessionGetRgbaSize(sessionId: sessionId, display: display); + void nextRgba(SessionID sessionId, int display) => + _ffiBind.sessionNextRgba(sessionId: sessionId, display: display); + void registerPixelbufferTexture(SessionID sessionId, int display, int ptr) => + _ffiBind.sessionRegisterPixelbufferTexture( + sessionId: sessionId, display: display, ptr: ptr); + void registerGpuTexture(SessionID sessionId, int display, int ptr) => + _ffiBind.sessionRegisterGpuTexture( + sessionId: sessionId, display: display, ptr: ptr); + + Future init(String appType) async { isWebDesktop = !context.callMethod('isMobile'); context.callMethod('init'); version = getByName('version'); } - static void setEventCallback(void Function(Map) fun) { + void setEventCallback(void Function(Map) fun) { context["onGlobalEvent"] = (String message) { try { Map event = json.decode(message); @@ -43,7 +114,7 @@ class PlatformFFI { }; } - static void setRgbaCallback(void Function(Uint8List) fun) { + void setRgbaCallback(void Function(Uint8List) fun) { context["onRgba"] = (Uint8List? rgba) { if (rgba != null) { fun(rgba); @@ -51,12 +122,12 @@ class PlatformFFI { }; } - static void startDesktopWebListener() { + void startDesktopWebListener() { mouseListeners.add( window.document.onContextMenu.listen((evt) => evt.preventDefault())); } - static void stopDesktopWebListener() { + void stopDesktopWebListener() { for (var ml in mouseListeners) { ml.cancel(); } @@ -67,9 +138,14 @@ class PlatformFFI { keyListeners.clear(); } - static void setMethodCallHandler(FMethod callback) {} + void setMethodCallHandler(FMethod callback) {} - static Future invokeMethod(String method, [dynamic arguments]) async { + invokeMethod(String method, [dynamic arguments]) async { return true; } + + // just for compilation + void syncAndroidServiceAppDirConfigPath() { + throw UnimplementedError(); + } } diff --git a/flutter/lib/native/common.dart b/flutter/lib/native/common.dart new file mode 100644 index 000000000..3ab8b786e --- /dev/null +++ b/flutter/lib/native/common.dart @@ -0,0 +1,10 @@ +import 'dart:io'; + +final isAndroid_ = Platform.isAndroid; +final isIOS_ = Platform.isIOS; +final isWindows_ = Platform.isWindows; +final isMacOS_ = Platform.isWindows; +final isLinux_ = Platform.isWindows; +final isWeb_ = false; + +final isDesktop_ = Platform.isWindows || Platform.isMacOS || Platform.isLinux; diff --git a/flutter/lib/native/win32.dart b/flutter/lib/native/win32.dart new file mode 100644 index 000000000..29f37339b --- /dev/null +++ b/flutter/lib/native/win32.dart @@ -0,0 +1,41 @@ +import 'dart:ffi' hide Size; + +import 'package:ffi/ffi.dart'; + +import 'package:win32/win32.dart' as win32; + +/// Get windows target build number. +/// +/// [Note] +/// Please use this function wrapped with `Platform.isWindows`. +int getWindowsTargetBuildNumber_() { + final rtlGetVersion = DynamicLibrary.open('ntdll.dll').lookupFunction< + Void Function(Pointer), + void Function(Pointer)>('RtlGetVersion'); + final osVersionInfo = _getOSVERSIONINFOEXPointer(); + rtlGetVersion(osVersionInfo); + int buildNumber = osVersionInfo.ref.dwBuildNumber; + calloc.free(osVersionInfo); + return buildNumber; +} + +/// Get Windows OS version pointer +/// +/// [Note] +/// Please use this function wrapped with `Platform.isWindows`. +Pointer _getOSVERSIONINFOEXPointer() { + final pointer = calloc(); + pointer.ref + ..dwOSVersionInfoSize = sizeOf() + ..dwBuildNumber = 0 + ..dwMajorVersion = 0 + ..dwMinorVersion = 0 + ..dwPlatformId = 0 + ..szCSDVersion = '' + ..wServicePackMajor = 0 + ..wServicePackMinor = 0 + ..wSuiteMask = 0 + ..wProductType = 0 + ..wReserved = 0; + return pointer; +} diff --git a/flutter/lib/web/bridge.dart b/flutter/lib/web/bridge.dart new file mode 100644 index 000000000..8c55c1d7e --- /dev/null +++ b/flutter/lib/web/bridge.dart @@ -0,0 +1,1414 @@ +import 'dart:async'; +import 'dart:typed_data'; +import 'package:uuid/uuid.dart'; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +mixin _$EventToUI { + Object get field0 => throw _privateConstructorUsedError; +} + +sealed class EventToUI { + const factory EventToUI.event( + String field0, + ) = EventToUI_Event; + const factory EventToUI.rgba( + int field0, + ) = EventToUI_Rgba; + const factory EventToUI.texture( + int field0, + ) = EventToUI_Texture; +} + +class EventToUI_Event implements EventToUI { + const EventToUI_Event(final String field0) : this.field = field0; + final String field; + String get field0 => field; +} + +class EventToUI_Rgba implements EventToUI { + const EventToUI_Rgba(final int field0) : this.field = field0; + final int field; + int get field0 => field; +} + +class EventToUI_Texture implements EventToUI { + const EventToUI_Texture(final int field0) : this.field = field0; + final int field; + int get field0 => field; +} + +class RustdeskImpl { + Future stopGlobalEventStream({required String appType, dynamic hint}) { + throw UnimplementedError(); + } + + Future hostStopSystemKeyPropagate( + {required bool stopped, dynamic hint}) { + throw UnimplementedError(); + } + + int peerGetDefaultSessionsCount({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + String sessionAddExistedSync( + {required String id, required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + void sessionTryAddDisplay( + {required UuidValue sessionId, + required Int32List displays, + dynamic hint}) { + throw UnimplementedError(); + } + + String sessionAddSync( + {required UuidValue sessionId, + required String id, + required bool isFileTransfer, + required bool isPortForward, + required bool isRdp, + required String switchUuid, + required bool forceRelay, + required String password, + required bool isSharedPassword, + dynamic hint}) { + throw UnimplementedError(); + } + + Stream sessionStart( + {required UuidValue sessionId, required String id, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionGetRemember( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionGetToggleOption( + {required UuidValue sessionId, required String arg, dynamic hint}) { + throw UnimplementedError(); + } + + bool sessionGetToggleOptionSync( + {required UuidValue sessionId, required String arg, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionGetOption( + {required UuidValue sessionId, required String arg, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionLogin( + {required UuidValue sessionId, + required String osUsername, + required String osPassword, + required String password, + required bool remember, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSend2Fa( + {required UuidValue sessionId, required String code, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionClose({required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionRefresh( + {required UuidValue sessionId, required int display, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionRecordScreen( + {required UuidValue sessionId, + required bool start, + required int display, + required int width, + required int height, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionRecordStatus( + {required UuidValue sessionId, required bool status, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionReconnect( + {required UuidValue sessionId, required bool forceRelay, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionToggleOption( + {required UuidValue sessionId, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionTogglePrivacyMode( + {required UuidValue sessionId, + required String implKey, + required bool on, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionGetFlutterOption( + {required UuidValue sessionId, required String k, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSetFlutterOption( + {required UuidValue sessionId, + required String k, + required String v, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionGetFlutterOptionByPeerId( + {required String id, required String k, dynamic hint}) { + throw UnimplementedError(); + } + + int getNextTextureKey({dynamic hint}) { + throw UnimplementedError(); + } + + String getLocalFlutterOption({required String k, dynamic hint}) { + throw UnimplementedError(); + } + + Future setLocalFlutterOption( + {required String k, required String v, dynamic hint}) { + throw UnimplementedError(); + } + + String getLocalKbLayoutType({dynamic hint}) { + throw UnimplementedError(); + } + + Future setLocalKbLayoutType( + {required String kbLayoutType, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionGetViewStyle( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSetViewStyle( + {required UuidValue sessionId, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionGetScrollStyle( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSetScrollStyle( + {required UuidValue sessionId, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionGetImageQuality( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSetImageQuality( + {required UuidValue sessionId, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionGetKeyboardMode( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSetKeyboardMode( + {required UuidValue sessionId, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + String? sessionGetReverseMouseWheelSync( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSetReverseMouseWheel( + {required UuidValue sessionId, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + String? sessionGetDisplaysAsIndividualWindows( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSetDisplaysAsIndividualWindows( + {required UuidValue sessionId, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + String? sessionGetUseAllMyDisplaysForTheRemoteSession( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSetUseAllMyDisplaysForTheRemoteSession( + {required UuidValue sessionId, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionGetCustomImageQuality( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + bool sessionIsKeyboardModeSupported( + {required UuidValue sessionId, required String mode, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSetCustomImageQuality( + {required UuidValue sessionId, required int value, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSetCustomFps( + {required UuidValue sessionId, required int fps, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionLockScreen({required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionCtrlAltDel({required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSwitchDisplay( + {required bool isDesktop, + required UuidValue sessionId, + required Int32List value, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionHandleFlutterKeyEvent( + {required UuidValue sessionId, + required String name, + required int platformCode, + required int positionCode, + required int lockModes, + required bool downOrUp, + dynamic hint}) { + throw UnimplementedError(); + } + + void sessionEnterOrLeave( + {required UuidValue sessionId, required bool enter, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionInputKey( + {required UuidValue sessionId, + required String name, + required bool down, + required bool press, + required bool alt, + required bool ctrl, + required bool shift, + required bool command, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionInputString( + {required UuidValue sessionId, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSendChat( + {required UuidValue sessionId, required String text, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionPeerOption( + {required UuidValue sessionId, + required String name, + required String value, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionGetPeerOption( + {required UuidValue sessionId, required String name, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionInputOsPassword( + {required UuidValue sessionId, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionReadRemoteDir( + {required UuidValue sessionId, + required String path, + required bool includeHidden, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSendFiles( + {required UuidValue sessionId, + required int actId, + required String path, + required String to, + required int fileNum, + required bool includeHidden, + required bool isRemote, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSetConfirmOverrideFile( + {required UuidValue sessionId, + required int actId, + required int fileNum, + required bool needOverride, + required bool remember, + required bool isUpload, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionRemoveFile( + {required UuidValue sessionId, + required int actId, + required String path, + required int fileNum, + required bool isRemote, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionReadDirRecursive( + {required UuidValue sessionId, + required int actId, + required String path, + required bool isRemote, + required bool showHidden, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionRemoveAllEmptyDirs( + {required UuidValue sessionId, + required int actId, + required String path, + required bool isRemote, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionCancelJob( + {required UuidValue sessionId, required int actId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionCreateDir( + {required UuidValue sessionId, + required int actId, + required String path, + required bool isRemote, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionReadLocalDirSync( + {required UuidValue sessionId, + required String path, + required bool showHidden, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionGetPlatform( + {required UuidValue sessionId, required bool isRemote, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionLoadLastTransferJobs( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionAddJob( + {required UuidValue sessionId, + required int actId, + required String path, + required String to, + required int fileNum, + required bool includeHidden, + required bool isRemote, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionResumeJob( + {required UuidValue sessionId, + required int actId, + required bool isRemote, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionElevateDirect( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionElevateWithLogon( + {required UuidValue sessionId, + required String username, + required String password, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSwitchSides( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionChangeResolution( + {required UuidValue sessionId, + required int display, + required int width, + required int height, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSetSize( + {required UuidValue sessionId, + required int display, + required int width, + required int height, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSendSelectedSessionId( + {required UuidValue sessionId, required String sid, dynamic hint}) { + throw UnimplementedError(); + } + + Future> mainGetSoundInputs({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetDefaultSoundInput({dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetLoginDeviceInfo({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainChangeId({required String newId, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetAsyncStatus({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetOption({required String key, dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetOptionSync({required String key, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetError({dynamic hint}) { + throw UnimplementedError(); + } + + bool mainShowOption({required String key, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSetOption( + {required String key, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetOptions({dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetOptionsSync({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSetOptions({required String json, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainTestIfValidServer({required String server, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSetSocks( + {required String proxy, + required String username, + required String password, + dynamic hint}) { + throw UnimplementedError(); + } + + Future> mainGetSocks({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetAppName({dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetAppNameSync({dynamic hint}) { + throw UnimplementedError(); + } + + String mainUriPrefixSync({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetLicense({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetVersion({dynamic hint}) { + throw UnimplementedError(); + } + + Future> mainGetFav({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainStoreFav({required List favs, dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetPeerSync({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetLanPeers({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetConnectStatus({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainCheckConnectStatus({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainIsUsingPublicServer({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainDiscover({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetApiServer({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainPostRequest( + {required String url, + required String body, + required String header, + dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetLocalOption({required String key, dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetEnv({required String key, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSetLocalOption( + {required String key, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetInputSource({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSetInputSource( + {required UuidValue sessionId, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetMyId({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetUuid({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetPeerOption( + {required String id, required String key, dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetPeerOptionSync( + {required String id, required String key, dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetPeerFlutterOptionSync( + {required String id, required String k, dynamic hint}) { + throw UnimplementedError(); + } + + void mainSetPeerFlutterOptionSync( + {required String id, + required String k, + required String v, + dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSetPeerOption( + {required String id, + required String key, + required String value, + dynamic hint}) { + throw UnimplementedError(); + } + + bool mainSetPeerOptionSync( + {required String id, + required String key, + required String value, + dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSetPeerAlias( + {required String id, required String alias, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetNewStoredPeers({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainForgetPassword({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainPeerHasPassword({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainPeerExists({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainLoadRecentPeers({dynamic hint}) { + throw UnimplementedError(); + } + + String mainLoadRecentPeersSync({dynamic hint}) { + throw UnimplementedError(); + } + + String mainLoadLanPeersSync({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainLoadRecentPeersForAb( + {required String filter, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainLoadFavPeers({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainLoadLanPeers({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainRemoveDiscovered({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainChangeTheme({required String dark, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainChangeLanguage({required String lang, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainDefaultVideoSaveDirectory({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSetUserDefaultOption( + {required String key, required String value, dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetUserDefaultOption({required String key, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainHandleRelayId({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetMainDisplay({dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetDisplays({dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionAddPortForward( + {required UuidValue sessionId, + required int localPort, + required String remoteHost, + required int remotePort, + dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionRemovePortForward( + {required UuidValue sessionId, required int localPort, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionNewRdp({required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionRequestVoiceCall( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionCloseVoiceCall( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future cmHandleIncomingVoiceCall( + {required int id, required bool accept, dynamic hint}) { + throw UnimplementedError(); + } + + Future cmCloseVoiceCall({required int id, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetLastRemoteId({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetSoftwareUpdateUrl({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetHomeDir({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetLangs({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetTemporaryPassword({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetPermanentPassword({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetFingerprint({dynamic hint}) { + throw UnimplementedError(); + } + + Future cmGetClientsState({dynamic hint}) { + throw UnimplementedError(); + } + + Future cmCheckClientsLength({required int length, dynamic hint}) { + throw UnimplementedError(); + } + + Future cmGetClientsLength({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainInit({required String appDir, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainDeviceId({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainDeviceName({required String name, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainRemovePeer({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + bool mainHasHwcodec({dynamic hint}) { + throw UnimplementedError(); + } + + bool mainHasGpucodec({dynamic hint}) { + throw UnimplementedError(); + } + + String mainSupportedHwdecodings({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainIsRoot({dynamic hint}) { + throw UnimplementedError(); + } + + int getDoubleClickTime({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainStartDbusServer({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSaveAb({required String json, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainClearAb({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainLoadAb({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSaveGroup({required String json, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainClearGroup({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainLoadGroup({dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSendPointer( + {required UuidValue sessionId, required String msg, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSendMouse( + {required UuidValue sessionId, required String msg, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionRestartRemoteDevice( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + String sessionGetAuditServerSync( + {required UuidValue sessionId, required String typ, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionSendNote( + {required UuidValue sessionId, required String note, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionAlternativeCodecs( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionChangePreferCodec( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionOnWaitingForImageDialogShow( + {required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + Future sessionToggleVirtualDisplay( + {required UuidValue sessionId, + required int index, + required bool on, + dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSetHomeDir({required String home, dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetDataDirIos({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainStopService({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainStartService({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainUpdateTemporaryPassword({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSetPermanentPassword( + {required String password, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainCheckSuperUserPermission({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainCheckMouseTime({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetMouseTime({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainWol({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainCreateShortcut({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + Future cmSendChat( + {required int connId, required String msg, dynamic hint}) { + throw UnimplementedError(); + } + + Future cmLoginRes( + {required int connId, required bool res, dynamic hint}) { + throw UnimplementedError(); + } + + Future cmCloseConnection({required int connId, dynamic hint}) { + throw UnimplementedError(); + } + + Future cmRemoveDisconnectedConnection( + {required int connId, dynamic hint}) { + throw UnimplementedError(); + } + + Future cmCheckClickTime({required int connId, dynamic hint}) { + throw UnimplementedError(); + } + + Future cmGetClickTime({dynamic hint}) { + throw UnimplementedError(); + } + + Future cmSwitchPermission( + {required int connId, + required String name, + required bool enabled, + dynamic hint}) { + throw UnimplementedError(); + } + + bool cmCanElevate({dynamic hint}) { + throw UnimplementedError(); + } + + Future cmElevatePortable({required int connId, dynamic hint}) { + throw UnimplementedError(); + } + + Future cmSwitchBack({required int connId, dynamic hint}) { + throw UnimplementedError(); + } + + Future cmGetConfig({required String name, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGetBuildDate({dynamic hint}) { + throw UnimplementedError(); + } + + String translate( + {required String name, required String locale, dynamic hint}) { + throw UnimplementedError(); + } + + int sessionGetRgbaSize( + {required UuidValue sessionId, required int display, dynamic hint}) { + throw UnimplementedError(); + } + + void sessionNextRgba( + {required UuidValue sessionId, required int display, dynamic hint}) { + throw UnimplementedError(); + } + + void sessionRegisterPixelbufferTexture( + {required UuidValue sessionId, + required int display, + required int ptr, + dynamic hint}) { + throw UnimplementedError(); + } + + void sessionRegisterGpuTexture( + {required UuidValue sessionId, + required int display, + required int ptr, + dynamic hint}) { + throw UnimplementedError(); + } + + Future queryOnlines({required List ids, dynamic hint}) { + throw UnimplementedError(); + } + + int versionToNumber({required String v, dynamic hint}) { + throw UnimplementedError(); + } + + Future optionSynced({dynamic hint}) { + throw UnimplementedError(); + } + + bool mainIsInstalled({dynamic hint}) { + throw UnimplementedError(); + } + + void mainInitInputSource({dynamic hint}) { + throw UnimplementedError(); + } + + bool mainIsInstalledLowerVersion({dynamic hint}) { + throw UnimplementedError(); + } + + bool mainIsInstalledDaemon({required bool prompt, dynamic hint}) { + throw UnimplementedError(); + } + + bool mainIsProcessTrusted({required bool prompt, dynamic hint}) { + throw UnimplementedError(); + } + + bool mainIsCanScreenRecording({required bool prompt, dynamic hint}) { + throw UnimplementedError(); + } + + bool mainIsCanInputMonitoring({required bool prompt, dynamic hint}) { + throw UnimplementedError(); + } + + bool mainIsShareRdp({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSetShareRdp({required bool enable, dynamic hint}) { + throw UnimplementedError(); + } + + bool mainGotoInstall({dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetNewVersion({dynamic hint}) { + throw UnimplementedError(); + } + + bool mainUpdateMe({dynamic hint}) { + throw UnimplementedError(); + } + + Future setCurSessionId({required UuidValue sessionId, dynamic hint}) { + throw UnimplementedError(); + } + + bool installShowRunWithoutInstall({dynamic hint}) { + throw UnimplementedError(); + } + + Future installRunWithoutInstall({dynamic hint}) { + throw UnimplementedError(); + } + + Future installInstallMe( + {required String options, required String path, dynamic hint}) { + throw UnimplementedError(); + } + + String installInstallPath({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainAccountAuth( + {required String op, required bool rememberMe, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainAccountAuthCancel({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainAccountAuthResult({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainOnMainWindowClose({dynamic hint}) { + throw UnimplementedError(); + } + + bool mainCurrentIsWayland({dynamic hint}) { + throw UnimplementedError(); + } + + bool mainIsLoginWayland({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainStartPa({dynamic hint}) { + throw UnimplementedError(); + } + + bool mainHideDocker({dynamic hint}) { + throw UnimplementedError(); + } + + bool mainHasPixelbufferTextureRender({dynamic hint}) { + throw UnimplementedError(); + } + + bool mainHasFileClipboard({dynamic hint}) { + throw UnimplementedError(); + } + + bool mainHasGpuTextureRender({dynamic hint}) { + throw UnimplementedError(); + } + + Future cmInit({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainStartIpcUrlServer({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainTestWallpaper({required int second, dynamic hint}) { + throw UnimplementedError(); + } + + Future mainSupportRemoveWallpaper({dynamic hint}) { + throw UnimplementedError(); + } + + bool isIncomingOnly({dynamic hint}) { + throw UnimplementedError(); + } + + bool isOutgoingOnly({dynamic hint}) { + throw UnimplementedError(); + } + + bool isCustomClient({dynamic hint}) { + throw UnimplementedError(); + } + + bool isDisableSettings({dynamic hint}) { + throw UnimplementedError(); + } + + bool isDisableAb({dynamic hint}) { + throw UnimplementedError(); + } + + bool isDisableAccount({dynamic hint}) { + throw UnimplementedError(); + } + + bool isDisableInstallation({dynamic hint}) { + throw UnimplementedError(); + } + + Future isPresetPassword({dynamic hint}) { + throw UnimplementedError(); + } + + Future sendUrlScheme({required String url, dynamic hint}) { + throw UnimplementedError(); + } + + Future pluginEvent( + {required String id, + required String peer, + required Uint8List event, + dynamic hint}) { + throw UnimplementedError(); + } + + Stream pluginRegisterEventStream( + {required String id, dynamic hint}) { + throw UnimplementedError(); + } + + String? pluginGetSessionOption( + {required String id, + required String peer, + required String key, + dynamic hint}) { + throw UnimplementedError(); + } + + Future pluginSetSessionOption( + {required String id, + required String peer, + required String key, + required String value, + dynamic hint}) { + throw UnimplementedError(); + } + + String? pluginGetSharedOption( + {required String id, required String key, dynamic hint}) { + throw UnimplementedError(); + } + + Future pluginSetSharedOption( + {required String id, + required String key, + required String value, + dynamic hint}) { + throw UnimplementedError(); + } + + Future pluginReload({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + void pluginEnable({required String id, required bool v, dynamic hint}) { + throw UnimplementedError(); + } + + bool pluginIsEnabled({required String id, dynamic hint}) { + throw UnimplementedError(); + } + + bool pluginFeatureIsEnabled({dynamic hint}) { + throw UnimplementedError(); + } + + Future pluginSyncUi({required String syncTo, dynamic hint}) { + throw UnimplementedError(); + } + + Future pluginListReload({dynamic hint}) { + throw UnimplementedError(); + } + + Future pluginInstall( + {required String id, required bool b, dynamic hint}) { + throw UnimplementedError(); + } + + bool isSupportMultiUiSession({required String version, dynamic hint}) { + throw UnimplementedError(); + } + + bool isSelinuxEnforcing({dynamic hint}) { + throw UnimplementedError(); + } + + String mainDefaultPrivacyModeImpl({dynamic hint}) { + throw UnimplementedError(); + } + + String mainSupportedPrivacyModeImpls({dynamic hint}) { + throw UnimplementedError(); + } + + String mainSupportedInputSource({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainGenerate2Fa({dynamic hint}) { + throw UnimplementedError(); + } + + Future mainVerify2Fa({required String code, dynamic hint}) { + throw UnimplementedError(); + } + + bool mainHasValid2FaSync({dynamic hint}) { + throw UnimplementedError(); + } + + String mainGetHardOption({required String key, dynamic hint}) { + throw UnimplementedError(); + } + + void dispose() { + throw UnimplementedError(); + } +} diff --git a/flutter/lib/web/common.dart b/flutter/lib/web/common.dart new file mode 100644 index 000000000..bab3684ed --- /dev/null +++ b/flutter/lib/web/common.dart @@ -0,0 +1,9 @@ + +final isAndroid_ = false; +final isIOS_ = false; +final isWindows_ = false; +final isMacOS_ = false; +final isLinux_ = false; +final isWeb_ = true; + +final isDesktop_ = false; diff --git a/flutter/lib/web/plugin/handlers.dart b/flutter/lib/web/plugin/handlers.dart new file mode 100644 index 000000000..f159ce9dd --- /dev/null +++ b/flutter/lib/web/plugin/handlers.dart @@ -0,0 +1,14 @@ +abstract class NativeHandler { + bool onEvent(Map evt); +} + +class NativeUiHandler extends NativeHandler { + NativeUiHandler._(); + + static NativeUiHandler instance = NativeUiHandler._(); + + @override + bool onEvent(Map evt) { + throw UnimplementedError(); + } +} diff --git a/flutter/lib/web/texture_rgba_renderer.dart b/flutter/lib/web/texture_rgba_renderer.dart new file mode 100644 index 000000000..834077735 --- /dev/null +++ b/flutter/lib/web/texture_rgba_renderer.dart @@ -0,0 +1,20 @@ +import 'dart:typed_data'; + +class TextureRgbaRenderer { + Future createTexture(int key) { + throw UnimplementedError(); + } + + Future closeTexture(int key) { + throw UnimplementedError(); + } + + Future onRgba( + int key, Uint8List data, int height, int width, int strideAlign) { + throw UnimplementedError(); + } + + Future getTexturePtr(int key) { + throw UnimplementedError(); + } +} diff --git a/flutter/lib/web/win32.dart b/flutter/lib/web/win32.dart new file mode 100644 index 000000000..358cb5ebb --- /dev/null +++ b/flutter/lib/web/win32.dart @@ -0,0 +1,5 @@ + +/// No use, for compilation only. +int getWindowsTargetBuildNumber_() { + return 0; +}