Skip to content

Commit

Permalink
Created complete changelog for v4
Browse files Browse the repository at this point in the history
  • Loading branch information
danvick committed Nov 23, 2020
1 parent a1b2122 commit a9f13ed
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 8 deletions.
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
## [4.0.0] - 23-Nov-2020
**IMPROVEMENTS**:
* New fields: `FormBuilderFilePicker`, `FormBuilderSearchableDropdown`, `FormBuilderCheckboxGroup`
* Localization of validation error texts
* Added external validation. Setting `InputDecoration.errorText` which invalidates the field.
* New validators: `FormBuilderValidators.integer`, `FormBuilderValidators.equal`
* Improved programmatically changing field values.
* Add to `FormBuilderField.onReset` callback - to enable reaction to resetting by changing the UI to reflect reset
* Add option to remove disabled field values from the final form value using `skipReadOnly` field.
* Number of Chips to be selected in FilterChip can now be limited by setting `maxChips` attribute. Closes #500
* Use localized text for OK and CANCEL button labels for ColorPicker dialog
* For default DateTimePicker format, use localized DateTime formats
* Added option for user to set own `border` for `FormBuilderSignaturePad`
* Improvements to example: break down to several pages; also show code in example app

**FIXES**:
* RadioGroup and CheckboxGroup labels not wrapping in vertical mode. Fixes #474
* Allow changing `enabled` and `initialValue` at runtime. Closes #515
* Hide floating label if field is empty
* Fixed bug in DateRangePicker where user can just pick one date
* ColorPicker, DateRangePicker, DateTimePicker - set TextField readOnly to true. Prevents keyboard popup
* Fixed label overflows in RadioGroup & CheckboxGroup fields
* Renamed `updateFormAttributeValue` to `setInternalAttributeValue` to avoid confusion

**BREAKING CHANGES**:
* Renamed `attribute` option in all fields to `name`
* Done away with `validators` attribute, use normal `validator`. Use `FormBuilderValidators.compose()` to compose multiple `FormFieldValidator`s into one
* Attribute `readOnly` replaced by `enabled` - this was done to match Flutter's `FormField` naming convention
* Renamed `FormBuilderRate` to `FormBuilderRating`
* Renamed `FormBuilderValidators.IP()` to `FormBuilderValidators.ip()`
* Removed CountryPicker field because of limited use. Replaced with SearchableDropdown with similar functionality but not only limited to countries.
* Use signature: ^3.0.0 package instead of self-maintained - comes with breaking changes.

## [4.0.0-pre.9] - 22-Nov-2020
* Upgraded to latest `file_picker` - adds `withReadStream` option for processing large files
* Fixed issue where `initialValue` working on SignaturePad
Expand Down
2 changes: 1 addition & 1 deletion example/lib/sources/complete_form.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/cupertino.dart';
//import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:intl/intl.dart';
Expand Down Expand Up @@ -33,6 +32,7 @@ class CompleteFormState extends State<CompleteForm> {
children: <Widget>[
FormBuilder(
key: _formKey,
// enabled: false,
autovalidateMode: AutovalidateMode.disabled,
initialValue: {
'movie_rating': 5,
Expand Down
4 changes: 3 additions & 1 deletion example/lib/sources/signup_form.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';

class SignupForm extends StatefulWidget {
Expand All @@ -17,7 +18,7 @@ class _SignupFormState extends State<SignupForm> {
padding: const EdgeInsets.all(8.0),
child: FormBuilder(
key: _formKey,
autovalidateMode: AutovalidateMode.disabled,
autovalidateMode: AutovalidateMode.onUserInteraction,
child: Column(
children: [
FormBuilderTextField(
Expand Down Expand Up @@ -49,6 +50,7 @@ class _SignupFormState extends State<SignupForm> {
const SizedBox(height: 10),
FormBuilderTextField(
name: 'confirm_password',
autovalidateMode: AutovalidateMode.onUserInteraction,
decoration: InputDecoration(
labelText: 'Confirm Password',
suffixIcon: (_formKey.currentState != null &&
Expand Down
6 changes: 6 additions & 0 deletions lib/src/form_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ class FormBuilderState extends State<FormBuilder> {

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

/*
bool get hasError => _fields.values.map((e) => e.hasError).firstWhere((element) => element == false, orElse: () => true);
bool get isValid => _fields.values.map((e) => e.isValid).firstWhere((element) => element == false, orElse: () => true);
*/

void setInternalFieldValue(String name, dynamic value) {
setState(() {
_value[name] = value;
Expand Down
2 changes: 0 additions & 2 deletions lib/src/form_builder_validators.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class FormBuilderValidators {
FormBuilderLocalizations.of(context).equalErrorText(value)
: null;

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

// TODO(any): implement inclusive in l10n
/// [FormFieldValidator] that requires the field's value to be less than
/// (or equal) to the provided number.
static FormFieldValidator<T> max<T>(
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/grouped_checkbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter_form_builder/flutter_form_builder.dart';

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

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

@override
_GroupedCheckboxState createState() => _GroupedCheckboxState();
_GroupedCheckboxState<T> createState() => _GroupedCheckboxState<T>();
}

class _GroupedCheckboxState<T> extends State<GroupedCheckbox<T>> {
Expand Down
4 changes: 2 additions & 2 deletions 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, reuse validation, react to changes, and collect final user input.
version: 4.0.0-pre.9
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: 4.0.0
homepage: https://github.com/danvick/flutter_form_builder

environment:
Expand Down

0 comments on commit a9f13ed

Please sign in to comment.