Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Issues #5 - Added clear button and other smaller features #7

Closed
wants to merge 1 commit into from

Conversation

ride4sun
Copy link
Contributor

@ride4sun ride4sun commented Oct 26, 2017

This is related to #5

  • 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

All changes should not affect the existing API and defaults

* 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();
Copy link
Owner

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;
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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);
Copy link
Owner

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) {
Copy link
Owner

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?

@ArcticZeroo
Copy link
Owner

closing due to inactivity

@ArcticZeroo ArcticZeroo closed this Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants