Skip to content

Commit 8a33ec0

Browse files
feat: improve fields documentation
1 parent b03d81d commit 8a33ec0

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

lib/src/form_builder.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,23 @@ class FormBuilderState extends State<FormBuilder> {
111111

112112
bool get enabled => widget.enabled;
113113

114-
/// Verify if all fields on form are valid
114+
/// Verify if all fields on form are valid.
115115
bool get isValid => fields.values.every((field) => field.isValid);
116116

117-
/// Verify if some field on form are dirty
117+
/// Will be true if some field on form are dirty.
118+
///
119+
/// Dirty: The value of field is changed by user or by logic code.
118120
bool get isDirty => fields.values.any((field) => field.isDirty);
119121

120-
/// Verify if some field on form are touched
122+
/// Will be true if some field on form are touched.
123+
///
124+
/// Touched: The field is focused by user or by logic code.
121125
bool get isTouched => fields.values.any((field) => field.isTouched);
122126

123-
/// Get initialValue
127+
/// Get initialValue.
124128
Map<String, dynamic> get initialValue => widget.initialValue;
125129

126-
/// Get all fields of form
130+
/// Get all fields of form.
127131
FormBuilderFields get fields => _fields;
128132

129133
Map<String, dynamic> get instantValue =>

lib/src/form_builder_field.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,15 @@ class FormBuilderFieldState<F extends FormBuilderField<T>, T>
106106

107107
bool get enabled => widget.enabled && (_formBuilderState?.enabled ?? true);
108108
bool get _readOnly => !(_formBuilderState?.widget.skipDisabled ?? false);
109+
110+
/// Will be true if the field is dirty
111+
///
112+
/// The value of field is changed by user or by logic code.
109113
bool get isDirty => _dirty;
114+
115+
/// Will be true if the field is touched
116+
///
117+
/// The field is focused by user or by logic code
110118
bool get isTouched => _touched;
111119

112120
InputDecoration get decoration => widget.decoration.copyWith(

0 commit comments

Comments
 (0)