getString method

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

Reads a key value of String type from Map.

If value is NULL or not String type return default value defaultString .

Implementation

String getString(String key, {String defaultValue = defaultString}) {
  if (containsKey(key)) {
    return this[key]?.toString() ?? defaultValue;
  }
  errorLogsNS("Map.getString[$key] has incorrect data : ${this[key]}");
  return defaultValue;
}