textTheme property

  1. @override
TextTheme get textTheme
override

Provides the application's TextTheme.

Implementation

@override
TextTheme get textTheme {
  try {
    return typography.toTextTheme(colorScheme);
  } catch (e) {
    // Fallback to empty TextTheme to maintain application stability
    // when typography conversion fails
    // In case of an error, use a fallback TextTheme
    // to avoid breaking the app.
    // 2 hours of my life I’ll never get back, LOL
    // Should’ve used a try-catch block instead of diving into the rabbit hole.
    // Rookie mistake, but hey, it works now... for now 😉
    return const TextTheme();
  }
}