of static method
- BuildContext context
Retrieves the NavigationRailThemeData from the closest ancestor NavigationRailTheme.
If there is no enclosing NavigationRailTheme widget, then ThemeData.navigationRailTheme is used.
Typical usage is as follows:
NavigationRailThemeData theme = NavigationRailTheme.of(context);
Implementation
static NavigationRailThemeData of(BuildContext context) {
final NavigationRailTheme? navigationRailTheme = context
.dependOnInheritedWidgetOfExactType<NavigationRailTheme>();
return navigationRailTheme?.data ?? Theme.of(context).navigationRailTheme;
}