Skip to content

Instantly share code, notes, and snippets.

@lawreyios
Created January 9, 2019 01:56
Show Gist options
  • Save lawreyios/7c002c04df730bbb85cb0da1c5373c52 to your computer and use it in GitHub Desktop.
Save lawreyios/7c002c04df730bbb85cb0da1c5373c52 to your computer and use it in GitHub Desktop.
void _searchPressed() {
setState(() {
if (this._searchIcon.icon == Icons.search) {
this._searchIcon = new Icon(Icons.close);
this._appBarTitle = new TextField(
controller: _filter,
style: new TextStyle(color: Colors.white),
decoration: new InputDecoration(
prefixIcon: new Icon(Icons.search, color: Colors.white),
fillColor: Colors.white,
hintText: 'Search by name',
hintStyle: TextStyle(color: Colors.white),
),
);
} else {
this._searchIcon = new Icon(Icons.search);
this._appBarTitle = new Text(appTitle);
_filter.clear();
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment