Skip to content

Commit

Permalink
Merge pull request #23 from udos86/v7.0.0
Browse files Browse the repository at this point in the history
v7.0.0
  • Loading branch information
udos86 authored May 13, 2022
2 parents 5b57240 + e95df38 commit 8f7b16b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 33 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## [7.0.0] - 04/24/2022
## [7.0.0] - 05/13/2022

* update to Flutter `3.0.0` and Dart `2.17.0`
* removes `autofocus` property from `FastFormField`
* adds `autofocus` property to `FastCheckbox`, `FastSwitch`, `FastDropdown`, `FastChoiceChips`, `FastSlider` and `FastTextField`
* uses Dart `2.17.0` super-initializer parameters now wherever possible

## [6.0.0] - 04/24/2022

Expand Down
50 changes: 19 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,10 @@ Let's assume a simple form field that provides a random integer whenever a butto
```dart
class MyCustomField extends FastFormField<int> {
const MyCustomField({
Key? key,
required String name,
}) : super(
builder: _myCustomFormFieldBuilder,
key: key,
name: name,
);
super.builder = myCustomFormFieldBuilder,
super.key,
required super.name,
});
@override
MyCustomFieldState createState() => MyCustomFieldState();
Expand All @@ -151,32 +148,23 @@ class MyCustomFieldState extends FastFormFieldState<int> {
}
```

2. Add optional parameters and pass them as you like:
2. Add optional super-initializer parameters as you like:
```dart
class MyCustomField extends FastFormField<int> {
const MyCustomField({
InputDecoration? decoration,
String? helperText,
int? initialValue,
Key? key,
String? labelText,
required String name,
ValueChanged<int>? onChanged,
VoidCallback? onReset,
FormFieldSetter<int>? onSaved,
FormFieldValidator<int>? validator,
}) : super(
builder: _myCustomFormFieldBuilder,
helperText: helperText,
initialValue: initialValue,
key: key,
labelText: labelText,
name: name,
onChanged: onChanged,
onReset: onReset,
onSaved: onSaved,
validator: validator,
);
super.builder = customFormFieldBuilder,
super.decoration,
super.enabled,
super.helperText,
super.initialValue,
super.key,
super.labelText,
required super.name,
super.onChanged,
super.onReset,
super.onSaved,
super.validator,
});
@override
MyCustomFieldState createState() => MyCustomFieldState();
Expand All @@ -190,7 +178,7 @@ class MyCustomFieldState extends FastFormFieldState<int> {

3. Implement the required `FormFieldBuilder<T>`:
```dart
Widget _myCustomFormFieldBuilder(FormFieldState<int> field) {
Widget myCustomFormFieldBuilder(FormFieldState<int> field) {
return InputDecorator(
decoration: field.decoration,
child: Row(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_fast_forms
description: Enhances the Flutter SDK with adaptive form field wrapper widgets and validation states to speed up building forms.
version: 6.0.0
version: 7.0.0
repository: https://github.com/udos86/flutter-fast-forms

environment:
Expand Down

0 comments on commit 8f7b16b

Please sign in to comment.