Skip to content

Commit 5f6eb4c

Browse files
Lance JohnstoneLance Johnstone
authored andcommitted
Update to flutter 3.38 props
1 parent 66b990f commit 5f6eb4c

23 files changed

Lines changed: 329 additions & 151 deletions

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [10.0.0]
2+
3+
#### (Flutter version support: v3.38.6)
4+
5+
- Adds all the flutter 3.38.6 additional properties for platform widgets
6+
- Removed deprecated parameters
7+
- (Breaking Change) `PlatformRadio` now has `value` prop as non nullable. Use `RadioGroup` parent to group value and changes
8+
- (Breaking Change) `CupertinoNavigationBarData`'s `title` property renamed to `middle`
9+
110
## [9.0.0]
211

312
#### (Flutter version support: v3.32.0)

example/lib/platform_page.dart.dart

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -112,33 +112,25 @@ class PlatformPage extends StatelessWidget {
112112
// ! PlatformRadio
113113
PlatformWidgetExample(
114114
title: 'PlatformRadio',
115-
builder: (_, platform) => StateProvider<String>(
115+
builder: (_, platform) => StateProvider<String?>(
116116
initialValue: 'One',
117-
builder: (_, value, setValue) => Row(
118-
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
119-
children: [
120-
PlatformRadio<String>(
121-
value: 'One',
122-
groupValue: value,
123-
onChanged: (dynamic newValue) {
124-
setValue(newValue as String);
125-
},
126-
),
127-
PlatformRadio<String>(
128-
value: 'Two',
129-
groupValue: value,
130-
onChanged: (dynamic newValue) {
131-
setValue(newValue as String);
132-
},
133-
),
134-
PlatformRadio<String>(
135-
value: 'Three',
136-
groupValue: value,
137-
onChanged: (dynamic newValue) {
138-
setValue(newValue as String);
139-
},
140-
),
141-
],
117+
builder: (_, value, setValue) => RadioGroup<String>(
118+
groupValue: value,
119+
onChanged: (value) => setValue(value),
120+
child: Row(
121+
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
122+
children: [
123+
PlatformRadio<String>(
124+
value: 'One',
125+
),
126+
PlatformRadio<String>(
127+
value: 'Two',
128+
),
129+
PlatformRadio<String>(
130+
value: 'Three',
131+
),
132+
],
133+
),
142134
),
143135
),
144136
),

example/lib/tab_pages/basicTabbedPage.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class _BasicTabbedPageState extends State<BasicTabbedPage> {
8484
),
8585
],
8686
cupertino: (_, __) => CupertinoNavigationBarData(
87-
title: Text(
87+
middle: Text(
8888
'${titles[index]}',
8989
style: TextStyle(color: cupertinoForgroundColor),
9090
),

example/lib/tab_pages/dynamicTabbedPage.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class _DynamicTabbedPageState extends State<DynamicTabbedPage> {
7575
),
7676
],
7777
cupertino: (_, __) => CupertinoNavigationBarData(
78-
title: Text('${titles[index]}'),
78+
middle: Text('${titles[index]}'),
7979
),
8080
),
8181
bodyBuilder: (context, index) => ContentView(index, widget.platform),

example/lib/tab_pages/originalTabbedPage.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class _OriginalTabbedPageState extends State<OriginalTabbedPage> {
6060
appBarBuilder: (_, index) => PlatformAppBar(
6161
title: Text('${widget.platform.text} Page Title'),
6262
cupertino: (_, __) => CupertinoNavigationBarData(
63-
title: Text('Title: ${titles[index]}'),
63+
middle: Text('Title: ${titles[index]}'),
6464
// only required if useCupertinoTabView = false,
6565
transitionBetweenRoutes: false,
6666
),

lib/src/platform_alert_dialog.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class MaterialAlertDialogData extends _BaseData {
5656
this.iconPadding,
5757
this.shadowColor,
5858
this.surfaceTintColor,
59+
this.constraints,
5960
});
6061

6162
final EdgeInsetsGeometry? contentPadding;
@@ -81,6 +82,7 @@ class MaterialAlertDialogData extends _BaseData {
8182
final EdgeInsetsGeometry? iconPadding;
8283
final Color? shadowColor;
8384
final Color? surfaceTintColor;
85+
final BoxConstraints? constraints;
8486
}
8587

8688
class CupertinoAlertDialogData extends _BaseData {
@@ -152,6 +154,7 @@ class PlatformAlertDialog extends PlatformWidgetBase<Widget, AlertDialog> {
152154
iconPadding: data?.iconPadding,
153155
shadowColor: data?.shadowColor,
154156
surfaceTintColor: data?.surfaceTintColor,
157+
constraints: data?.constraints,
155158
);
156159
}
157160

lib/src/platform_app_bar.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ class MaterialAppBarData extends _BaseData {
7878
this.forceMaterialTransparency,
7979
this.actionsPadding,
8080
this.useDefaultSemanticsOrder,
81+
this.animateColor,
82+
this.automaticallyImplyActions,
8183
});
8284

8385
final List<Widget>? actions;
@@ -106,11 +108,12 @@ class MaterialAppBarData extends _BaseData {
106108
final bool? forceMaterialTransparency;
107109
final EdgeInsetsGeometry? actionsPadding;
108110
final bool? useDefaultSemanticsOrder;
111+
final bool? animateColor;
112+
final bool? automaticallyImplyActions;
109113
}
110114

111115
class CupertinoNavigationBarData extends _BaseData {
112116
CupertinoNavigationBarData({
113-
super.title,
114117
super.backgroundColor,
115118
super.leading,
116119
super.widgetKey,
@@ -127,7 +130,8 @@ class CupertinoNavigationBarData extends _BaseData {
127130
this.heroTag,
128131
this.noMaterialParent = false,
129132
this.enableBackgroundFilterBlur,
130-
});
133+
Widget? middle,
134+
}) : super(title: middle);
131135

132136
final Widget? trailing;
133137
final Border? border;
@@ -212,6 +216,8 @@ class PlatformAppBar
212216
forceMaterialTransparency: data?.forceMaterialTransparency ?? false,
213217
actionsPadding: data?.actionsPadding,
214218
useDefaultSemanticsOrder: data?.useDefaultSemanticsOrder ?? true,
219+
animateColor: data?.animateColor ?? false,
220+
automaticallyImplyActions: data?.automaticallyImplyActions ?? true,
215221
);
216222
}
217223

lib/src/platform_checkbox.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ abstract class _BaseData {
2828
this.mouseCursor,
2929
this.fillColor,
3030
this.semanticLabel,
31+
this.tapTargetSize,
3132
});
3233
final Key? widgetKey;
3334
final bool? value;
@@ -43,6 +44,7 @@ abstract class _BaseData {
4344
final MouseCursor? mouseCursor;
4445
final WidgetStateProperty<Color?>? fillColor;
4546
final String? semanticLabel;
47+
final Size? tapTargetSize;
4648
}
4749

4850
class MaterialCheckboxData extends _BaseData {
@@ -62,6 +64,7 @@ class MaterialCheckboxData extends _BaseData {
6264
super.mouseCursor,
6365
super.fillColor,
6466
super.semanticLabel,
67+
super.tapTargetSize,
6568

6669
//Material
6770
this.hoverColor,
@@ -97,6 +100,7 @@ class CupertinoCheckboxData extends _BaseData {
97100
super.mouseCursor,
98101
super.fillColor,
99102
super.semanticLabel,
103+
super.tapTargetSize,
100104
});
101105
}
102106

@@ -196,6 +200,7 @@ class PlatformCheckbox extends PlatformWidgetBase<CupertinoCheckbox, Checkbox> {
196200
fillColor: data?.fillColor ?? fillColor,
197201
mouseCursor: data?.mouseCursor ?? mouseCursor,
198202
semanticLabel: data?.semanticLabel ?? semanticLabel,
203+
tapTargetSize: data?.tapTargetSize,
199204
// inactiveColor: , Deprecated
200205
);
201206
}

lib/src/platform_circular_progress_indicator.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ import 'widget_base.dart';
1414
const double _kDefaultIndicatorRadius = 10.0;
1515

1616
abstract class _BaseData {
17-
_BaseData({
18-
this.key,
19-
this.color,
20-
});
17+
_BaseData({this.key, this.color});
2118

2219
final Key? key;
2320
final Color? color;
@@ -38,6 +35,7 @@ class MaterialProgressIndicatorData extends _BaseData {
3835
this.constraints,
3936
this.padding,
4037
this.trackGap,
38+
this.controller,
4139
});
4240

4341
final Color? backgroundColor;
@@ -51,6 +49,7 @@ class MaterialProgressIndicatorData extends _BaseData {
5149
final BoxConstraints? constraints;
5250
final EdgeInsetsGeometry? padding;
5351
final double? trackGap;
52+
final AnimationController? controller;
5453
}
5554

5655
class CupertinoProgressIndicatorData extends _BaseData {
@@ -65,8 +64,12 @@ class CupertinoProgressIndicatorData extends _BaseData {
6564
final double? radius;
6665
}
6766

68-
class PlatformCircularProgressIndicator extends PlatformWidgetBase<
69-
CupertinoActivityIndicator, CircularProgressIndicator> {
67+
class PlatformCircularProgressIndicator
68+
extends
69+
PlatformWidgetBase<
70+
CupertinoActivityIndicator,
71+
CircularProgressIndicator
72+
> {
7073
final Key? widgetKey;
7174

7275
final PlatformBuilder<MaterialProgressIndicatorData>? material;
@@ -98,6 +101,7 @@ class PlatformCircularProgressIndicator extends PlatformWidgetBase<
98101
constraints: data?.constraints,
99102
padding: data?.padding,
100103
trackGap: data?.trackGap,
104+
controller: data?.controller,
101105
// year2023: , // deprecated
102106
);
103107
}

lib/src/platform_date_picker.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ class CupertinoDatePickerData extends _BaseData {
129129
this.itemExtent,
130130
this.selectionOverlayBuilder,
131131
this.showTimeSeparator,
132+
this.changeReportingBehavior,
133+
this.selectableDayPredicate,
132134
});
133135

134136
final Key? key;
@@ -146,6 +148,9 @@ class CupertinoDatePickerData extends _BaseData {
146148
final double? itemExtent;
147149
final SelectionOverlayBuilder? selectionOverlayBuilder;
148150
final bool? showTimeSeparator;
151+
152+
final ChangeReportingBehavior? changeReportingBehavior;
153+
final SelectableDayPredicate? selectableDayPredicate;
149154
}
150155

151156
Future<DateTime?> showPlatformDatePicker({
@@ -292,6 +297,10 @@ class DefaultCupertinoDatePicker extends StatelessWidget {
292297
itemExtent: data?.itemExtent ?? _kItemExtent,
293298
selectionOverlayBuilder: data?.selectionOverlayBuilder,
294299
showTimeSeparator: data?.showTimeSeparator ?? false,
300+
changeReportingBehavior:
301+
data?.changeReportingBehavior ??
302+
ChangeReportingBehavior.onScrollUpdate,
303+
selectableDayPredicate: data?.selectableDayPredicate,
295304
),
296305
Row(
297306
children: [

0 commit comments

Comments
 (0)