File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
packages/firebase_remote_config Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.2.0+7
2
+
3
+ * Fix ` Bad state: Future already completed ` error when initially
4
+ calling ` RemoteConfig.instance ` multiple times in parallel.
5
+
1
6
## 0.2.0+6
2
7
3
8
* Update documentation to reflect new repository location.
Original file line number Diff line number Diff line change @@ -33,12 +33,12 @@ class RemoteConfig extends ChangeNotifier {
33
33
/// Gets the instance of RemoteConfig for the default Firebase app.
34
34
static Future <RemoteConfig > get instance async {
35
35
if (! _instanceCompleter.isCompleted) {
36
- _getRemoteConfigInstance ();
36
+ _instanceCompleter. complete ( await _getRemoteConfigInstance () );
37
37
}
38
38
return _instanceCompleter.future;
39
39
}
40
40
41
- static void _getRemoteConfigInstance () async {
41
+ static Future < RemoteConfig > _getRemoteConfigInstance () async {
42
42
final Map <String , dynamic > properties =
43
43
await channel.invokeMapMethod <String , dynamic >('RemoteConfig#instance' );
44
44
@@ -53,7 +53,7 @@ class RemoteConfig extends ChangeNotifier {
53
53
instance._remoteConfigSettings = remoteConfigSettings;
54
54
instance._parameters =
55
55
_parseRemoteConfigParameters (parameters: properties['parameters' ]);
56
- _instanceCompleter. complete ( instance) ;
56
+ return instance;
57
57
}
58
58
59
59
static Map <String , RemoteConfigValue > _parseRemoteConfigParameters (
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Remote Config. Update your application
3
3
re-releasing.
4
4
author : Flutter Team <flutter-dev@googlegroups.com>
5
5
homepage : https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_remote_config
6
- version : 0.2.0+6
6
+ version : 0.2.0+7
7
7
8
8
dependencies :
9
9
flutter :
You can’t perform that action at this time.
0 commit comments