How to work 'selectedIcon' in DropdownMenu

I want to use DropdownMenu with Flutter.
Now I use the source code from this site: DropdownMenu class - material library - Dart API
However ‘selectedIcon’ doesn’t work. TrailingIcon work well. When I select an option, the icon doesn’t switch.
Could you tell me how to work it.
Flutter:3.24.3 Dart:3.5.3

Show your code. Do you have the proper onSelected callback updating a state variable?

DropdownMenu(
requestFocusOnTap: false,
enableSearch: false,
enableFilter: false,
enabled: true,
width: 300,
menuHeight: 200,
leadingIcon: Icon(Icons.add),
trailingIcon: Icon(Icons.abc),
selectedTrailingIcon: Icon(Icons.send),
label: const Text(‘label’),
hintText: ‘hintText’,
helperText: ‘helperText’,
textStyle: TextStyle(color: Colors.blue),
errorText: selectedOption2 == OptionLabel.optionError
? ‘errorText’
: null,
onSelected: (OptionLabel? option) {
setState(() {
selectedOption2 = option;
});
},
menuStyle: MenuStyle(),
dropdownMenuEntries: OptionLabel.values
.map<DropdownMenuEntry>(
(OptionLabel option) {
return DropdownMenuEntry(
value: option,
label: option.label,
);
}).toList(),
),

The same code as the WebSite. The code doesn’t have any error.

‘MaterialApp(
useMaterial3: true’

To add this part, the problem was solved.