boolVariation method Null safety

Future<bool?> boolVariation(
  1. String flagKey,
  2. bool? fallback
)

Returns the flag value for the current user. Returns 'fallback' when one of the following occurs:

  • Flag is missing
  • The flag is not of a boolean type
  • Any other error flagKey key for the flag to evaluate fallback fallback value in case of errors evaluating the flag

Implementation

Future<bool?> boolVariation(String flagKey, bool? fallback) async {
  if (fallback == null) {
    return await _channel
        .invokeMethod('boolVariation', <String, dynamic>{'flagKey': flagKey});
  } else {
    return await _channel.invokeMethod('boolVariationFallback',
        <String, dynamic>{'flagKey': flagKey, 'fallback': fallback});
  }
}