Skip to content

Commit

Permalink
Use lazy iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
michalina-majewska committed Jun 5, 2024
1 parent 82bcd2e commit e833f0f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/src/form_group_cubit/form_group_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,8 @@ class FormGroupState with EquatableMixin {
final bool validating;

/// List of this form's fields including subforms' fields.
Iterable<FieldCubit<dynamic, dynamic>> get allFields {
return [
...fields,
for (final subform in subforms) ...subform.state.allFields,
];
}
Iterable<FieldCubit<dynamic, dynamic>> get allFields =>
fields.followedBy(subforms.expand((e) => e.state.allFields));

/// Map of all validation errors (including subfroms') grouped by fields
Map<FieldCubit<dynamic, dynamic>, dynamic> get validationErrors => {
Expand Down

0 comments on commit e833f0f

Please sign in to comment.