1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-10 14:58:34 +00:00

[Shrine] New Shrine with expanding cart bottom sheet from experimenal (#18)

This commit is contained in:
Will Larche
2018-09-27 11:36:30 -04:00
committed by Andrew Brogdon
parent b5ce05e934
commit 4b4d5fef9c
11 changed files with 857 additions and 88 deletions

View File

@@ -21,10 +21,12 @@ import 'model/product.dart';
class CategoryMenuPage extends StatelessWidget {
final List<Category> _categories = Category.values;
final VoidCallback onCategoryTap;
const CategoryMenuPage({
Key key,
});
this.onCategoryTap,
}) : super(key: key);
Widget _buildCategory(Category category, BuildContext context) {
final categoryString =
@@ -32,7 +34,10 @@ class CategoryMenuPage extends StatelessWidget {
final ThemeData theme = Theme.of(context);
return ScopedModelDescendant<AppStateModel>(
builder: (context, child, model) => GestureDetector(
onTap: () => model.setCategory(category),
onTap: () {
model.setCategory(category);
if (onCategoryTap != null) onCategoryTap();
},
child: model.selectedCategory == category
? Column(
children: <Widget>[