1import 'package:easy_localization/easy_localization.dart';
2import 'package:fluentui_system_icons/fluentui_system_icons.dart';
3import 'package:flutter/material.dart';
4import 'package:flutter_screenutil/flutter_screenutil.dart';
5import '../../../common/enums/collection_priority.dart';
6import '../../theme/color_palette.dart';
7import '../../../common/enums/collection_status.dart';
8import '../../../common/entities/collection_entity.dart';
9import '../collection_badges/collection_status_badge.dart';
10import '../collection_badges/collection_priority_badge.dart';
11import 'collection_info_row.dart';
25 required this.collection,
27 required this.showNumber,
28 this.isCompleted =
false,
29 this.isPending =
false,
30 this.hidePriority =
false,
31 this.hideStatus =
false,
32 this.isHistory =
false,
36 Widget
build(BuildContext context) {
38 margin: EdgeInsets.fromLTRB(16.sp, 8.sp, 16.sp, 8.sp),
39 decoration: BoxDecoration(
41 borderRadius: BorderRadius.circular(20),
46 offset:
const Offset(0, 5),
59 decoration: BoxDecoration(
60 shape: BoxShape.circle,
70 style: Theme.of(context).textTheme.titleSmall!.copyWith(
72 fontWeight: FontWeight.w600,
80 crossAxisAlignment: CrossAxisAlignment.start,
84 style: Theme.of(context).textTheme.titleMedium!.copyWith(
86 fontWeight: FontWeight.w500,
91 "CV Reference: ${collection.reference ?? "--
"}",
92 style: Theme.of(context).textTheme.titleSmall!.copyWith(
99 style: Theme.of(context).textTheme.titleSmall!.copyWith(
114 crossAxisAlignment: CrossAxisAlignment.end,
128 Divider(height: 1.sp),
130 padding: EdgeInsets.all(16.sp),
134 label:
'collection_card.address'.tr(),
136 icon: FluentIcons.location_12_regular,
140 label:
isHistory ?
'collection_card.declared_quantity'.tr() :
'collection_card.quantity'.tr(),
142 icon: FluentIcons.drop_12_regular,
146 label:
'collection_card.collected_quantity'.tr(),
148 icon: FluentIcons.drop_12_regular,
150 label:
'collection_card.time_slot'.tr(),
151 value:
"${collection.startTime ?? 'N/A'} - ${collection.endTime ?? 'N/A'}",
152 icon: FluentIcons.clock_12_regular,
163 if (
volume == null)
return "--";
164 double volumeValue =
volume is
double ?
volume :
double.tryParse(
volume.toString()) ?? 0.0;
165 if (volumeValue > 999) {
166 return '${(volumeValue / 1000).toStringAsFixed(2)} MT';
168 return '$volumeValue KG';
173 if (
isCompleted)
return "${'collection_card.done_on'.tr()} ${collection.datePlanned}";
174 if (
isPending)
return "${'collection_card.scheduled_for'.tr()} ${collection.datePlanned}";
175 return '${collection.datePlanned} | ${collection.slot}';
style Text( '${ 'scheduling.reference'.tr()}:${collection.internalCode}', style:Theme.of(context).textTheme.bodySmall,)
style SizedBox(height:2.h)
style Column(crossAxisAlignment:CrossAxisAlignment.end, children:[Container(padding:EdgeInsets.symmetric(horizontal:8.w, vertical:4.h), decoration:BoxDecoration(color:ColorPalette.tiffanyBlue.withValues(alpha:0.1), borderRadius:BorderRadius.circular(12),), child:Text(collection.type ?? '', style:Theme.of(context).textTheme.bodySmall?.copyWith(color:ColorPalette.tiffanyBlue, fontWeight:FontWeight.bold,),),),],)