我想在InputDecorationlabelText 中添加星号并更改其颜色(如红色),以便用户轻松理解此字段是必需的。
TextField(
autofocus: true,
controller: _nameCtrlr,
keyboardType: TextInputType.text,
decoration: InputDecoration(
labelText: "Name *",
))
Run Code Online (Sandbox Code Playgroud)
预期结果如下图 示例图像