getString method

String getString(
  1. String key, {
  2. String defaultValue = '',
})

Retrieves a string value from Remote Config.

Returns the value associated with the key. If the key is not found or the value is empty, it returns the optional defaultValue.

Args: key (String): The key for the Remote Config value. defaultValue (String): The value to return if the key is not found or the value is empty. Defaults to ''.

Returns: String: The value for the key or the default value.

Implementation

String getString(String key, {String defaultValue = ''}) {
  final value = _remoteConfig.getString(key);
  return value.isNotEmpty ? value : defaultValue;
}