fixed tests

This commit is contained in:
Vadim 2023-11-07 11:48:05 +01:00
parent 98c96577fb
commit dc7adb8472
2 changed files with 6 additions and 3 deletions

View file

@ -50,7 +50,11 @@ class RemoteConfigService implements IRemoteConfigService {
}
}
Future<void> fetchConfig() => FirebaseRemoteConfig.instance.fetch();
Future<void> fetchConfig() async {
// https://github.com/firebase/flutterfire/issues/6196#issuecomment-927751667
await Future.delayed(const Duration(seconds: 1));
await FirebaseRemoteConfig.instance.fetch();
}
dynamic getValue(Feature feature) => FirebaseRemoteConfig.instance.getValue(feature.name).toValue(feature);

View file

@ -26,8 +26,7 @@ class RemoteConfigProviderState extends State<RemoteConfigProvider> {
@override
void initState() {
super.initState();
// https://github.com/firebase/flutterfire/issues/6196#issuecomment-927751667
Future.delayed(const Duration(seconds: 1)).then((_) => widget.remoteConfigService.fetchConfig());
widget.remoteConfigService.fetchConfig();
_updatesSubscription = widget.remoteConfigService.onConfigUpdated().listen(
_updateFeatures,
onError: (e) => log(e.toString()),