as you can see in the picture, when we press the search icon, I want the icon to pass into the textfield.
Basically, when I press the search icon, I want that icon to disappear into the textfield. Thank you for your help.
return Scaffold(
appBar: AppBar(
backgroundColor: it_tool_main_grey_accent,
elevation: 0,
title: !isSearching
? Text('All')
: TextField(
decoration: InputDecoration(
enabledBorder: const OutlineInputBorder(
borderSide:
BorderSide(color: Colors.black, width: 1.0),
),
hintText: "Search"),
),
automaticallyImplyLeading: false,
leadingWidth: 55,
leading: Padding(
padding:
EdgeInsets.only(left: MediaQuery.of(context).size.width / 30),
child: DecoratedBox(
decoration:
BoxDecoration(shape: BoxShape.circle, color: Colors.white),
child: IconButton(
icon: customIcon,
onPressed: () {
setState(() {
isSearching = !isSearching;
});
},
),
),
),
),
body: Text("hi"),
);