Flutter uses a flexible system that allows you to call platform-specific APIs whether available in Kotlin or Java code on Android, or in Swift or Objective-C code on iOS. A named channel for communicating with platform plugins using asynchronous method calls.
Questions tagged [flutter-method-channel]
146 questions
1
vote
0 answers
Kotlin changes parameter names to alphabetical values on release for a Flutter app
I recently started running into an issue, where, when building my Flutter in release mode to deploy to Play Console's internal testing track, some of my functions in Flutter started failing.
For context, I have EventChannels that stream data from a…

JadedEric
- 1,943
- 2
- 26
- 49
1
vote
1 answer
How Flutter MethodChannel works, and how it is different from Interop?
Note: This question is specifically for `flutter.android.dart`.
How does the MethodChannel of Flutter works internally, like:
I know that MethodChannel first serializes the messages, before passing, but how, and what?
Is the kotlin/java side,…

gitman-2021
- 111
- 8
1
vote
1 answer
Error when try to start local Hotspot on android part of a flutter app
I've got a flutter app in which I want to start the hotspot of the device. So I have to write some platform specific code on android to use hotspot.
I got this that compiles without a problem:
try {
if (call.method ==…

un_cafeinoman
- 67
- 1
- 7
1
vote
1 answer
How to create list of Pairs?
I want to create some Pair in Dart (Flutter) e.g.
Pair('text', 'some text here')
Pair('my_value', '233')
and pass it to Android activity (kotlin) via MethodChannel
How Can I do that?
I've create a Dart function which takes HashMap but I a bit lost…

Wafi_ck
- 1,045
- 17
- 41
1
vote
0 answers
MethodChannel not sending data back from Flutter to iOS with flutter engine run from notification service extension
I'm trying to launch briefly a flutter engine from a notification service extension in order to run some dart code. I created a new flutter module that I compiled as a framework and added to the extension target in xCode.
The code works well and the…

aloys-c
- 51
- 5
1
vote
0 answers
java.lang.NullPointerException: Attempt to invoke virtual method 'android.app.Activity io.flutter.embedding.android.FlutterActivity.getActivity()'
Everyone, please help me
My Flutter Plugin Java can't start Intent service from android native please tell me to fix I created a Flutter plugin to connect to my watch. I created a Method Chanel, run Android native SDK, and I want the flutter plugin…

Thananat Rueangchot
- 13
- 3
1
vote
0 answers
How to call Flutter Widget from Flutter project to Native Android to bind in Service?
I'm working on a project where I have the requirement to bind the Flutter Widget to Native Android Service class and in the place of LayoutInflater. I've already worked on the method channels concept, but this is completely different story.
Need…

hemandroid
- 568
- 4
- 12
1
vote
1 answer
Add Flutter method channel to the IOS share extension
I want to add the Flutter platform channel in an iOS share extension ( Is this even possible?
In the main app's AppDelegate I would simply use something like this:
let controller : FlutterViewController = window?.rootViewController as!…

mytakii sergii
- 11
- 2
1
vote
1 answer
How to use accessibility service in Flutter - Platform Specific
I'm trying to integrate accessibility service in the flutter based application and I dug into it and found out that I will have to use method channels in order to achieve this task because it is possible only by using android native code…

shakky
- 434
- 5
- 20
1
vote
1 answer
How to pass method into another class in flutter
I tried to create a task app using flutter, So I created a text field in DialogBox and my aim is when I add some text into the text field and when I clicked the OK button, I need to show that text in the list. but I have no idea how to call a method…

Madusha Chamal
- 13
- 2
1
vote
0 answers
How does a terminated Flutter App receive method channel call from BroadcastReceiver?
I want to know how a terminated Flutter App receives method channel call from BroadcastReceiver which starts the…

n-kotaro
- 11
- 1
1
vote
0 answers
How to make callback/coroutines in Method Channel in Kotlin?
I'm trying to make callback to return data by method channel (because I will get the data after another function will activate), but returning variable is already callback.
What should I do?
Kotlin MethodChannel code:
val list: MutableList =…

Jakub Kořenek
- 23
- 6
1
vote
0 answers
Flutter pigeon inter-referencing @HostApi classes
Hi there I'm using flutter. However, I have some classes which need to be associated with equivalents on the native side. For this I'm using pigeon. Here is a sample of the pigeon template:
import 'package:pigeon/pigeon.dart';
@HostApi()
abstract…

rhobro
- 103
- 1
- 7
1
vote
0 answers
flutter black screen at running after integrate android platform with argear sdk
I want to integrate flutter app with ArGear SDK.
There is no package or plugin to use this SDK directly in flutter, and we should implement SDK in platform side and call corresponding method with method channel.
I want to open camera in platform…

Mahmoud
- 462
- 3
- 12
1
vote
1 answer
separate web and mobile flutter
I want to separate between web and mobile in my flutter project. I use below code but not work in web app (when I'm test in chrome with this mode)
onTap: () {
Platform.isAndroid || Platform.isIOS
? Navigator.push(context,
…

Abbas Asadi
- 265
- 1
- 5
- 14