of static method

Returns the data from the closest BoustroTheme ancestor. If there is no ancestor, it returns BoustroThemeData.light or BoustroThemeData.dark depending on the Theme's brightness.

Implementation

static BoustroComponentConfigData of(BuildContext context) {
  final boustroTheme =
      context.dependOnInheritedWidgetOfExactType<BoustroComponentConfig>();
  if (boustroTheme != null) {
    return boustroTheme.data;
  }
  return BoustroComponentConfigData.empty();
}