checkNullableString static method
Implementation
static String? checkNullableString(dynamic value, String fieldName) {
if (value == null) return null;
if (value is String) return value;
throw FormatException("Invalid type for '$fieldName': expected String");
}