Flutter - How to change TextField hint color?

后端 未结 3 1261
日久生厌
日久生厌 2021-01-31 14:15

I\'m a bit confused how to change the hint color of the textfield. Someone can guide me how to do it.Thanks

child: TextField(
   style: TextStyle(fontSize: 20),
         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-31 14:48

    You can do with hintStyle: in InputDecoration

    TextField(
            style: TextStyle(fontSize: 20),
            decoration: InputDecoration(
              hintText: "Password",
              hintStyle: TextStyle(fontSize: 20.0, color: Colors.redAccent),
              border: OutlineInputBorder(
                borderSide: BorderSide(
                  color: Colors.teal,
                ),
              ),
              prefixIcon: const Icon(
                Icons.security,
                color: Colors.white,
              ),
            ),
          ),
    

提交回复
热议问题