Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
water_savings_view.dart
Go to the documentation of this file.
1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3
4import '../../../../../core/ui/widgets/custom_card.dart';
5import '../../../../../core/ui/widgets/custom_text_form_field.dart';
6import '../../operational_details_screen/views/operational_hours_view.dart';
7import '../../widgets/step_brogress_bar.dart';
8
9class WaterSavingView extends StatefulWidget {
10 const WaterSavingView({super.key});
11
12 @override
13 State<WaterSavingView> createState() => _WaterSavingViewState();
14}
15
16class _WaterSavingViewState extends State<WaterSavingView> {
17 final List<String> options = [
18 'Low-flow faucets or water-saving appliances',
19 'Water recycling or reuse systems',
20 'Staff training on water conservation',
21 'Other (specify)',
22 ];
23 List<String> selectedOptions = [];
24 bool monitoringEnabled = false;
25
26 void _onSelect(String option) {
27 setState(() {
28 if (selectedOptions.contains(option)) {
29 selectedOptions.remove(option);
30 } else {
31 selectedOptions.add(option);
32 }
33 });
34 }
35
36 @override
37 Widget build(BuildContext context) {
38 return SingleChildScrollView(
39 padding: EdgeInsets.all(15.sp),
40 child: Column(
41 crossAxisAlignment: CrossAxisAlignment.start,
42 children: [
43 Container(
44 width: double.infinity,
45 padding: EdgeInsets.all(15.sp),
46 decoration: BoxDecoration(
47 color: Colors.blue.withOpacity(0.11),
48 borderRadius: BorderRadius.circular(10),
49 ),
50 child: Center(
51 child: Text(
52 'Water',
53 style: Theme.of(context)
54 .textTheme
55 .bodySmall
56 ?.copyWith(color: Colors.blue),
57 ),
58 ),
59 ),
60 SizedBox(height: 10.sp),
62 padding: EdgeInsets.all(15.sp),
63 child: Column(
64 crossAxisAlignment: CrossAxisAlignment.start,
65 children: [
66 SimpleProgressBar(
67 totalSteps: 6,
68 currentStep: 3,
69 ),
70 SizedBox(height: 10.sp),
71 Text(
72 'Have You Implemented Water-Saving Measures In Your Establishment?',
73 style: Theme.of(context).textTheme.displaySmall?.copyWith(
74 fontSize: 12.sp,
75 ),
76 ),
77 Text(
78 '(Select All That Apply)',
79 style: Theme.of(context).textTheme.displaySmall?.copyWith(
80 color: Theme.of(context).hintColor,
81 fontSize: 10.sp,
82 ),
83 ),
84 SizedBox(height: 20.sp),
85 ...options.map((option) => Padding(
86 padding: const EdgeInsets.only(bottom: 10),
87 child: CustomOptionButton(
88 isSelected: selectedOptions.contains(option),
89 onPressed: () => _onSelect(option),
90 option: option,
91 ),
92 )),
93 if (selectedOptions.contains('Other (specify)'))
94 CustomTextFormField(
95 hintText: 'Type...',
96 maxLines: 4,
97 fillColor:
98 Theme.of(context).highlightColor.withOpacity(0.11),
99 controller: TextEditingController(),
100 ),
101 SizedBox(height: 20.sp),
102 Text(
103 'Do You Monitor Your Water Consumption Trends?',
104 style: Theme.of(context).textTheme.displaySmall?.copyWith(
105 fontSize: 12.sp,
106 ),
107 ),
108 SizedBox(height: 10.sp),
109 CustomOptionButton(
111 onPressed: () =>
112 setState(() => monitoringEnabled = !monitoringEnabled),
113 option: 'Yes',
114 ),
115 CustomOptionButton(
117 onPressed: () =>
118 setState(() => monitoringEnabled = !monitoringEnabled),
119 option: 'No',
120 ),
121 ],
122 ),
123 ),
124 ],
125 ),
126 );
127 }
128}
override State< WaterSavingView > createState()
const WaterSavingView({super.key})
const CustomCard({ super.key, required this.child, this.padding, this.bgColor, })
final Widget child
final EdgeInsets padding
void _onSelect(String option)
final bool isSelected
class EnergySavingsMeasure extends StatefulWidget options
final Color color
Definition failures.dart:1
override Widget build(BuildContext context)
final Set< String > selectedOptions
bool monitoringEnabled