optString method

String? optString(
  1. String key
)

Gets the value for the given key, returns null if null or wrong type

Implementation

String? optString(String key) {
  final value = _internalMap[key];
  return value is String ? value : null;
}