Skip to content

Commit b2bd5ec

Browse files
committed
Drop deprecated attributes
1 parent 801ae90 commit b2bd5ec

7 files changed

+21
-28
lines changed

example/lib/sources/complete_form.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,8 @@ class CompleteFormState extends State<CompleteForm> {
432432
),
433433
const SizedBox(width: 20),
434434
Expanded(
435-
child: OutlineButton(
436-
color: Theme.of(context).accentColor,
435+
child: OutlinedButton(
436+
// color: Theme.of(context).accentColor,
437437
child: Text(
438438
'Reset',
439439
style: TextStyle(color: Theme.of(context).accentColor),

lib/src/fields/form_builder_choice_chips.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ class FormBuilderChoiceChip<T> extends FormBuilderField<T> {
320320
backgroundColor: backgroundColor,
321321
shadowColor: shadowColor,
322322
selectedShadowColor: selectedShadowColor,
323-
shape: shape,
323+
// shape: shape,
324324
elevation: elevation,
325325
pressElevation: pressElevation,
326326
materialTapTargetSize: materialTapTargetSize,

lib/src/fields/form_builder_color_picker.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class FormBuilderColorPickerField extends FormBuilderField<Color> {
4949

5050
final bool obscureText;
5151
final bool autocorrect;
52-
final bool maxLengthEnforced;
52+
final MaxLengthEnforcement maxLengthEnforcement;
5353

5454
final int maxLines;
5555
final bool expands;
@@ -94,7 +94,7 @@ class FormBuilderColorPickerField extends FormBuilderField<Color> {
9494
this.autofocus = false,
9595
this.obscureText = false,
9696
this.autocorrect = true,
97-
this.maxLengthEnforced = true,
97+
this.maxLengthEnforcement,
9898
this.maxLines = 1,
9999
this.expands = false,
100100
this.showCursor,
@@ -166,7 +166,7 @@ class FormBuilderColorPickerField extends FormBuilderField<Color> {
166166
inputFormatters: inputFormatters,
167167
keyboardAppearance: keyboardAppearance,
168168
maxLength: maxLength,
169-
maxLengthEnforced: maxLengthEnforced,
169+
maxLengthEnforcement: maxLengthEnforcement,
170170
maxLines: maxLines,
171171
minLines: minLines,
172172
onEditingComplete: onEditingComplete,

lib/src/fields/form_builder_date_range_picker.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class FormBuilderDateRangePicker extends FormBuilderField<List<DateTime>> {
2323
final TextAlign textAlign;
2424
final bool autofocus;
2525
final bool autocorrect;
26-
final bool maxLengthEnforced;
26+
final MaxLengthEnforcement maxLengthEnforcement;
2727
final int maxLength;
2828
final VoidCallback onEditingComplete;
2929
final ValueChanged<List<DateTime>> onFieldSubmitted;
@@ -70,7 +70,7 @@ class FormBuilderDateRangePicker extends FormBuilderField<List<DateTime>> {
7070
this.textCapitalization = TextCapitalization.none,
7171
this.scrollPadding = const EdgeInsets.all(20.0),
7272
this.enableInteractiveSelection = true,
73-
this.maxLengthEnforced = true,
73+
this.maxLengthEnforcement,
7474
this.textAlign = TextAlign.start,
7575
this.autofocus = false,
7676
this.autocorrect = true,
@@ -152,7 +152,7 @@ class FormBuilderDateRangePicker extends FormBuilderField<List<DateTime>> {
152152
maxLength: maxLength,
153153
inputFormatters: inputFormatters,
154154
keyboardAppearance: keyboardAppearance,
155-
maxLengthEnforced: maxLengthEnforced,
155+
maxLengthEnforcement: maxLengthEnforcement,
156156
scrollPadding: scrollPadding,
157157
textAlign: textAlign,
158158
textCapitalization: textCapitalization,

lib/src/fields/form_builder_date_time_picker.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class FormBuilderDateTimePicker extends FormBuilderField<DateTime> {
8484
final bool autofocus;
8585
final bool obscureText;
8686
final bool autocorrect;
87-
final bool maxLengthEnforced;
87+
final MaxLengthEnforcement maxLengthEnforcement;
8888
final int maxLines;
8989
final int maxLength;
9090
final List<TextInputFormatter> inputFormatters;
@@ -174,7 +174,7 @@ class FormBuilderDateTimePicker extends FormBuilderField<DateTime> {
174174
this.obscureText = false,
175175
this.autocorrect = true,
176176
this.maxLines = 1,
177-
this.maxLengthEnforced = true,
177+
this.maxLengthEnforcement,
178178
this.expands = false,
179179
this.format,
180180
this.firstDate,
@@ -241,8 +241,7 @@ class FormBuilderDateTimePicker extends FormBuilderField<DateTime> {
241241
format: state._dateFormat,
242242
validator: validator,
243243
onShowPicker: state.onShowPicker,
244-
autovalidate: autovalidateMode != AutovalidateMode.disabled &&
245-
autovalidateMode != null,
244+
autovalidateMode: autovalidateMode,
246245
resetIcon: resetIcon,
247246
textDirection: textDirection,
248247
textAlign: textAlign,
@@ -256,7 +255,6 @@ class FormBuilderDateTimePicker extends FormBuilderField<DateTime> {
256255
focusNode: state.effectiveFocusNode,
257256
inputFormatters: inputFormatters,
258257
keyboardType: keyboardType,
259-
maxLengthEnforced: maxLengthEnforced,
260258
maxLines: maxLines,
261259
obscureText: obscureText,
262260
showCursor: showCursor,
@@ -276,6 +274,7 @@ class FormBuilderDateTimePicker extends FormBuilderField<DateTime> {
276274
textCapitalization: textCapitalization,
277275
textInputAction: textInputAction,
278276
onChanged: (val) => state.didChange(val),
277+
maxLengthEnforcement: maxLengthEnforcement,
279278
);
280279
},
281280
);

lib/src/fields/form_builder_filter_chips.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class FormBuilderFilterChip<T> extends FormBuilderField<List<T>> {
127127
backgroundColor: backgroundColor,
128128
shadowColor: shadowColor,
129129
selectedShadowColor: selectedShadowColor,
130-
shape: shape,
130+
// shape: shape, //TODO: remove - latter flutter versions
131131
elevation: elevation,
132132
pressElevation: pressElevation,
133133
materialTapTargetSize: materialTapTargetSize,

lib/src/fields/form_builder_text_field.dart

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class FormBuilderTextField extends FormBuilderField<String> {
9999
/// to [TextField.noMaxLength] then only the current character count is displayed.
100100
///
101101
/// After [maxLength] characters have been input, additional input
102-
/// is ignored, unless [maxLengthEnforced] is set to false. The text field
102+
/// is ignored, unless [maxLengthEnforcement] is set to false. The text field
103103
/// enforces the length with a [LengthLimitingTextInputFormatter], which is
104104
/// evaluated after the supplied [inputFormatters], if any.
105105
///
@@ -111,7 +111,7 @@ class FormBuilderTextField extends FormBuilderField<String> {
111111
/// Whitespace characters (e.g. newline, space, tab) are included in the
112112
/// character count.
113113
///
114-
/// If [maxLengthEnforced] is set to false, then more than [maxLength]
114+
/// If [maxLengthEnforcement] is set to false, then more than [maxLength]
115115
/// characters may be entered, but the error counter and divider will
116116
/// switch to the [decoration.errorStyle] when the limit is exceeded.
117117
///
@@ -142,14 +142,8 @@ class FormBuilderTextField extends FormBuilderField<String> {
142142
/// * [LengthLimitingTextInputFormatter] for more information on how it
143143
/// counts characters, and how it may differ from the intuitive meaning.
144144
final int maxLength;
145-
146-
/// If true, prevents the field from allowing more than [maxLength]
147-
/// characters.
148-
///
149-
/// If [maxLength] is set, [maxLengthEnforced] indicates whether or not to
150-
/// enforce the limit, or merely provide a character counter and warning when
151-
/// [maxLength] is exceeded.
152-
final bool maxLengthEnforced;
145+
146+
final MaxLengthEnforcement maxLengthEnforcement;
153147

154148
/// {@macro flutter.widgets.editableText.onEditingComplete}
155149
final VoidCallback onEditingComplete;
@@ -311,7 +305,7 @@ class FormBuilderTextField extends FormBuilderField<String> {
311305
this.textCapitalization = TextCapitalization.none,
312306
this.scrollPadding = const EdgeInsets.all(20.0),
313307
this.enableInteractiveSelection = true,
314-
this.maxLengthEnforced = true,
308+
this.maxLengthEnforcement = MaxLengthEnforcement.enforced,
315309
this.textAlign = TextAlign.start,
316310
this.autofocus = false,
317311
this.autocorrect = true,
@@ -355,7 +349,7 @@ class FormBuilderTextField extends FormBuilderField<String> {
355349
assert(autocorrect != null),
356350
assert(enableSuggestions != null),
357351
assert(autovalidateMode != null),
358-
assert(maxLengthEnforced != null),
352+
assert(maxLengthEnforcement != null),
359353
assert(scrollPadding != null),
360354
assert(maxLines == null || maxLines > 0),
361355
assert(minLines == null || minLines > 0),
@@ -414,7 +408,7 @@ class FormBuilderTextField extends FormBuilderField<String> {
414408
obscureText: obscureText,
415409
autocorrect: autocorrect,
416410
enableSuggestions: enableSuggestions,
417-
maxLengthEnforced: maxLengthEnforced,
411+
maxLengthEnforcement: maxLengthEnforcement,
418412
maxLines: maxLines,
419413
minLines: minLines,
420414
expands: expands,

0 commit comments

Comments
 (0)