Created
July 18, 2019 06:40
-
-
Save ShivamGoyal1899/d2dc47540d2ed02b5e16bbaca9e6bf92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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