问题描述
我在 WEB 上运行我的 flutter 应用程序时遇到以下错误,但它在 Android 上运行良好。
Error: MissingPluginException(No implementation found for method check on channel plugins.flutter.io/connectivity)
at Object.createErrorWithStack (http://localhost:64900/dart_sdk.js:5348:12)
at Object._rethrow (http://localhost:64900/dart_sdk.js:39350:16)
at async._AsyncCallbackEntry.new.callback (http://localhost:64900/dart_sdk.js:39344:13)
at Object._microtaskLoop (http://localhost:64900/dart_sdk.js:39176:13)
at _startMicrotaskLoop (http://localhost:64900/dart_sdk.js:39182:13)
at http://localhost:64900/dart_sdk.js:34689:9
我调试了代码,问题出在这个方法上:
@override
Future<ConnectivityResult> checkConnectivity() async {
final String checkResult =
await methodChannel.invokeMethod<String>('check') ?? '';
return parseConnectivityResult(checkResult);
}
我使用的是 Connectivity 3.0.3 和 Flutter 2.0 稳定通道 我还搜索了网络和 stackoverflow,但我无法找到并回答我的具体案例。 我也尝试过flutter clean和rebuild,但没有结果。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)