Skip to content

Commit

Permalink
v18.0.0
Browse files Browse the repository at this point in the history
* upgrade to Flutter 3.27.0

* v18.0.0

* v18.0.0
  • Loading branch information
udos86 authored Dec 18, 2024
1 parent de20298 commit 8387fa1
Show file tree
Hide file tree
Showing 15 changed files with 111 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.0'
flutter-version: '3.27.1'
channel: 'stable'

- name: Install Dependencies
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# [18.0.0] - 12/18/2024

* upgrades to Flutter `3.27.0`
* adds `checkboxScaleFactor` and `internalAddSemanticForOnTap` properties to `FastCheckbox`
* adds `internalAddSemanticForOnTap` and `trackOutlineWidth` properties to `FastSwitch`
* adds `itemExtent` and `selectionOverlayBuilder` properties to `FastDatePicker`
* adds `selectableDayPredicate` property to `FastDatePicker`
* adds `optionsViewOpenDirection` property to `FastChipsInput`
* adds `autofocus`, `dense`, `enableFeedback`, `internalAddSemanticForOnTap` and `onFocusChange` properties to `FastRadioGroup`
* adds `direction` and `expandedInsets` properties to `FastSegmentedButton`
* adds `disabledChildren` and `proportionalWidth` properties to `FastSegmentedControl`
* adds `forceErrorText` and `ignorePointers` properties to `FastTextField`
* deprecates `inactiveColor` on `FastCheckbox`
* deprecates `activeColor` and `trackColor` properties on `FastSwitch`

* **Breaking Changes**

* Due to Flutter API changes `mouseCursor` property of `FastSwitch` is now of type `WidgetStateMouseCursor`

## [17.1.1] - 09/14/2024

* adds `extends Object` to `<T>` of `FastSegmentedControl` according to latest Cupertino changes
Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 17.1.1
version: 18.0.0

environment:
sdk: ">=3.2.0 <4.0.0"
Expand All @@ -28,7 +28,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.6

intl: ^0.19.0
intl: ^0.20.1

flutter_fast_forms:
path: ../
Expand Down
2 changes: 0 additions & 2 deletions lib/flutter_fast_forms.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
library flutter_fast_forms;

export 'src/check/checkbox.dart';
export 'src/check/switch.dart';
export 'src/date_time/calendar.dart';
Expand Down
12 changes: 11 additions & 1 deletion lib/src/check/checkbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class FastCheckbox extends FastFormField<bool> {
super.validator,
this.activeColor,
this.autofocus = false,
this.checkboxScaleFactor = 1.0,
this.checkboxSemanticLabel,
this.checkboxShape,
this.checkColor,
Expand All @@ -45,7 +46,8 @@ class FastCheckbox extends FastFormField<bool> {
this.focusColor,
this.focusNode,
this.hoverColor,
this.inactiveColor,
@Deprecated('Use fillColor instead.') this.inactiveColor,
this.internalAddSemanticForOnTap = false,
this.isError = false,
this.isThreeLine = false,
this.materialTapTargetSize,
Expand All @@ -69,6 +71,7 @@ class FastCheckbox extends FastFormField<bool> {

final bool autofocus;
final Color? activeColor;
final double checkboxScaleFactor;
final String? checkboxSemanticLabel;
final OutlinedBorder? checkboxShape;
final Color? checkColor;
Expand All @@ -83,6 +86,7 @@ class FastCheckbox extends FastFormField<bool> {
final FocusNode? focusNode;
final Color? hoverColor;
final Color? inactiveColor;
final bool internalAddSemanticForOnTap;
final bool isError;
final bool isThreeLine;
final MaterialTapTargetSize? materialTapTargetSize;
Expand Down Expand Up @@ -169,6 +173,7 @@ Widget materialCheckboxBuilder(FormFieldState<bool> field) {
activeColor: widget.activeColor,
autofocus: widget.autofocus,
checkColor: widget.checkColor,
checkboxScaleFactor: widget.checkboxScaleFactor,
checkboxSemanticLabel: widget.checkboxSemanticLabel,
checkboxShape: widget.checkboxShape,
contentPadding: widget.contentPadding,
Expand All @@ -179,6 +184,7 @@ Widget materialCheckboxBuilder(FormFieldState<bool> field) {
fillColor: widget.fillColor,
focusNode: widget.focusNode,
hoverColor: widget.hoverColor,
internalAddSemanticForOnTap: widget.internalAddSemanticForOnTap,
isError: widget.isError,
isThreeLine: widget.isThreeLine,
materialTapTargetSize: widget.materialTapTargetSize,
Expand Down Expand Up @@ -226,10 +232,14 @@ Widget cupertinoCheckboxBuilder(FormFieldState<bool> field) {
activeColor: widget.activeColor,
autofocus: widget.autofocus,
checkColor: widget.checkColor,
fillColor: widget.fillColor,
focusColor: widget.focusColor,
focusNode: widget.focusNode,
// ignore: deprecated_member_use
inactiveColor: widget.inactiveColor,
mouseCursor: widget.mouseCursor,
onChanged: enabled ? didChange : null,
semanticLabel: widget.checkboxSemanticLabel,
shape: widget.shape,
side: widget.side,
tristate: widget.tristate,
Expand Down
28 changes: 23 additions & 5 deletions lib/src/check/switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class FastSwitch extends FastFormField<bool> {
super.onTouched,
super.restorationId,
super.validator,
this.activeColor,
@Deprecated('Use activeTrackColor instead.') this.activeColor,
this.activeThumbImage,
this.activeTrackColor,
this.applyTheme,
Expand All @@ -48,6 +48,7 @@ class FastSwitch extends FastFormField<bool> {
this.inactiveThumbColor,
this.inactiveThumbImage,
this.inactiveTrackColor,
this.internalAddSemanticForOnTap = false,
this.isThreeLine = false,
this.materialTapTargetSize,
this.mouseCursor,
Expand All @@ -68,8 +69,9 @@ class FastSwitch extends FastFormField<bool> {
this.tileColor,
this.titleText,
this.titleBuilder = switchTitleBuilder,
this.trackColor,
@Deprecated('Use inactiveTrackColor instead.') this.trackColor,
this.trackOutlineColor,
this.trackOutlineWidth,
this.visualDensity,
});

Expand All @@ -91,9 +93,10 @@ class FastSwitch extends FastFormField<bool> {
final Color? inactiveThumbColor;
final ImageProvider<Object>? inactiveThumbImage;
final Color? inactiveTrackColor;
final bool internalAddSemanticForOnTap;
final bool isThreeLine;
final MaterialTapTargetSize? materialTapTargetSize;
final MouseCursor? mouseCursor;
final WidgetStateMouseCursor? mouseCursor;
final Color? offLabelColor;
final void Function(Object, StackTrace?)? onActiveThumbImageError;
final void Function(bool)? onFocusChange;
Expand All @@ -112,6 +115,7 @@ class FastSwitch extends FastFormField<bool> {
final String? titleText;
final WidgetStateProperty<Color?>? trackColor;
final WidgetStateProperty<Color?>? trackOutlineColor;
final WidgetStateProperty<double?>? trackOutlineWidth;
final FastSwitchWidgetBuilder titleBuilder;
final VisualDensity? visualDensity;

Expand Down Expand Up @@ -194,6 +198,7 @@ Widget materialSwitchBuilder(FormFieldState<bool> field) {
inactiveThumbColor: widget.inactiveThumbColor,
inactiveThumbImage: widget.inactiveThumbImage,
inactiveTrackColor: widget.inactiveTrackColor,
internalAddSemanticForOnTap: widget.internalAddSemanticForOnTap,
isThreeLine: widget.isThreeLine,
materialTapTargetSize: widget.materialTapTargetSize,
mouseCursor: widget.mouseCursor,
Expand Down Expand Up @@ -242,18 +247,31 @@ Widget cupertinoSwitchBuilder(FormFieldState<bool> field) {
helper: widget.cupertinoHelperBuilder(field),
error: widget.cupertinoErrorBuilder(field),
child: CupertinoSwitch(
offLabelColor: widget.offLabelColor,
onLabelColor: widget.onLabelColor,
// ignore: deprecated_member_use
activeColor: widget.activeColor,
activeThumbImage: widget.activeThumbImage,
activeTrackColor: widget.activeTrackColor,
applyTheme: widget.applyTheme,
autofocus: widget.autofocus,
dragStartBehavior: widget.dragStartBehavior,
focusColor: widget.focusColor,
focusNode: widget.focusNode,
inactiveThumbColor: widget.inactiveThumbColor,
inactiveThumbImage: widget.inactiveThumbImage,
inactiveTrackColor: widget.inactiveTrackColor,
mouseCursor: widget.mouseCursor,
offLabelColor: widget.offLabelColor,
onActiveThumbImageError: widget.onActiveThumbImageError,
onChanged: enabled ? didChange : null,
onFocusChange: widget.onFocusChange,
onInactiveThumbImageError: widget.onInactiveThumbImageError,
onLabelColor: widget.onLabelColor,
thumbColor: widget.thumbColor,
trackOutlineWidth: widget.trackOutlineWidth,
thumbIcon: widget.thumbIcon,
// ignore: deprecated_member_use
trackColor: widget.activeTrackColor,
trackOutlineColor: widget.trackOutlineColor,
value: value,
),
);
Expand Down
10 changes: 10 additions & 0 deletions lib/src/date_time/date_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class FastDatePicker extends FastFormField<DateTime> {
this.iconButtonBuilder = datePickerIconButtonBuilder,
this.initialDatePickerMode = DatePickerMode.day,
this.initialEntryMode = DatePickerEntryMode.calendar,
this.itemExtent = 32.0,
this.keyboardType,
required this.lastDate,
this.locale,
Expand All @@ -78,6 +79,7 @@ class FastDatePicker extends FastFormField<DateTime> {
this.onDatePickerModeChange,
this.routeSettings,
this.selectableDayPredicate,
this.selectionOverlayBuilder,
this.showDayOfWeek = false,
this.showModalPopup = false,
this.switchToCalendarEntryModeIcon,
Expand Down Expand Up @@ -113,6 +115,7 @@ class FastDatePicker extends FastFormField<DateTime> {
final Icon? icon;
final FastDatePickerIconButtonBuilder iconButtonBuilder;
final DatePickerMode initialDatePickerMode;
final double itemExtent;
final DatePickerEntryMode initialEntryMode;
final TextInputType? keyboardType;
final DateTime lastDate;
Expand All @@ -126,6 +129,9 @@ class FastDatePicker extends FastFormField<DateTime> {
final void Function(DatePickerEntryMode)? onDatePickerModeChange;
final RouteSettings? routeSettings;
final SelectableDayPredicate? selectableDayPredicate;
final Widget? Function(BuildContext,
{required int columnCount,
required int selectedIndex})? selectionOverlayBuilder;
final bool showDayOfWeek;
final bool showModalPopup;
final Icon? switchToCalendarEntryModeIcon;
Expand Down Expand Up @@ -267,13 +273,15 @@ Container cupertinoDatePickerModalPopupBuilder(
backgroundColor: widget.backgroundColor,
dateOrder: widget.dateOrder,
initialDateTime: value,
itemExtent: widget.itemExtent,
maximumDate: widget.lastDate,
maximumYear: widget.maximumYear,
minimumDate: widget.firstDate,
minimumYear: widget.minimumYear,
minuteInterval: widget.minuteInterval,
mode: widget.mode,
onDateTimeChanged: (DateTime value) => modalValue = value,
selectionOverlayBuilder: widget.selectionOverlayBuilder,
showDayOfWeek: widget.showDayOfWeek,
use24hFormat: widget.use24hFormat,
),
Expand Down Expand Up @@ -415,6 +423,8 @@ Widget cupertinoDatePickerBuilder(FormFieldState<DateTime> field) {
backgroundColor: widget.backgroundColor,
dateOrder: widget.dateOrder,
initialDateTime: widget.initialValue,
itemExtent: widget.itemExtent,
selectionOverlayBuilder: widget.selectionOverlayBuilder,
maximumDate: widget.lastDate,
maximumYear: widget.maximumYear,
minimumDate: widget.firstDate,
Expand Down
3 changes: 3 additions & 0 deletions lib/src/date_time/date_range_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class FastDateRangePicker extends FastFormField<DateTimeRange> {
required this.lastDate,
this.routeSettings,
this.saveText,
this.selectableDayPredicate,
this.switchToCalendarEntryModeIcon,
this.switchToInputEntryModeIcon,
this.textBuilder = dateRangPickerTextBuilder,
Expand Down Expand Up @@ -93,6 +94,7 @@ class FastDateRangePicker extends FastFormField<DateTimeRange> {
final Locale? locale;
final RouteSettings? routeSettings;
final String? saveText;
final SelectableDayForRangePredicate? selectableDayPredicate;
final Icon? switchToCalendarEntryModeIcon;
final Icon? switchToInputEntryModeIcon;
final FastDateRangePickerTextBuilder textBuilder;
Expand Down Expand Up @@ -189,6 +191,7 @@ Widget dateRangePickerBuilder(FormFieldState<DateTimeRange> field) {
locale: widget.locale,
routeSettings: widget.routeSettings,
saveText: widget.saveText,
selectableDayPredicate: widget.selectableDayPredicate,
switchToCalendarEntryModeIcon: widget.switchToCalendarEntryModeIcon,
switchToInputEntryModeIcon: widget.switchToInputEntryModeIcon,
textDirection: widget.textDirection,
Expand Down
1 change: 1 addition & 0 deletions lib/src/form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ abstract class FastFormField<T> extends FormField<T> {
super.autovalidateMode = AutovalidateMode.onUserInteraction,
required super.builder,
super.enabled = true,
super.forceErrorText,
super.initialValue,
super.key,
super.onSaved,
Expand Down
3 changes: 3 additions & 0 deletions lib/src/options/chips_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class FastChipsInput extends FastFormField<List<String>> {
this.optionsBuilder,
this.optionsMaxHeight = 200.0,
this.optionsViewBuilder,
this.optionsViewOpenDirection = OptionsViewOpenDirection.down,
this.runAlignment = WrapAlignment.start,
this.runSpacing = 0.0,
this.spacing = 8.0,
Expand All @@ -93,6 +94,7 @@ class FastChipsInput extends FastFormField<List<String>> {
final AutocompleteOptionsBuilder<String>? optionsBuilder;
final double optionsMaxHeight;
final AutocompleteOptionsViewBuilder<String>? optionsViewBuilder;
final OptionsViewOpenDirection optionsViewOpenDirection;
final WrapAlignment runAlignment;
final double runSpacing;
final double spacing;
Expand Down Expand Up @@ -608,6 +610,7 @@ Widget chipsInputBuilder(FormFieldState<List<String>> field) {
fieldViewBuilder: fieldViewBuilder(field),
focusNode: textFieldFocusNode,
onSelected: _onFieldSubmitted(field, true),
optionsViewOpenDirection: widget.optionsViewOpenDirection,
optionsBuilder:
widget.optionsBuilder ?? _optionsBuilder(widget.options, field),
optionsViewBuilder:
Expand Down
18 changes: 17 additions & 1 deletion lib/src/options/radio_group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,17 @@ class FastRadioGroup<T> extends FastFormField<T> {
super.restorationId,
super.validator,
this.activeColor,
this.autofocus = false,
this.controlAffinity = ListTileControlAffinity.platform,
this.dense,
this.enableFeedback,
this.fillColor,
this.hoverColor,
this.internalAddSemanticForOnTap = false,
this.materialTapTargetSize,
this.mouseCursor,
this.orientation = FastRadioGroupOrientation.vertical,
this.onFocusChange,
required this.options,
this.overlayColor,
this.selectedTileColor,
Expand All @@ -77,12 +82,18 @@ class FastRadioGroup<T> extends FastFormField<T> {
builder: builder ?? radioGroupBuilder,
initialValue: initialValue ?? _getInitialValue(options),
);

final Color? activeColor;
final bool autofocus;
final ListTileControlAffinity controlAffinity;
final bool? dense;
final bool? enableFeedback;
final WidgetStateProperty<Color?>? fillColor;
final Color? hoverColor;
final bool internalAddSemanticForOnTap;
final MaterialTapTargetSize? materialTapTargetSize;
final MouseCursor? mouseCursor;
final void Function(bool)? onFocusChange;
final List<FastRadioOption<T>> options;
final FastRadioOptionBuilder<T> optionBuilder;
final FastRadioOptionsBuilder<T> optionsBuilder;
Expand Down Expand Up @@ -129,14 +140,19 @@ Widget radioOptionBuilder<T>(
final FastRadioGroupState<T>(:didChange, :enabled, :value, :widget) = field;
final tile = RadioListTile<T>(
activeColor: widget.activeColor,
autofocus: widget.autofocus,
controlAffinity: widget.controlAffinity,
dense: widget.dense,
enableFeedback: widget.enableFeedback,
fillColor: widget.fillColor,
hoverColor: widget.hoverColor,
groupValue: value,
hoverColor: widget.hoverColor,
internalAddSemanticForOnTap: widget.internalAddSemanticForOnTap,
isThreeLine: option.isThreeLine,
materialTapTargetSize: widget.materialTapTargetSize,
mouseCursor: widget.mouseCursor,
onChanged: enabled ? didChange : null,
onFocusChange: widget.onFocusChange,
overlayColor: widget.overlayColor,
secondary: option.secondary,
selected: option.selected,
Expand Down
Loading

0 comments on commit 8387fa1

Please sign in to comment.