From 36e9c361740c096c054df2faae42a34438f675b1 Mon Sep 17 00:00:00 2001 From: geronimol <56521222+geronimol@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:07:17 -0300 Subject: [PATCH 01/13] fix: change DateTime Picker behavior when InputType==both --- lib/src/fields/form_builder_date_time_picker.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/fields/form_builder_date_time_picker.dart b/lib/src/fields/form_builder_date_time_picker.dart index 84c70f3f4..c0ff0825b 100644 --- a/lib/src/fields/form_builder_date_time_picker.dart +++ b/lib/src/fields/form_builder_date_time_picker.dart @@ -306,7 +306,11 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState< if (date != null) { if (!mounted) break; final time = await _showTimePicker(currentValue); - newValue = combine(date, time); + if(time == null) { + newValue = null; + } else { + newValue = combine(date, time); + } } break; default: From 04d5896e8bdcefc09924d695992b0cbbcba16845 Mon Sep 17 00:00:00 2001 From: geronimol <56521222+geronimol@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:20:15 -0300 Subject: [PATCH 02/13] fix: change DateTime Picker behavior when user presses "cancel" button --- lib/src/fields/form_builder_date_time_picker.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/src/fields/form_builder_date_time_picker.dart b/lib/src/fields/form_builder_date_time_picker.dart index c0ff0825b..ce80aef7d 100644 --- a/lib/src/fields/form_builder_date_time_picker.dart +++ b/lib/src/fields/form_builder_date_time_picker.dart @@ -364,7 +364,7 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState< }; } - final timePickerResult = await showTimePicker( + return await showTimePicker( context: context, initialTime: currentValue != null ? TimeOfDay.fromDateTime(currentValue) @@ -380,8 +380,6 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState< errorInvalidText: widget.errorInvalidText, onEntryModeChanged: widget.onEntryModeChanged, ); - return timePickerResult ?? - (currentValue != null ? TimeOfDay.fromDateTime(currentValue) : null); } /// Sets the hour and minute of a [DateTime] from a [TimeOfDay]. From 99b74fb9a8766d7ed8bf388dd94732dd5da8b273 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:21:50 +0000 Subject: [PATCH 03/13] build(deps): bump flutter_lints from 4.0.0 to 5.0.0 Bumps [flutter_lints](https://github.com/flutter/packages/tree/main/packages) from 4.0.0 to 5.0.0. - [Release notes](https://github.com/flutter/packages/releases) - [Commits](https://github.com/flutter/packages/commits/flutter_lints-v5.0.0/packages) --- updated-dependencies: - dependency-name: flutter_lints dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pubspec.lock | 8 ++++---- pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index f6ac24361..40e288155 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -58,10 +58,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "5.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -103,10 +103,10 @@ packages: dependency: transitive description: name: lints - sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" + sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "5.0.0" matcher: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 0c6f7e786..dcddbba24 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,6 +20,6 @@ dependencies: intl: ">=0.19.0 <0.20.0" dev_dependencies: - flutter_lints: ^4.0.0 + flutter_lints: ">=4.0.0 <6.0.0" flutter_test: sdk: flutter From 83f083a3ae93c7ce3b0b095aa2031506893bdaa6 Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Wed, 18 Dec 2024 13:35:35 +0100 Subject: [PATCH 04/13] build: update dependencies --- example/pubspec.lock | 8 ++++---- pubspec.lock | 8 ++++---- pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 287d5de88..7edec56c0 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -99,18 +99,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: diff --git a/pubspec.lock b/pubspec.lock index 40e288155..fae0894c7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -79,18 +79,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index dcddbba24..bfcc7e46d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ environment: dependencies: flutter: sdk: flutter - intl: ">=0.19.0 <0.20.0" + intl: ">=0.19.0 <0.21.0" dev_dependencies: flutter_lints: ">=4.0.0 <6.0.0" From 502f7f569e10dec03385448b5e4cecb40a17aae7 Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Wed, 18 Dec 2024 13:35:56 +0100 Subject: [PATCH 05/13] style: fix lint warnings --- lib/src/fields/form_builder_date_time_picker.dart | 3 --- lib/src/widgets/grouped_radio.dart | 1 - 2 files changed, 4 deletions(-) diff --git a/lib/src/fields/form_builder_date_time_picker.dart b/lib/src/fields/form_builder_date_time_picker.dart index ce80aef7d..b73cd599b 100644 --- a/lib/src/fields/form_builder_date_time_picker.dart +++ b/lib/src/fields/form_builder_date_time_picker.dart @@ -284,7 +284,6 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState< case InputType.date: return DateFormat.yMd(languageCode); case InputType.both: - default: return DateFormat.yMd(languageCode).add_Hms(); } } @@ -313,8 +312,6 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState< } } break; - default: - throw 'Unexpected input type ${widget.inputType}'; } if (!mounted) return null; final finalValue = newValue ?? currentValue; diff --git a/lib/src/widgets/grouped_radio.dart b/lib/src/widgets/grouped_radio.dart index a26ac4571..855ff9cda 100644 --- a/lib/src/widgets/grouped_radio.dart +++ b/lib/src/widgets/grouped_radio.dart @@ -237,7 +237,6 @@ class _GroupedRadioState extends State> { child: Row(children: widgetList), ); case OptionsOrientation.wrap: - default: return SingleChildScrollView( child: Wrap( spacing: widget.wrapSpacing, From ed456670dc4231ad33404a406858f27dee4c68f9 Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Wed, 18 Dec 2024 13:37:05 +0100 Subject: [PATCH 06/13] ci: update fvm action version --- .github/workflows/base.yaml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/base.yaml b/.github/workflows/base.yaml index 052d9f36b..dc5a49260 100644 --- a/.github/workflows/base.yaml +++ b/.github/workflows/base.yaml @@ -35,21 +35,10 @@ jobs: with: distribution: 'zulu' java-version: '11' - - - name: Get Flutter version by FVM - uses: kuhnroyal/flutter-fvm-config-action@v2 - id: fvm-config-action - with: - path: ".fvmrc" - - - name: Flutter action - uses: subosito/flutter-action@v2 + - name: Setup Flutter + uses: kuhnroyal/flutter-fvm-config-action/setup@v3 with: - flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} - channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} - architecture: x64 - cache: true - + path: '.fvmrc' - name: Install dependencies run: flutter pub get - name: Format code From 712c843082b869364787680b6bac4cd407af276d Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Wed, 18 Dec 2024 13:43:42 +0100 Subject: [PATCH 07/13] build: fix version --- pubspec.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index bfcc7e46d..caa60e9ed 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,9 @@ environment: dependencies: flutter: sdk: flutter - intl: ">=0.19.0 <0.21.0" + # This version would be max, the same version used on flutter_localizations + # https://github.com/flutter/flutter/blob/17025dd88227cd9532c33fa78f5250d548d87e9a/packages/flutter_localizations/pubspec.yaml#L14 + intl: ">=0.19.0 <0.20.0" dev_dependencies: flutter_lints: ">=4.0.0 <6.0.0" From 93e6d6a5ec60e64ebddf006626f9a662c7e0fdb4 Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Wed, 18 Dec 2024 14:10:14 +0100 Subject: [PATCH 08/13] build: update minimal flutter version --- example/pubspec.lock | 12 ++++++------ example/pubspec.yaml | 6 +++--- pubspec.lock | 4 ++-- pubspec.yaml | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 7edec56c0..f4cbc50af 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -65,10 +65,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "5.0.0" flutter_localizations: dependency: "direct main" description: flutter @@ -123,10 +123,10 @@ packages: dependency: transitive description: name: lints - sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" + sha256: "4a16b3f03741e1252fda5de3ce712666d010ba2122f8e912c94f9f7b90e1a4c3" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "5.1.0" matcher: dependency: transitive description: @@ -229,5 +229,5 @@ packages: source: hosted version: "14.3.0" sdks: - dart: ">=3.5.0 <4.0.0" - flutter: ">=3.24.0" + dart: ">=3.6.0 <4.0.0" + flutter: ">=3.27.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 1b19c9d30..57d63a9a9 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -4,8 +4,8 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=3.5.0 <4.0.0" - flutter: ">=3.24.0" + sdk: ">=3.6.0 <4.0.0" + flutter: ">=3.27.0" dependencies: flutter: @@ -18,7 +18,7 @@ dependencies: intl: ^0.19.0 dev_dependencies: - flutter_lints: ^4.0.0 + flutter_lints: ">=5.0.0 <6.0.0" flutter_test: sdk: flutter diff --git a/pubspec.lock b/pubspec.lock index fae0894c7..3b55fffaa 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -209,5 +209,5 @@ packages: source: hosted version: "14.3.0" sdks: - dart: ">=3.5.0 <4.0.0" - flutter: ">=3.24.0" + dart: ">=3.6.0 <4.0.0" + flutter: ">=3.27.0" diff --git a/pubspec.yaml b/pubspec.yaml index caa60e9ed..7d730c851 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,8 +11,8 @@ funding: - https://opencollective.com/flutter-form-builder-ecosystem environment: - sdk: ">=3.5.0 <4.0.0" - flutter: ">=3.24.0" + sdk: ">=3.6.0 <4.0.0" + flutter: ">=3.27.0" dependencies: flutter: @@ -22,6 +22,6 @@ dependencies: intl: ">=0.19.0 <0.20.0" dev_dependencies: - flutter_lints: ">=4.0.0 <6.0.0" + flutter_lints: ">=5.0.0 <6.0.0" flutter_test: sdk: flutter From b7fd913e1aa58e4f1dd32c5ed5faeb6f00e4b691 Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Wed, 18 Dec 2024 14:10:26 +0100 Subject: [PATCH 09/13] style: fix lint warning --- lib/flutter_form_builder.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/flutter_form_builder.dart b/lib/flutter_form_builder.dart index de3a7c521..5d6241eba 100644 --- a/lib/flutter_form_builder.dart +++ b/lib/flutter_form_builder.dart @@ -1,5 +1,3 @@ -library flutter_form_builder; - export 'src/form_builder.dart'; export 'src/form_builder_field.dart'; export 'src/form_builder_field_decoration.dart'; From cb38bedc0ba4ffeb416974126780f9c2c43dfa31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:36:55 +0000 Subject: [PATCH 10/13] build(deps): bump codecov/codecov-action from 4 to 5 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4...v5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base.yaml b/.github/workflows/base.yaml index dc5a49260..c40281b0c 100644 --- a/.github/workflows/base.yaml +++ b/.github/workflows/base.yaml @@ -48,7 +48,7 @@ jobs: - name: Run tests run: flutter test --coverage - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: From 4e3d5da5ed5ea797f35cef4e29d91977a2f74143 Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Wed, 18 Dec 2024 13:03:45 +0100 Subject: [PATCH 11/13] Update base.yaml --- .github/workflows/base.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/base.yaml b/.github/workflows/base.yaml index c40281b0c..4ea09a383 100644 --- a/.github/workflows/base.yaml +++ b/.github/workflows/base.yaml @@ -49,8 +49,6 @@ jobs: run: flutter test --coverage - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: files: coverage/lcov.info name: flutter_form_builder From f39fa6d6553bd6f3284af790ff532bb197cdf049 Mon Sep 17 00:00:00 2001 From: geronimol <56521222+geronimol@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:39:04 -0300 Subject: [PATCH 12/13] feat: add "barrierDismissible" to DateTime picker --- lib/src/fields/form_builder_date_time_picker.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/fields/form_builder_date_time_picker.dart b/lib/src/fields/form_builder_date_time_picker.dart index b73cd599b..7517c22e5 100644 --- a/lib/src/fields/form_builder_date_time_picker.dart +++ b/lib/src/fields/form_builder_date_time_picker.dart @@ -125,6 +125,7 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration { final SelectableDayPredicate? selectableDayPredicate; final Offset? anchorPoint; final EntryModeChangeCallback? onEntryModeChanged; + final bool barrierDismissible; /// Creates field for `Date`, `Time` and `DateTime` input FormBuilderDateTimePicker({ @@ -195,6 +196,7 @@ class FormBuilderDateTimePicker extends FormBuilderFieldDecoration { this.selectableDayPredicate, this.anchorPoint, this.onEntryModeChanged, + this.barrierDismissible = true, }) : super( builder: (FormFieldState field) { final state = field as _FormBuilderDateTimePickerState; @@ -343,6 +345,7 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState< currentDate: widget.currentDate, anchorPoint: widget.anchorPoint, keyboardType: widget.keyboardType, + barrierDismissible: widget.barrierDismissible, ); } @@ -376,6 +379,7 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState< anchorPoint: widget.anchorPoint, errorInvalidText: widget.errorInvalidText, onEntryModeChanged: widget.onEntryModeChanged, + barrierDismissible: widget.barrierDismissible, ); } From e7b3f94d014af1d79a9d67e5d07aaa1c4edb7545 Mon Sep 17 00:00:00 2001 From: geronimol <56521222+geronimol@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:07:55 -0300 Subject: [PATCH 13/13] fix: change DateTime Picker behavior when InputType==both --- lib/src/fields/form_builder_date_time_picker.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/fields/form_builder_date_time_picker.dart b/lib/src/fields/form_builder_date_time_picker.dart index 7517c22e5..46c3ba422 100644 --- a/lib/src/fields/form_builder_date_time_picker.dart +++ b/lib/src/fields/form_builder_date_time_picker.dart @@ -307,7 +307,7 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState< if (date != null) { if (!mounted) break; final time = await _showTimePicker(currentValue); - if(time == null) { + if (time == null) { newValue = null; } else { newValue = combine(date, time);