of static method

NavigationBarThemeData of(
  1. BuildContext context
)

Retrieves the NavigationBarThemeData from the closest ancestor NavigationBarTheme.

If there is no enclosing NavigationBarTheme widget, then ThemeData.navigationBarTheme is used.

Typical usage is as follows:

NavigationBarThemeData theme = NavigationBarTheme.of(context);

Implementation

static NavigationBarThemeData of(BuildContext context) {
  final NavigationBarTheme? navigationBarTheme = context
      .dependOnInheritedWidgetOfExactType<NavigationBarTheme>();
  return navigationBarTheme?.data ?? Theme.of(context).navigationBarTheme;
}