Created
July 18, 2019 06:38
-
-
Save ShivamGoyal1899/cca5ad3d2010e641a013f1696ba8ef3a 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 ProductListTab extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return CupertinoPageScaffold( | |
child: Consumer<AppStateModel>( | |
builder: (context, child, model) { | |
final products = model.getProducts(); | |
return CustomScrollView( | |
semanticChildCount: products.length, | |
slivers: <Widget>[ | |
CupertinoSliverNavigationBar( | |
largeTitle: const Text('Cupertino Store'), | |
), | |
SliverSafeArea( // BEGINNING OF NEW CONTENT | |
top: false, | |
minimum: const EdgeInsets.only(top: 8), | |
sliver: SliverList( | |
delegate: SliverChildBuilderDelegate( | |
(context, index) { | |
if (index < products.length) { | |
return ProductRowItem( | |
index: index, | |
product: products[index], | |
lastItem: index == products.length - 1, | |
); | |
} | |
return null; | |
}, | |
), | |
), | |
) // END OF NEW CONTENT | |
], | |
); | |
}, | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment