File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 <key >CFBundleVersion </key >
2222 <string >1.0 </string >
2323 <key >MinimumOSVersion </key >
24- <string >11 .0 </string >
24+ <string >12 .0 </string >
2525</dict >
2626</plist >
Original file line number Diff line number Diff line change 275275 GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
276276 GCC_WARN_UNUSED_FUNCTION = YES;
277277 GCC_WARN_UNUSED_VARIABLE = YES;
278- IPHONEOS_DEPLOYMENT_TARGET = 11 .0;
278+ IPHONEOS_DEPLOYMENT_TARGET = 12 .0;
279279 MTL_ENABLE_DEBUG_INFO = NO;
280280 SDKROOT = iphoneos;
281281 SUPPORTED_PLATFORMS = iphoneos;
349349 GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
350350 GCC_WARN_UNUSED_FUNCTION = YES;
351351 GCC_WARN_UNUSED_VARIABLE = YES;
352- IPHONEOS_DEPLOYMENT_TARGET = 11 .0;
352+ IPHONEOS_DEPLOYMENT_TARGET = 12 .0;
353353 MTL_ENABLE_DEBUG_INFO = YES;
354354 ONLY_ACTIVE_ARCH = YES;
355355 SDKROOT = iphoneos;
398398 GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
399399 GCC_WARN_UNUSED_FUNCTION = YES;
400400 GCC_WARN_UNUSED_VARIABLE = YES;
401- IPHONEOS_DEPLOYMENT_TARGET = 11 .0;
401+ IPHONEOS_DEPLOYMENT_TARGET = 12 .0;
402402 MTL_ENABLE_DEBUG_INFO = NO;
403403 SDKROOT = iphoneos;
404404 SUPPORTED_PLATFORMS = iphoneos;
Original file line number Diff line number Diff line change @@ -152,12 +152,19 @@ class PlatformSettingsData {
152152 /// Set to true (wrapped) by default which could be a breaking change. If it is then set this value to false
153153 final bool wrapCupertinoAppBarMiddleWithMediaQuery;
154154
155+ /// With Material3 spec defining buttons text as being non ALL CAPS (see https://m3.material.io/components/buttons/overview#388f6096-c34d-4a22-8b1f-11ad69963f7c)
156+ /// If this is set to true then using [PlatformText] with material3 style will default to sentence case and not ALL CAPS. Material 2 will continue to be ALL CAPS
157+ /// If this is set to false then it will default to previous behavour of ALL CAPS.
158+ /// Going forward [PlatformText] will likely be removed when the material3 property on ThemeData is removed and all material widgets will assume material3 style.
159+ final bool matchMaterialCaseForPlatformText;
160+
155161 PlatformSettingsData ({
156162 this .iosUsesMaterialWidgets = false ,
157163 this .iosUseZeroPaddingForAppbarPlatformIcon = false ,
158164 this .legacyIosUsesMaterialWidgets = false ,
159165 this .platformStyle = const PlatformStyleData (),
160166 this .wrapCupertinoAppBarMiddleWithMediaQuery = true ,
167+ this .matchMaterialCaseForPlatformText = true ,
161168 });
162169}
163170
Original file line number Diff line number Diff line change 66
77import 'dart:ui' as ui show TextHeightBehavior;
88
9+ import 'package:flutter/material.dart' show Theme;
910import 'package:flutter/widgets.dart' ;
1011
1112import 'platform.dart' show isMaterial;
13+ import 'platform_provider.dart' show PlatformProvider;
14+ import 'platform_theme.dart' show PlatformTheme;
1215
1316String formatData (BuildContext context, String data) {
1417 if (isMaterial (context)) {
18+ final providerState = PlatformProvider .of (context);
19+ final matchMaterialCaseForPlatformText =
20+ providerState? .settings.matchMaterialCaseForPlatformText ?? true ;
21+
22+ final m3 = PlatformTheme .of (context)? .isMaterial3 ??
23+ Theme .of (context).useMaterial3;
24+
25+ // If it material3 and we want to match the casing as defined for material3 then do not return ALL CAPS
26+ if (m3 && matchMaterialCaseForPlatformText) {
27+ return data;
28+ }
29+
1530 return data.toUpperCase ();
1631 }
1732 return data;
Original file line number Diff line number Diff line change @@ -118,6 +118,10 @@ class _PlatformThemeState extends State<PlatformTheme>
118118 applyToBothDarkAndLightTheme: applyToBothDarkAndLightTheme);
119119 }
120120
121+ bool get isMaterial3 =>
122+ (isDark ? _materialDarkTheme : _materialLightTheme)? .useMaterial3 ??
123+ false ;
124+
121125 void _setMaterialThemeType ({
122126 required bool ? useMaterial3,
123127 bool applyToBothDarkAndLightTheme = false ,
@@ -167,6 +171,7 @@ class PlatformThemeState {
167171 set themeMode (ThemeMode ? themeMode) => _parent.themeMode = themeMode;
168172
169173 bool get isDark => _parent.isDark;
174+ bool get isMaterial3 => _parent.isMaterial3;
170175
171176 CupertinoThemeData ? get cupertinoLightTheme => _parent._cupertinoLightTheme;
172177 CupertinoThemeData ? get cupertinoDarkTheme => _parent._cupertinoDarkTheme;
You can’t perform that action at this time.
0 commit comments