Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
wallet_screen.dart
Go to the documentation of this file.
1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3import 'package:easy_localization/easy_localization.dart';
4
5import '../../core/ui/theme/color_palette.dart';
6import '../../core/ui/widgets/custom_scaffold.dart';
7
8class WalletScreen extends StatelessWidget {
9 const WalletScreen({super.key});
10
11 @override
12 Widget build(BuildContext context) {
13 return CustomScaffold(
14 title: "wallet.title".tr(),
15 backgroundColor: ColorPalette.antiFlashWhite,
16 body: CustomScrollView(
17 slivers: [
18 SliverToBoxAdapter(
19 child: Padding(
20 padding: EdgeInsets.all(16.sp),
22 crossAxisAlignment: CrossAxisAlignment.start,
23 children: [
24 // Balance Card
25 Container(
26 width: double.infinity,
27 decoration: BoxDecoration(
28 gradient: LinearGradient(
29 begin: Alignment.topLeft,
30 end: Alignment.bottomRight,
31 colors: [
32 ColorPalette.darkGreen.withValues(alpha:0.8),
33 ColorPalette.darkGreen.withValues(alpha:0.8),
34 // ColorPalette.darkGreen.withValues(alpha:0.8),
35 ],
36 ),
37 borderRadius: BorderRadius.circular(24),
38 boxShadow: [
39 BoxShadow(
40 color: ColorPalette.lightGreen.withValues(alpha:0.3),
41 blurRadius: 20,
42 offset: const Offset(0, 10),
43 ),
44 ],
45 ),
46 child: Stack(
47 children: [
48 // Background Pattern
49 Positioned(
50 right: -50.sp,
51 top: -50.sp,
52 child: Container(
53 width: 200.sp,
54 height: 200.sp,
55 decoration: BoxDecoration(
56 color: Colors.white.withValues(alpha:0.1),
57 shape: BoxShape.circle,
58 ),
59 ),
60 ),
61 // Content
62 Padding(
63 padding: EdgeInsets.all(24.sp),
65 crossAxisAlignment: CrossAxisAlignment.center,
66 children: [
67 Text(
68 'wallet.total_balance'.tr(),
69 style: TextStyle(
70 color: Colors.white,
71 fontWeight: FontWeight.w600,
72 fontSize: 16,
73 ),
74 ),
75 SizedBox(height: 8.sp),
76 Row(
77 crossAxisAlignment: CrossAxisAlignment.end,
78 mainAxisAlignment: MainAxisAlignment.center,
79 children: [
80 const Text(
81 '0',
82 style: TextStyle(
83 color: Colors.white,
84 fontSize: 40,
85 fontWeight: FontWeight.bold,
86 ),
87 ),
88 SizedBox(width: 8.sp),
89 Padding(
90 padding: EdgeInsets.only(bottom: 8.sp),
91 child: Text(
92 'wallet.currency'.tr(),
93 style: TextStyle(
94 color: Colors.white70,
95 fontSize: 16,
96 ),
97 ),
98 ),
99 ],
100 ),
101 SizedBox(height: 10.sp),
102 Container(
103 padding: EdgeInsets.all(10.sp),
104 decoration: BoxDecoration(
105 color: Colors.black.withValues(alpha:0.1),
106 borderRadius: BorderRadius.circular(16),
107 ),
108 child: Row(
109 mainAxisAlignment: MainAxisAlignment.spaceAround,
110 children: [
112 icon: Icons.arrow_upward,
113 amount: '0',
114 label: 'wallet.income'.tr(),
115 isIncome: true,
116 ),
117 SizedBox(
118 height: 40.sp,
119 child: const VerticalDivider(
120 color: Colors.white24,
121 thickness: 1,
122 ),
123 ),
125 icon: Icons.arrow_downward,
126 amount: '0',
127 label: 'wallet.expense'.tr(),
128 isIncome: false,
129 ),
130 ],
131 ),
132 ),
133 ],
134 ),
135 ),
136 ],
137 ),
138 ),
139 const SizedBox(height: 32),
140 // Recent Transactions Section
141 Row(
142 mainAxisAlignment: MainAxisAlignment.spaceBetween,
143 children: [
144 Text(
145 'wallet.recent_transactions'.tr(),
146 style: TextStyle(
147 fontSize: 20.sp,
148 fontWeight: FontWeight.bold,
149 ),
150 ),
151 TextButton(
152 onPressed: () {},
153 child: Text('wallet.see_all'.tr()),
154 ),
155 ],
156 ),
157 SizedBox(height: 16.sp),
158 // Empty State
159 Container(
160 width: double.infinity,
161 padding: EdgeInsets.all(32.sp),
162 decoration: BoxDecoration(
163 color: Colors.white,
164 borderRadius: BorderRadius.circular(24),
165 boxShadow: [
166 BoxShadow(
167 color: Colors.black.withValues(alpha:0.05),
168 blurRadius: 20,
169 offset: const Offset(0, 10),
170 ),
171 ],
172 ),
173 child: Column(
174 children: [
175 Container(
176 padding: EdgeInsets.all(16.sp),
177 decoration: BoxDecoration(
178 color: Colors.grey[100],
179 shape: BoxShape.circle,
180 ),
181 child: Icon(
182 Icons.receipt_long,
183 size: 32.sp,
184 color: Colors.grey[400],
185 ),
186 ),
187 SizedBox(height: 16.sp),
188 Text(
189 'wallet.no_transactions'.tr(),
190 style: TextStyle(
191 fontSize: 16.sp,
192 color: Colors.grey[600],
193 fontWeight: FontWeight.w500,
194 ),
195 ),
196 SizedBox(height: 8.sp),
197 Text(
198 'wallet.transactions_will_appear'.tr(),
199 style: TextStyle(
200 fontSize: 14.sp,
201 color: Colors.grey[400],
202 ),
203 ),
204 ],
205 ),
206 ),
207 ],
208 ),
209 ),
210 ),
211 ],
212 ),
213 );
214 }
215}
216
218 final IconData icon;
221 final bool isIncome;
222
224 required this.icon,
225 required this.amount,
226 required this.label,
227 required this.isIncome,
228 });
229
230 @override
231 Widget build(BuildContext context) {
232 return Column(
233 children: [
234 Container(
235 padding: EdgeInsets.all(3.sp),
236 decoration: BoxDecoration(
237 color: isIncome ? ColorPalette.lightGreen.withValues(alpha:0.7) : ColorPalette.red.withValues(alpha:0.7),
238 shape: BoxShape.circle,
239 ),
240 child: Icon(icon, color: ColorPalette.white, size: 18.sp),
241 ),
242 SizedBox(height: 5.sp),
243 Row(
244 children: [
245 Text(
246 isIncome ? '+' : '-',
247 style: TextStyle(
248 color: Colors.white,
249 fontSize: 15.sp,
250 fontWeight: FontWeight.bold,
251 ),
252 ),
253 Text(
254 ' $amount ${isIncome ? 'wallet.currency'.tr() : 'wallet.currency'.tr()}',
255 style: TextStyle(
256 color: Colors.white,
257 fontSize: 15.sp,
258 fontWeight: FontWeight.bold,
259 ),
260 ),
261 ],
262 ),
263 Text(
264 label,
265 style: TextStyle(
266 color: Colors.white70,
267 fontSize: 13.sp,
268 ),
269 ),
270 ],
271 );
272 }
273}
static const lightGreen
static const red
static const white
static const antiFlashWhite
static const darkGreen
final VoidCallback onPressed
const WalletScreen({super.key})
final String title
final Widget child
final LinearGradient gradient
override Widget build(BuildContext context)
final EdgeInsets padding
final Widget child
final EdgeInsets padding
class Partner String
final Color color
Definition failures.dart:1
wallet
Definition routes.dart:76
final String amount
final bool isIncome
final String label
const _TransactionSummaryItem({ required this.icon, required this.amount, required this.label, required this.isIncome, })
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,),),),],)