Skip to content

Commit d56d046

Browse files
esenmxWilliamCunhaCardosodeandreamatias
authored
FormBuilderDateTimePicker resetIcon parameter fix (#1026)
* fix: #818 * resetIcon is Widget? now Co-authored-by: William Cunha Cardoso <[email protected]> Co-authored-by: Matias de Andrea <[email protected]>
1 parent 4693eb2 commit d56d046

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/flutter_form_builder/lib/src/fields/form_builder_date_time_picker.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class FormBuilderDateTimePicker extends FormBuilderField<DateTime> {
4545
/// If defined, the TextField [decoration]'s [suffixIcon] will be
4646
/// overridden to reset the input using the icon defined here.
4747
/// Set this to `null` to stop that behavior. Defaults to [Icons.close].
48-
final Icon resetIcon;
48+
final Widget? resetIcon;
4949

5050
/// Called when an enclosing form is saved. The value passed will be `null`
5151
/// if [format] fails to parse the text.
@@ -218,7 +218,7 @@ class FormBuilderDateTimePicker extends FormBuilderField<DateTime> {
218218
textAlign: textAlign,
219219
maxLength: maxLength,
220220
autofocus: autofocus,
221-
decoration: state.decoration,
221+
decoration: state.decoration.copyWith(suffixIcon: resetIcon),
222222
readOnly: true,
223223
enabled: state.enabled,
224224
autocorrect: autocorrect,

0 commit comments

Comments
 (0)