text stringlengths 1 372 |
|---|
}, |
onAcceptWithDetails: (details) { |
_itemDroppedOnCustomerCart( |
item: details.data, |
customer: customer, |
); |
}, |
), |
), |
); |
} |
} |
class CustomerCart extends StatelessWidget { |
const CustomerCart({ |
super.key, |
required this.customer, |
this.highlighted = false, |
this.hasItems = false, |
}); |
final customer customer; |
final bool highlighted; |
final bool hasItems; |
@override |
widget build(BuildContext context) { |
final textColor = highlighted ? colors.white : colors.black; |
return transform.scale( |
scale: highlighted ? 1.075 : 1.0, |
child: material( |
elevation: highlighted ? 8 : 4, |
borderRadius: BorderRadius.circular(22), |
color: highlighted ? const Color(0xFFF64209) : colors.white, |
child: padding( |
padding: const EdgeInsets.symmetric( |
horizontal: 12, |
vertical: 24, |
), |
child: column( |
mainAxisSize: MainAxisSize.min, |
children: [ |
ClipOval( |
child: SizedBox( |
width: 46, |
height: 46, |
child: image( |
image: customer.imageProvider, |
fit: BoxFit.cover, |
), |
), |
), |
const SizedBox(height: 8), |
text( |
customer.name, |
style: Theme.of(context).textTheme.titleMedium?.copyWith( |
color: textColor, |
fontWeight: |
hasItems ? FontWeight.normal : FontWeight.bold, |
), |
), |
visibility( |
visible: hasItems, |
maintainState: true, |
maintainAnimation: true, |
maintainSize: true, |
child: column( |
children: [ |
const SizedBox(height: 4), |
text( |
customer.formattedTotalItemPrice, |
style: Theme.of(context).textTheme.bodySmall!.copyWith( |
color: textColor, |
fontSize: 16, |
fontWeight: FontWeight.bold, |
), |
), |
const SizedBox(height: 4), |
text( |
'${customer.items.length} item${customer.items.length != 1 ? 's' : ''}', |
style: Theme.of(context).textTheme.titleMedium!.copyWith( |
color: textColor, |
fontSize: 12, |
), |
), |
], |
), |
) |
], |
), |
), |
), |
); |
} |
} |
class MenuListItem extends StatelessWidget { |
const MenuListItem({ |
super.key, |
this.name = '', |
this.price = '', |
required this.photoProvider, |
this.isDepressed = false, |
}); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.