text stringlengths 1 474 |
|---|
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, |
}); |
final String name; |
final String price; |
final ImageProvider photoProvider; |
final bool isDepressed; |
@override |
Widget build(BuildContext context) { |
return Material( |
elevation: 12, |
borderRadius: BorderRadius.circular(20), |
child: Padding( |
padding: const EdgeInsets.all(12), |
child: Row( |
mainAxisSize: MainAxisSize.max, |
children: [ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.