mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
Upgrading samples to flutter_lints, part 1 of n (#804)
This commit is contained in:
@@ -24,7 +24,7 @@ class MyCart extends StatelessWidget {
|
||||
child: _CartList(),
|
||||
),
|
||||
),
|
||||
Divider(height: 4, color: Colors.black),
|
||||
const Divider(height: 4, color: Colors.black),
|
||||
_CartTotal()
|
||||
],
|
||||
),
|
||||
@@ -45,9 +45,9 @@ class _CartList extends StatelessWidget {
|
||||
return ListView.builder(
|
||||
itemCount: cart.items.length,
|
||||
itemBuilder: (context, index) => ListTile(
|
||||
leading: Icon(Icons.done),
|
||||
leading: const Icon(Icons.done),
|
||||
trailing: IconButton(
|
||||
icon: Icon(Icons.remove_circle_outline),
|
||||
icon: const Icon(Icons.remove_circle_outline),
|
||||
onPressed: () {
|
||||
cart.remove(cart.items[index]);
|
||||
},
|
||||
@@ -82,14 +82,14 @@ class _CartTotal extends StatelessWidget {
|
||||
Consumer<CartModel>(
|
||||
builder: (context, cart, child) =>
|
||||
Text('\$${cart.totalPrice}', style: hugeStyle)),
|
||||
SizedBox(width: 24),
|
||||
const SizedBox(width: 24),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Buying not supported yet.')));
|
||||
const SnackBar(content: Text('Buying not supported yet.')));
|
||||
},
|
||||
style: TextButton.styleFrom(primary: Colors.white),
|
||||
child: Text('BUY'),
|
||||
child: const Text('BUY'),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user