Created
November 12, 2025 19:11
-
-
Save fredgrott/1f2e39321a7d53434530f6c750b8c1c4 to your computer and use it in GitHub Desktop.
m3e theme extension on colorscheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Convenience creation helpers to install M3ETheme with minimal boilerplate. | |
| extension M3EColorSchemeAccessors on ColorScheme { | |
| /// Creates a ThemeData from this ColorScheme and installs the M3ETheme | |
| /// extension in one call. | |
| /// | |
| /// Example: | |
| /// final theme = ColorScheme.fromSeed(seedColor: Colors.teal).toM3EThemeData(); | |
| ThemeData toM3EThemeData({ | |
| bool useMaterial3 = true, | |
| M3ETheme? override, | |
| ThemeData? base, | |
| }) { | |
| final ThemeData seed = | |
| base ?? ThemeData(useMaterial3: useMaterial3, colorScheme: this); | |
| return withM3ETheme(seed, override: override); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment