Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
footprint_screen.dart
Go to the documentation of this file.
1import '/core/router/routes.dart';
2import '/core/ui/widgets/custom_scaffold.dart';
3import '/features/monthly_footprint/presentation/screens/widgets/cartoon_tracker.dart';
4import '/features/monthly_footprint/presentation/screens/widgets/emission_tracker_widget.dart';
5import 'package:fl_chart/fl_chart.dart';
6import 'package:flutter/material.dart';
7import 'package:flutter_screenutil/flutter_screenutil.dart';
8import 'package:go_router/go_router.dart';
9import 'package:hugeicons/hugeicons.dart';
10
11class FootPrintScreen extends StatelessWidget {
12 const FootPrintScreen({super.key});
13
14 @override
15 Widget build(BuildContext context) {
16 return CustomScaffold(
17 title: 'My Footprint',
18 actions: [
19 IconButton(
20 onPressed: () {
21 context.push(Routes.co2emissions.route);
22 },
23 icon: const Icon(HugeIcons.strokeRoundedDatabase01),
24 ),
25 IconButton(
26 onPressed: () {
27 context.push(Routes.monthlyFootprintStats.route);
28 },
29 icon: const Icon(HugeIcons.strokeRoundedPieChart),
30 ),
31 ],
32 body: SafeArea(
33 child: SingleChildScrollView(
34 padding: EdgeInsets.symmetric(
35 horizontal: 15.sp,
36 vertical: 10.sp,
37 ),
38 child: Column(
39 crossAxisAlignment: CrossAxisAlignment.center,
40 mainAxisAlignment: MainAxisAlignment.center,
41 children: [
43 currentCO2: 158.909,
44 targetCO2: 135.072,
45 points: 8500,
46 progress: 70,
47 ),
48 SizedBox(height: 15.sp),
50 points: 140,
51 emissions: 16.246,
52 chartData: const [
53 FlSpot(0, 0),
54 FlSpot(1, 10),
55 FlSpot(2, 20),
56 FlSpot(3, 50),
57 FlSpot(4, 40),
58 FlSpot(5, 80),
59 FlSpot(6, 60),
60 FlSpot(7, 100),
61 ],
63 onCategorySelected: (index) {},
64 ),
65 SizedBox(height: 15.sp),
66 ElevatedButton(
67 onPressed: () {},
68 style: ElevatedButton.styleFrom(
69 padding: EdgeInsets.only(
70 right: 5.sp,
71 left: 15.sp,
72 top: 5.sp,
73 bottom: 5.sp,
74 ),
75 ),
76 child: Row(
77 children: [
78 Flexible(
79 child: Text(
80 'Access the complete PDF document of your footprint analysis',
81 style: Theme.of(context).textTheme.bodySmall?.copyWith(
82 color: Theme.of(context).colorScheme.onPrimary,
83 ),
84 ),
85 ),
86 IconButton(
87 onPressed: () {},
88 icon: Icon(HugeIcons.strokeRoundedDownloadCircle01),
89 )
90 ],
91 ),
92 ),
93 SizedBox(height: 20.sp),
94 Text(
95 'You can improve your footprint by 15% ',
96 style: Theme.of(context).textTheme.bodySmall,
97 ),
98 SizedBox(height: 10.sp),
99 Text(
100 "Your carbon footprint of 158,909 kg CO₂\nequals driving 827,651 km.\nSmall changes can greatly reduce your impact!",
101 textAlign: TextAlign.center,
102 style: Theme.of(context).textTheme.bodySmall?.copyWith(
103 color: Theme.of(context).hintColor,
104 fontSize: 9.sp,
105 ),
106 )
107 ],
108 ),
109 ),
110 ),
111 );
112 }
113}
const CarbonTrackerCard({ super.key, required this.currentCO2, required this.targetCO2, required this.points, required this.progress, })
final List< FlSpot > chartData
final IconData icon
final VoidCallback onPressed
final String title
final double currentCO2
final Widget child
override Widget build(BuildContext context)
final List< Widget > actions
final double progress
const EmissionsTracker({ super.key, required this.points, required this.emissions, required this.chartData, required this.selectedCategoryIndex, required this.onCategorySelected, })
final double targetCO2
const FootPrintScreen({super.key})
Routes
Definition routes.dart:32