stringVariation method Null safety
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 string type
- Any other error
flagKey
key for the flag to evaluatefallback
fallback value in case of errors evaluating the flag
Implementation
Future<String?> stringVariation(String flagKey, String? fallback) async {
if (fallback == null) {
return await _channel.invokeMethod(
'stringVariation', <String, dynamic>{'flagKey': flagKey});
} else {
return await _channel.invokeMethod('stringVariationFallback',
<String, dynamic>{'flagKey': flagKey, 'fallback': fallback});
}
}