Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
adjust_menu_based.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:connect/core/ui/widgets/custom_card.dart';
4import 'package:connect/features/co2_emmissions/screens/energy/energy_screen.dart';
5import 'package:connect/features/co2_emmissions/screens/widgets/step_brogress_bar.dart';
6import 'package:flutter/material.dart';
7import 'package:flutter_screenutil/flutter_screenutil.dart';
8
9class AdjustMenuBased extends StatefulWidget {
10 const AdjustMenuBased({super.key});
11
12 @override
13 State<AdjustMenuBased> createState() => _AdjustMenuBasedState();
14}
15
16class _AdjustMenuBasedState extends State<AdjustMenuBased> {
17 List<String> options = [
18 'Yes',
19 'No',
20 ];
21
22 List<String> selectedOption = [];
23
24 void onSelect(String option) {
25 if (selectedOption.contains(option)) {
26 selectedOption.remove(option);
27 } else {
28 selectedOption.add(option);
29 }
30 setState(() {});
31 }
32
33 bool isSelected(String option) {
34 return selectedOption.contains(option);
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.green.withOpacity(0.11),
49 borderRadius: BorderRadius.circular(10)),
50 child: Center(
51 child: Text(
52 'Food',
53 style: Theme.of(context)
54 .textTheme
55 .bodySmall
56 ?.copyWith(color: Colors.green),
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: 5,
68 currentStep: 4,
69 ),
70 SizedBox(height: 10.sp),
71 Text(
72 ' Do you actively adjust your menu based on food seasonality or availability?',
73 style: Theme.of(context).textTheme.displaySmall?.copyWith(
74 fontSize: 12.sp,
75 ),
76 ),
77 SizedBox(height: 10.sp),
78 SizedBox(height: 10.sp),
79 ListView.separated(
80 physics: NeverScrollableScrollPhysics(),
81 shrinkWrap: true,
82 itemCount: options.length,
83 separatorBuilder: (context, index) => SizedBox(height: 10.sp),
84 itemBuilder: (BuildContext context, int index) {
85 return CustomOptionButton(
86 option: options[index],
87 onPressed: () {
88 onSelect(options[index]);
89 },
91 );
92 },
93 ),
94 ],
95 ),
96 ),
97 ],
98 ),
99 );
100 }
101}
const AdjustMenuBased({super.key})
override State< AdjustMenuBased > createState()
const CustomCard({ super.key, required this.child, this.padding, this.bgColor, })
final Widget child
final EdgeInsets padding
final bool isSelected
class EnergySavingsMeasure extends StatefulWidget options
List< String > selectedOption
void onSelect(String option)
final Color color
Definition failures.dart:1
override Widget build(BuildContext context)