import 'package:flutter/material.dart'; import '../text/monospace.dart'; /// [base] in the monospace family at a terminal's compact size: Material's /// roles a step smaller (monospace runs wide), with no added letter spacing. TextTheme terminalTextTheme(TextTheme base) { TextStyle? mono(TextStyle? style) { if (style == null) return null; final size = style.fontSize; return style.copyWith( fontFamily: appMonospaceFamily, fontSize: size == null ? null : (size * 0.875).roundToDouble(), letterSpacing: 0, ); } return base.copyWith( displayLarge: mono(base.displayLarge), displayMedium: mono(base.displayMedium), displaySmall: mono(base.displaySmall), headlineLarge: mono(base.headlineLarge), headlineMedium: mono(base.headlineMedium), headlineSmall: mono(base.headlineSmall), titleLarge: mono(base.titleLarge), titleMedium: mono(base.titleMedium), titleSmall: mono(base.titleSmall), bodyLarge: mono(base.bodyLarge), bodyMedium: mono(base.bodyMedium), bodySmall: mono(base.bodySmall), labelLarge: mono(base.labelLarge), labelMedium: mono(base.labelMedium), labelSmall: mono(base.labelSmall), ); }