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