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 but...

Flutter app not working after integration with existing native app

I have an existing native iOS App that in production already. Now i want a flutter module to be integrated into the existing app. My flutter module works fine when run...

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...

Why does MethodChannel.Result.success() sometimes cause a timeout at Flutter?

I'm having a simple Flutter plugin that communicates through a <code>MethodChannel</code> with some native Android code. Here's a simple example how the methods provid...

How to call Dart from Android in background

I'm trying to call Dart code from Android when either the Activity is in de background or when there is no activity at all. For example, when the alarmmanager has trig...

Flutter error: 2 Positional arguments expected, but 1 found

I receive the above error message in the following code. <pre><code>import 'package:flutter/services.dart'; import 'dart:io'; // for File import 'package:file_pick...

How to invoke method channel from Workmanager task

I have a method channel registered in the Android build's MainActivity class, which works fine when called from the foreground application. I want to call this...

Flutter MethodCall non-nil check in kotlin way

I tried to make a MethodCall type judgement function using kotlin, but it return a type mismatch for me, how should I fix with it? <pre><code>import java.util.Obje...

Need a way to separate out multiple Flutter Method Channel code

I have two different functionalities that are to be written in native code(android/ios). I want to create multiple flutter method channels for each of these functional...

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 achi...

Flutter on Android: can I call a custom MethodChannel while the app is in the background?

I have created a custom MethodChannel com.example.app/widget that updates a home screen widget on Android after receiving a Firebase Cloud Message. It runs...

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

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 Fl...

Flutter method channel error. { Unhandled Exception: MissingPluginException(No implementation found for method getBatteryLevel on channel battery) }

so i followed everthing from 'https://flutter.dev/docs/development/platform-integration/platform-channels?tab=android-channel-java-tab' but when I click the floating b...

Flutter MethodChannel Unhandled Exception: MissingPluginException(No implementation found for method startService on channel com.mypackage.messages)

So, here i'm trying to implement my MethodChannel on Flutter. Here are some of my code snippets. <pre><code>&lt;manifest xmlns:android=http://schemas....

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...