ThemeManager class

Manages the active theme at runtime, supports custom themes, and converts Neomage themes to Flutter ThemeData.

Constructors

ThemeManager.withTheme(NeomageTheme theme)
Allow construction for testing with a specific initial theme.
factory

Properties

currentTheme NeomageTheme
The currently active theme.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
themeStream Stream<NeomageTheme>
Stream that emits whenever the theme changes.
no setter

Methods

customTheme({required String name, required NeomageColorScheme colors, NeomageTextTheme? text, NeomageComponentTheme? components, SyntaxTheme? syntax}) → void
Register and activate a user-defined theme.
dispose() → void
Release resources. Call when the application shuts down.
exportTheme() Map<String, dynamic>
Serialise the current theme to a map suitable for JSON encoding.
getAvailableThemes() List<ThemeInfo>
Returns metadata for every available theme (built-in + custom).
importTheme(Map<String, dynamic> map) → void
Import a theme from a previously exported map and activate it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setTheme(String name) → void
Switch to a named built-in or custom theme.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance ThemeManager
Singleton instance.
final

Static Methods

applyComponentOverrides(ThemeData base, NeomageComponentTheme comp) ThemeData
Apply NeomageComponentTheme overrides to an existing ThemeData.
toMaterialTheme(NeomageColorScheme colors) ThemeData
Convert a NeomageColorScheme to a Flutter ThemeData.