I have a simple flutter app where when I tap on the search icon, it should show me CupertinoSearchTextField() with the keyboard.
The good thing is that CupertinoSearchTextField() is showing when I tap the search icon, as you can see in the 2nd image, but the problem is that the keyboard does not pop up when I tap the search icon.
The search text field and the keyboard must show together so that the user can type directly.
-> Keep in mind, the user can still type, but user has to tap into the search field to activate the keyboard.
This is what my code looks like -
iOSAppBar(BuildContext context) {
return CupertinoNavigationBar(
backgroundColor: AppColors.blue,
middle: state ? appBarTitle() : appBarSearchBox(),
trailing: state ? appBarSearchIcon() : appBarCancelText(),
);
}
//this is the search field
Widget appBarSearchBox() {
return CupertinoSearchTextField();
}