DropdownMenu(
alignmentOffset: Offset(0, 6),
menuStyle: MenuStyle(
maximumSize: WidgetStatePropertyAll(Size.fromHeight(200)),
padding: const WidgetStatePropertyAll(EdgeInsets.all(4)),
),
dropdownMenuEntries: [
DropdownMenuEntry(
value: 'all',
label: 'All',
style: ButtonStyle(
textStyle: WidgetStateProperty.resolveWith(
(states) => TextStyle(
fontWeight: states.contains(WidgetState.focused)
? FontWeight.bold
: FontWeight.w400,
fontSize: 14,
height: 20 / 14,
),
),
padding: const WidgetStatePropertyAll(
EdgeInsets.symmetric(horizontal: 10, vertical: 8),
),
foregroundColor: WidgetStateProperty.resolveWith(
(states) => states.contains(WidgetState.focused)
? Colors.teal.shade800
: Colors.black,
),
backgroundColor: WidgetStateProperty.resolveWith(
(states) => states.contains(WidgetState.focused)
? Colors.teal.shade50
: states.contains(WidgetState.hovered)
? Colors.grey
: Colors.transparent,
),
shape: WidgetStatePropertyAll(
RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
),
),
),
),
DropdownMenuEntry(
value: 'upcoming',
label: 'Upcoming',
style: ButtonStyle(
textStyle: WidgetStateProperty.resolveWith(
(states) => TextStyle(
fontWeight: states.contains(WidgetState.focused)
? FontWeight.bold
: FontWeight.w400,
fontSize: 14,
height: 20 / 14,
),
),
padding: const WidgetStatePropertyAll(
EdgeInsets.symmetric(horizontal: 10, vertical: 8),
),
foregroundColor: WidgetStateProperty.resolveWith(
(states) => states.contains(WidgetState.focused)
? Colors.teal.shade800
: Colors.black,
),
backgroundColor: WidgetStateProperty.resolveWith(
(states) => states.contains(WidgetState.focused)
? Colors.teal.shade50
: states.contains(WidgetState.hovered)
? Colors.grey
: Colors.transparent,
),
shape: WidgetStatePropertyAll(
RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
),
),
),
),
DropdownMenuEntry(
value: 'past',
label: 'Past',
style: ButtonStyle(
textStyle: WidgetStateProperty.resolveWith(
(states) => TextStyle(
fontWeight: states.contains(WidgetState.focused)
? FontWeight.bold
: FontWeight.w400,
fontSize: 14,
height: 20 / 14,
),
),
padding: const WidgetStatePropertyAll(
EdgeInsets.symmetric(horizontal: 10, vertical: 8),
),
foregroundColor: WidgetStateProperty.resolveWith(
(states) => states.contains(WidgetState.focused)
? Colors.teal.shade800
: Colors.black,
),
backgroundColor: WidgetStateProperty.resolveWith(
(states) => states.contains(WidgetState.focused)
? Colors.teal.shade50
: states.contains(WidgetState.hovered)
? Colors.grey
: Colors.transparent,
),
shape: WidgetStatePropertyAll(
RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
),
),
),
),
],
),
Steps to reproduce
textStyleinButtonStyleforDropdownMenuEntryis not resolving with states. It doesn't change fontWeight or fontSize for focused entry.You can use the following
textStylein theButtonStyle;WidgetStateProperty.resolveWithis working with other properties likeforegroundColoras you can see in the reproducible code below.Expected results
It is expected to change text style according to the state of button in
DropdownMenuActual results
Not resolving with states on
textStyle.Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
Expected Output
Current Output
Screen.Recording.2025-10-22.at.10.20.50.AM.mov
Flutter Doctor output
Doctor output