Skip to content

Commit 8b60449

Browse files
authored
Merge pull request #42 from udos86/upgrade-flutter-3.16
v13.0.0
2 parents c3df892 + dcc33c8 commit 8b60449

14 files changed

Lines changed: 129 additions & 41 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v3
1515
- uses: subosito/flutter-action@v2
1616
with:
17-
flutter-version: '3.13.0'
17+
flutter-version: '3.16.0'
1818
channel: 'stable'
1919

2020
- name: Install Dependencies

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## [13.0.0] - 12/02/2023
2+
3+
* upgrades to Flutter `3.16.0`
4+
* upgrades to Dart `3.2.0`
5+
* removes deprecated `text` property from `FastRadioOption<T>`
6+
* adds `offLabelColor` and `onLabelColor` properties to `FastSwitch`
7+
* adds `barrierColor`, `barrierDismissible` and `barrierLabel` properties to `FastDatePicker`, `FastDateRangePicker` and `FastTimePicker`
8+
* adds `optionsViewOpenDirection` property to `FastAutocomplete`
9+
* adds `checkmarkColor` and `showCheckmark` properties to `FastChoiceChip`
10+
* adds `canRequestFocus`, `clipBehavior`, `contentInsertionConfiguration`, `cursorOpacityAnimates`,
11+
`dragStartBehavior`, `onAppPrivateCommand`, `scribbleEnabled`, `scrollController`,
12+
`selectionHeightStyle`, `selectionWidthStyle` and `undoController` properties to `FastTextField`
13+
114
## [12.0.0] - 08/22/2023
215

316
* upgrades to Flutter `3.13.0`

example/pubspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1818
version: 1.0.0+1
1919

2020
environment:
21-
sdk: ">=3.1.0 <4.0.0"
21+
sdk: ">=3.2.0 <4.0.0"
2222

2323
dependencies:
2424
flutter:
2525
sdk: flutter
2626

2727
# The following adds the Cupertino Icons font to your application.
2828
# Use with the CupertinoIcons class for iOS style icons.
29-
cupertino_icons: ^1.0.3
29+
cupertino_icons: ^1.0.6
3030

31-
intl: ^0.18.0
31+
intl: ^0.18.1
3232

3333
flutter_fast_forms:
3434
path: ../
@@ -42,7 +42,7 @@ dev_dependencies:
4242
# activated in the `analysis_options.yaml` file located at the root of your
4343
# package. See that file for information about deactivating specific lint
4444
# rules and activating additional ones.
45-
flutter_lints: ^2.0.1
45+
flutter_lints: ^3.0.1
4646

4747
# For information on the generic Dart part of this file, see the
4848
# following page: https://dart.dev/tools/pub/pubspec

lib/src/check/switch.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ class FastSwitch extends FastFormField<bool> {
4646
this.isThreeLine = false,
4747
this.materialTapTargetSize,
4848
this.mouseCursor,
49+
this.offLabelColor,
4950
this.onActiveThumbImageError,
5051
this.onFocusChange,
5152
this.onInactiveThumbImageError,
53+
this.onLabelColor,
5254
this.overlayColor,
5355
this.secondary,
5456
this.selectedTileColor,
@@ -85,9 +87,11 @@ class FastSwitch extends FastFormField<bool> {
8587
final bool isThreeLine;
8688
final MaterialTapTargetSize? materialTapTargetSize;
8789
final MouseCursor? mouseCursor;
90+
final Color? offLabelColor;
8891
final void Function(Object, StackTrace?)? onActiveThumbImageError;
8992
final void Function(bool)? onFocusChange;
9093
final void Function(Object, StackTrace?)? onInactiveThumbImageError;
94+
final Color? onLabelColor;
9195
final MaterialStateProperty<Color?>? overlayColor;
9296
final Widget? secondary;
9397
final Color? selectedTileColor;
@@ -183,6 +187,8 @@ Widget cupertinoSwitchBuilder(FormFieldState<bool> field) {
183187
helper: (widget.helperBuilder ?? helperBuilder)(field),
184188
error: (widget.errorBuilder ?? errorBuilder)(field),
185189
child: CupertinoSwitch(
190+
offLabelColor: widget.offLabelColor,
191+
onLabelColor: widget.onLabelColor,
186192
activeColor: widget.activeColor,
187193
applyTheme: widget.applyTheme,
188194
autofocus: widget.autofocus,

lib/src/date_time/date_picker.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ class FastDatePicker extends FastFormField<DateTime> {
3737
super.validator,
3838
this.anchorPoint,
3939
this.backgroundColor,
40+
this.barrierColor,
41+
this.barrierDismissible = true,
42+
this.barrierLabel,
4043
this.cancelText,
4144
this.confirmText,
4245
this.currentDate,
@@ -81,6 +84,9 @@ class FastDatePicker extends FastFormField<DateTime> {
8184

8285
final Offset? anchorPoint;
8386
final Color? backgroundColor;
87+
final Color? barrierColor;
88+
final bool barrierDismissible;
89+
final String? barrierLabel;
8490
final String? cancelText;
8591
final String? confirmText;
8692
final DateTime? currentDate;
@@ -224,6 +230,7 @@ Container cupertinoDatePickerModalPopupBuilder(
224230
minuteInterval: widget.minuteInterval,
225231
mode: widget.mode,
226232
onDateTimeChanged: (DateTime value) => modalValue = value,
233+
showDayOfWeek: widget.showDayOfWeek,
227234
use24hFormat: widget.use24hFormat,
228235
),
229236
),
@@ -238,6 +245,9 @@ Widget materialDatePickerBuilder(FormFieldState<DateTime> field) {
238245
Future<DateTime?> show(DatePickerEntryMode entryMode) {
239246
return showDatePicker(
240247
anchorPoint: widget.anchorPoint,
248+
barrierColor: widget.barrierColor,
249+
barrierDismissible: widget.barrierDismissible,
250+
barrierLabel: widget.barrierLabel,
241251
builder: widget.dialogBuilder,
242252
cancelText: widget.cancelText,
243253
confirmText: widget.confirmText,

lib/src/date_time/date_range_picker.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class FastDateRangePicker extends FastFormField<DateTimeRange> {
3232
super.restorationId,
3333
super.validator,
3434
this.anchorPoint,
35+
this.barrierColor,
36+
this.barrierDismissible = true,
37+
this.barrierLabel,
3538
this.cancelText,
3639
this.confirmText,
3740
this.currentDate,
@@ -62,6 +65,9 @@ class FastDateRangePicker extends FastFormField<DateTimeRange> {
6265
}) : dateFormat = format ?? intl.DateFormat.yMd();
6366

6467
final Offset? anchorPoint;
68+
final Color? barrierColor;
69+
final bool barrierDismissible;
70+
final String? barrierLabel;
6571
final String? cancelText;
6672
final String? confirmText;
6773
final DateTime? currentDate;
@@ -130,6 +136,9 @@ Widget dateRangePickerBuilder(FormFieldState<DateTimeRange> field) {
130136
Future<DateTimeRange?> show(DatePickerEntryMode entryMode) {
131137
return showDateRangePicker(
132138
anchorPoint: widget.anchorPoint,
139+
barrierColor: widget.barrierColor,
140+
barrierDismissible: widget.barrierDismissible,
141+
barrierLabel: widget.barrierLabel,
133142
builder: widget.dialogBuilder,
134143
cancelText: widget.cancelText,
135144
confirmText: widget.confirmText,

lib/src/date_time/time_picker.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class FastTimePicker extends FastFormField<TimeOfDay> {
2929
super.restorationId,
3030
super.validator,
3131
this.anchorPoint,
32+
this.barrierColor,
33+
this.barrierDismissible = true,
34+
this.barrierLabel,
3235
this.cancelText,
3336
this.confirmText,
3437
this.dialogBuilder,
@@ -48,6 +51,9 @@ class FastTimePicker extends FastFormField<TimeOfDay> {
4851
});
4952

5053
final Offset? anchorPoint;
54+
final Color? barrierColor;
55+
final bool barrierDismissible;
56+
final String? barrierLabel;
5157
final String? cancelText;
5258
final String? confirmText;
5359
final TransitionBuilder? dialogBuilder;
@@ -105,6 +111,9 @@ Widget timePickerBuilder(FormFieldState<TimeOfDay> field) {
105111
Future<TimeOfDay?> show(TimePickerEntryMode entryMode) {
106112
return showTimePicker(
107113
anchorPoint: widget.anchorPoint,
114+
barrierColor: widget.barrierColor,
115+
barrierDismissible: widget.barrierDismissible,
116+
barrierLabel: widget.barrierLabel,
108117
builder: widget.dialogBuilder,
109118
cancelText: widget.cancelText,
110119
confirmText: widget.confirmText,

lib/src/form.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FastForm extends StatefulWidget {
3030
static FastFormState? of(BuildContext context) {
3131
final _FastFormScope? scope =
3232
context.dependOnInheritedWidgetOfExactType<_FastFormScope>();
33-
return scope?._formState;
33+
return scope?.formState;
3434
}
3535

3636
@override
@@ -70,10 +70,10 @@ class FastFormState extends State<FastForm> {
7070
class _FastFormScope extends InheritedWidget {
7171
const _FastFormScope({
7272
required super.child,
73-
required FastFormState formState,
74-
}) : _formState = formState;
73+
required this.formState,
74+
});
7575

76-
final FastFormState _formState;
76+
final FastFormState formState;
7777

7878
@override
7979
bool updateShouldNotify(InheritedWidget oldWidget) => true;

lib/src/form_array.dart

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,27 @@ class FastFormArrayState<T> extends FastFormFieldState<List<T?>> {
7676
didChange(newValue);
7777
}
7878

79-
void move(int oldIndex, int newIndex) {
80-
if (newIndex >= 0 && newIndex < value!.length) {
81-
final item = value![oldIndex];
82-
final key = _keys[oldIndex];
83-
84-
_keys
85-
..removeAt(oldIndex)
86-
..insert(newIndex, key);
87-
88-
didChange([...value!]
89-
..removeAt(oldIndex)
90-
..insert(newIndex, item));
91-
}
79+
void move(int index, int newIndex) {
80+
if (newIndex < 0 || newIndex >= value!.length) return;
81+
82+
final item = value![index];
83+
final key = _keys[index];
84+
85+
_keys
86+
..removeAt(index)
87+
..insert(newIndex, key);
88+
89+
didChange([...value!]
90+
..removeAt(index)
91+
..insert(newIndex, item));
9292
}
9393

9494
void remove(int index) {
95-
if (value != null && index >= 0 && index < value!.length) {
96-
_keys.removeAt(index);
97-
final newValue = [...value!]..removeAt(index);
98-
didChange(newValue);
99-
}
95+
if (value == null || index < 0 || index >= value!.length) return;
96+
97+
_keys.removeAt(index);
98+
final newValue = [...value!]..removeAt(index);
99+
didChange(newValue);
100100
}
101101

102102
void _initKeys() {

lib/src/options/autocomplete.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class FastAutocomplete<O extends Object> extends FastFormField<String> {
3333
this.optionsBuilder,
3434
this.optionsMaxHeight = 200.00,
3535
this.optionsViewBuilder,
36+
this.optionsViewOpenDirection = OptionsViewOpenDirection.down,
3637
this.willDisplayOption,
3738
}) : assert(options != null || optionsBuilder != null),
3839
_initialValue = initialValue,
@@ -49,6 +50,7 @@ class FastAutocomplete<O extends Object> extends FastFormField<String> {
4950
final AutocompleteOptionsBuilder<O>? optionsBuilder;
5051
final double optionsMaxHeight;
5152
final AutocompleteOptionsViewBuilder<O>? optionsViewBuilder;
53+
final OptionsViewOpenDirection optionsViewOpenDirection;
5254
final FastAutocompleteWillDisplayOption<O>? willDisplayOption;
5355

5456
@override
@@ -116,5 +118,6 @@ Widget autocompleteBuilder<O extends Object>(FormFieldState<String> field) {
116118
optionsBuilder: optionsBuilder,
117119
optionsMaxHeight: widget.optionsMaxHeight,
118120
optionsViewBuilder: widget.optionsViewBuilder,
121+
optionsViewOpenDirection: widget.optionsViewOpenDirection,
119122
);
120123
}

0 commit comments

Comments
 (0)