MorphState class

The piece of state exposed to descendants via MorphInheritedWidget. Everything in here is derived from the system or from the scorer — never from user app state.

Annotations

Constructors

MorphState({required MorphTheme theme, required String sessionId, bool safeMode = false, Map<String, int> zoneOrder = const {}, bool fontScaleApplied = false, bool v2Enabled = false, MorphSystemSettings systemSettings = const MorphSystemSettings(), ThemeData? adaptedTheme, MorphAdaptedColors? adaptedColors, MorphAnalyticsConfig? analyticsConfig})
const
MorphState.safe(MorphTheme theme)
factory

Properties

adaptedColors MorphAdaptedColors?
Flat semantic color palette extracted from adaptedTheme. Null when no adaptation is needed (system brightness matches the base). Widgets read this via BuildContext.morphPalette and fall back to their own base AppColors values when null.
final
adaptedTheme ThemeData?
ThemeData derived from the app's original theme + systemSettings. Null until the first frame — consumers should fall back to their own theme when reading on the very first build.
final
analyticsConfig MorphAnalyticsConfig?
Snapshot of the analytics config the dev passed to MorphProvider. Null when analytics is disabled (the default — privacy by default). Read via the analytics extensions (context.morphAnalyticsEnabled, context.morphUserConsented).
final
fontScaleApplied bool
True once the font-scale threshold has been crossed.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
safeMode bool
final
sessionId String
final
systemSettings MorphSystemSettings
Raw OS-reported accessibility + appearance state. Updated on every platform-brightness or accessibility change.
final
theme MorphTheme
final
v2Enabled bool
True once at least one successful scoring pass has completed.
final
zoneOrder Map<String, int>
Map<zoneId, orderIndex>. Empty before the scorer has run or when the scorer decides no reorder is warranted.
final

Methods

copyWith({MorphTheme? theme, String? sessionId, bool? safeMode, Map<String, int>? zoneOrder, bool? fontScaleApplied, bool? v2Enabled, MorphSystemSettings? systemSettings, ThemeData? adaptedTheme, bool clearAdaptedTheme = false, MorphAdaptedColors? adaptedColors, bool clearAdaptedColors = false, MorphAnalyticsConfig? analyticsConfig, bool clearAnalyticsConfig = false}) MorphState
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override