labelTextStyle property

  1. @override
WidgetStateProperty<TextStyle?>? labelTextStyle
override

The style to merge with the default text style for NavigationDestination labels.

You can use this to specify a different style when the label is selected.

Implementation

@override
WidgetStateProperty<TextStyle?>? get labelTextStyle {
  return WidgetStateProperty.resolveWith((Set<WidgetState> states) {
    final TextStyle style = _textTheme.labelLarge!;
    return style.apply(
      color: states.contains(WidgetState.selected)
          ? _colors.onSecondaryContainer
          : _colors.onSurfaceVariant,
    );
  });
}