1import '/core/ui/widgets/custom_card.dart';
2import 'package:flutter/material.dart';
3import 'package:flutter_screenutil/flutter_screenutil.dart';
4import 'package:hugeicons/hugeicons.dart';
10 Widget
build(BuildContext context) {
13 EdgeInsets.only(left: 3.sp, right: 17.sp, top: 10.sp, bottom: 15.sp),
18 icon: HugeIcons.strokeRoundedEnergy,
27 icon: HugeIcons.strokeRoundedVegetarianFood,
36 icon: HugeIcons.strokeRoundedWasteRestore,
45 icon: HugeIcons.strokeRoundedContainerTruck,
54 icon: HugeIcons.strokeRoundedDroplet,
72 required this.categories,
76 Widget
build(BuildContext context) {
81 physics:
const NeverScrollableScrollPhysics(),
84 separatorBuilder: (context, index) =>
const SizedBox(height: 16),
85 itemBuilder: (context, index) {
90 SizedBox(height: 4.sp),
101 required this.category,
105 Widget
build(BuildContext context) {
111 decoration: BoxDecoration(
112 borderRadius: BorderRadius.circular(12),
119 SizedBox(width: 7.sp),
122 crossAxisAlignment: CrossAxisAlignment.center,
123 mainAxisAlignment: MainAxisAlignment.center,
126 mainAxisAlignment: MainAxisAlignment.spaceBetween,
130 style: Theme.of(context).textTheme.bodySmall,
133 '${(category.percentage * 100).toInt()}%',
134 style: Theme.of(context).textTheme.bodySmall?.copyWith(
135 color: Theme.of(context).hintColor,
141 SizedBox(height: 12.sp),
143 borderRadius: BorderRadius.circular(4),
144 child: LinearProgressIndicator(
148 AlwaysStoppedAnimation<Color>(
category.progressColor),
172 required this.percentage,
173 required this.backgroundColor,
174 required this.iconColor,
175 required this.progressColor,
176 required this.progressBackgroundColor,
final Color backgroundColor
const EmissionsBreakdown({ super.key, required this.categories, })
EmissionCategory({ required this.name, required this.icon, required this.percentage, required this.backgroundColor, required this.iconColor, required this.progressColor, required this.progressBackgroundColor, })
final Color progressBackgroundColor
final Color progressColor
class EmissionsBreakdownList extends StatelessWidget categories