Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
status_card_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 StatusCardSection extends StatelessWidget {
10 final double? collectedVolume;
12 super.key,
13 required this.reference,
14 required this.collectedVolume,
15 });
16
17 @override
18 Widget build(BuildContext context) {
19 return Container(
20 width: double.infinity,
21 padding: EdgeInsets.all(20.sp),
22 decoration: BoxDecoration(
24 borderRadius: BorderRadius.circular(20),
25 boxShadow: [
26 BoxShadow(
27 color: ColorPalette.black.withValues(alpha:0.05),
28 blurRadius: 10,
29 offset: const Offset(0, 4),
30 ),
31 ],
32 ),
34 children: [
36 icon: FluentIcons.qr_code_20_filled,
37 title: 'confirmation.cv_reference'.tr(),
38 value: reference ?? '--',
39 iconColor: ColorPalette.grey,
40 context: context,
41 ),
42 const Divider(height: 24),
44 icon: FluentIcons.drop_12_filled,
45 title: 'confirmation.collected_quantity'.tr(),
47 iconColor: ColorPalette.grey,
48 context: context,
49 ),
50 ],
51 ),
52 );
53 }
54
56 required IconData icon,
57 required String title,
58 required String value,
59 required Color iconColor,
60 required BuildContext context,
61 }) {
62 return Row(
63 children: [
64 Container(
65 padding: EdgeInsets.all(8.sp),
66 decoration: BoxDecoration(
67 color: iconColor.withValues(alpha: 0.1),
68 borderRadius: BorderRadius.circular(8),
69 ),
70 child: Icon(icon, color: iconColor, size: 20.sp),
71 ),
72 SizedBox(width: 12.sp),
73 Expanded(
75 crossAxisAlignment: CrossAxisAlignment.start,
76 children: [
77 Text(
78 title,
79 style: Theme.of(context).textTheme.titleSmall!.copyWith(
81 ),
82 ),
83 SizedBox(height: 2.sp),
84 Text(
85 value,
86 style: Theme.of(context).textTheme.titleSmall!.copyWith(
88 ),
89 ),
90 ],
91 ),
92 ),
93 ],
94 );
95 }
96
98 if (volume == null) return "--";
99 double volumeValue = volume is double ? volume : double.tryParse(volume.toString()) ?? 0.0;
100 if (volumeValue > 999) {
101 return '${(volumeValue / 1000).toStringAsFixed(2)} MT';
102 } else {
103 return '$volumeValue KG';
104 }
105 }
106}
static const darkGrey
static const black
static const white
static const grey
String formatVolume(dynamic volume)
const StatusCardSection({ super.key, required this.reference, required this.collectedVolume, })
final String title
final Widget child
override Widget build(BuildContext context)
Widget _buildInfoRow({ required IconData icon, required String title, required String value, required Color iconColor, required BuildContext context, })
final EdgeInsets padding
final Widget child
final EdgeInsets padding
class Partner String
final Color color
Definition failures.dart:1
final String title
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,),),),],)