Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
statistics_card_shimmer.dart
Go to the documentation of this file.
1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3import 'package:shimmer/shimmer.dart';
4
5import '../../../../../core/ui/theme/color_palette.dart';
6
7class StatisticsCardShimmer extends StatelessWidget {
8 const StatisticsCardShimmer({super.key});
9
10 @override
11 Widget build(BuildContext context) {
12 return Shimmer.fromColors(
13 baseColor: Colors.grey[300]!,
14 highlightColor: Colors.grey[100]!,
15 child: Container(
16 decoration: BoxDecoration(
18 borderRadius: BorderRadius.circular(24),
19 boxShadow: [
20 BoxShadow(
21 color: ColorPalette.black.withValues(alpha: 0.05),
22 blurRadius: 20,
23 offset: const Offset(0, 10),
24 ),
25 ],
26 ),
27 child: Row(
28 crossAxisAlignment: CrossAxisAlignment.start,
29 children: [
30 Expanded(
32 ),
33 const SizedBox(width: 6),
34 Container(
35 width: 1,
36 height: 230.sp,
37 color: ColorPalette.grey.withValues(alpha: 0.2),
38 ),
39 const SizedBox(width: 6),
40 Expanded(
41 child: _buildShimmerCard(showSecondaryValue: false),
42 ),
43 ],
44 ),
45 ),
46 );
47 }
48
49 Widget _buildShimmerCard({bool showSecondaryValue = true}) {
50 return Container(
51 padding: const EdgeInsets.all(20),
53 crossAxisAlignment: CrossAxisAlignment.start,
54 children: [
55 Container(
56 width: 48,
57 height: 48,
58 decoration: BoxDecoration(
59 color: Colors.white,
60 borderRadius: BorderRadius.circular(12),
61 ),
62 ),
63 const SizedBox(height: 16),
64 Container(
65 width: 100,
66 height: 12,
67 decoration: BoxDecoration(
68 color: Colors.white,
69 borderRadius: BorderRadius.circular(4),
70 ),
71 ),
72 const SizedBox(height: 8),
73 Row(
74 children: [
75 Container(
76 width: 60,
77 height: 28,
78 decoration: BoxDecoration(
79 color: Colors.white,
80 borderRadius: BorderRadius.circular(4),
81 ),
82 ),
83 const SizedBox(width: 4),
84 Container(
85 width: 40,
86 height: 20,
87 decoration: BoxDecoration(
88 color: Colors.white,
89 borderRadius: BorderRadius.circular(4),
90 ),
91 ),
92 ],
93 ),
94 const SizedBox(height: 4),
95 Container(
96 width: 80,
97 height: 14,
98 decoration: BoxDecoration(
99 color: Colors.white,
100 borderRadius: BorderRadius.circular(4),
101 ),
102 ),
103 if (showSecondaryValue) ...[
104 const SizedBox(height: 12),
105 Container(
106 width: double.infinity,
107 height: 30,
108 decoration: BoxDecoration(
109 color: Colors.white,
110 borderRadius: BorderRadius.circular(8),
111 ),
112 ),
113 ],
114 ],
115 ),
116 );
117 }
118}
static const black
static const white
static const grey
Widget _buildShimmerCard({bool showSecondaryValue=true})
final Widget child
const StatisticsCardShimmer({super.key})
override Widget build(BuildContext context)
final Widget child
final EdgeInsets padding
final Color color
Definition failures.dart:1
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,),),),],)