Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
water_source_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 '../../energy/energy_screen.dart';
7import '../../operational_details_screen/views/operational_hours_view.dart';
8import '../../widgets/step_brogress_bar.dart';
9
10class WaterSourceView extends StatefulWidget {
11 const WaterSourceView({super.key});
12
13 @override
14 State<WaterSourceView> createState() => _WaterSourceViewState();
15}
16
17class _WaterSourceViewState extends State<WaterSourceView> {
18 final List<String> options = [
19 'Municipal water',
20 'Well water',
21 'Bottled water (for specific operations)',
22 'Other (specify)',
23 ];
24 String selectedSource = '';
25 final TextEditingController bottledWaterController = TextEditingController();
26
27 @override
28 Widget build(BuildContext context) {
29 return SingleChildScrollView(
30 padding: EdgeInsets.all(15.sp),
31 child: Column(
32 crossAxisAlignment: CrossAxisAlignment.start,
33 children: [
34 Container(
35 width: double.infinity,
36 padding: EdgeInsets.all(15.sp),
37 decoration: BoxDecoration(
38 color: Colors.blue.withOpacity(0.11),
39 borderRadius: BorderRadius.circular(10),
40 ),
41 child: Center(
42 child: Text(
43 'Water',
44 style: Theme.of(context)
45 .textTheme
46 .bodySmall
47 ?.copyWith(color: Colors.blue),
48 ),
49 ),
50 ),
51 SizedBox(height: 10.sp),
53 padding: EdgeInsets.all(15.sp),
54 child: Column(
55 crossAxisAlignment: CrossAxisAlignment.start,
56 children: [
57 SimpleProgressBar(
58 totalSteps: 6,
59 currentStep: 5,
60 ),
61 SizedBox(height: 10.sp),
62 Text(
63 'What Is The Primary Source Of Your Water Supply?',
64 style: Theme.of(context).textTheme.displaySmall?.copyWith(
65 fontSize: 12.sp,
66 ),
67 ),
68 Text(
69 '(Select One)',
70 style: Theme.of(context).textTheme.displaySmall?.copyWith(
71 color: Theme.of(context).hintColor,
72 fontSize: 10.sp,
73 ),
74 ),
75 SizedBox(height: 20.sp),
76 ...options.map((option) => Padding(
77 padding: const EdgeInsets.only(bottom: 10),
78 child: CustomOptionButton(
79 isSelected: selectedSource == option,
80 onPressed: () => setState(() => selectedSource = option),
81 option: option,
82 ),
83 )),
84 if (selectedSource == 'Other (specify)')
85 CustomTextFormField(
86 hintText: 'Type...',
87 maxLines: 4,
88 fillColor:
89 Theme.of(context).highlightColor.withOpacity(0.11),
90 controller: TextEditingController(),
91 ),
92 if (selectedSource == 'Bottled water (for specific operations)') ...[
93 SizedBox(height: 20.sp),
94 CustomInputField(
95 label:
96 'How Much Bottled Water Do You Use Monthly (In Liters)?',
97 hint: 'liters/month',
98 ),
99 ],
100 ],
101 ),
102 ),
103 ],
104 ),
105 );
106 }
107}
const WaterSourceView({super.key})
override State< WaterSourceView > createState()
const CustomCard({ super.key, required this.child, this.padding, this.bgColor, })
final Widget child
final EdgeInsets padding
final String label
final bool isSelected
class EnergySavingsMeasure extends StatefulWidget options
final Color color
Definition failures.dart:1
override Widget build(BuildContext context)
final TextEditingController bottledWaterController
String selectedSource