protected override void OnCreate()
        {
            base.OnCreate();

            // Get paths to resources required for launch.
            string resPath     = Current.DirectoryInfo.Resource;
            string assetsPath  = $"{resPath}/flutter_assets";
            string icuDataPath = $"{resPath}/icudtl.dat";
            string aotLibPath  = $"{resPath}/../lib/libapp.so";

            // Read engine arguments passed from the tool.
            ParseEngineArgs();

            using var switches = new StringArray(EngineArgs);
            var engineProperties = new FlutterDesktopEngineProperties
            {
                assets_path      = assetsPath,
                icu_data_path    = icuDataPath,
                aot_library_path = aotLibPath,
                switches         = switches.Handle,
                switches_count   = (uint)switches.Length,
            };

            Handle = FlutterDesktopRunEngine(ref engineProperties, true);
            if (Handle.IsInvalid)
            {
                throw new Exception("Could not launch a Flutter 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.");
                    }

                    if (!FlutterDesktopEngineRun(Engine))
                    {
                        throw new Exception("Could not launch a service application.");
                    }
                }
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            var windowProperties = new FlutterDesktopWindowProperties
            {
                headed      = IsHeaded,
                x           = WindowOffsetX,
                y           = WindowOffsetY,
                width       = WindowWidth,
                height      = WindowHeight,
                transparent = IsWindowTransparent,
                focusable   = IsWindowFocusable,
                top_level   = IsTopLevel,
            };

            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 Flutter application.");
                    }
                }
        }
Esempio n. 4
0
 public static extern void FlutterDesktopNotifyAppIsPaused(
     FlutterDesktopEngine engine);
Esempio n. 5
0
 public static extern void FlutterDesktopNotifyLowMemoryWarning(
     FlutterDesktopEngine engine);
Esempio n. 6
0
 public static extern void FlutterDesktopNotifyLocaleChange(
     FlutterDesktopEngine engine);
Esempio n. 7
0
 public static extern void FlutterDesktopNotifyAppControl(
     FlutterDesktopEngine engine,
     SafeAppControlHandle handle);
Esempio n. 8
0
 public static extern FlutterDesktopMessenger FlutterDesktopEngineGetMessenger(
     FlutterDesktopEngine engine);
Esempio n. 9
0
 public static extern FlutterDesktopPluginRegistrar FlutterDesktopGetPluginRegistrar(
     FlutterDesktopEngine engine,
     string plugin_name);
Esempio n. 10
0
 public static extern void FlutterDesktopShutdownEngine(
     FlutterDesktopEngine engine);
Esempio n. 11
0
 public static extern FlutterDesktopView FlutterDesktopViewCreateFromNewWindow(
     ref FlutterDesktopWindowProperties window_properties,
     FlutterDesktopEngine engine);
Esempio n. 12
0
 public static extern void FlutterDesktopEngineNotifyAppIsResumed(
     FlutterDesktopEngine engine);
Esempio n. 13
0
 public static extern bool FlutterDesktopEngineRun(
     FlutterDesktopEngine engine);