flutter - MissingPluginException(在通道 plugins.flutter.io/shared_preferences 上找不到方法 getAll 的实现)
问题描述
shared_preferences: ^0.5.3+4 已经在使用
SharedPreferences.setMockInitialValues({});
const MethodChannel('plugins.flutter.io/shared_preferences')
.setMockMethodCallHandler((MethodCall methodCall) async {
if (methodCall.method == 'getAll') {
return <String, dynamic>{}; // set initial values here if desired
}
return null;
});
解决方案
推荐阅读
- jquery - Django REST framework Ajax 调用仅适用于第一次调用
- c - C/Linux:线程同步的使用
- c# - 如何将包含元组的值的字典映射到类实例
- swift - 我想对 RealmSwift 列表进行排序
- node.js - 我想使用 mongoose-gridfs 将图像上传到我的数据库。但我遇到了麻烦
- python - 如何找到给定长度的碱基对的频繁子序列
- android - 如何解决 Access denied find property "camera.aux.packagelist" 和 W/Gralloc3: allocator 3.x is not supported" 错误?
- json - bcp select with STUFF function to .json 格式
- android - Flutter:对话框上的“context!= null is not true”
- python - Airflow 中最新的唯一运营商和追赶者之间的区别