update
This commit is contained in:
parent
ff619ac88a
commit
a76d3a0f35
3 changed files with 175 additions and 118 deletions
|
|
@ -12,6 +12,7 @@ class ItemCardWidget extends StatelessWidget {
|
|||
final double price;
|
||||
final double quantity;
|
||||
final bool isLoading;
|
||||
final double cart;
|
||||
|
||||
const ItemCardWidget(
|
||||
{super.key,
|
||||
|
|
@ -20,7 +21,8 @@ class ItemCardWidget extends StatelessWidget {
|
|||
required this.subtext,
|
||||
required this.price,
|
||||
required this.quantity,
|
||||
required this.isLoading});
|
||||
required this.isLoading,
|
||||
required this.cart});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -110,13 +112,32 @@ class ItemCardWidget extends StatelessWidget {
|
|||
Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: cart > 0 ? const Color.fromRGBO(99, 44, 113, 1) : const Color.fromRGBO(255, 255, 255, 1),
|
||||
border: Border.all(color: Colors.black),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.cartShopping,
|
||||
size: 12,
|
||||
))
|
||||
child: (cart > 0)
|
||||
? Row(
|
||||
children: [
|
||||
const FaIcon(
|
||||
FontAwesomeIcons.cartShopping,
|
||||
size: 12,
|
||||
color: Color.fromRGBO(255, 255, 255, 1),
|
||||
),
|
||||
const Gap(4),
|
||||
TextWidget(
|
||||
text: cart.toStringAsFixed(0),
|
||||
size: 12,
|
||||
color: const Color.fromRGBO(255, 255, 255, 1),
|
||||
bold: true,
|
||||
)
|
||||
],
|
||||
)
|
||||
: const FaIcon(
|
||||
FontAwesomeIcons.cartShopping,
|
||||
size: 12,
|
||||
color: Color.fromRGBO(0, 0, 0, 1),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue