I am trying to implement a DropdownButtonFormField which should work similarly to a country-code selector. In its dropdown list, the full names and corresponding codes are demonstrated, while when one of them is selected, the form should only keep the country code. Is there any approach to accomplish this?
Alternatively, is there any way to hide the value selected and leave only the dropdown triangle button, so that I can add widgets to display by myself? I tried to put it in a SizedBox with an extremely small width as the solution of the alternating question, but that looks terrible.
Here is a demonstration of what I expected (modifying the DropdownMenu sample but it does not work when the field contains only country code). demonstration
Thanks.

This can be finished by implementing the
selectedItemBuilder.For instance, for the country codes defined in enum that
It can be displayed by the following widget:
The
itemcan control the style of dropdown list, while theselectedItemBuilderallows to display selected item in another style. So the purpose is accomplished.