Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
stats_card.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 '../theme/color_palette.dart';
6
7class StatsCard extends StatelessWidget {
8 final String title;
9 final String number;
11 final LinearGradient gradient;
12 final String? unit;
13
14 const StatsCard({
15 super.key,
16 required this.title,
17 required this.number,
18 required this.subtitle,
19 required this.gradient,
20 this.unit,
21 });
22
23 @override
24 Widget build(BuildContext context) {
25 return Container(
26 padding: EdgeInsets.symmetric(horizontal: 17.sp, vertical: 16.sp),
27 decoration: BoxDecoration(
29 borderRadius: BorderRadius.circular(20),
30 boxShadow: [
31 BoxShadow(
32 color: gradient.colors.first.withValues(alpha:0.25),
33 blurRadius: 20,
34 offset: const Offset(0, 8),
35 ),
36 ],
37 ),
39 crossAxisAlignment: CrossAxisAlignment.start,
40 children: [
41 Row(
42 mainAxisAlignment: MainAxisAlignment.spaceBetween,
43 children: [
44 Text(
45 title,
46 style: Theme.of(context).textTheme.titleMedium!.copyWith(
47 fontSize: 13.sp,
49 fontWeight: FontWeight.w600,
50 ),
51 ),
52 Container(
53 padding: EdgeInsets.symmetric(horizontal: 10.sp, vertical: 5.sp),
54 decoration: BoxDecoration(
55 color: ColorPalette.white.withValues(alpha:0.15),
56 borderRadius: BorderRadius.circular(12),
57 ),
58 child: Text(
60 style: Theme.of(context).textTheme.labelLarge!.copyWith(
62 fontWeight: FontWeight.bold,
63 ),
64 ),
65 ),
66 ],
67 ),
68 SizedBox(height: 3.sp),
69 Row(
70 crossAxisAlignment: CrossAxisAlignment.end,
71 children: [
72 Text(
73 number,
74 style: Theme.of(context).textTheme.headlineSmall!.copyWith(
76 fontWeight: FontWeight.w700,
77 ),
78 ),
79 SizedBox(width: 5.sp),
80 Padding(
81 padding: EdgeInsets.only(bottom: 5.sp),
82 child: Text(
83 unit ?? "${"common.collection".tr()}${number == '0' ? '' : context.locale == Locale('en') ? 's' : ''}",
84 style: Theme.of(context).textTheme.titleSmall!.copyWith(
85 color: ColorPalette.white.withValues(alpha:0.8),
86 fontWeight: FontWeight.w500,
87 ),
88 ),
89 ),
90 ],
91 ),
92 ],
93 ),
94 );
95 }
96}
static const white
final String title
final Widget child
final LinearGradient gradient
override Widget build(BuildContext context)
const StatsCard({ super.key, required this.title, required this.number, required this.subtitle, required this.gradient, this.unit, })
final String unit
final EdgeInsets padding
final String subtitle
class Partner String
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,),),),],)