Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
co2_emissions_screen.dart
Go to the documentation of this file.
1import 'package:connect/core/router/routes.dart';
2import 'package:connect/core/ui/widgets/custom_card.dart';
3import 'package:connect/core/ui/widgets/custom_scaffold.dart';
4import 'package:flutter/material.dart';
5import 'package:flutter_screenutil/flutter_screenutil.dart';
6import 'package:go_router/go_router.dart';
7import 'package:hugeicons/hugeicons.dart';
8
9class Co2EmissionsScreen extends StatelessWidget {
10 const Co2EmissionsScreen({super.key});
11
12 @override
13 Widget build(BuildContext context) {
14 return CustomScaffold(
15 title: 'CO₂ emissions',
16 body: ListView(
17 padding: EdgeInsets.all(15.sp),
18 children: [
20 bgColor: Theme.of(context).colorScheme.primary,
21 padding: EdgeInsets.all(15.sp),
22 child: Text(
23 'Ready to take action? Let’s calculate your CO₂emissions today!',
24 style: Theme.of(context).textTheme.displaySmall?.copyWith(
25 color: Theme.of(context).colorScheme.onPrimary,
26 ),
27 ),
28 ),
29 SizedBox(height: 20.sp),
30 Text(
31 'Calculate',
32 style: Theme.of(context).textTheme.displaySmall,
33 ),
34 SizedBox(height: 15.sp),
36 context: context,
37 iconColor: Colors.blue,
38 label: 'Operational Details',
39 icon: HugeIcons.strokeRoundedSettings02,
40 onPeressed: () {
41 context.push(Routes.operationalDetails.route);
42 },
43 ),
44 SizedBox(height: 15.sp),
46 context: context,
47 iconColor: Colors.red,
48 label: 'Energy',
49 icon: HugeIcons.strokeRoundedEnergy,
50 onPeressed: () {
51 context.push(Routes.energy.route);
52 },
53 ),
54 SizedBox(height: 15.sp),
56 context: context,
57 iconColor: Colors.green,
58 label: 'Food',
59 icon: HugeIcons.strokeRoundedRestaurant02,
60 onPeressed: () {
61 context.push(Routes.food.route);
62 },
63 ),
64 SizedBox(height: 15.sp),
66 context: context,
67 iconColor: Colors.orange,
68 label: 'Waste',
69 icon: HugeIcons.strokeRoundedWaste,
70 onPeressed: () {
71 context.push(Routes.waste.route);
72 },
73 ),
74 SizedBox(height: 15.sp),
76 context: context,
77 iconColor: Colors.blueAccent,
78 label: 'Transport',
79 icon: HugeIcons.strokeRoundedContainerTruck01,
80 onPeressed: () {
81 context.push(Routes.transport.route);
82 },
83 ),
84 SizedBox(height: 15.sp),
86 context: context,
87 iconColor: Colors.blueAccent,
88 label: 'Water',
89 icon: HugeIcons.strokeRoundedRainDrop,
90 onPeressed: () {
91 context.push(Routes.water.route);
92 },
93 ),
94 ],
95 ),
96 );
97 }
98
100 required BuildContext context,
101 required Color iconColor,
102 required String label,
103 required IconData icon,
104 required Function() onPeressed,
105 }) {
106 return ElevatedButton(
107 style: ElevatedButton.styleFrom(
108 backgroundColor: Theme.of(context).colorScheme.surface,
109 ),
110 onPressed: onPeressed,
111 child: Column(
112 children: [
113 CircleAvatar(
114 radius: 25.sp,
115 backgroundColor: iconColor.withOpacity(0.11),
116 child: Icon(
117 icon,
119 ),
120 ),
121 SizedBox(height: 10.sp),
122 Text(
123 label,
124 style: Theme.of(context).textTheme.displaySmall,
125 ),
126 ],
127 ),
128 );
129 }
130}
final Function() onPressed
final IconData icon
final String title
final Color bgColor
const CustomCard({ super.key, required this.child, this.padding, this.bgColor, })
final Widget child
override Widget build(BuildContext context)
final String label
const Co2EmissionsScreen({super.key})
_buildMenubutton({ required BuildContext context, required Color iconColor, required String label, required IconData icon, required Function() onPeressed, })
final Widget child
final Color backgroundColor
final Color iconColor
final String label
final Color color
Definition failures.dart:1