草庐IT

MethodChannel

全部标签

android - '_Smi' 不是类型 'bool' 的子类型 - Flutter MethodChannel

得到这个奇怪的错误。似乎MethodChannel正在转换为int而不是bool?06-0700:16:26.58936784993Eflutter:[ERROR:topaz/lib/tonic/logging/dart_error.cc(16)]Unhandledexception:06-0700:16:26.58936784993Eflutter:type'_Smi'isnotasubtypeoftype'bool'where06-0700:16:26.58936784993Eflutter:_Smiisfromdart:core06-0700:16:26.58936784993E

java - 自定义 Facebook 登录以与 MethodChannel 一起使用

我正在尝试使用一些native代码为Flutter创建一个Facebook身份验证插件。我已经让代码在一个完全native的测试项目上工作,但无法让它在android插件项目中工作。我不是Android专家,所以我对此的了解非常有限。但这就是我所拥有的:publicclassFacebookSignInPluginimplementsMethodCallHandler{CallbackManagercallbackManager;AccessTokentoken;/***Pluginregistration.*/publicstaticvoidregisterWith(Registra

native - 如何使用 MethodChannel 从 native 平台调用应用程序 Dart 部分中的方法?

我正在编写一个原生插件,在某些情况下,它必须调用应用程序的Flutter部分中的函数,用Dart编写。它是如何实现的,在这里解释:https://flutter.io/platform-channels/此外,从native/平台部分向Dart/非native调用方法的示例如下:https://github.com/flutter/plugins/tree/master/packages/quick_actions现在,如果平台只需要调用method,即该调用不返回任何内容/void,但如果需要调用function,即需要来自非本地/Dart部分的返回值,我无法在Internet上找到

Flutter插件开发之MethodChannel交互基础

MethodChannel是Flutter和原生交互的基础,通过传入Flutter插件的名字,调用invokeMethod方法,便可以调用原生的方法,有点类似于Java的反射。staticconstMethodChannel_channel=constMethodChannel('scene_camera_plugin');staticFuturegetplatformVersionasync{ //调用原生的代码 finalString?version=await_channel.invokeMethod('getPlatformVersion'); returnversion;}在Andr

Flutter插件开发之MethodChannel交互基础

MethodChannel是Flutter和原生交互的基础,通过传入Flutter插件的名字,调用invokeMethod方法,便可以调用原生的方法,有点类似于Java的反射。staticconstMethodChannel_channel=constMethodChannel('scene_camera_plugin');staticFuturegetplatformVersionasync{ //调用原生的代码 finalString?version=await_channel.invokeMethod('getPlatformVersion'); returnversion;}在Andr
12