I'm trying to create a Textformfield that has button inside it. Please check the screenshot.
Here is what I have done
TextField(
decoration: InputDecoration(
prefixIcon: Icon(Icons.search),
hintText: "Search",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(2.w),
borderSide: BorderSide(
width: 0,
style: BorderStyle.none,
),
),
suffixIcon: ElevatedButton(
child: Text("Search"),
onPressed: () {},
),
),
),
But here it is the result from my script
The button is overlapping the Textformfield, how can I fix it ?


