Skip to content

Instantly share code, notes, and snippets.

@lwinged
Created May 6, 2019 16:38
Show Gist options
  • Save lwinged/957abb43627f3a17fdd5572cf2274c72 to your computer and use it in GitHub Desktop.
Save lwinged/957abb43627f3a17fdd5572cf2274c72 to your computer and use it in GitHub Desktop.
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
TextField(
controller: _searchController,
decoration: InputDecoration(
hintText: 'Address',
border: OutlineInputBorder(),
),
onChanged: (_) => _refreshState(),
onSubmitted: validForSearch
? (query) => widget.onSubmit(context, query)
: null,
),
SizedBox(height: 8.0),
Row(
children: <Widget>[
RaisedButton(
child: Text("Go"),
onPressed: validForSearch
? () => widget.onSubmit(context, _searchController.text)
: null,
),
SizedBox(width: 8.0),
RaisedButton(
child: Text("My location"),
onPressed: () => widget.onSubmit(context, SEARCH_MY_LOCATION),
)
],
)
],
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment