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
0
votes
0 answers
How to present video in flutter from a package in swift?
I am using UMEye SDK in ios for live streaming. I am creating a flutter app and using method channel to communicate with the native SDK from flutter. I was planning to call the start() function from the SDK to show the video in flutter. So, anybody…

viki
- 404
- 3
- 14
0
votes
0 answers
Flutter : Access digital well-being controls in flutter
I am developing a digital well-being app in Flutter and I aim to incorporate a timer for individual applications. Once the specified time limit is reached for a particular app, the user will be unable to continue its usage. I have attached examples…

Sharan Sukesh
- 21
- 3
0
votes
0 answers
Sending data from flutter to foreground service
I am new to the world of mobile development.
I'm currently using flutter_foreground_task to create the service and push the updates to UI.
The problem I'm having is trying to send data to the service from the UI.
I have tried with MethodChannel…

Jpabon
- 1
- 1
0
votes
0 answers
How can I send data as Stream from native kotlin to Flutter
How can I send data as a stream from native Kotlin code to Flutter?
I have implemented Method Channel, but they send only once, but I need a stream of data.
I have tried EventChannel but I'm getting error
"Type mismatch: inferred type is but…

Shehzad Raheem
- 111
- 6
0
votes
0 answers
Not getting data from native side to flutter using method channels in android
In my app I am using flutter_twilio package to get the incoming call from twilio. When user lift the call the package showing a call screen from native side. Now I want add a new button to call screen and based on button click I need to send data…

Harish Birlangi
- 1
- 2
0
votes
1 answer
Flutter Package or Flutter Plugin
Hello Flutter/Dart Devs , I'm developing a flutter package . Nearly 80% of the functionality can be achieved in dart itself so that I've written those in dart . And now , for a specific authentication related feature , I need to consume…

Vignesh Hendrix
- 29
- 4
0
votes
0 answers
is it possible to stream mjpeg video from native Kotlin to Flutter?
I have video stream in mjpeg format, so I have read and implmented a lot of ways to work with it, but anything of these ways don't meet my requirments (also I was using webView packages, but now we should implement changing screen oreintation…

inkwelll075
- 494
- 4
- 19
0
votes
1 answer
Error: Type mismatch: inferred type is Map? but Map was expected while using MethodChannel in Flutter/Kotlin
I am implementing MethodChannel to pass value from Flutter side to the Kotlin Android native code. I followed these two tutorials and they are doing exactly the same as I replicated: https://youtu.be/j0cy_Z6IG_c & https://youtu.be/XwwsI8vAHtk
My…

Somdip Dey
- 3,346
- 6
- 28
- 60
0
votes
0 answers
Error: Unexpected tokens (use ';' to separate expressions on the same line) while using Flutter Method Channel [Kotlin/Flutter]
I am trying to implement MethodChannel in Flutter so that I can call Android Native Code within my Flutter application. The code for this purpose in main.dart is as follows:
class _MyHomePageState extends State {
static const…

Somdip Dey
- 3,346
- 6
- 28
- 60
0
votes
0 answers
How to getWindow() in MethosChannel in Flutter
I have the following problem:
In Flutter, I need to change the screen brightness. I have written the method channel but cannot get window attributes (WindowManager.LayoutParams).
The code of the method channel screen handler:
public class…

kertoip
- 35
- 7
0
votes
0 answers
android router to flutter page can’t to using the MethodChannel
I use the MethodChannel(platform = const MethodChannel('example_service');
) to control the background service for notification.
for the android , i use the startService and stopService to control the service, running is fine.
on android i use the…

ncp ncc
- 1
0
votes
2 answers
Flutter error: 2 Positional arguments expected, but 1 found
I receive the above error message in the following code.
import 'package:flutter/services.dart';
import 'dart:io'; // for File
import 'package:file_picker/file_picker.dart'; // for FilePickerResultfile_picker: ^5.2.2
typedef OnRewardListener = void…
0
votes
0 answers
Cannot invoke method - Method Channel in Flutter
I'm trying to write platform specific code in Flutter. First of all, created a method to obtain battery temperature inside MainActivity.kt
This is my full code in MainActivity.kt file:
package com.xyz.zyx
import android.os.BatteryManager;
…

Zahid Tekbaş
- 809
- 2
- 12
- 27
0
votes
1 answer
How to send object from Flutter to Android?
I have class in Flutter:
class Foo {
String id;
int power;
Foo (this.id, this.power);
Map toJson() => {
'id': id,
'power': power
};
}
I've created a instance of this object and pass it to Android via MethodChannel as a…

Wafi_ck
- 1,045
- 17
- 41
0
votes
0 answers
Flutter: how to call dart code from native (swift, kotlin)?
I know it is possible and maybe common to call native code from dart via method channel, but does it works both ways (how to call a method which is written in dart from kotlin or swift)?

1encore
- 394
- 4
- 15