Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
metric_card.dart
Go to the documentation of this file.
1import '/core/ui/widgets/custom_card.dart';
2import 'package:flutter/material.dart';
3import 'package:flutter_screenutil/flutter_screenutil.dart';
4
5class MetricCard extends StatelessWidget {
6 const MetricCard({
7 super.key,
8 required this.title,
9 required this.image,
10 required this.amount,
11 required this.subtitle,
12 required this.color,
13 });
14
15 final String title;
16 final String image;
17 final String amount;
18 final String subtitle;
19 final Color color;
20
21 @override
22 Widget build(BuildContext context) {
23 return CustomCard(
24 padding: EdgeInsets.symmetric(horizontal: 10.sp),
25 child: Column(
26 crossAxisAlignment: CrossAxisAlignment.center,
27 mainAxisAlignment: MainAxisAlignment.center,
28 mainAxisSize: MainAxisSize.min,
29 children: [
30 // Text(
31 // title,
32 // textAlign: TextAlign.center,
33 // style: Theme.of(context).textTheme.bodySmall?.copyWith(
34 // fontSize: 9.sp,
35 // ),
36 // ),
37 // SizedBox(height: 10.sp),
38 Image.asset(
39 image,
40 height: 40.sp,
41 ),
42 SizedBox(height: 6.sp),
43 FittedBox(
44 fit: BoxFit.scaleDown,
45 child: Text(
46 amount,
47 style: Theme.of(context).textTheme.bodySmall,
48 ),
49 ),
50 SizedBox(height: 3.sp),
51 Opacity(
52 opacity: 0.7,
53 child: Text(
55 textAlign: TextAlign.center,
56 style: Theme.of(context).textTheme.bodySmall?.copyWith(
57 fontSize: 9.sp,
58 ),
59 ),
60 ),
61 ],
62 ),
63 );
64 }
65}
final String amount
final String image
final String title
const CustomCard({ super.key, required this.child, this.padding, this.bgColor, })
final Widget child
override Widget build(BuildContext context)
const MetricCard({ super.key, required this.title, required this.image, required this.amount, required this.subtitle, required this.color, })
final String subtitle
final Color color
Definition failures.dart:1
final String title