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 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3
4class MetricCardv2 extends StatelessWidget {
6 super.key,
7 required this.title,
8 required this.image,
9 required this.amount,
10 required this.subtitle,
11 required this.color,
12 });
13
14 final String title;
15 final String image;
16 final String amount;
17 final String subtitle;
18 final Color color;
19
20 @override
21 Widget build(BuildContext context) {
22 return Container(
23 padding: EdgeInsets.all(20.sp),
24 decoration: BoxDecoration(
25 borderRadius: BorderRadius.circular(10),
26 color: Theme.of(context).colorScheme.surface,
27 ),
28 child: Column(
29 crossAxisAlignment: CrossAxisAlignment.center,
30 mainAxisAlignment: MainAxisAlignment.center,
31 mainAxisSize: MainAxisSize.min,
32 children: [
33 Text(
34 title,
35 textAlign: TextAlign.center,
36 style: Theme.of(context).textTheme.bodySmall,
37 ),
38 SizedBox(height: 12.sp),
39 Image.asset(
40 image,
41 height: 80.sp,
42 ),
43 SizedBox(height: 12.sp),
44 FittedBox(
45 fit: BoxFit.scaleDown,
46 child: Text(
47 amount,
48 style: Theme.of(context).textTheme.displaySmall,
49 ),
50 ),
51 Text(
53 textAlign: TextAlign.center,
54 style: Theme.of(context).textTheme.bodySmall?.copyWith(
55 color: Theme.of(context).hintColor,
56 ),
57 ),
58 ],
59 ),
60 );
61 }
62}
final String amount
final String image
final String title
final Widget child
override Widget build(BuildContext context)
const MetricCardv2({ super.key, required this.title, required this.image, required this.amount, required this.subtitle, required this.color, })
final String subtitle
final String title