configOf static method

PublicAppConfig? configOf(
  1. BuildContext context, {
  2. bool listen = true,
})

Accesses current public app configuration, if resolved.

Implementation

static PublicAppConfig? configOf(BuildContext context, {bool listen = true}) {
  final scope = listen
      ? context.dependOnInheritedWidgetOfExactType<CupThreadThemeScope>()
      : (context.getInheritedWidgetOfExactType<CupThreadThemeScope>() ??
          context.dependOnInheritedWidgetOfExactType<CupThreadThemeScope>());
  return scope?.appConfig;
}