Skip to content

Instantly share code, notes, and snippets.

@ShivamGoyal1899
Created July 18, 2019 06:38
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/cca5ad3d2010e641a013f1696ba8ef3a to your computer and use it in GitHub Desktop.
Save ShivamGoyal1899/cca5ad3d2010e641a013f1696ba8ef3a to your computer and use it in GitHub Desktop.
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