Skip to content

Commit c6a0091

Browse files
docs: add comments about skip disabled
1 parent 29b8f3c commit c6a0091

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/src/form_builder_field_decoration.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class FormBuilderFieldDecorationState<F extends FormBuilderFieldDecoration<T>,
3636
F get widget => super.widget as F;
3737

3838
InputDecoration get decoration => widget.decoration.copyWith(
39+
// Read only allow show error to support property skipDisabled
3940
errorText: widget.enabled || readOnly
4041
? widget.decoration.errorText ?? errorText
4142
: null,

test/src/form_builder_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void main() {
183183

184184
group('skipDisabled -', () {
185185
testWidgets(
186-
'Should not show error when field is not enabled and skipDisabled is true',
186+
'Should not show error when field is disabled and skipDisabled is true',
187187
(tester) async {
188188
const textFieldName = 'text3';
189189
const errorTextField = 'error text field';
@@ -206,7 +206,7 @@ void main() {
206206
expect(find.text(errorTextField), findsNothing);
207207
});
208208
testWidgets(
209-
'Should show error when field is not enabled and skipDisabled is false',
209+
'Should show error when field is disabled and skipDisabled is false',
210210
(tester) async {
211211
const textFieldName = 'text4';
212212
const errorTextField = 'error text field';

0 commit comments

Comments
 (0)