示例#1
0
        private void LaunchFlutterActivity()
        {
            const string EngineId = "FlutterActivityEngine";

            EnsureFlutterEngineCreated(EngineId);

            var intent = FlutterActivity
                         .WithCachedEngine(EngineId)
                         .Build(this);

            StartActivity(intent);
        }
示例#2
0
        private void FabOnClick(object sender, EventArgs eventArgs)
        {
            if (flutterEngine == null)
            {
                flutterEngine = new FlutterEngine(this);

                flutterEngine.DartExecutor.ExecuteDartEntrypoint(
                    DartEntrypoint.CreateDefault()
                    );

                FlutterEngineCache.Instance.Put("my_engine", flutterEngine);

                var channel = new MethodChannel(flutterEngine.DartExecutor.BinaryMessenger, "diversido.io/main");
                channel.SetMethodCallHandler(this);
            }

            StartActivity(FlutterActivity.WithCachedEngine("my_engine").Build(this));
        }