Skip to content

Commit 7694bfc

Browse files
feat: replace deprecated properties
1 parent 0aa938c commit 7694bfc

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/src/fields/form_builder_switch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class FormBuilderSwitch extends FormBuilderFieldDecoration<bool> {
136136
field.didChange(value);
137137
}
138138
: null,
139-
activeColor: activeColor,
139+
activeThumbColor: activeColor,
140140
activeThumbImage: activeThumbImage,
141141
activeTrackColor: activeTrackColor,
142142
inactiveThumbColor: inactiveThumbColor,

lib/src/form_builder_field.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ class FormBuilderField<T> extends FormField<T> {
3737
/// Called when the field value is changed.
3838
final ValueChanged<T?>? onChanged;
3939

40-
/// Called when the field value is reset.
41-
final VoidCallback? onReset;
42-
4340
/// {@macro flutter.widgets.Focus.focusNode}
4441
final FocusNode? focusNode;
4542

@@ -54,10 +51,10 @@ class FormBuilderField<T> extends FormField<T> {
5451
super.restorationId,
5552
required super.builder,
5653
super.errorBuilder,
54+
super.onReset,
5755
required this.name,
5856
this.valueTransformer,
5957
this.onChanged,
60-
this.onReset,
6158
this.focusNode,
6259
});
6360

@@ -228,7 +225,6 @@ class FormBuilderFieldState<F extends FormBuilderField<T>, T>
228225
if (_customErrorText != null) {
229226
setState(() => _customErrorText = null);
230227
}
231-
widget.onReset?.call();
232228
}
233229

234230
/// Validate field

0 commit comments

Comments
 (0)