checkNullableString static method

String? checkNullableString(
  1. dynamic value,
  2. String fieldName
)

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");
}