Skip to content

Commit

Permalink
chore(core): release flutter_form_builder v7.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danvick committed May 19, 2022
1 parent c5addf0 commit 2cf87cc
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 62 deletions.
6 changes: 6 additions & 0 deletions packages/flutter_form_builder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [7.2.0] - 19-May-2022
* Added new dropdown attributes: borderRadius, enableFeedback, alignment. Fixes #1011
* Added more date picker and time picker options
* Made itemHeight attribute of FormBuilderDropdown nullable. Fixes #1015
* Resolved 'Null check operator used on a null value' bug in RangeSlider. Fixes #990

## [7.1.1] - 17-Feb-2022
* More improvements to focus handling
* Other minor fixes
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_form_builder/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
sdk: flutter

dev_dependencies:
flutter_lints: ^1.0.4
flutter_lints: ^2.0.1
flutter_test:
sdk: flutter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class FormBuilderCheckbox extends FormBuilderField<bool> {
decoration: decoration,
focusNode: focusNode,
builder: (FormFieldState<bool?> field) {
final state = field as _FormBuilderCheckboxState;
final state = field as FormBuilderCheckboxState;

return InputDecorator(
decoration: state.decoration,
Expand Down Expand Up @@ -144,8 +144,8 @@ class FormBuilderCheckbox extends FormBuilderField<bool> {
);

@override
_FormBuilderCheckboxState createState() => _FormBuilderCheckboxState();
FormBuilderCheckboxState createState() => FormBuilderCheckboxState();
}

class _FormBuilderCheckboxState
class FormBuilderCheckboxState
extends FormBuilderFieldState<FormBuilderCheckbox, bool> {}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class FormBuilderCheckboxGroup<T> extends FormBuilderField<List<T>> {
decoration: decoration,
focusNode: focusNode,
builder: (FormFieldState<List<T>?> field) {
final state = field as _FormBuilderCheckboxGroupState<T>;
final state = field as FormBuilderCheckboxGroupState<T>;

return InputDecorator(
decoration: state.decoration,
Expand Down Expand Up @@ -113,9 +113,9 @@ class FormBuilderCheckboxGroup<T> extends FormBuilderField<List<T>> {
);

@override
_FormBuilderCheckboxGroupState<T> createState() =>
_FormBuilderCheckboxGroupState<T>();
FormBuilderCheckboxGroupState<T> createState() =>
FormBuilderCheckboxGroupState<T>();
}

class _FormBuilderCheckboxGroupState<T>
class FormBuilderCheckboxGroupState<T>
extends FormBuilderFieldState<FormBuilderCheckboxGroup<T>, List<T>> {}
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class FormBuilderChoiceChip<T> extends FormBuilderField<T> {
decoration: decoration,
focusNode: focusNode,
builder: (FormFieldState<T?> field) {
final state = field as _FormBuilderChoiceChipState<T>;
final state = field as FormBuilderChoiceChipState<T>;

return InputDecorator(
decoration: state.decoration,
Expand Down Expand Up @@ -338,9 +338,9 @@ class FormBuilderChoiceChip<T> extends FormBuilderField<T> {
});

@override
_FormBuilderChoiceChipState<T> createState() =>
_FormBuilderChoiceChipState<T>();
FormBuilderChoiceChipState<T> createState() =>
FormBuilderChoiceChipState<T>();
}

class _FormBuilderChoiceChipState<T>
class FormBuilderChoiceChipState<T>
extends FormBuilderFieldState<FormBuilderChoiceChip<T>, T> {}
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class FormBuilderDateTimePicker extends FormBuilderField<DateTime> {
decoration: decoration,
focusNode: focusNode,
builder: (FormFieldState<DateTime?> field) {
final state = field as _FormBuilderDateTimePickerState;
final state = field as FormBuilderDateTimePickerState;

return TextField(
textDirection: textDirection,
Expand Down Expand Up @@ -249,11 +249,11 @@ class FormBuilderDateTimePicker extends FormBuilderField<DateTime> {
);

@override
_FormBuilderDateTimePickerState createState() =>
_FormBuilderDateTimePickerState();
FormBuilderDateTimePickerState createState() =>
FormBuilderDateTimePickerState();
}

class _FormBuilderDateTimePickerState
class FormBuilderDateTimePickerState
extends FormBuilderFieldState<FormBuilderDateTimePicker, DateTime> {
late TextEditingController _textFieldController;

Expand Down Expand Up @@ -316,6 +316,7 @@ class _FormBuilderDateTimePickerState
case InputType.both:
final date = await _showDatePicker(context, currentValue);
if (date != null) {
if(!mounted) break;
final time = await _showTimePicker(context, currentValue);
newValue = combine(date, time);
}
Expand Down Expand Up @@ -385,8 +386,8 @@ class _FormBuilderDateTimePickerState
time == null ? null : DateTime(1, 1, 1, time.hour, time.minute);

@override
void didChange(DateTime? val) {
super.didChange(val);
_textFieldController.text = (val == null) ? '' : _dateFormat.format(val);
void didChange(DateTime? value) {
super.didChange(value);
_textFieldController.text = (value == null) ? '' : _dateFormat.format(value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class FormBuilderDropdown<T> extends FormBuilderField<T> {
decoration: decoration,
focusNode: focusNode,
builder: (FormFieldState<T?> field) {
final state = field as _FormBuilderDropdownState<T>;
final state = field as FormBuilderDropdownState<T>;
// DropdownButtonFormField
// TextFormField

Expand Down Expand Up @@ -350,8 +350,8 @@ class FormBuilderDropdown<T> extends FormBuilderField<T> {
);

@override
_FormBuilderDropdownState<T> createState() => _FormBuilderDropdownState<T>();
FormBuilderDropdownState<T> createState() => FormBuilderDropdownState<T>();
}

class _FormBuilderDropdownState<T>
class FormBuilderDropdownState<T>
extends FormBuilderFieldState<FormBuilderDropdown<T>, T> {}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class FormBuilderFilterChip<T> extends FormBuilderField<List<T>> {
validator: validator,
valueTransformer: valueTransformer,
builder: (FormFieldState<List<T>?> field) {
final state = field as _FormBuilderFilterChipState<T>;
final state = field as FormBuilderFilterChipState<T>;

return InputDecorator(
decoration: state.decoration,
Expand Down Expand Up @@ -145,9 +145,9 @@ class FormBuilderFilterChip<T> extends FormBuilderField<List<T>> {
);

@override
_FormBuilderFilterChipState<T> createState() =>
_FormBuilderFilterChipState<T>();
FormBuilderFilterChipState<T> createState() =>
FormBuilderFilterChipState<T>();
}

class _FormBuilderFilterChipState<T>
class FormBuilderFilterChipState<T>
extends FormBuilderFieldState<FormBuilderFilterChip<T>, List<T>> {}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class FormBuilderRadioGroup<T> extends FormBuilderField<T> {
focusNode: focusNode,
decoration: decoration,
builder: (FormFieldState<T?> field) {
final state = field as _FormBuilderRadioGroupState<T>;
final state = field as FormBuilderRadioGroupState<T>;

return InputDecorator(
decoration: state.decoration,
Expand Down Expand Up @@ -106,9 +106,9 @@ class FormBuilderRadioGroup<T> extends FormBuilderField<T> {
);

@override
_FormBuilderRadioGroupState<T> createState() =>
_FormBuilderRadioGroupState<T>();
FormBuilderRadioGroupState<T> createState() =>
FormBuilderRadioGroupState<T>();
}

class _FormBuilderRadioGroupState<T>
class FormBuilderRadioGroupState<T>
extends FormBuilderFieldState<FormBuilderRadioGroup<T>, T> {}
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ class FormBuilderRangeSlider extends FormBuilderField<RangeValues> {
decoration: decoration,
focusNode: focusNode,
builder: (FormFieldState<RangeValues?> field) {
final state = field as _FormBuilderRangeSliderState;
final _numberFormat = numberFormat ?? NumberFormat.compact();
final state = field as FormBuilderRangeSliderState;
final effectiveNumberFormat = numberFormat ?? NumberFormat.compact();

return InputDecorator(
decoration: state.decoration,
Expand Down Expand Up @@ -183,21 +183,21 @@ class FormBuilderRangeSlider extends FormBuilderField<RangeValues> {
if (displayValues != DisplayValues.none &&
displayValues != DisplayValues.current)
Text(
_numberFormat.format(min),
effectiveNumberFormat.format(min),
style: minTextStyle ?? textStyle,
),
const Spacer(),
if (displayValues != DisplayValues.none &&
displayValues != DisplayValues.minMax)
Text(
'${_numberFormat.format(field.value!.start)} - ${_numberFormat.format(field.value!.end)}',
'${effectiveNumberFormat.format(field.value!.start)} - ${effectiveNumberFormat.format(field.value!.end)}',
style: textStyle,
),
const Spacer(),
if (displayValues != DisplayValues.none &&
displayValues != DisplayValues.current)
Text(
_numberFormat.format(max),
effectiveNumberFormat.format(max),
style: maxTextStyle ?? textStyle,
),
],
Expand All @@ -209,8 +209,8 @@ class FormBuilderRangeSlider extends FormBuilderField<RangeValues> {
});

@override
_FormBuilderRangeSliderState createState() => _FormBuilderRangeSliderState();
FormBuilderRangeSliderState createState() => FormBuilderRangeSliderState();
}

class _FormBuilderRangeSliderState
class FormBuilderRangeSliderState
extends FormBuilderFieldState<FormBuilderRangeSlider, RangeValues> {}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class FormBuilderSegmentedControl<T extends Object>
decoration: decoration,
focusNode: focusNode,
builder: (FormFieldState<T?> field) {
final state = field as _FormBuilderSegmentedControlState<T>;
final state = field as FormBuilderSegmentedControlState<T>;
final theme = Theme.of(state.context);

return InputDecorator(
Expand Down Expand Up @@ -119,9 +119,9 @@ class FormBuilderSegmentedControl<T extends Object>
);

@override
_FormBuilderSegmentedControlState<T> createState() =>
_FormBuilderSegmentedControlState();
FormBuilderSegmentedControlState<T> createState() =>
FormBuilderSegmentedControlState();
}

class _FormBuilderSegmentedControlState<T extends Object>
class FormBuilderSegmentedControlState<T extends Object>
extends FormBuilderFieldState<FormBuilderSegmentedControl<T>, T> {}
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ class FormBuilderSlider extends FormBuilderField<double> {
decoration: decoration,
focusNode: focusNode,
builder: (FormFieldState<double?> field) {
final state = field as _FormBuilderSliderState;
final _numberFormat = numberFormat ?? NumberFormat.compact();
final state = field as FormBuilderSliderState;
final effectiveNumberFormat = numberFormat ?? NumberFormat.compact();

return InputDecorator(
decoration: state.decoration,
child: Container(
Expand Down Expand Up @@ -212,21 +213,21 @@ class FormBuilderSlider extends FormBuilderField<double> {
if (displayValues != DisplayValues.none &&
displayValues != DisplayValues.current)
Text(
_numberFormat.format(min),
effectiveNumberFormat.format(min),
style: minTextStyle ?? textStyle,
),
const Spacer(),
if (displayValues != DisplayValues.none &&
displayValues != DisplayValues.minMax)
Text(
_numberFormat.format(field.value),
effectiveNumberFormat.format(field.value),
style: textStyle,
),
const Spacer(),
if (displayValues != DisplayValues.none &&
displayValues != DisplayValues.current)
Text(
_numberFormat.format(max),
effectiveNumberFormat.format(max),
style: maxTextStyle ?? textStyle,
),
],
Expand All @@ -239,8 +240,8 @@ class FormBuilderSlider extends FormBuilderField<double> {
);

@override
_FormBuilderSliderState createState() => _FormBuilderSliderState();
FormBuilderSliderState createState() => FormBuilderSliderState();
}

class _FormBuilderSliderState
class FormBuilderSliderState
extends FormBuilderFieldState<FormBuilderSlider, double> {}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class FormBuilderSwitch extends FormBuilderField<bool> {
decoration: decoration,
focusNode: focusNode,
builder: (FormFieldState<bool?> field) {
final state = field as _FormBuilderSwitchState;
final state = field as FormBuilderSwitchState;

return InputDecorator(
decoration: state.decoration,
Expand Down Expand Up @@ -159,8 +159,8 @@ class FormBuilderSwitch extends FormBuilderField<bool> {
);

@override
_FormBuilderSwitchState createState() => _FormBuilderSwitchState();
FormBuilderSwitchState createState() => FormBuilderSwitchState();
}

class _FormBuilderSwitchState
class FormBuilderSwitchState
extends FormBuilderFieldState<FormBuilderSwitch, bool> {}
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ class FormBuilderTextField extends FormBuilderField<String> {
decoration: decoration,
focusNode: focusNode,
builder: (FormFieldState<String?> field) {
final state = field as _FormBuilderTextFieldState;
final state = field as FormBuilderTextFieldState;
/*final effectiveDecoration = (decoration ?? const InputDecoration())
.applyDefaults(Theme.of(field.context).inputDecorationTheme);*/

Expand Down Expand Up @@ -422,10 +422,10 @@ class FormBuilderTextField extends FormBuilderField<String> {
);

@override
_FormBuilderTextFieldState createState() => _FormBuilderTextFieldState();
FormBuilderTextFieldState createState() => FormBuilderTextFieldState();
}

class _FormBuilderTextFieldState
class FormBuilderTextFieldState
extends FormBuilderFieldState<FormBuilderTextField, String> {
TextEditingController? get _effectiveController =>
widget.controller ?? _controller;
Expand Down
8 changes: 4 additions & 4 deletions packages/flutter_form_builder/lib/src/form_builder_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ class FormBuilderFieldState<F extends FormBuilderField<T>, T>

dynamic get transformedValue => widget.valueTransformer?.call(value) ?? value;

void registerTransformer(Map<String, Function> _map) {
final _fun = widget.valueTransformer;
if (_fun != null) {
_map[widget.name] = _fun;
void registerTransformer(Map<String, Function> map) {
final fun = widget.valueTransformer;
if (fun != null) {
map[widget.name] = fun;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ class GroupedRadio<T> extends StatefulWidget {
}) : super(key: key);

@override
_GroupedRadioState<T> createState() => _GroupedRadioState<T>();
GroupedRadioState<T> createState() => GroupedRadioState<T>();
}

class _GroupedRadioState<T> extends State<GroupedRadio<T?>> {
class GroupedRadioState<T> extends State<GroupedRadio<T?>> {
@override
Widget build(BuildContext context) {
final widgetList = <Widget>[];
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_form_builder/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_form_builder
description: This package helps in creation of forms in Flutter by removing the boilerplate code, reusing validation, react to changes, and collect final user input.
version: 7.1.1
version: 7.2.0
homepage: https://github.com/danvick/flutter_form_builder

environment:
Expand All @@ -13,6 +13,6 @@ dependencies:
collection: ^1.15.0

dev_dependencies:
flutter_lints: ^1.0.4
flutter_lints: ^2.0.1
flutter_test:
sdk: flutter

0 comments on commit 2cf87cc

Please sign in to comment.