of static method

BadgeThemeData of(
  1. BuildContext context
)

Retrieves the BadgeThemeData from the closest ancestor BadgeTheme.

If there is no enclosing BadgeTheme widget, then ThemeData.badgeTheme is used.

Typical usage is as follows:

BadgeThemeData theme = BadgeTheme.of(context);

Implementation

static BadgeThemeData of(BuildContext context) {
  final BadgeTheme? badgeTheme = context.dependOnInheritedWidgetOfExactType<BadgeTheme>();
  return badgeTheme?.data ?? Theme.of(context).badgeTheme;
}