getString method

String? getString({
  1. required String key,
  2. String? defaultValue,
})

Implementation

String? getString({required String key, String? defaultValue}) {
  dynamic value = getData(key: key, defaultValue: defaultValue);

  if (value is String) {
    return value;
  }

  if (value == null) {
    return null;
  }

  return value.toString();
}