dataOf static method

GBThemeData? dataOf(
  1. BuildContext context, {
  2. bool shadowThemeOnly = false,
})

Implementation

static GBThemeData? dataOf(BuildContext context, {bool shadowThemeOnly = false}) {
  final ThemeData themeData = Theme.of(context);
  if (themeData.runtimeType != GBThemeData) {
    return null;
  }
  // TODO: Catch error when no of type
  return themeData as GBThemeData?;
  // final _InheritedTheme inheritedTheme = context.dependOnInheritedWidgetOfExactType<_InheritedTheme>();
  // if (shadowThemeOnly) {
  //   if (inheritedTheme == null || inheritedTheme.theme.isMaterialAppTheme)
  //     return null;
  //   return inheritedTheme.theme.data;
  // }

  // final MaterialLocalizations localizations = MaterialLocalizations.of(context);
  // final ScriptCategory category = localizations?.scriptCategory ?? ScriptCategory.englishLike;
  // final ThemeData theme = inheritedTheme?.theme?.data ?? _kFallbackTheme;
  // return ThemeData.localize(theme, theme.typography.geometryThemeFor(category));
}