![](/img/trans.png)
[英]Change Background Color of Elevated Button OnPressed in Flutter
[英]Flutter - Change background color of TextFormField onPressed (focus)
我的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),
),
)
就像按下時邊框顏色如何變化一樣,如果用戶選擇它,我想更改 textformfield 的背景顏色。
我的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),
),
)
就像按下時邊框顏色如何變化一樣,如果用戶選擇它,我想更改 textformfield 的背景顏色。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.