How do I use a TextField widget as a search bar to query results from a local SQLite database asset?
Would there be a better option than using a textfield widget? Examples would be much appreciated.
edit with code:
padding: EdgeInsets.all(10.0),
child: Column(
children: <Widget>[
Container(
padding: const EdgeInsets.all(8.0),
child: new Container(
height: 70.0,
color: Theme.CompanyColors.iBlue,
child: new Padding(
padding: const EdgeInsets.all(8.0),
child: new Card(
child: new Container(
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
new Icon(Icons.search),
new Container(
width: MediaQuery.of(context).size.width - 100.0,
child: new TextField(
decoration: InputDecoration(
hintText: 'Search',
//onChanged:
//onSearchTextChanged,
),
),
),
This is the code for the searchbar
my database has a table sentences attached with a paragraph_id, so i would want to search through a query like this
select * from sentences where title or body = userinput%