Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
food_waste_breakdown_view.dart
Go to the documentation of this file.
1import 'package:flutter/material.dart';
2import 'package:flutter_screenutil/flutter_screenutil.dart';
3import '../../widgets/step_brogress_bar.dart';
4import '/core/ui/widgets/custom_card.dart';
5import '/core/ui/widgets/custom_text_form_field.dart';
6
7class FoodWasteBreakdownView extends StatelessWidget {
8 const FoodWasteBreakdownView({super.key});
9
10 @override
11 Widget build(BuildContext context) {
12 return SingleChildScrollView(
13 padding: EdgeInsets.all(15.sp),
14 child: Column(
15 crossAxisAlignment: CrossAxisAlignment.start,
16 children: [
17 Container(
18 width: double.infinity,
19 padding: EdgeInsets.all(15.sp),
20 decoration: BoxDecoration(
21 color: Colors.orange.withOpacity(0.11),
22 borderRadius: BorderRadius.circular(10),
23 ),
24 child: Center(
25 child: Text(
26 'Waste',
27 style: Theme.of(context)
28 .textTheme
29 .bodySmall
30 ?.copyWith(color: Colors.orange),
31 ),
32 ),
33 ),
34 SizedBox(height: 10.sp),
36 padding: EdgeInsets.all(15.sp),
37 child: Column(
38 crossAxisAlignment: CrossAxisAlignment.start,
39 children: [
40 SimpleProgressBar(
41 totalSteps: 9,
42 currentStep: 3,
43 ),
44 SizedBox(height: 10.sp),
45 Text(
46 'What Is The Approximate Breakdown Of Your Food Waste (In %)?',
47 style: Theme.of(context).textTheme.displaySmall?.copyWith(
48 fontSize: 12.sp,
49 ),
50 ),
51 SizedBox(height: 20.sp),
53 context,
54 'Preparation Waste (E.G., Peelings, Trimmings):',
55 ),
56 SizedBox(height: 15.sp),
57 _buildInputField(context, 'Plate Leftovers:'),
58 SizedBox(height: 15.sp),
59 _buildInputField(context, 'Unsold Food:'),
60 ],
61 ),
62 ),
63 ],
64 ),
65 );
66 }
67
68 Widget _buildInputField(BuildContext context, String label) {
69 return Column(
70 crossAxisAlignment: CrossAxisAlignment.start,
71 children: [
72 Text(
73 label,
74 style: Theme.of(context).textTheme.bodySmall,
75 ),
76 SizedBox(height: 10.sp),
78 hintText: 'input',
79 fillColor: Theme.of(context).highlightColor.withOpacity(0.11),
80 suffix: Padding(
81 padding: EdgeInsets.only(top: 13.sp, right: 10.sp),
82 child: Text(
83 '%',
84 style: Theme.of(context).textTheme.bodySmall?.copyWith(
85 color: Theme.of(context).colorScheme.primary,
86 height: 0.0,
87 ),
88 ),
89 ),
90 controller: TextEditingController(),
91 ),
92 ],
93 );
94 }
95}
const CustomCard({ super.key, required this.child, this.padding, this.bgColor, })
final TextEditingController controller
final Widget child
const FoodWasteBreakdownView({super.key})
override Widget build(BuildContext context)
const CustomTextFormField({ super.key, required this.hintText, required this.controller, this.suffix, this.focusNode, this.validator, this.isObscure=false, this.inputType, this.maxLines=1, this.padding, this.fillColor, this.labelText, this.inputFormatters, this.onChanged, })
final String label
Widget _buildInputField(BuildContext context, String label)