【发布时间】:2020-10-13 22:29:14
【问题描述】:
我成功添加了多个下拉菜单,但我想要一个 TextFormField 的 InputDecoration,这样我可以保持用户界面一致,并在您从下拉菜单中选择后显示下拉菜单的内容。
TextFormField(
decoration: InputDecoration(
labelText: 'Action'
),
);
显然我需要 10 声望才能发布图片。 (我的意思是有道理)
TextFormField with labelText set to Action
给了我一个好看的 TextFormField... 但是我想要我的下拉菜单使用相同类型的界面,我可以在其中给它一个 InputDecoration。现在,在我选择了 DropdownButton 之后,我想要在我的 DropdownButton 上方使用相同的“labelText”。
My DropdownButton has a nice look and feel before I've entered the value
But afterwards it doesn't have a reminder for what the dropdown was
我尝试创建一个 TextDecorator/TextDecoration 的 mixin 并将其放入现有的 DropdownButton 类中,但我仍然是该语言的超级菜鸟,并且刚刚了解了 mixins,它似乎没有帮助。如何将 TextFormField 中的 TextDecoration 添加到 DropdownButton 上?
【问题讨论】: