I need to change textfield background color grey to white when user tap on textfiled. Focused textfield's background color should change grey to white and other un focused textfield background color stay remain grey.
i tried this
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: AppColors.textFieldBG,
focusColor: AppColors.white,
hintStyle: const TextStyle(color: AppColors.labelText, fontSize: 16),
contentPadding:
const EdgeInsets.symmetric(horizontal: 10, vertical: 20),
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.black26),
borderRadius: BorderRadius.circular(10)),
disabledBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.transparent),
borderRadius: BorderRadius.circular(10)),
enabledBorder: UnderlineInputBorder(
borderSide: const BorderSide(color: Colors.transparent),
borderRadius: BorderRadius.circular(10),
),
Here is text-filed code:
TextField(
focusNode: focusNode,
onChanged: onChanged,
controller: controller,
maxLines: maxLines,
onTap: onTap,
enabled: isEnable,
decoration: InputDecoration(
filled: true,
fillColor: AppColors.textFieldBG,
focusColor: AppColors.white,
hintText: hintText,
suffixIcon: isShowSuffixIcon
? InkWell(
onTap: onTapIcon,
child: const Icon(
Icons.date_range_outlined,
color: AppColors.labelText,
),
)
: null),
),