errors property

  1. @override
Map<String, Object> errors
override

Gets all errors of the array.

Contains all the errors of the array and the child errors.

Implementation

@override
Map<String, Object> get errors {
  final allErrors = Map.of(super.errors);
  _controls.asMap().entries.forEach((entry) {
    final control = entry.value;
    final name = entry.key.toString();
    if (control.enabled && control.hasErrors) {
      allErrors.update(
        name,
        (_) => control.errors,
        ifAbsent: () => control.errors,
      );
    }
  });

  return allErrors;
}