Skip to content

Instantly share code, notes, and snippets.

@ShivamGoyal1899
Created July 18, 2019 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShivamGoyal1899/d2dc47540d2ed02b5e16bbaca9e6bf92 to your computer and use it in GitHub Desktop.
Save ShivamGoyal1899/d2dc47540d2ed02b5e16bbaca9e6bf92 to your computer and use it in GitHub Desktop.
class _SearchTabState extends State<SearchTab> {
// ...
@override
Widget build(BuildContext context) {
final model = Provider.of<AppStateModel>(context);
final results = model.search(_terms);
return DecoratedBox(
decoration: const BoxDecoration(
color: Styles.scaffoldBackground,
),
child: SafeArea(
child: Column(
children: [
_buildSearchBox(),
Expanded(
child: ListView.builder(
itemBuilder: (context, index) => ProductRowItem(
index: index,
product: results[index],
lastItem: index == results.length - 1,
),
itemCount: results.length,
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment