20 Widget
build(BuildContext context) {
22 decoration: BoxDecoration(
23 borderRadius: BorderRadius.circular(16),
24 gradient: LinearGradient(
26 Theme.of(context).colorScheme.primary,
27 Theme.of(context).colorScheme.secondary,
32 padding:
const EdgeInsets.all(20.0),
34 crossAxisAlignment: CrossAxisAlignment.start,
35 mainAxisSize: MainAxisSize.min,
38 mainAxisAlignment: MainAxisAlignment.spaceBetween,
42 SvgPicture.asset(
'assets/svgs/leaf.svg'),
43 SizedBox(width: 8.sp),
45 'You reached\n1/4 leaf',
46 style: Theme.of(context).textTheme.bodySmall?.copyWith(
47 color: Theme.of(context).colorScheme.onPrimary,
55 style: Theme.of(context).textTheme.bodySmall?.copyWith(
56 color: Theme.of(context).colorScheme.onPrimary,
61 SizedBox(height: 20.sp),
63 crossAxisAlignment: CrossAxisAlignment.center,
67 style: Theme.of(context).textTheme.displayLarge?.copyWith(
68 color: Theme.of(context).colorScheme.onPrimary,
75 style: Theme.of(context).textTheme.bodySmall?.copyWith(
76 color: Theme.of(context).colorScheme.onPrimary,
80 SizedBox(height: 13.sp),
81 LinearProgressIndicator(
85 Theme.of(context).colorScheme.onPrimary.withOpacity(0.11),
86 valueColor: AlwaysStoppedAnimation<Color>(
87 Theme.of(context).colorScheme.onPrimary,
90 SizedBox(height: 12.sp),
94 'Your target: ${targetCO2.toStringAsFixed(2)} kg',
95 style: Theme.of(context).textTheme.bodySmall?.copyWith(
96 color: Theme.of(context).colorScheme.onPrimary,