createGBTextTheme function
Creates default TextTheme for GB UI Kit typography.
Implementation
TextTheme createGBTextTheme([TextTheme? customTextTheme]) {
final base = customTextTheme ?? const TextTheme();
return base.copyWith(
displayLarge: (base.displayLarge ?? const TextStyle()).copyWith(
fontSize: 34,
fontWeight: FontWeight.bold,
),
displayMedium: (base.displayMedium ?? const TextStyle()).copyWith(
fontSize: 24,
fontWeight: FontWeight.w400,
),
displaySmall: (base.displaySmall ?? const TextStyle()).copyWith(
fontSize: 20,
fontWeight: FontWeight.w400,
),
headlineMedium: (base.headlineMedium ?? const TextStyle()).copyWith(
fontSize: 19,
fontWeight: FontWeight.w400,
),
headlineSmall: (base.headlineSmall ?? const TextStyle()).copyWith(
fontSize: 18,
fontWeight: FontWeight.w400,
),
titleLarge: (base.titleLarge ?? const TextStyle()).copyWith(
fontSize: 16,
fontWeight: FontWeight.w400,
),
titleMedium: (base.titleMedium ?? const TextStyle()).copyWith(
fontSize: 16,
fontWeight: FontWeight.bold,
),
titleSmall: (base.titleSmall ?? const TextStyle()).copyWith(
fontSize: 14,
fontWeight: FontWeight.bold,
),
bodyLarge: (base.bodyLarge ?? const TextStyle()).copyWith(
fontSize: 16,
fontWeight: FontWeight.w400,
),
bodyMedium: (base.bodyMedium ?? const TextStyle()).copyWith(
fontSize: 14,
fontWeight: FontWeight.w400,
),
labelLarge: (base.labelLarge ?? const TextStyle()).copyWith(
fontSize: 14,
fontWeight: FontWeight.bold,
),
bodySmall: (base.bodySmall ?? const TextStyle()).copyWith(
fontSize: 12,
fontWeight: FontWeight.w400,
),
labelSmall: (base.labelSmall ?? const TextStyle()).copyWith(
fontSize: 10,
fontWeight: FontWeight.w400,
),
);
}