Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
environmental_dashboard_cards.dart
Go to the documentation of this file.
1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
4import 'package:intl/intl.dart';
5
6import '../../../../../core/constants/assets.dart';
7import '../../../domain/entities/environmental_dashboard_entity.dart';
8import 'metric_card.dart';
9
10class EnvironmentalDashboardCards extends StatelessWidget {
11 const EnvironmentalDashboardCards({super.key, required this.entity});
12
13 final ColorMetricsEntity? entity;
14
15 @override
16 Widget build(BuildContext context) {
17 return StaggeredGrid.count(
18 crossAxisCount: 2,
19 mainAxisSpacing: 10,
20 crossAxisSpacing: 10,
21 children: [
23 title: 'YOU HAVE PREVENTED',
25 amount: '${NumberFormat.compact().format(entity?.blue ?? 0)} M3',
26 subtitle: 'YOU HAVE PREVENTED\nWATER BEING POLLUTED',
27 color: Colors.blue,
28 ),
29 SizedBox(width: 10.sp),
31 title: '',
33 amount: '${NumberFormat.compact().format(entity?.green ?? 0)} KG',
34 subtitle: 'YOU HAVE PRESERVED\nWOOD BEING SAVED.',
35 color: Colors.green,
36 ),
37 SizedBox(width: 10.sp),
39 title: 'YOU HAVE HELPED TO CREATE',
41 amount: '${NumberFormat.compact().format(entity?.orange ?? 0)} L',
42 subtitle: 'YOU HAVE HELPED TO\nCREATE SOME BIOFUEL',
43 color: Colors.amber,
44 ),
45 SizedBox(width: 10.sp),
47 title: 'YOU HAVE AVOIDED',
49 amount: '${NumberFormat.compact().format(entity?.gray ?? 0)} KG',
50 subtitle: 'YOU HAVE AVOIDED\nCO₂ BEING EMITTED.',
51 color: Colors.grey,
52 ),
53 SizedBox(width: 15.sp),
54 ],
55 );
56 }
57}
static const String bioFuelImage
Definition assets.dart:4
static const String woodImage
Definition assets.dart:7
static const String waterImage
Definition assets.dart:6
static const String co2Image
Definition assets.dart:5
final DashboardEntity entity
final String amount
const EnvironmentalDashboardCards({super.key, required this.entity})
final String image
final String title
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
ColorMetricsEntity({ required this.blue, required this.gray, required this.green, required this.orange, })