Skip to content

Commit abc0eff

Browse files
committed
Removed an unnecessary null guard around decoration.
1 parent fb0a593 commit abc0eff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/src/form_builder_field.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ abstract class FormBuilderFieldState<F extends FormBuilderField<T>, T>
9797

9898
bool _touched = false;
9999

100-
bool get enabled => _formBuilderState?.enabled == false ? false : widget.enabled;
100+
bool get enabled => widget.enabled && (_formBuilderState?.enabled ?? true);
101101

102102
FocusNode _focusNode;
103103

@@ -173,6 +173,6 @@ abstract class FormBuilderFieldState<F extends FormBuilderField<T>, T>
173173
}
174174

175175
InputDecoration decoration() => widget.decoration.copyWith(
176-
errorText: widget.decoration?.errorText ?? errorText,
176+
errorText: widget.decoration.errorText ?? errorText,
177177
);
178178
}

0 commit comments

Comments
 (0)