Complete Material-only APIs and fixtures
Remove obsolete control-family flags and icon metadata across all callers, dead alternate themes and host helpers, obsolete test setup, and the unused icon-font dependency. Preserve native Material Back transitions. Make navigation fixtures independent of update plugins and answer auxiliary shell snapshots so the complete application suite can run deterministically.
This commit is contained in:
@@ -1,34 +1,12 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
// Framework transition for Material routes: keeps Apple's interactive Back.
|
||||
import 'package:flutter/cupertino.dart' show CupertinoPageTransitionsBuilder;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// The app's backgrounds. Dark mode uses a near-black gray rather than pure
|
||||
/// black, so cards, sections and bars read as layers above the page.
|
||||
abstract final class AppColors {
|
||||
/// A page.
|
||||
static const background = CupertinoDynamicColor.withBrightness(
|
||||
color: Color(0xFFFFFFFF),
|
||||
darkColor: Color(0xFF141416),
|
||||
);
|
||||
|
||||
/// Behind grouped sections (Settings-style lists).
|
||||
static const groupedBackground = CupertinoDynamicColor.withBrightness(
|
||||
color: Color(0xFFF2F2F7),
|
||||
darkColor: Color(0xFF141416),
|
||||
);
|
||||
|
||||
/// Bars over the page.
|
||||
static const bar = CupertinoDynamicColor.withBrightness(
|
||||
color: Color(0xF0F9F9F9),
|
||||
darkColor: Color(0xF01C1C1F),
|
||||
);
|
||||
}
|
||||
|
||||
const _seed = Color(0xFF6750A4);
|
||||
|
||||
/// [fontFamily] replaces the platform family throughout the text themes
|
||||
/// (Material's, and Cupertino's for Cupertino widgets on a Material host),
|
||||
/// keeping every size, weight and the text scaling; null keeps the system
|
||||
/// [fontFamily] replaces the platform family throughout the Material text
|
||||
/// themes, keeping every size, weight and text scaling. Null keeps the system
|
||||
/// typography.
|
||||
ThemeData appLightTheme({String? fontFamily}) {
|
||||
final scheme = ColorScheme.fromSeed(seedColor: _seed);
|
||||
@@ -111,36 +89,3 @@ ThemeData appDarkTheme({String? fontFamily}) {
|
||||
fontFamily: fontFamily,
|
||||
);
|
||||
}
|
||||
|
||||
const appCupertinoTheme = CupertinoThemeData(
|
||||
scaffoldBackgroundColor: AppColors.background,
|
||||
barBackgroundColor: AppColors.bar,
|
||||
);
|
||||
|
||||
/// [appCupertinoTheme] with every Cupertino text role in [fontFamily]; null
|
||||
/// keeps the system typography.
|
||||
CupertinoThemeData appCupertinoThemeWith({String? fontFamily}) =>
|
||||
fontFamily == null
|
||||
? appCupertinoTheme
|
||||
: appCupertinoTheme.copyWith(textTheme: appCupertinoTextTheme(fontFamily));
|
||||
|
||||
/// The stock Cupertino text roles (sizes, weights, colours) in [fontFamily].
|
||||
/// Action roles take [primaryColor], as the stock roles do.
|
||||
CupertinoTextThemeData appCupertinoTextTheme(
|
||||
String fontFamily, {
|
||||
Color primaryColor = CupertinoColors.systemBlue,
|
||||
}) {
|
||||
final base = CupertinoTextThemeData(primaryColor: primaryColor);
|
||||
TextStyle face(TextStyle style) => style.copyWith(fontFamily: fontFamily);
|
||||
return CupertinoTextThemeData(
|
||||
textStyle: face(base.textStyle),
|
||||
actionTextStyle: face(base.actionTextStyle),
|
||||
actionSmallTextStyle: face(base.actionSmallTextStyle),
|
||||
tabLabelTextStyle: face(base.tabLabelTextStyle),
|
||||
navTitleTextStyle: face(base.navTitleTextStyle),
|
||||
navLargeTitleTextStyle: face(base.navLargeTitleTextStyle),
|
||||
navActionTextStyle: face(base.navActionTextStyle),
|
||||
pickerTextStyle: face(base.pickerTextStyle),
|
||||
dateTimePickerTextStyle: face(base.dateTimePickerTextStyle),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user