Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
water_usage_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 WaterUsageView extends StatefulWidget {
10 const WaterUsageView({super.key});
11
12 @override
13 State<WaterUsageView> createState() => _WaterUsageViewState();
14}
15
16class _WaterUsageViewState extends State<WaterUsageView> {
17 final List<String> options = [
18 'Cooking',
19 'Cleaning (e.g., kitchen, dining areas)',
20 'Staff facilities (e.g., restrooms, handwashing)',
21 'Customer facilities (e.g., restrooms)',
22 'Landscaping/irrigation',
23 'Other (specify)',
24 ];
25 List<String> selectedOptions = [];
26
27 void _onSelect(String option) {
28 setState(() {
29 if (selectedOptions.contains(option)) {
30 selectedOptions.remove(option);
31 } else {
32 selectedOptions.add(option);
33 }
34 });
35 }
36
37 @override
38 Widget build(BuildContext context) {
39 return SingleChildScrollView(
40 padding: EdgeInsets.all(15.sp),
41 child: Column(
42 crossAxisAlignment: CrossAxisAlignment.start,
43 children: [
44 Container(
45 width: double.infinity,
46 padding: EdgeInsets.all(15.sp),
47 decoration: BoxDecoration(
48 color: Colors.blue.withOpacity(0.11),
49 borderRadius: BorderRadius.circular(10),
50 ),
51 child: Center(
52 child: Text(
53 'Water',
54 style: Theme.of(context)
55 .textTheme
56 .bodySmall
57 ?.copyWith(color: Colors.blue),
58 ),
59 ),
60 ),
61 SizedBox(height: 10.sp),
63 padding: EdgeInsets.all(15.sp),
64 child: Column(
65 crossAxisAlignment: CrossAxisAlignment.start,
66 children: [
67 SimpleProgressBar(
68 totalSteps: 6,
69 currentStep: 2,
70 ),
71 SizedBox(height: 10.sp),
72 Text(
73 'What Are The Primary Uses Of Water In Your Operations?',
74 style: Theme.of(context).textTheme.displaySmall?.copyWith(
75 fontSize: 12.sp,
76 ),
77 ),
78 Text(
79 '(Select All That Apply)',
80 style: Theme.of(context).textTheme.displaySmall?.copyWith(
81 color: Theme.of(context).hintColor,
82 fontSize: 10.sp,
83 ),
84 ),
85 SizedBox(height: 20.sp),
86 ...options.map((option) => Padding(
87 padding: const EdgeInsets.only(bottom: 10),
88 child: CustomOptionButton(
89 isSelected: selectedOptions.contains(option),
90 onPressed: () => _onSelect(option),
91 option: option,
92 ),
93 )),
94 if (selectedOptions.contains('Other (specify)'))
95 CustomTextFormField(
96 hintText: 'Type...',
97 maxLines: 4,
98 fillColor:
99 Theme.of(context).highlightColor.withOpacity(0.11),
100 controller: TextEditingController(),
101 ),
102 ],
103 ),
104 ),
105 ],
106 ),
107 );
108 }
109}
override State< WaterUsageView > createState()
const WaterUsageView({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