Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
water_disposal_view.dart
Go to the documentation of this file.
1import 'package:connect/features/co2_emmissions/screens/operational_details_screen/views/operational_hours_view.dart';
2import 'package:flutter/material.dart';
3import 'package:flutter_screenutil/flutter_screenutil.dart';
4
5import '../../../../../core/ui/widgets/custom_card.dart';
6import '../../../../../core/ui/widgets/custom_text_form_field.dart';
7import '../../widgets/step_brogress_bar.dart';
8
9class WastewaterDisposalView extends StatefulWidget {
10 const WastewaterDisposalView({super.key});
11
12 @override
13 State<WastewaterDisposalView> createState() => _WastewaterDisposalViewState();
14}
15
16class _WastewaterDisposalViewState extends State<WastewaterDisposalView> {
17 final List<String> options = [
18 'Municipal sewage system',
19 'Septic tank',
20 'On-site treatment plant',
21 'Other (specify)',
22 ];
23 List<String> selectedOptions = [];
24
25 void _onSelect(String option) {
26 setState(() {
27 if (selectedOptions.contains(option)) {
28 selectedOptions.remove(option);
29 } else {
30 selectedOptions.add(option);
31 }
32 });
33 }
34
35 @override
36 Widget build(BuildContext context) {
37 return SingleChildScrollView(
38 padding: EdgeInsets.all(15.sp),
39 child: Column(
40 crossAxisAlignment: CrossAxisAlignment.start,
41 children: [
42 _buildHeader(context),
43 SizedBox(height: 10.sp),
45 padding: EdgeInsets.all(15.sp),
46 child: Column(
47 crossAxisAlignment: CrossAxisAlignment.start,
48 children: [
49 SimpleProgressBar(
50 totalSteps: 6,
51 currentStep: 6,
52 ),
53 SizedBox(height: 10.sp),
54 Text(
55 'How Do You Dispose Of Wastewater?',
56 style: Theme.of(context).textTheme.displaySmall?.copyWith(
57 fontSize: 12.sp,
58 ),
59 ),
60 Text(
61 '(Select All That Apply)',
62 style: Theme.of(context).textTheme.displaySmall?.copyWith(
63 color: Theme.of(context).hintColor,
64 fontSize: 10.sp,
65 ),
66 ),
67 SizedBox(height: 20.sp),
68 ...options.map((option) => Padding(
69 padding: const EdgeInsets.only(bottom: 10),
70 child: CustomOptionButton(
71 isSelected: selectedOptions.contains(option),
72 onPressed: () => _onSelect(option),
73 option: option,
74 ),
75 )),
76 if (selectedOptions.contains('Other (specify)'))
77 CustomTextFormField(
78 hintText: 'Type...',
79 maxLines: 4,
80 fillColor:
81 Theme.of(context).highlightColor.withOpacity(0.11),
82 controller: TextEditingController(),
83 ),
84 ],
85 ),
86 ),
87 ],
88 ),
89 );
90 }
91}
92
93// Helper widget for the blue header shown in all views
94Widget _buildHeader(BuildContext context) {
95 return Container(
96 width: double.infinity,
97 padding: EdgeInsets.all(15.sp),
98 decoration: BoxDecoration(
99 color: Colors.blue.withOpacity(0.11),
100 borderRadius: BorderRadius.circular(10),
101 ),
102 child: Center(
103 child: Text(
104 'Water',
105 style: Theme.of(context)
106 .textTheme
107 .bodySmall
108 ?.copyWith(color: Colors.blue),
109 ),
110 ),
111 );
112}
override State< WastewaterDisposalView > createState()
const WastewaterDisposalView({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
Widget _buildHeader(BuildContext context)