Skip to content

Commit 216d5e2

Browse files
authored
Merge pull request #456 from stryder-dev/Update-to-flutter-3.19.6
Update to flutter 3.19.6
2 parents 38958c8 + 100725c commit 216d5e2

15 files changed

Lines changed: 106 additions & 35 deletions

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## [7.0.0]
2+
3+
#### (Flutter version support: v3.19.6)
4+
5+
- Adds all the flutter 3.19 additional properties for platform widgets
6+
- Updated cupertino_icons to version 1.0.8
7+
- Added deprecation notice on switching between material 2 and material 3. Calling these has no effect and the method calls will be removed in a furture version
8+
19
## [6.1.0]
210

311
#### (Flutter version support: v3.16.8)

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
97C146E61CF9000F007C117D /* Project object */ = {
128128
isa = PBXProject;
129129
attributes = {
130-
LastUpgradeCheck = 1430;
130+
LastUpgradeCheck = 1510;
131131
ORGANIZATIONNAME = "";
132132
TargetAttributes = {
133133
97C146ED1CF9000F007C117D = {

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/lib/platform_page.dart.dart

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,7 @@ class PlatformPage extends StatelessWidget {
3636
: p.changeToMaterialPlatform();
3737
}),
3838
),
39-
if (isMaterial(context))
40-
Padding(
41-
padding: const EdgeInsets.all(8.0),
42-
child: PlatformElevatedButton(
43-
child: PlatformText(
44-
'Change to Material${Theme.of(context).useMaterial3 ? "" : " 3"}'),
45-
onPressed: () {
46-
final isMaterial3 = Theme.of(context).useMaterial3;
4739

48-
isMaterial3
49-
? PlatformTheme.of(context)?.changeToMaterial2(
50-
applyToBothDarkAndLightTheme: true)
51-
: PlatformTheme.of(context)?.changeToMaterial3(
52-
applyToBothDarkAndLightTheme: true);
53-
}),
54-
),
5540
Padding(
5641
padding: const EdgeInsets.all(8.0),
5742
child: PlatformElevatedButton(

lib/src/platform.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import 'package:flutter/material.dart'
1919
import 'package:flutter/widgets.dart';
2020
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
2121

22+
const double _defaultScrollControlDisabledMaxHeightRatio = 9.0 / 16.0;
23+
2224
const Color _kModalBarrierColor = CupertinoDynamicColor.withBrightness(
2325
color: Color(0x33000000),
2426
darkColor: Color(0x7A000000),
@@ -223,6 +225,9 @@ class MaterialModalSheetData extends _ModalSheetBaseData {
223225
final AnimationController? transitionAnimationController;
224226
final BoxConstraints? constraints;
225227
final bool? useSafeArea;
228+
String? barrierLabel;
229+
double? scrollControlDisabledMaxHeightRatio;
230+
bool? showDragHandle;
226231

227232
MaterialModalSheetData({
228233
super.anchorPoint,
@@ -239,6 +244,9 @@ class MaterialModalSheetData extends _ModalSheetBaseData {
239244
this.transitionAnimationController,
240245
this.constraints,
241246
this.useSafeArea,
247+
this.barrierLabel,
248+
this.scrollControlDisabledMaxHeightRatio,
249+
this.showDragHandle,
242250
});
243251
}
244252

@@ -287,6 +295,11 @@ Future<T?> showPlatformModalSheet<T>({
287295
constraints: material?.constraints,
288296
anchorPoint: material?.anchorPoint,
289297
useSafeArea: material?.useSafeArea ?? false,
298+
barrierLabel: material?.barrierLabel,
299+
scrollControlDisabledMaxHeightRatio:
300+
material?.scrollControlDisabledMaxHeightRatio ??
301+
_defaultScrollControlDisabledMaxHeightRatio,
302+
showDragHandle: material?.showDragHandle,
290303
);
291304
} else {
292305
return showCupertinoModalPopup<T>(

lib/src/platform_app.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ class MaterialAppData extends _BaseData {
204204
this.scaffoldMessengerKey,
205205
this.themeAnimationCurve,
206206
this.themeAnimationDuration,
207+
this.themeAnimationStyle,
207208
});
208209

209210
final ThemeData? theme;
@@ -213,6 +214,7 @@ class MaterialAppData extends _BaseData {
213214
final GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey;
214215
final Curve? themeAnimationCurve;
215216
final Duration? themeAnimationDuration;
217+
final AnimationStyle? themeAnimationStyle;
216218
}
217219

218220
class MaterialAppRouterData extends _BaseRouterData {
@@ -248,6 +250,7 @@ class MaterialAppRouterData extends _BaseRouterData {
248250
this.scaffoldMessengerKey,
249251
this.themeAnimationCurve,
250252
this.themeAnimationDuration,
253+
this.themeAnimationStyle,
251254
});
252255

253256
final ThemeData? theme;
@@ -257,6 +260,7 @@ class MaterialAppRouterData extends _BaseRouterData {
257260
final GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey;
258261
final Curve? themeAnimationCurve;
259262
final Duration? themeAnimationDuration;
263+
final AnimationStyle? themeAnimationStyle;
260264
}
261265

262266
class CupertinoAppData extends _BaseData {
@@ -536,6 +540,7 @@ class PlatformApp extends PlatformWidgetBase<CupertinoApp, MaterialApp> {
536540
dataRouter?.themeAnimationDuration ?? kThemeAnimationDuration,
537541
onNavigationNotification:
538542
dataRouter?.onNavigationNotification ?? onNavigationNotification,
543+
themeAnimationStyle: dataRouter?.themeAnimationStyle,
539544
// useInheritedMediaQuery: , Deprecated
540545
);
541546
} else {
@@ -602,6 +607,7 @@ class PlatformApp extends PlatformWidgetBase<CupertinoApp, MaterialApp> {
602607
data?.themeAnimationDuration ?? kThemeAnimationDuration,
603608
onNavigationNotification:
604609
data?.onNavigationNotification ?? onNavigationNotification,
610+
themeAnimationStyle: data?.themeAnimationStyle,
605611
// useInheritedMediaQuery: , Deprecated
606612
);
607613
}

lib/src/platform_nav_bar.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import 'package:flutter/material.dart'
1414
NavigationBar,
1515
NavigationDestination,
1616
NavigationDestinationLabelBehavior,
17+
MaterialStateProperty,
1718
Theme;
1819
import 'package:flutter/widgets.dart';
1920

@@ -80,6 +81,7 @@ class MaterialNavigationBarData {
8081
this.selectedIndex,
8182
this.shadowColor,
8283
this.surfaceTintColor,
84+
this.overlayColor,
8385
});
8486

8587
final Key? widgetKey;
@@ -95,6 +97,7 @@ class MaterialNavigationBarData {
9597
final int? selectedIndex;
9698
final Color? shadowColor;
9799
final Color? surfaceTintColor;
100+
final MaterialStateProperty<Color?>? overlayColor;
98101
}
99102

100103
class MaterialNavBarData extends _BaseData {
@@ -224,6 +227,7 @@ class PlatformNavBar extends PlatformWidgetBase<CupertinoTabBar, Widget> {
224227
selectedIndex: selectedIndex,
225228
shadowColor: data?.shadowColor,
226229
surfaceTintColor: data?.surfaceTintColor,
230+
overlayColor: data?.overlayColor,
227231
);
228232
}
229233

lib/src/platform_popup_menu.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ class MaterialPopupMenuData {
108108
final Color? shadowColor;
109109
final Color? surfaceTintColor;
110110
final Color? iconColor;
111+
final AnimationStyle? popUpAnimationStyle;
112+
final bool? useRootNavigator;
111113

112114
MaterialPopupMenuData({
113115
this.key,
@@ -133,6 +135,8 @@ class MaterialPopupMenuData {
133135
this.shadowColor,
134136
this.surfaceTintColor,
135137
this.iconColor,
138+
this.popUpAnimationStyle,
139+
this.useRootNavigator,
136140
});
137141
}
138142

@@ -302,6 +306,8 @@ class PlatformPopupMenu extends StatelessWidget {
302306
shadowColor: data?.shadowColor,
303307
surfaceTintColor: data?.surfaceTintColor,
304308
iconColor: data?.iconColor,
309+
popUpAnimationStyle: data?.popUpAnimationStyle,
310+
useRootNavigator: data?.useRootNavigator ?? false,
305311
);
306312
}
307313
}

lib/src/platform_search_bar.dart

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'package:flutter/cupertino.dart'
1111
OverlayVisibilityMode,
1212
CupertinoIcons;
1313
import 'package:flutter/material.dart' show MaterialStateProperty, SearchBar;
14-
import 'package:flutter/services.dart' show TextCapitalization;
14+
import 'package:flutter/services.dart' show TextCapitalization, TextInputAction;
1515
import 'package:flutter/widgets.dart';
1616

1717
import 'platform.dart';
@@ -24,12 +24,16 @@ abstract class _BaseData {
2424
this.focusNode,
2525
this.onTap,
2626
this.onChanged,
27+
this.keyboardType,
28+
this.autofocus,
2729
});
2830
final Key? widgetKey;
2931
final FocusNode? focusNode;
3032
final TextEditingController? controller;
3133
final void Function()? onTap;
3234
final ValueChanged<String>? onChanged;
35+
final TextInputType? keyboardType;
36+
final bool? autofocus;
3337
}
3438

3539
class MaterialSearchBarData extends _BaseData {
@@ -40,6 +44,9 @@ class MaterialSearchBarData extends _BaseData {
4044
super.focusNode,
4145
super.onTap,
4246
super.onChanged,
47+
super.autofocus,
48+
super.keyboardType,
49+
4350
//Material
4451
this.leading,
4552
this.trailing,
@@ -57,6 +64,7 @@ class MaterialSearchBarData extends _BaseData {
5764
this.hintText,
5865
this.onSubmitted,
5966
this.textCapitalization,
67+
this.textInputAction,
6068
});
6169

6270
// final String? hintText;
@@ -76,6 +84,7 @@ class MaterialSearchBarData extends _BaseData {
7684
final String? hintText;
7785
final ValueChanged<String>? onSubmitted;
7886
final TextCapitalization? textCapitalization;
87+
final TextInputAction? textInputAction;
7988
}
8089

8190
class CupertinoSearchBarData extends _BaseData {
@@ -86,12 +95,13 @@ class CupertinoSearchBarData extends _BaseData {
8695
super.focusNode,
8796
super.onTap,
8897
super.onChanged,
98+
super.autofocus,
99+
super.keyboardType,
89100

90101
//Cupertino
91102
this.onSubmitted,
92103
this.decoration,
93104
this.borderRadius,
94-
this.keyboardType,
95105
this.itemColor = CupertinoColors.secondaryLabel,
96106
this.itemSize = 20.0,
97107
this.prefixInsets = const EdgeInsetsDirectional.fromSTEB(6, 0, 0, 3),
@@ -103,9 +113,8 @@ class CupertinoSearchBarData extends _BaseData {
103113
this.restorationId,
104114
this.smartQuotesType,
105115
this.smartDashesType,
106-
this.enableIMEPersonalizedLearning = true,
107-
this.autofocus = false,
108-
this.autocorrect = true,
116+
this.enableIMEPersonalizedLearning,
117+
this.autocorrect,
109118
this.enabled,
110119
this.padding,
111120
this.backgroundColor,
@@ -127,7 +136,6 @@ class CupertinoSearchBarData extends _BaseData {
127136
final ValueChanged<String>? onSubmitted;
128137
final BoxDecoration? decoration;
129138
final BorderRadius? borderRadius;
130-
final TextInputType? keyboardType;
131139
final Color itemColor;
132140
final double itemSize;
133141
final EdgeInsetsGeometry prefixInsets;
@@ -140,9 +148,8 @@ class CupertinoSearchBarData extends _BaseData {
140148

141149
final SmartQuotesType? smartQuotesType;
142150
final SmartDashesType? smartDashesType;
143-
final bool enableIMEPersonalizedLearning;
144-
final bool autofocus;
145-
final bool autocorrect;
151+
final bool? enableIMEPersonalizedLearning;
152+
final bool? autocorrect;
146153
final bool? enabled;
147154
final EdgeInsetsGeometry? padding;
148155
final Color? backgroundColor;
@@ -161,6 +168,8 @@ class PlatformSearchBar
161168
final void Function()? onTap;
162169
final ValueChanged<String>? onChanged;
163170
final Color? backgroundColor;
171+
final TextInputType? keyboardType;
172+
final bool? autoFocus;
164173

165174
//Mixed
166175
final String? hintText;
@@ -180,6 +189,8 @@ class PlatformSearchBar
180189
this.onTap,
181190
this.onChanged,
182191
this.backgroundColor,
192+
this.keyboardType,
193+
this.autoFocus,
183194
//Mixed
184195
this.hintText,
185196
this.hintStyle,
@@ -216,6 +227,8 @@ class PlatformSearchBar
216227
(textStyle != null
217228
? MaterialStateProperty.all<TextStyle>(textStyle)
218229
: null),
230+
autoFocus: data?.autofocus ?? autoFocus ?? false,
231+
keyboardType: data?.keyboardType ?? keyboardType,
219232

220233
//Material only
221234
leading: data?.leading,
@@ -230,6 +243,8 @@ class PlatformSearchBar
230243
padding: data?.padding,
231244
onSubmitted: data?.onSubmitted,
232245
textCapitalization: data?.textCapitalization,
246+
247+
textInputAction: data?.textInputAction,
233248
);
234249
}
235250

@@ -249,12 +264,13 @@ class PlatformSearchBar
249264
placeholder: data?.placeholder ?? hintText,
250265
placeholderStyle: data?.placeholderStyle ?? hintStyle,
251266
style: data?.style ?? textStyle,
267+
autofocus: data?.autofocus ?? autoFocus ?? false,
268+
keyboardType: data?.keyboardType ?? keyboardType ?? TextInputType.text,
252269

253270
//Cupertino only
254271
onSubmitted: data?.onSubmitted,
255272
decoration: data?.decoration,
256273
borderRadius: data?.borderRadius,
257-
keyboardType: data?.keyboardType,
258274
itemColor: data?.itemColor ?? CupertinoColors.secondaryLabel,
259275
itemSize: data?.itemSize ?? 20.0,
260276
prefixInsets: data?.prefixInsets ??
@@ -271,7 +287,6 @@ class PlatformSearchBar
271287
smartDashesType: data?.smartDashesType,
272288
enableIMEPersonalizedLearning:
273289
data?.enableIMEPersonalizedLearning ?? true,
274-
autofocus: data?.autofocus ?? false,
275290
autocorrect: data?.autocorrect ?? true,
276291
enabled: data?.enabled,
277292
);

lib/src/platform_sliver_app_bar.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ class PlatformSliverAppBar
224224
systemOverlayStyle: data?.systemOverlayStyle,
225225
forceMaterialTransparency: data?.forceMaterialTransparency ?? false,
226226
clipBehavior: data?.clipBehavior,
227+
scrolledUnderElevation: data?.scrolledUnderElevation,
228+
surfaceTintColor: data?.surfaceTintColor,
227229
);
228230
}
229231

0 commit comments

Comments
 (0)