Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
station_card.dart
Go to the documentation of this file.
1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3
4import '../../../../core/UI/theme/color_palette.dart';
5import '../../../models/driver_request.dart';
6
7class StationCard extends StatelessWidget {
9
11 super.key,
12 required this.station,
13 });
14
15 @override
16 Widget build(BuildContext context) {
17 return Container(
18 margin: EdgeInsets.only(bottom: 16.h),
19 decoration: BoxDecoration(
20 gradient: LinearGradient(
21 begin: Alignment.topLeft,
22 end: Alignment.bottomRight,
23 colors: [
25 ColorPalette.lightGrey.withValues(alpha: 0.3),
26 ],
27 ),
28 borderRadius: BorderRadius.circular(16.r),
29 boxShadow: [
30 BoxShadow(
31 color: ColorPalette.lightGreen.withValues(alpha: 0.05),
32 blurRadius: 8,
33 offset: const Offset(0, 2),
34 spreadRadius: 0,
35 ),
36 ],
37 ),
38 child: Padding(
39 padding: EdgeInsets.all(16.sp),
41 crossAxisAlignment: CrossAxisAlignment.start,
42 children: [
43 // Header with station icon and quantity
44 Row(
45 children: [
46 Container(
47 padding: EdgeInsets.all(10.sp),
48 decoration: BoxDecoration(
49 gradient: LinearGradient(
50 colors: [
51 ColorPalette.lightGreen.withValues(alpha: 0.1),
52 ColorPalette.lightGreen.withValues(alpha: 0.05),
53 ],
54 ),
55 borderRadius: BorderRadius.circular(12.r),
56 border: Border.all(
57 color: ColorPalette.lightGreen.withValues(alpha: 0.2),
58 width: 1,
59 ),
60 ),
61 child: Icon(
62 Icons.local_gas_station,
63 size: 18.sp,
65 ),
66 ),
67 SizedBox(width: 12.w),
68 Expanded(
70 crossAxisAlignment: CrossAxisAlignment.start,
71 children: [
72 Text(
73 station.name,
74 style: TextStyle(
75 fontSize: 14.sp,
76 fontWeight: FontWeight.w700,
78 height: 1.2,
79 ),
80 ),
81 SizedBox(height: 2.h),
82 Text(
83 'Station ID: ${station.id}',
84 style: TextStyle(
85 fontSize: 10.sp,
87 fontWeight: FontWeight.w500,
88 ),
89 ),
90 ],
91 ),
92 ),
93 Container(
94 padding:
95 EdgeInsets.symmetric(horizontal: 10.w, vertical: 6.h),
96 decoration: BoxDecoration(
97 gradient: LinearGradient(
98 colors: [
100 ColorPalette.lightGreen.withValues(alpha: 0.8),
101 ],
102 ),
103 borderRadius: BorderRadius.circular(20.r),
104 boxShadow: [
105 BoxShadow(
106 color: ColorPalette.lightGreen.withValues(alpha: 0.3),
107 blurRadius: 8,
108 offset: const Offset(0, 2),
109 ),
110 ],
111 ),
112 child: Text(
113 '${station.quantityInLiters.toInt()}L',
114 style: TextStyle(
115 fontSize: 10.sp,
116 fontWeight: FontWeight.w700,
118 ),
119 ),
120 ),
121 ],
122 ),
123 SizedBox(height: 16.h),
124 // Location section
125 Container(
126 padding: EdgeInsets.all(6.sp),
127 child: Row(
128 children: [
129 Container(
130 padding: EdgeInsets.all(6.sp),
131 child: Icon(
132 Icons.location_on,
133 size: 12.sp,
134 ),
135 ),
136 SizedBox(width: 8.w),
137 Expanded(
138 child: Text(
139 station.address,
140 style: TextStyle(
141 fontSize: 11.sp,
143 fontWeight: FontWeight.w500,
144 height: 1.3,
145 ),
146 ),
147 ),
148 ],
149 ),
150 ),
151 ],
152 ),
153 ),
154 );
155 }
156}
static const darkGrey
static const lightGreen
static const lightGrey
static const white
static const grey
final Widget child
final LinearGradient gradient
override Widget build(BuildContext context)
final EdgeInsets padding
const StationCard({ super.key, required this.station, })
final Station station
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,),),),],)