Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
energy_savings_measure_view.dart
Go to the documentation of this file.
1import 'package:connect/core/ui/widgets/custom_text_form_field.dart';
2import 'package:flutter/material.dart';
3import 'package:flutter_screenutil/flutter_screenutil.dart';
4import 'package:connect/core/ui/widgets/custom_card.dart';
5import 'package:connect/features/co2_emmissions/screens/widgets/step_brogress_bar.dart';
6
7import '../../operational_details_screen/views/operational_hours_view.dart';
8
9class EnergySavingsMeasure extends StatefulWidget {
10 const EnergySavingsMeasure({super.key});
11
12 @override
13 State<EnergySavingsMeasure> createState() => _EnergySavingsMeasureState();
14}
15
16class _EnergySavingsMeasureState extends State<EnergySavingsMeasure> {
17 List<String> options = [
18 'LED lighting in all areas',
19 'Energy-efficient HVAC systems (e.g., SEER-certified AC units)',
20 'Scheduled maintenance for appliances (e.g., refrigerators, ovens)',
21 'Automatic timers or motion sensors for lighting',
22 'Solar water heaters',
23 'Other (specify)',
24 ];
25
26 List<String> selectedOption = [];
27
28 void onSelect(String option) {
29 if (selectedOption.contains(option)) {
30 selectedOption.remove(option);
31 } else {
32 selectedOption.add(option);
33 }
34 setState(() {});
35 }
36
37 bool isSelected(String option) {
38 return selectedOption.contains(option);
39 }
40
41 @override
42 Widget build(BuildContext context) {
43 return SingleChildScrollView(
44 padding: EdgeInsets.all(15.sp),
45 child: Column(
46 crossAxisAlignment: CrossAxisAlignment.start,
47 children: [
48 Container(
49 width: double.infinity,
50 padding: EdgeInsets.all(15.sp),
51 decoration: BoxDecoration(
52 color: Colors.red.withOpacity(0.11),
53 borderRadius: BorderRadius.circular(10)),
54 child: Center(
55 child: Text(
56 'Energy',
57 style: Theme.of(context)
58 .textTheme
59 .bodySmall
60 ?.copyWith(color: Colors.red),
61 ),
62 ),
63 ),
64 SizedBox(height: 10.sp),
66 padding: EdgeInsets.all(15.sp),
67 child: Column(
68 crossAxisAlignment: CrossAxisAlignment.start,
69 children: [
70 SimpleProgressBar(
71 totalSteps: 6,
72 currentStep: 4,
73 ),
74 SizedBox(height: 10.sp),
75 Text(
76 'What energy-saving measures have you implemented?',
77 style: Theme.of(context).textTheme.displaySmall?.copyWith(
78 fontSize: 12.sp,
79 ),
80 ),
81 SizedBox(height: 5.sp),
82 Text(
83 '(Select all that apply):',
84 style: Theme.of(context).textTheme.displaySmall?.copyWith(
85 color: Theme.of(context).hintColor,
86 fontSize: 10.sp,
87 ),
88 ),
89 SizedBox(height: 10.sp),
90 ListView.separated(
91 physics: NeverScrollableScrollPhysics(),
92 shrinkWrap: true,
93 itemCount: options.length,
94 separatorBuilder: (context, index) => SizedBox(height: 10.sp),
95 itemBuilder: (BuildContext context, int index) {
96 return CustomOptionButton(
97 option: options[index],
98 onPressed: () {
99 onSelect(options[index]);
100 },
102 );
103 },
104 ),
105 SizedBox(height: 10.sp),
106 CustomTextFormField(
107 hintText: 'Type...',
108 maxLines: 4,
109 fillColor: Theme.of(context).highlightColor.withOpacity(0.11),
110 controller: TextEditingController(),
111 ),
112 ],
113 ),
114 ),
115 ],
116 ),
117 );
118 }
119}
override State< EnergySavingsMeasure > createState()
const EnergySavingsMeasure({super.key})
const CustomCard({ super.key, required this.child, this.padding, this.bgColor, })
final Widget child
final EdgeInsets padding
final bool isSelected
class EnergySavingsMeasure extends StatefulWidget options
List< String > selectedOption
void onSelect(String option)
final Color color
Definition failures.dart:1
override Widget build(BuildContext context)