Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
waste_disposal_methods_view.dart
Go to the documentation of this file.
1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3import '../../operational_details_screen/views/operational_hours_view.dart';
4import '../../widgets/step_brogress_bar.dart';
5import '/core/ui/widgets/custom_card.dart';
6import '/core/ui/widgets/custom_text_form_field.dart';
7
8class WasteDisposalMethodsView extends StatefulWidget {
9 const WasteDisposalMethodsView({super.key});
10
11 @override
12 State<WasteDisposalMethodsView> createState() => _WasteDisposalMethodsViewState();
13}
14
15class _WasteDisposalMethodsViewState extends State<WasteDisposalMethodsView> {
16 List<String> options = [
17 'Landfill',
18 'Composting',
19 'Recycling',
20 'Donation (e.g., unsold food)',
21 'Other (specify)',
22 ];
23 List<String> selectedOptions = [];
24 final TextEditingController _otherController = TextEditingController();
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.orange.withOpacity(0.11),
48 borderRadius: BorderRadius.circular(10),
49 ),
50 child: Center(
51 child: Text(
52 'Waste',
53 style: Theme.of(context)
54 .textTheme
55 .bodySmall
56 ?.copyWith(color: Colors.orange),
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: 9,
68 currentStep: 6,
69 ),
70 SizedBox(height: 10.sp),
71 Text(
72 'What Methods Do You Use For Waste Disposal?',
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 fontSize: 11.sp,
81 fontStyle: FontStyle.italic,
82 ),
83 ),
84 SizedBox(height: 15.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 Padding(
95 padding: EdgeInsets.only(top: 10.sp),
96 child: CustomTextFormField(
97 hintText: 'Type...',
98 maxLines: 4,
99 fillColor: Theme.of(context).highlightColor.withOpacity(0.11),
100 controller: _otherController,
101 ),
102 ),
103 ],
104 ),
105 ),
106 ],
107 ),
108 );
109 }
110}
const WasteDisposalMethodsView({super.key})
override State< WasteDisposalMethodsView > createState()
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
final TextEditingController _otherController