Open Switernal opened 3 years ago
I am unable to reproduce this in the example from the latest pr #46 . Can you show some code?
@ArcticZeroo The issue was on my side. I was able to fix it.
Hello, flutter_search_bar: ^2.1.0
I'm having the same problem: at the beginning I see the 'default' appbar with title and the lens icon. If I press the icon I see nothing but in the debug/run window I note that the 'build' function is recalled (setstate() ?) - no errors.
The code I used is basically the one from the example:
searchBar = new SearchBar(
inBar: true,
buildDefaultAppBar: buildAppBar,
setState: setState,
hintText: "Filter",
onSubmitted: onSearchSubmitted,
onCleared: () {
print("cleared");
},
onClosed: () {
print("closed");
}
);
AppBar buildAppBar(BuildContext context) {
return new AppBar(
title: new Text(widget.title),
actions: [searchBar.getSearchAction(context)]);
}
@override
Widget build(BuildContext context) {
//
return Scaffold(
appBar: buildAppBar(context),
...
Solved,
I re-checked the code. The error was in the appbar:
row.
@override
Widget build(BuildContext context) {
//
return Scaffold(
appBar: searchBar.build(context),
Thanks
When I try to tap on the search button, the search bar doesn't open and just throws an error:
The method 'addLocalHistoryEntry' was called on null. Receiver: null Tried calling: addLocalHistoryEntry(Instance of 'LocalHistoryEntry')
What's the matter with it?