Error: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
at Object.throw_ [as throw] (http://localhost:64672/dart_sdk.js:5348:11)
at MethodChannel._invokeMethod (http://localhost:64672/packages/flutter/src/services/system_channels.dart.lib.js:962:21)
at _invokeMethod.next (<anonymous>)
at http://localhost:64672/dart_sdk.js:39230:33
at _RootZone.runUnary (http://localhost:64672/dart_sdk.js:39087:58)
at _FutureListener.thenAwait.handleValue (http://localhost:64672/dart_sdk.js:34073:29)
at handleValueCallback (http://localhost:64672/dart_sdk.js:34633:49)
at Function._propagateToListeners (http://localhost:64672/dart_sdk.js:34671:17)
at _Future.new.[_completeWithValue] (http://localhost:64672/dart_sdk.js:34513:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:64672/dart_sdk.js:34536:35)
at Object._microtaskLoop (http://localhost:64672/dart_sdk.js:39374:13)
at _startMicrotaskLoop (http://localhost:64672/dart_sdk.js:39380:13)
at http://localhost:64672/dart_sdk.js:34887:9
But my program can run smoothly and the used sharedpreferences
works well too .I think the multiple occurence can be attributed to my several use of sharedPreferences.
Does the version of shared_preference dependency devote to this bug?
My version is:
shared_preferences: ^0.4.2
Can anyone solve this,thanks.
in the earlier versions you can initial manually Doc:
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;
});