Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
scanned_drums_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 ScannedDrumsSection extends StatelessWidget {
8 final List<String> recoveredDrums;
9 final List<String> depositedDrums;
10
12 super.key,
13 required this.recoveredDrums,
14 required this.depositedDrums,
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 crossAxisAlignment: CrossAxisAlignment.start,
35 children: [
36 _buildDrumsList('confirmation.recovered_drums'.tr(), recoveredDrums, context),
37 SizedBox(height: 16.sp),
38 _buildDrumsList('confirmation.deposited_drums'.tr(), depositedDrums, context),
39 ],
40 ),
41 );
42 }
43
44 Widget _buildDrumsList(String title, List<String> drums, BuildContext context) {
45 return Column(
46 crossAxisAlignment: CrossAxisAlignment.start,
47 children: [
48 Row(
49 mainAxisAlignment: MainAxisAlignment.spaceBetween,
50 children: [
51 Text(
52 title,
53 style: Theme.of(context).textTheme.titleSmall!.copyWith(
55 ),
56 ),
57 Container(
58 padding: EdgeInsets.symmetric(horizontal: 8.sp, vertical: 4.sp),
59 decoration: BoxDecoration(
60 color: ColorPalette.grey.withValues(alpha: 0.15),
61 borderRadius: BorderRadius.circular(12),
62 ),
63 child: Text(
64 '${drums.length} scanned',
65 style: Theme.of(context).textTheme.titleSmall!.copyWith(
66 fontSize: 12.sp,
67 color: ColorPalette.darkGrey.withValues(alpha: 0.8),
68 ),
69 ),
70 ),
71 ],
72 ),
73 SizedBox(height: 8.sp),
74 Wrap(
75 spacing: 8.sp,
76 runSpacing: 8.sp,
77 children: drums.map(
78 (drum) => Container(
79 padding: EdgeInsets.symmetric(
80 horizontal: 12.sp,
81 vertical: 8.sp,
82 ),
83 decoration: BoxDecoration(
84 color: ColorPalette.lightGrey.withValues(alpha: 0.2),
85 borderRadius: BorderRadius.circular(8),
86 border: Border.all(color: ColorPalette.grey.withValues(alpha: 0.2)),
87 ),
88 child: Row(
89 mainAxisSize: MainAxisSize.min,
90 children: [
91 Icon(Icons.qr_code_2, size: 16.sp, color: ColorPalette.grey),
92 SizedBox(width: 8.sp),
93 Text(drum),
94 ],
95 ),
96 ),
97 ).toList(),
98 ),
99 ],
100 );
101 }
102}
static const darkGrey
static const black
static const lightGrey
static const white
static const grey
Widget _buildDrumsList(String title, List< String > drums, BuildContext context)
final List< String > recoveredDrums
final List< String > depositedDrums
final String title
final Widget child
override Widget build(BuildContext context)
const ScannedDrumsSection({ super.key, required this.recoveredDrums, required this.depositedDrums, })
final EdgeInsets padding
final DrumScan drum
Definition scan_card.dart:9
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,),),),],)