It is necessary to implement the following function: when entering text into the TextField, show the Remove button; when there are no characters in the TextField, do not show the Remove button. I do not yet understand how to implement this function, I need to track the input as a character somehow. I will be grateful if you help.
code
TextField(
autofocus: true,
onChanged: onChanged,
style: constants.Styles.textFieldTextStyleWhite,
cursorColor: Colors.white,
decoration: InputDecoration(
contentPadding: const EdgeInsets.only(
top: 10,
),
border: InputBorder.none,
prefixIcon: Container(
width: 10,
height: 10,
alignment: Alignment.center,
child: SvgPicture.asset(
constants.Assets.search,
),
),
),
),