Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
unloading_history_collection_item.dart
Go to the documentation of this file.
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 '../../../../../core/UI/widgets/show_documents_option.dart' show DocumentOption, showDocumentOptions;
6import '../../../../../core/services/documents_service.dart';
7import '../../../../../core/ui/theme/color_palette.dart';
8import '../../../../../core/ui/widgets/collection_item/collection_info_row.dart';
9
10class UnloadingHistoryCollectionItem extends StatelessWidget {
11 final int id;
12 final String number;
13 final Function(bool?)? onCheckboxChanged;
15 final String reference;
20
22 super.key,
23 required this.id,
24 required this.number,
25 this.onCheckboxChanged,
26 required this.status,
27 required this.reference,
28 required this.deliveryDate,
29 required this.quantityUnloaded,
30 required this.quantityWeighted,
31 required this.warehouseRepresentative,
32 });
33
34 @override
35 Widget build(BuildContext context) {
36 return GestureDetector(
37 onTap: () {
39 context,
40 [
41 // DocumentOption(
42 // icon: Icons.receipt_long_outlined,
43 // title: 'E-Manifest',
44 // color: ColorPalette.lightGreen,
45 // onTap: () {
46 // DocumentsService.instance.getManifestDocument('$id', context);
47 // },
48 // ),
50 icon: Icons.receipt_long_outlined,
51 title: 'unloading.documents.weightbridge_note'.tr(),
53 onTap: () {
54 DocumentsService.instance.getDeliveryVoucherDocument('$id', context);
55 },
56 ),
57 ],
58 );
59 },
60 child: Container(
61 margin: EdgeInsets.fromLTRB(16.sp, 8.sp, 16.sp, 8.sp),
62 decoration: BoxDecoration(
64 borderRadius: BorderRadius.circular(20),
65 boxShadow: [
66 BoxShadow(
67 color: ColorPalette.black.withValues(alpha: 0.04),
68 blurRadius: 15,
69 offset: const Offset(0, 5),
70 ),
71 ],
72 ),
74 children: [
75 Padding(
76 padding: EdgeInsets.all(16.sp),
77 child: Row(
78 children: [
79 Expanded(
81 crossAxisAlignment: CrossAxisAlignment.start,
82 children: [
83 Text(
84 "${"unloading.collection_info.dv_reference".tr()} : $reference",
85 style:
86 Theme.of(context).textTheme.titleMedium!.copyWith(
87 fontSize: 13.sp,
89 fontWeight: FontWeight.w600,
90 ),
91 ),
92 SizedBox(height: 4.sp),
93 Text(
94 "${'unloading.collection_info.delivered_on'.tr()} ${deliveryDate.split(' ')[0]}",
95 style:
96 Theme.of(context).textTheme.titleSmall!.copyWith(
98 ),
99 ),
100 SizedBox(height: 4.sp),
101 ],
102 ),
103 ),
104 // Collection Status Badge
105 Container(
106 padding: EdgeInsets.all(7.sp),
107 decoration: BoxDecoration(
108 color: ColorPalette.grey.withValues(alpha: 0.4),
109 borderRadius: BorderRadius.circular(25),
110 boxShadow: [
111 BoxShadow(
112 color: ColorPalette.black.withValues(alpha: 0.04),
113 blurRadius: 15,
114 offset: const Offset(0, 5),
115 ),
116 ],
117 ),
118 child: Text(
119 status,
120 style: Theme.of(context).textTheme.titleSmall!.copyWith(
121 fontSize: 12.sp,
123 fontWeight: FontWeight.w500,
124 ),
125 ),
126 )
127 ],
128 ),
129 ),
130 Divider(height: 1.sp),
131 Padding(
132 padding: EdgeInsets.all(16.sp),
133 child: Column(
134 children: [
136 label: 'unloading.collection_info.quantity_unloaded'.tr(),
137 value: '$quantityUnloaded KG',
138 icon: FluentIcons.drop_12_regular,
139 ),
140 SizedBox(height: 12.sp),
142 label: 'unloading.collection_info.quantity_weighted'.tr(),
143 value: '$quantityWeighted KG',
144 icon: FluentIcons.scales_20_regular,
145 ),
146 SizedBox(height: 12.sp),
148 label: 'unloading.collection_info.warehouse_rep'.tr(),
150 icon: FluentIcons.home_split_20_filled,
151 )
152 ],
153 ),
154 ),
155 ],
156 ),
157 ),
158 );
159 }
160}
static const darkGrey
static const black
static const white
static const orange
static const grey
final Function(bool?)? onCheckboxChanged
final VoidCallback onTap
final String title
final Widget child
override Widget build(BuildContext context)
final CollectionStatus status
const UnloadingHistoryCollectionItem({ super.key, required this.id, required this.number, this.onCheckboxChanged, required this.status, required this.reference, required this.deliveryDate, required this.quantityUnloaded, required this.quantityWeighted, required this.warehouseRepresentative, })
const CollectionInfoRow({ super.key, required this.label, required this.value, required this.icon, })
final EdgeInsets padding
class Partner String
class DocumentOption showDocumentOptions(BuildContext context, List< DocumentOption > options,)
DocumentOption({ required this.icon, required this.title, required this.color, required this.onTap, })
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,),),),],)