unregisterAllFlagsListener method Null safety

Future<bool?> unregisterAllFlagsListener(
  1. String? listenerId
)

Unregisters a callback so it will no longer be called on flag updates.

listenerId the id to remove the listener from

Implementation

Future<bool?> unregisterAllFlagsListener(String? listenerId) async {
  if (listenerId == null) {
    return false;
  }

  if (!allFlagsListeners!.containsKey(listenerId) ||
      allFlagsListeners![listenerId] == null) {
    return false;
  }

  allFlagsListeners!.remove(listenerId);
  return await _channel.invokeMethod('unregisterAllFlagsListener',
      <String, dynamic>{'listenerId': listenerId});
}