簡體   English   中英

Flutter - 更改 TextFormField onPressed 的背景顏色(焦點)

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM