of static method

BrandTokens of(
  1. BuildContext context
)

Returns the BrandTokens for the current BuildContext.

Implementation

static BrandTokens of(BuildContext context) {
  final scope = context.dependOnInheritedWidgetOfExactType<BrandThemeScope>();
  assert(
    scope != null,
    'BrandThemeScope.of() called with a context that does not contain BrandTokens.',
  );
  return scope!.tokens;
}