Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
volume_info_section.dart
Go to the documentation of this file.
1import 'package:easy_localization/easy_localization.dart';
2import 'package:flutter/material.dart';
3import 'package:flutter_screenutil/flutter_screenutil.dart';
4
5import '../../../../../../core/ui/theme/color_palette.dart';
6
7class VolumeInfoSection extends StatelessWidget {
10
12 super.key,
13 required this.declaredVolume,
14 required this.collectedVolume,
15 });
16
17 @override
18 Widget build(BuildContext context) {
19 return Row(
20 mainAxisAlignment: MainAxisAlignment.spaceBetween,
21 children: [
22 _buildVolumeInfo(context, 'full_fill_collection.declared_quantity'.tr(), declaredVolume),
23 Container(
24 height: 50.sp,
25 width: 1.sp,
26 color: ColorPalette.grey.withValues(alpha: 0.3),
27 ),
28 _buildVolumeInfo(context, 'full_fill_collection.collected_quantity'.tr(), collectedVolume),
29 ],
30 );
31 }
32
33 Widget _buildVolumeInfo(BuildContext context, String title, String value) {
34 return Container(
35 margin: EdgeInsets.symmetric(horizontal: 16.sp),
36 child: Padding(
37 padding: EdgeInsets.all(12.sp),
39 children: [
40 Text(
41 title,
42 style: Theme.of(context).textTheme.titleSmall,
43 ),
44 SizedBox(height: 4.sp),
45 Text(
47 style: Theme.of(context).textTheme.titleSmall?.copyWith(
49 fontWeight: FontWeight.w600,
50 ),
51 ),
52 ],
53 ),
54 ),
55 );
56 }
57
59 if (volume == null) return "--";
60 double volumeValue = volume is double ? volume : double.tryParse(volume.toString()) ?? 0.0;
61 if (volumeValue > 999) {
62 return '${(volumeValue / 1000).toStringAsFixed(2)} MT';
63 } else {
64 return '$volumeValue KG';
65 }
66 }
67
68}
static const darkGreen
static const grey
String formatVolume(dynamic volume)
Widget _buildVolumeInfo(BuildContext context, String title, String value)
final String title
final Widget child
override Widget build(BuildContext context)
final String declaredVolume
final EdgeInsets padding
const VolumeInfoSection({ super.key, required this.declaredVolume, required this.collectedVolume, })
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,),),),],)