The value must be a String.
String? isString(String field, Object? value) => value != null && value is! String ? '$field must be a string' : null;