[英]Flutter - Change background color of TextFormField onPressed (focus)
I have my InputDecoration
as follows:我的InputDecoration
如下:
InputDecoration(
floatingLabelBehavior: FloatingLabelBehavior.always,
labelText: 'Password',
labelStyle: TextStyle(
color: AppColors.labelInputFocus,
fontWeight: FontWeight.w400,
fontSize: 18.sp,
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: AppColors.secondaryBlue, width: 2.0),
),
)
Like how bordercolor changes if pressed I want to change background color of textformfield if user selects it.就像按下时边框颜色如何变化一样,如果用户选择它,我想更改 textformfield 的背景颜色。
I have my InputDecoration
as follows:我的InputDecoration
如下:
InputDecoration(
floatingLabelBehavior: FloatingLabelBehavior.always,
labelText: 'Password',
labelStyle: TextStyle(
color: AppColors.labelInputFocus,
fontWeight: FontWeight.w400,
fontSize: 18.sp,
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: AppColors.secondaryBlue, width: 2.0),
),
)
Like how bordercolor changes if pressed I want to change background color of textformfield if user selects it.就像按下时边框颜色如何变化一样,如果用户选择它,我想更改 textformfield 的背景颜色。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.