checkString static method

String checkString(
  1. dynamic input,
  2. String fieldName
)

Implementation

static String checkString(dynamic input, String fieldName) {
  if (input is String) return input;
  throw FormatException("Expected String for '$fieldName', got ${input.runtimeType}");
}