I'm tring to change labels color depends on if it selected or not, but flutter sets 1 color for all
NavigationBarTheme(
data: NavigationBarThemeData(
backgroundColor: Theme.of(context)
.extension<MyExtension>()!
.white,
labelTextStyle: MaterialStateProperty.resolveWith(
(state) {
return state == MaterialState.selected
? Theme.of(context).textTheme.caption!.copyWith(
color: Theme.of(context)
.extension<MyExtension>()!
.black,
)
: Theme.of(context).textTheme.caption!.copyWith(
color: Theme.of(context)
.extension<MyExtension>()!
.grey3,
);
}),
indicatorColor: Theme.of(context)
.extension<MyExtension>()!
.grey2),
I tried to print the state of every item and it always MaterialState.pressed for each