registerFeatureFlagListener static method Null safety
- String flagKey,
- LDFlagUpdatedCallback flagUpdateCallback
Registers a callback to be notified when the value of the flag flagKey
is updated.
Implementation
static Future<void> registerFeatureFlagListener(String flagKey, LDFlagUpdatedCallback flagUpdateCallback) async {
var isOnlyListenerForFlag = _flagUpdateCallbacks[flagKey].isEmpty;
_flagUpdateCallbacks.add(flagKey, flagUpdateCallback);
if (isOnlyListenerForFlag) {
await _channel.invokeMethod('startFlagListening', flagKey);
}
}