getError method
Implementation
String? getError(String name) {
if (errors.containsKey(name)) {
final dynamic error = errors[name];
if (error is List && error.isNotEmpty) {
final String errorText = error[0].toString();
if (consumeError) {
remainingError.remove(name);
}
return errorText;
} else {
final String errorText = error.toString();
if (consumeError) {
remainingError.remove(name);
}
return errorText;
}
}
return null;
}