protected override void OnCreate() { base.OnCreate(); var windowProperties = new FlutterDesktopWindowProperties { headed = false, }; Utils.ParseEngineArgs(EngineArgs); using var switches = new StringArray(EngineArgs); using var entrypointArgs = new StringArray(DartEntrypointArgs); var engineProperties = new FlutterDesktopEngineProperties { assets_path = "../res/flutter_assets", icu_data_path = "../res/icudtl.dat", aot_library_path = "../lib/libapp.so", switches = switches.Handle, switches_count = (uint)switches.Length, entrypoint = DartEntrypoint, dart_entrypoint_argc = entrypointArgs.Length, dart_entrypoint_argv = entrypointArgs.Handle, }; Handle = FlutterDesktopRunEngine(ref windowProperties, ref engineProperties); if (Handle.IsInvalid) { throw new Exception("Could not launch a service application."); } }
protected override void OnCreate() { base.OnCreate(); Utils.ParseEngineArgs(EngineArgs); using (var switches = new StringArray(EngineArgs)) using (var entrypointArgs = new StringArray(DartEntrypointArgs)) { var engineProperties = new FlutterDesktopEngineProperties { assets_path = "../res/flutter_assets", icu_data_path = "../res/icudtl.dat", aot_library_path = "../lib/libapp.so", switches = switches.Handle, switches_count = (uint)switches.Length, entrypoint = DartEntrypoint, dart_entrypoint_argc = entrypointArgs.Length, dart_entrypoint_argv = entrypointArgs.Handle, }; Engine = FlutterDesktopEngineCreate(ref engineProperties); if (Engine.IsInvalid) { throw new Exception("Could not create a Flutter engine."); } } var windowProperties = new FlutterDesktopWindowProperties { x = WindowOffsetX, y = WindowOffsetY, width = WindowWidth, height = WindowHeight, transparent = IsWindowTransparent, focusable = IsWindowFocusable, top_level = IsTopLevel, }; View = FlutterDesktopViewCreateFromNewWindow(ref windowProperties, Engine); if (View.IsInvalid) { throw new Exception("Could not launch a Flutter application."); } }
public static extern FlutterDesktopEngine FlutterDesktopRunEngine( ref FlutterDesktopWindowProperties window_properties, ref FlutterDesktopEngineProperties engine_properties);
public static extern FlutterDesktopView FlutterDesktopViewCreateFromNewWindow( ref FlutterDesktopWindowProperties window_properties, FlutterDesktopEngine engine);