flutter-method-channel

Fetch arguments in Flutter module

余生颓废 提交于 2021-02-04 21:39:42
问题 I have a native Android app. I imported a Flutter module. Now, I can successfully navigate to the selected route from my Android app. I know passing data between native and flutter side is by method channels. But I did not understand how to implement it when starting the Activity. Here is my GitHub repo. startActivity( new FlutterActivity.NewEngineIntentBuilder(MyFlutterActivity.class) .initialRoute("/secondScreen") .build(getApplicationContext()) .putExtra("title", "Hello")); // Here, title

How to use Flutter Method Channel in background (app minimised/closed)

老子叫甜甜 提交于 2020-08-10 19:32:37
问题 I am working on a native Android widget in a Flutter App. In which there is refresh button, on click of that I have to call a method in the Flutter code. I am using Flutter Method Channel for the communication and it is working fine when app is in foreground. But it does not work when app is minimised or closed. I get error PlatformException(NO_ACTIVITY, null, null) . Below is my code. Android (AppWidgetProvider) if (methodChannel == null && context != null) { FlutterMain.startInitialization

How to use Flutter Method Channel in background (app minimised/closed)

家住魔仙堡 提交于 2020-08-10 19:32:05
问题 I am working on a native Android widget in a Flutter App. In which there is refresh button, on click of that I have to call a method in the Flutter code. I am using Flutter Method Channel for the communication and it is working fine when app is in foreground. But it does not work when app is minimised or closed. I get error PlatformException(NO_ACTIVITY, null, null) . Below is my code. Android (AppWidgetProvider) if (methodChannel == null && context != null) { FlutterMain.startInitialization