Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
details_section.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';
5
6import '../../../../../../core/ui/theme/color_palette.dart';
7
8class DetailsSection extends StatelessWidget {
13
15 super.key,
16 required this.address,
17 required this.cRReference,
18 required this.volume,
19 required this.instructions,
20
21 });
22
23 @override
24 Widget build(BuildContext context) {
25 return Container(
26 padding: EdgeInsets.all(20.sp),
27 decoration: BoxDecoration(
29 borderRadius: BorderRadius.circular(20),
30 boxShadow: [
31 BoxShadow(
32 color: ColorPalette.black.withValues(alpha:0.05),
33 blurRadius: 10,
34 offset: const Offset(0, 2),
35 ),
36 ],
37 ),
39 children: [
41 context,
42 FluentIcons.location_24_filled,
43 'collection_card.address'.tr(),
44 address,
45 ),
46 SizedBox(height: 16.h),
48 context,
49 FluentIcons.qr_code_24_filled,
50 'collection_card.cr_reference'.tr(),
52 ),
53 SizedBox(height: 16.h),
55 context,
56 FluentIcons.drop_12_filled,
57 'collection_card.declared_quantity'.tr(),
59 ),
60 SizedBox(height: 16.h),
62 context,
63 FluentIcons.list_16_filled,
64 'collection_card.instructions'.tr(),
66 ),
67 ],
68 ),
69 );
70 }
71
73 BuildContext context,
74 IconData icon,
76 String content,
77 ) {
78 return Row(
79 children: [
80 Container(
81 padding: EdgeInsets.all(12.sp),
82 decoration: BoxDecoration(
83 color: ColorPalette.lightGreen.withValues(alpha:0.1),
84 borderRadius: BorderRadius.circular(16),
85 ),
86 child: Icon(
87 icon,
89 size: 20.sp,
90 ),
91 ),
92 SizedBox(width: 16.w),
93 Expanded(
95 crossAxisAlignment: CrossAxisAlignment.start,
96 children: [
97 Text(
98 title,
99 style: Theme.of(context).textTheme.titleSmall?.copyWith(
101 ),
102 ),
103 SizedBox(height: 4.h),
104 Text(
105 content,
106 style: Theme.of(context).textTheme.displaySmall?.copyWith(
108 fontWeight: FontWeight.w400,
109 ),
110 ),
111 ],
112 ),
113 ),
114 ],
115 );
116 }
117
119 if (volume == null) return "--";
120 double volumeValue = volume is double ? volume : double.tryParse(volume.toString()) ?? 0.0;
121 if (volumeValue > 999) {
122 return '${(volumeValue / 1000).toStringAsFixed(2)} MT';
123 } else {
124 return '$volumeValue KG';
125 }
126 }
127}
static const lightGreen
static const black
static const white
static const darkGreen
static const grey
String formatVolume(dynamic volume)
final String cRReference
final String title
final String instructions
final Widget child
override Widget build(BuildContext context)
final String address
const DetailsSection({ super.key, required this.address, required this.cRReference, required this.volume, required this.instructions, })
final EdgeInsets padding
Widget _buildDetailItem(BuildContext context, IconData icon, String title, String content,)
class Partner String
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,),),),],)