Skip to content

Commit a9f13ed

Browse files
committed
Created complete changelog for v4
1 parent a1b2122 commit a9f13ed

File tree

7 files changed

+47
-8
lines changed

7 files changed

+47
-8
lines changed

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
## [4.0.0] - 23-Nov-2020
2+
**IMPROVEMENTS**:
3+
* New fields: `FormBuilderFilePicker`, `FormBuilderSearchableDropdown`, `FormBuilderCheckboxGroup`
4+
* Localization of validation error texts
5+
* Added external validation. Setting `InputDecoration.errorText` which invalidates the field.
6+
* New validators: `FormBuilderValidators.integer`, `FormBuilderValidators.equal`
7+
* Improved programmatically changing field values.
8+
* Add to `FormBuilderField.onReset` callback - to enable reaction to resetting by changing the UI to reflect reset
9+
* Add option to remove disabled field values from the final form value using `skipReadOnly` field.
10+
* Number of Chips to be selected in FilterChip can now be limited by setting `maxChips` attribute. Closes #500
11+
* Use localized text for OK and CANCEL button labels for ColorPicker dialog
12+
* For default DateTimePicker format, use localized DateTime formats
13+
* Added option for user to set own `border` for `FormBuilderSignaturePad`
14+
* Improvements to example: break down to several pages; also show code in example app
15+
16+
**FIXES**:
17+
* RadioGroup and CheckboxGroup labels not wrapping in vertical mode. Fixes #474
18+
* Allow changing `enabled` and `initialValue` at runtime. Closes #515
19+
* Hide floating label if field is empty
20+
* Fixed bug in DateRangePicker where user can just pick one date
21+
* ColorPicker, DateRangePicker, DateTimePicker - set TextField readOnly to true. Prevents keyboard popup
22+
* Fixed label overflows in RadioGroup & CheckboxGroup fields
23+
* Renamed `updateFormAttributeValue` to `setInternalAttributeValue` to avoid confusion
24+
25+
**BREAKING CHANGES**:
26+
* Renamed `attribute` option in all fields to `name`
27+
* Done away with `validators` attribute, use normal `validator`. Use `FormBuilderValidators.compose()` to compose multiple `FormFieldValidator`s into one
28+
* Attribute `readOnly` replaced by `enabled` - this was done to match Flutter's `FormField` naming convention
29+
* Renamed `FormBuilderRate` to `FormBuilderRating`
30+
* Renamed `FormBuilderValidators.IP()` to `FormBuilderValidators.ip()`
31+
* Removed CountryPicker field because of limited use. Replaced with SearchableDropdown with similar functionality but not only limited to countries.
32+
* Use signature: ^3.0.0 package instead of self-maintained - comes with breaking changes.
33+
134
## [4.0.0-pre.9] - 22-Nov-2020
235
* Upgraded to latest `file_picker` - adds `withReadStream` option for processing large files
336
* Fixed issue where `initialValue` working on SignaturePad

example/lib/sources/complete_form.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:flutter/cupertino.dart';
2-
//import 'package:flutter/gestures.dart';
32
import 'package:flutter/material.dart';
43
import 'package:flutter_form_builder/flutter_form_builder.dart';
54
import 'package:intl/intl.dart';
@@ -33,6 +32,7 @@ class CompleteFormState extends State<CompleteForm> {
3332
children: <Widget>[
3433
FormBuilder(
3534
key: _formKey,
35+
// enabled: false,
3636
autovalidateMode: AutovalidateMode.disabled,
3737
initialValue: {
3838
'movie_rating': 5,

example/lib/sources/signup_form.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:flutter/widgets.dart';
23
import 'package:flutter_form_builder/flutter_form_builder.dart';
34

45
class SignupForm extends StatefulWidget {
@@ -17,7 +18,7 @@ class _SignupFormState extends State<SignupForm> {
1718
padding: const EdgeInsets.all(8.0),
1819
child: FormBuilder(
1920
key: _formKey,
20-
autovalidateMode: AutovalidateMode.disabled,
21+
autovalidateMode: AutovalidateMode.onUserInteraction,
2122
child: Column(
2223
children: [
2324
FormBuilderTextField(
@@ -49,6 +50,7 @@ class _SignupFormState extends State<SignupForm> {
4950
const SizedBox(height: 10),
5051
FormBuilderTextField(
5152
name: 'confirm_password',
53+
autovalidateMode: AutovalidateMode.onUserInteraction,
5254
decoration: InputDecoration(
5355
labelText: 'Confirm Password',
5456
suffixIcon: (_formKey.currentState != null &&

lib/src/form_builder.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ class FormBuilderState extends State<FormBuilder> {
9696

9797
Map<String, FormBuilderFieldState> get fields => _fields;
9898

99+
/*
100+
bool get hasError => _fields.values.map((e) => e.hasError).firstWhere((element) => element == false, orElse: () => true);
101+
102+
bool get isValid => _fields.values.map((e) => e.isValid).firstWhere((element) => element == false, orElse: () => true);
103+
*/
104+
99105
void setInternalFieldValue(String name, dynamic value) {
100106
setState(() {
101107
_value[name] = value;

lib/src/form_builder_validators.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class FormBuilderValidators {
4949
FormBuilderLocalizations.of(context).equalErrorText(value)
5050
: null;
5151

52-
// TODO(any): implement inclusive in l10n
5352
/// [FormFieldValidator] that requires the field's value to be greater than
5453
/// (or equal) to the provided number.
5554
static FormFieldValidator<T> min<T>(
@@ -74,7 +73,6 @@ class FormBuilderValidators {
7473
};
7574
}
7675

77-
// TODO(any): implement inclusive in l10n
7876
/// [FormFieldValidator] that requires the field's value to be less than
7977
/// (or equal) to the provided number.
8078
static FormFieldValidator<T> max<T>(

lib/src/widgets/grouped_checkbox.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'package:flutter_form_builder/flutter_form_builder.dart';
33

44
class GroupedCheckbox<T> extends StatefulWidget {
55
/// A list of string that describes each checkbox. Each item must be distinct.
6-
final List<FormBuilderFieldOption> options;
6+
final List<FormBuilderFieldOption<T>> options;
77

88
/// A list of string which specifies automatically checked checkboxes.
99
/// Every element must match an item from itemList.
@@ -205,7 +205,7 @@ class GroupedCheckbox<T> extends StatefulWidget {
205205
}) : super(key: key);
206206

207207
@override
208-
_GroupedCheckboxState createState() => _GroupedCheckboxState();
208+
_GroupedCheckboxState<T> createState() => _GroupedCheckboxState<T>();
209209
}
210210

211211
class _GroupedCheckboxState<T> extends State<GroupedCheckbox<T>> {

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_form_builder
2-
description: This package helps in creation of forms in Flutter by removing the boilerplate, reuse validation, react to changes, and collect final user input.
3-
version: 4.0.0-pre.9
2+
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.
3+
version: 4.0.0
44
homepage: https://github.com/danvick/flutter_form_builder
55

66
environment:

0 commit comments

Comments
 (0)