private void LaunchFlutterActivity() { const string EngineId = "FlutterActivityEngine"; EnsureFlutterEngineCreated(EngineId); var intent = FlutterActivity .WithCachedEngine(EngineId) .Build(this); StartActivity(intent); }
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)); }