1
0
mirror of https://github.com/flutter/samples.git synced 2026-03-29 15:51:47 +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

@@ -1,4 +1,4 @@
include: package:pedantic/analysis_options.yaml
include: package:pedantic/analysis_options.1.7.0.yaml
analyzer:
strong-mode:

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(

View File

@@ -1,5 +1,5 @@
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
@@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.2.0"
boolean_selector:
dependency: transitive
description:
@@ -80,14 +80,14 @@ packages:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.0"
version: "1.7.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.3"
scoped_model:
dependency: "direct main"
description:
@@ -148,7 +148,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.4"
version: "0.2.5"
typed_data:
dependency: transitive
description:

View File

@@ -15,7 +15,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.5.0
pedantic: ^1.7.0
flutter:
uses-material-design: true