Unverified Commit 01776a3e authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Declare NavigationRailDestination.label as non-nullable (#77427)

parent fd890292
...@@ -490,7 +490,7 @@ class _NavigationRailState extends State<NavigationRail> with TickerProviderStat ...@@ -490,7 +490,7 @@ class _NavigationRailState extends State<NavigationRail> with TickerProviderStat
extendedTransitionAnimation: _extendedAnimation, extendedTransitionAnimation: _extendedAnimation,
selected: widget.selectedIndex == i, selected: widget.selectedIndex == i,
icon: widget.selectedIndex == i ? widget.destinations[i].selectedIcon : widget.destinations[i].icon, icon: widget.selectedIndex == i ? widget.destinations[i].selectedIcon : widget.destinations[i].icon,
label: widget.destinations[i].label!, label: widget.destinations[i].label,
destinationAnimation: _destinationAnimations[i], destinationAnimation: _destinationAnimations[i],
labelType: labelType, labelType: labelType,
iconTheme: widget.selectedIndex == i ? selectedIconTheme : unselectedIconTheme, iconTheme: widget.selectedIndex == i ? selectedIconTheme : unselectedIconTheme,
...@@ -818,10 +818,11 @@ class NavigationRailDestination { ...@@ -818,10 +818,11 @@ class NavigationRailDestination {
const NavigationRailDestination({ const NavigationRailDestination({
required this.icon, required this.icon,
Widget? selectedIcon, Widget? selectedIcon,
this.label, required this.label,
this.padding, this.padding,
}) : selectedIcon = selectedIcon ?? icon, }) : selectedIcon = selectedIcon ?? icon,
assert(icon != null); assert(icon != null),
assert(label != null);
/// The icon of the destination. /// The icon of the destination.
/// ///
...@@ -856,7 +857,7 @@ class NavigationRailDestination { ...@@ -856,7 +857,7 @@ class NavigationRailDestination {
/// [NavigationRail.labelType] is [NavigationRailLabelType.none], the label is /// [NavigationRail.labelType] is [NavigationRailLabelType.none], the label is
/// still used for semantics, and may still be used if /// still used for semantics, and may still be used if
/// [NavigationRail.extended] is true. /// [NavigationRail.extended] is true.
final Widget? label; final Widget label;
/// The amount of space to inset the destination item. /// The amount of space to inset the destination item.
final EdgeInsetsGeometry? padding; final EdgeInsetsGeometry? padding;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment