of static method

CupThreadColors of(
  1. BuildContext context
)

Accesses current CupThread theme colors.

Implementation

static CupThreadColors of(BuildContext context) {
  final scope = context.dependOnInheritedWidgetOfExactType<CupThreadThemeScope>();
  if (scope != null) return scope.colors;
  final isDark = Theme.of(context).brightness == Brightness.dark;
  return CupThreadColors.resolve(SdkTheme.system, isDarkMode: isDark);
}