Created
November 9, 2025 15:30
-
-
Save fredgrott/6486bbf82a2a0129da43ad18eb38c220 to your computer and use it in GitHub Desktop.
M3E typography Emily's original code
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
| factory M3ETypography.defaultFor( | |
| Brightness brightness, { | |
| String? brandFontFamily, | |
| String? plainFontFamily, | |
| TextTheme? baseOverride, | |
| }) { | |
| // 1) Start from Material 3 baseline type. | |
| final m3 = Typography.material2021(); | |
| final TextTheme m3Base = | |
| baseOverride ?? (brightness == Brightness.dark ? m3.white : m3.black); | |
| // 2) Optionally map brand/plain families to role groups (M3E guidance). | |
| final TextTheme baseWithFamilies = _applyFamilies( | |
| m3Base, | |
| brand: brandFontFamily, | |
| plain: plainFontFamily, | |
| ); | |
| // 3) Provide emphasized deltas (weights/tracking). | |
| return M3ETypography( | |
| base: baseWithFamilies, | |
| emphasized: M3EEmphasized.forBrightness(brightness), | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment