Skip to content

Commit

Permalink
fix(remote_config): ensure all listeners fire on onConfigUpdated (#13512
Browse files Browse the repository at this point in the history
)

* fix(remote_config): ensure all listeners fire on onConfigUpdated

* chore: run format
  • Loading branch information
SelaseKay authored Oct 29, 2024
1 parent d958f2a commit 170cc96
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,17 @@ class MethodChannelFirebaseRemoteConfig extends FirebaseRemoteConfigPlatform {
static const EventChannel _eventChannelConfigUpdated =
EventChannel('plugins.flutter.io/firebase_remote_config_updated');

Stream<RemoteConfigUpdate>? _onConfigUpdatedStream;

@override
Stream<RemoteConfigUpdate> get onConfigUpdated {
return _eventChannelConfigUpdated.receiveBroadcastStream(<String, dynamic>{
_onConfigUpdatedStream ??=
_eventChannelConfigUpdated.receiveBroadcastStream(<String, dynamic>{
'appName': app.name,
}).map((event) {
final updatedKeys = Set<String>.from(event);
return RemoteConfigUpdate(updatedKeys);
});
return _onConfigUpdatedStream!;
}
}

0 comments on commit 170cc96

Please sign in to comment.