mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Added trailing button to delete cart item in provider_shopper App (#571)
This commit is contained in:
@@ -46,6 +46,12 @@ class _CartList extends StatelessWidget {
|
||||
itemCount: cart.items.length,
|
||||
itemBuilder: (context, index) => ListTile(
|
||||
leading: Icon(Icons.done),
|
||||
trailing: IconButton(
|
||||
icon: Icon(Icons.remove_circle_outline),
|
||||
onPressed: () {
|
||||
cart.remove(cart.items[index]);
|
||||
},
|
||||
),
|
||||
title: Text(
|
||||
cart.items[index].name,
|
||||
style: itemNameStyle,
|
||||
|
||||
Reference in New Issue
Block a user