of static method

GBThemeData of(
  1. BuildContext context
)

Implementation

static GBThemeData of(BuildContext context) {
  _GBInheritedTheme? inheritedTheme;
  GBThemeData theme;
  try {
    inheritedTheme = context.dependOnInheritedWidgetOfExactType<_GBInheritedTheme>();
    if (inheritedTheme == null) {
      final _theme = Theme.of(context);
      if (_theme is GBThemeData) {
        return _theme;
      }
    }
  } catch (e) {}
  theme = inheritedTheme?.theme.data ?? GBThemeExtension.dataOf(context) ?? _kFallbackTheme;
  return theme;
}