我想在flutter中像android一样在Text()上显示提示文本。但是我没有在flutter中找到任何与TextView相关的提示键。
就像这样。
Text("", hint : "Choose State")发布于 2020-02-06 14:23:53
我自己也做过。
var selectedValue = null;
Text(selectedValue ?? "Choose Country")如果selectedValue为null,那么我将显示可选值ie。"Choose Country"
发布于 2020-01-31 15:33:09
您需要使用具有类型为InputDecoration的属性decoration并包含hintText属性的textfield:
TextField(
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Choose State'
),
);https://stackoverflow.com/questions/59999612
复制相似问题