1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-13 00:08:24 +00:00

Tweaked pubspecs, linted. (#113)

This commit is contained in:
Andrew Brogdon
2019-07-08 11:25:46 -07:00
committed by Filip Hracek
parent db963d801c
commit 3d40fa9fb2
39 changed files with 140 additions and 139 deletions

View File

@@ -34,37 +34,37 @@ class CategoryMenuPage extends StatelessWidget {
final ThemeData theme = Theme.of(context);
return ScopedModelDescendant<AppStateModel>(
builder: (context, child, model) => GestureDetector(
onTap: () {
model.setCategory(category);
if (onCategoryTap != null) onCategoryTap();
},
child: model.selectedCategory == category
? Column(
children: <Widget>[
SizedBox(height: 16.0),
Text(
categoryString,
style: theme.textTheme.body2,
textAlign: TextAlign.center,
),
SizedBox(height: 14.0),
Container(
width: 70.0,
height: 2.0,
color: kShrinePink400,
),
],
)
: Padding(
padding: EdgeInsets.symmetric(vertical: 16.0),
child: Text(
categoryString,
style: theme.textTheme.body2
.copyWith(color: kShrineBrown900.withAlpha(153)),
textAlign: TextAlign.center,
),
onTap: () {
model.setCategory(category);
if (onCategoryTap != null) onCategoryTap();
},
child: model.selectedCategory == category
? Column(
children: <Widget>[
SizedBox(height: 16.0),
Text(
categoryString,
style: theme.textTheme.body2,
textAlign: TextAlign.center,
),
),
SizedBox(height: 14.0),
Container(
width: 70.0,
height: 2.0,
color: kShrinePink400,
),
],
)
: Padding(
padding: EdgeInsets.symmetric(vertical: 16.0),
child: Text(
categoryString,
style: theme.textTheme.body2
.copyWith(color: kShrineBrown900.withAlpha(153)),
textAlign: TextAlign.center,
),
),
),
);
}

View File

@@ -33,12 +33,12 @@ class _ShoppingCartPageState extends State<ShoppingCartPage> {
return model.productsInCart.keys
.map(
(id) => ShoppingCartRow(
product: model.getProductById(id),
quantity: model.productsInCart[id],
onPressed: () {
model.removeItemFromCart(id);
},
),
product: model.getProductById(id),
quantity: model.productsInCart[id],
onPressed: () {
model.removeItemFromCart(id);
},
),
)
.toList();
}

View File

@@ -42,12 +42,12 @@ class ProductCard extends StatelessWidget {
return ScopedModelDescendant<AppStateModel>(
builder: (context, child, model) => GestureDetector(
onTap: () {
model.addProductToCart(product.id);
// TODO: Add Snackbar
},
child: child,
),
onTap: () {
model.addProductToCart(product.id);
// TODO: Add Snackbar
},
child: child,
),
child: Stack(
children: <Widget>[
Column(