-
Notifications
You must be signed in to change notification settings - Fork 69
Issues #5 - Added clear button and other smaller features #7
Conversation
* Added clear button to clear the search term * Added configuration to hide clear button showClearTextButton * Added bool hideSearchBoxDevider * Added popParentOnBackButton to navigate back on back buttonnot just out of the SearchBar
this.popParentOnBackButton = false, | ||
this.showClearTextButton = false, | ||
this.hideSearchBoxDevider = true}) { | ||
if (controller == null) controller = new TextEditingController(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use default parameter values for this?
bool showClearTextButton; | ||
|
||
/// This hides or shows the underline of the search text input field | ||
bool hideSearchBoxDevider; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrectly spelled; should be "divider"
this.colorBackButton = true, | ||
this.closeOnSubmit = true | ||
}); | ||
/// This hides or shows the button on the right site of the text input field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo; should be "side"
/// Whether a search text is present. | ||
bool _isSearchTextPresent = false; | ||
|
||
// If this is true the Parent Route will be poped when the Back Button is used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"poped" should be "popped"
/// | ||
AppBar buildSearchBar(BuildContext context) { | ||
ThemeData theme = Theme.of(context); | ||
var theme = Theme.of(context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a ThemeData, Theme.of can't return anything else
void beginSearch(context) { | ||
ModalRoute.of(context).addLocalHistoryEntry(new LocalHistoryEntry( | ||
onRemove: () { | ||
if (!popParentOnBackButton) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be checking for true, not false?
closing due to inactivity |
This is related to #5
All changes should not affect the existing API and defaults