Correct grammar in shrine demo (#4381)
I was also going to implement sorting and emptying the cart but the current data model doesn't make that easy, so I gave up on that. That's why the TODOs are moved around though.
This commit is contained in:
parent
1c1aa59bce
commit
5e6baf4a26
@ -162,7 +162,10 @@ class _OrderPageState extends State<OrderPage> {
|
||||
floatingActionButton: new FloatingActionButton(
|
||||
onPressed: () {
|
||||
updateOrder(inCart: true);
|
||||
showSnackBarMessage('There are ${currentOrder.quantity} items in the shopping cart');
|
||||
final int n = currentOrder.quantity;
|
||||
showSnackBarMessage(
|
||||
'There ${ n == 1 ? "is one item" : "are $n items" } in the shopping cart.'
|
||||
);
|
||||
},
|
||||
backgroundColor: const Color(0xFF16F0F0),
|
||||
child: new Icon(
|
||||
|
@ -29,11 +29,13 @@ class ShrinePage extends StatelessWidget {
|
||||
child: new Text('SHRINE', style: ShrineTheme.of(context).appBarTitleStyle)
|
||||
),
|
||||
backgroundColor: Theme.of(context).canvasColor,
|
||||
actions: <Widget>[ // TODO(hansmuller): implement the actions.
|
||||
actions: <Widget>[
|
||||
new IconButton(
|
||||
icon: Icons.shopping_cart,
|
||||
tooltip: 'Shopping cart',
|
||||
onPressed: () { /* activate the button for now */ }
|
||||
onPressed: () {
|
||||
// TODO(hansmuller): implement the action.
|
||||
}
|
||||
),
|
||||
new PopupMenuButton<ShrineAction>(
|
||||
itemBuilder: (BuildContext context) => <PopupMenuItem<ShrineAction>>[
|
||||
@ -49,7 +51,20 @@ class ShrinePage extends StatelessWidget {
|
||||
value: ShrineAction.emptyCart,
|
||||
child: new Text('Empty shopping cart')
|
||||
)
|
||||
]
|
||||
],
|
||||
onSelected: (ShrineAction action) {
|
||||
switch (action) {
|
||||
case ShrineAction.sortByPrice:
|
||||
// TODO(hansmuller): implement the action.
|
||||
break;
|
||||
case ShrineAction.sortByProduct:
|
||||
// TODO(hansmuller): implement the action.
|
||||
break;
|
||||
case ShrineAction.emptyCart:
|
||||
// TODO(hansmuller): implement the action.
|
||||
break;
|
||||
}
|
||||
}
|
||||
)
|
||||
]
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user