diff --git a/.github/workflows/base.yaml b/.github/workflows/base.yaml index 052d9f36b..4ea09a383 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 @@ -59,9 +48,7 @@ jobs: - name: Run tests run: flutter test --coverage - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + uses: codecov/codecov-action@v5 with: files: coverage/lcov.info name: flutter_form_builder diff --git a/example/pubspec.lock b/example/pubspec.lock index a403632ee..45099e91c 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" fake_async: dependency: transitive description: @@ -100,18 +100,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -164,7 +164,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: @@ -177,10 +177,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -193,10 +193,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" term_glyph: dependency: transitive description: @@ -209,10 +209,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.3" vector_math: dependency: transitive description: @@ -225,10 +225,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" sdks: dart: ">=3.5.0 <4.0.0" flutter: ">=3.24.0" diff --git a/lib/src/fields/form_builder_choice_chips.dart b/lib/src/fields/form_builder_choice_chips.dart index 662922a58..2988d2581 100644 --- a/lib/src/fields/form_builder_choice_chips.dart +++ b/lib/src/fields/form_builder_choice_chips.dart @@ -51,6 +51,28 @@ class FormBuilderChoiceChip extends FormBuilderFieldDecoration { /// The default is [Colors.black]. final Color? shadowColor; + /// The color and weight of the chip's outline. + /// + /// Defaults to the border side in the ambient [ChipThemeData]. If the theme + /// border side resolves to null and [ThemeData.useMaterial3] is true, then + /// [BorderSide] with a [ColorScheme.outline] color is used when the chip is + /// enabled, and [BorderSide] with a [ColorScheme.onSurface] color with an + /// opacity of 0.12 is used when the chip is disabled. Otherwise, it defaults + /// to null. + /// + /// This value is combined with [shape] to create a shape decorated with an + /// outline. To omit the outline entirely, pass [BorderSide.none] to [side]. + /// + /// If it is a [WidgetStateBorderSide], [WidgetStateProperty.resolve] is + /// used for the following [WidgetState]s: + /// + /// * [WidgetState.disabled]. + /// * [WidgetState.selected]. + /// * [WidgetState.hovered]. + /// * [WidgetState.focused]. + /// * [WidgetState.pressed]. + final BorderSide? side; + /// The [OutlinedBorder] to draw around the chip. /// /// Defaults to the shape in the ambient [ChipThemeData]. If the theme @@ -293,6 +315,7 @@ class FormBuilderChoiceChip extends FormBuilderFieldDecoration { this.selectedColor, this.selectedShadowColor, this.shadowColor, + this.side, this.shape, this.spacing = 0.0, this.textDirection, @@ -317,6 +340,7 @@ class FormBuilderChoiceChip extends FormBuilderFieldDecoration { for (FormBuilderChipOption option in options) ChoiceChip( label: option, + side: side, shape: shape, selected: field.value == option.value, onSelected: state.enabled diff --git a/lib/src/fields/form_builder_date_time_picker.dart b/lib/src/fields/form_builder_date_time_picker.dart index 84c70f3f4..3ba64c737 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(); } } @@ -309,8 +308,6 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState< newValue = combine(date, time); } break; - default: - throw 'Unexpected input type ${widget.inputType}'; } if (!mounted) return null; final finalValue = newValue ?? currentValue; diff --git a/lib/src/fields/form_builder_filter_chips.dart b/lib/src/fields/form_builder_filter_chips.dart index d4d9e06d2..e30d8aa4b 100644 --- a/lib/src/fields/form_builder_filter_chips.dart +++ b/lib/src/fields/form_builder_filter_chips.dart @@ -13,6 +13,7 @@ class FormBuilderFilterChip extends FormBuilderFieldDecoration> { final double? elevation, pressElevation; final List> options; final MaterialTapTargetSize? materialTapTargetSize; + final BorderSide? side; final OutlinedBorder? shape; // Wrap Settings @@ -66,6 +67,7 @@ class FormBuilderFilterChip extends FormBuilderFieldDecoration> { this.selectedColor, this.selectedShadowColor, this.shadowColor, + this.side, this.shape, this.showCheckmark = true, this.spacing = 0.0, @@ -119,6 +121,7 @@ class FormBuilderFilterChip extends FormBuilderFieldDecoration> { pressElevation: pressElevation, materialTapTargetSize: materialTapTargetSize, padding: padding, + side: side, shape: shape, checkmarkColor: checkmarkColor, clipBehavior: clipBehavior, 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, diff --git a/pubspec.lock b/pubspec.lock index 29c46a5c8..6234f5774 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" fake_async: dependency: transitive description: @@ -79,18 +79,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -143,7 +143,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: @@ -156,10 +156,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -172,10 +172,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" term_glyph: dependency: transitive description: @@ -188,10 +188,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.3" vector_math: dependency: transitive description: @@ -204,10 +204,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" sdks: dart: ">=3.5.0 <4.0.0" flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index 0c6f7e786..43779563e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,6 +17,8 @@ environment: dependencies: flutter: sdk: flutter + # 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: