Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
waste_reduction_initiatives_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 WasteReductionInitiativesView extends StatefulWidget {
9 const WasteReductionInitiativesView({super.key});
10
11 @override
12 State<WasteReductionInitiativesView> createState() =>
13 _WasteReductionInitiativesViewState();
14}
15
16class _WasteReductionInitiativesViewState
17 extends State<WasteReductionInitiativesView> {
18 List<String> options = [
19 'Smaller portion sizes to minimize plate waste',
20 'Food donation programs for unsold food',
21 'Replacing single-use packaging with reusable/biodegradable materials',
22 'Training staff on waste reduction practices',
23 ];
24 List<String> selectedOptions = [];
25 final TextEditingController _otherController = TextEditingController();
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.orange.withOpacity(0.11),
49 borderRadius: BorderRadius.circular(10),
50 ),
51 child: Center(
52 child: Text(
53 'Waste',
54 style: Theme.of(context)
55 .textTheme
56 .bodySmall
57 ?.copyWith(color: Colors.orange),
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: 9,
69 currentStep: 8,
70 ),
71 SizedBox(height: 10.sp),
72 Text(
73 'Have You Implemented Initiatives To Reduce Waste Generation?',
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 fontSize: 11.sp,
82 fontStyle: FontStyle.italic,
83 ),
84 ),
85 SizedBox(height: 15.sp),
86 ...options.map((option) => Padding(
87 padding: EdgeInsets.only(bottom: 10.sp),
88 child: CustomOptionButton(
89 isSelected: selectedOptions.contains(option),
90 onPressed: () => _onSelect(option),
91 option: option,
92 ),
93 )),
94 CustomTextFormField(
95 hintText: 'Type...',
96 maxLines: 4,
97 fillColor: Theme.of(context).highlightColor.withOpacity(0.11),
98 controller: _otherController,
99 ),
100 ],
101 ),
102 ),
103 ],
104 ),
105 );
106 }
107}
const WasteReductionInitiativesView({super.key})
override State< WasteReductionInitiativesView > 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