setiOSThemeData method
Assigning the Cupertino theme
Implementation
CupertinoThemeData? setiOSThemeData(BuildContext context) {
// Retain the original theme
App.baseiOSTheme = CupertinoTheme.of(context);
CupertinoThemeData? cupertinoThemeData = _iOSTheme ?? oniOSTheme();
if (_allowChangeTheme) {
// If a saved preference
final theme = App.iOSThemeData;
if (theme != null) {
cupertinoThemeData = theme;
}
}
if (cupertinoThemeData == null) {
// Possibly Material can provide
final themeData = _theme ?? onTheme() ?? App.themeData;
if (themeData == null) {
// The original theme
App.iOSThemeData ??= App.baseiOSTheme;
cupertinoThemeData = App.iOSThemeData;
} else {
// Assign the provided theme
App.iOSThemeData = themeData;
cupertinoThemeData = App.iOSThemeData;
}
} else {
App.iOSThemeData = cupertinoThemeData;
}
return cupertinoThemeData;
}