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
| @override | |
| Widget build(BuildContext context) { | |
| return DynamicColorBuilder( | |
| builder: (lightDynamic, darkDynamic){ | |
| final light = lightDynamic ?? ColorScheme.fromSeed(seedColor: Colors.teal); | |
| final dark = darkDynamic ?? | |
| ColorScheme.fromSeed(seedColor: Colors.teal, brightness: Brightness.dark); | |
| return MaterialApp( | |
| theme: light.toM3EThemeData(override: M3eOverride(colors: M3ECustomColors.from(light), | |
| typography: M3ECustomTypography(base: CustomTextTheme, emphasized: MyM3ECustomEmphasized ), |
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
| @override | |
| Widget build(BuildContext context) { | |
| final light = ColorScheme.fromSeed( | |
| seedColor: Colors.purple, brightness: Brightness.light); | |
| final dark = ColorScheme.fromSeed( | |
| seedColor: Colors.purple, brightness: Brightness.dark); | |
| return MaterialApp( | |
| title: 'M3E Gallery', | |
| theme: light.toM3EThemeData(override: M3eOverride(colors: M3ECustomColors.from(light), | |
| typography: M3ECustomTypography(base: CustomTextTheme, emphasized: MyM3ECustomEmphasized ), |
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
| /// Expressive emphasis tweaks layered on top of baseline M3 type. | |
| /// Keep line-height the same; only tune weight/letter-spacing for emphasis. | |
| /// For most purposes, the M3ECustomEmphasized() construct is used. | |
| @immutable | |
| class M3ECustomEmphasized { | |
| final TextStyle expressiveDisplayLarge; | |
| final TextStyle expressiveDisplayMedium; | |
| final TextStyle expressiveDisplaySmall; | |
| final TextStyle expressiveHeadlineLarge; | |
| final TextStyle expressiveHeadlineMedium; |
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
| @immutable | |
| class ButtonFontSize { | |
| final double xs; | |
| final double sm; | |
| final double md; | |
| final double lg; | |
| final double xl; | |
| const ButtonFontSize({this.xs = 14, this.sm = 14, this.md = 16, this.lg = 20, this.xl = 24}); | |
| } |
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
| /// Material 3 Expressive typography tokens. | |
| /// - `base` starts from **M3 (Typography.material2021)**. | |
| /// - Optionally remaps fonts: brand (UI) for display/headline/title/label | |
| /// and plain (reading) for body. | |
| /// - Adds an emphasized set (weight/tracking tweaks) for expressive hierarchy. | |
| @immutable | |
| class M3ECustomTypography { | |
| final TextTheme base; | |
| final M3ECustomEmphasized emphasized; |
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
| /// Expressive emphasis tweaks layered on top of baseline M3 type. | |
| /// Keep line-height the same; only tune weight/letter-spacing for emphasis. | |
| /// For most purposes, the M3ECustomEmphasized() construct is used. | |
| @immutable | |
| class M3ECustomEmphasized { | |
| final TextStyle expressiveDisplayLarge; | |
| final TextStyle expressiveDisplayMedium; | |
| final TextStyle expressiveDisplaySmall; | |
| final TextStyle expressiveHeadlineLarge; | |
| final TextStyle expressiveHeadlineMedium; |
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
| class kVarWdth { | |
| static const FontVariation displayLarge = FontVariation('wdth', 100); | |
| static const FontVariation displayMedium = FontVariation('wdth', 100); | |
| static const FontVariation displaySmall = FontVariation('wdth', 100); | |
| static const FontVariation headlineLarge = FontVariation('wdth', 100); | |
| static const FontVariation headlineMedium = FontVariation('wdth', 100); |
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
| class kFontWeights { | |
| final FontWeight displayLarge = FontWeight.w400; | |
| final FontWeight displayMedium = FontWeight.w400; | |
| final FontWeight displaySmall = FontWeight.w400; | |
| final FontWeight headlineLarge = FontWeight.w400; | |
| final FontWeight headlineMedium = FontWeight.w400; |
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
| // Copyright 2026 Fredrick Allan Grott. All rights reserved. | |
| // Use of this source code is governed by a BSD-style | |
| // license that can be found in the LICENSE file. | |
| // | |
| // Modified from m3e_design package | |
| // Copyright (c) 2025 Emily Moonstone | |
| // MIT Licnese | |
| // ignore_for_file: prefer_constructors_over_static_methods |
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); |
NewerOlder