0
I have this code on Searchdelegate
class CustomSearchDelegate extends SearchDelegate<String> {
@override
List<Widget> buildActions(BuildContext context) {
return [
IconButton(
icon: Icon(Icons.clear),
onPressed: (){
query = "";
},
)
];
}
@override
Widget buildLeading(BuildContext context) {
return IconButton(
icon: Icon(Icons.arrow_back),
onPressed: (){
close(context, "");
},
);
}
@override
Widget buildResults(BuildContext context) {
close(context, query );
return Container();
}
@override
Widget buildSuggestions(BuildContext context) {
return Container();
}
}
When I run in debug mode, it works correctly. But when running in release mode, when confirming the search, it does not return to the page you called Search, it only returns the container, even with "close(context, query );" before in buildResults.