@@ -17,11 +17,7 @@ class FeedbackScreen extends StatelessWidget {
1717 final TextEditingController textController = TextEditingController ();
1818 final int mealId;
1919 static const List <String > feedbackHeadings = [
20- "Ambience" ,
21- "Hygiene and Cleanliness" ,
22- "Weekly Menu" ,
23- "Worker and Services" ,
24- "Diet and Nutrition" ,
20+ "Your Feedback" ,
2521 ];
2622
2723 @override
@@ -54,17 +50,14 @@ class FeedbackScreen extends StatelessWidget {
5450 ),
5551 ),
5652 6. toVerticalSizedBox,
57- ...List .generate (feedbackHeadings.length, (ind) {
58- return Padding (
59- padding: EdgeInsets .symmetric (
60- vertical: 2. toAutoScaledHeight),
61- child: FeedbackTile (
62- parentState: state,
63- title: feedbackHeadings[ind],
64- index: ind,
65- ),
66- );
67- }, growable: false ),
53+ Padding (
54+ padding: EdgeInsets .symmetric (
55+ vertical: 2. toAutoScaledHeight),
56+ child: FeedbackTile (
57+ parentState: state,
58+ title: "Your Feedback" ,
59+ ),
60+ ),
6861 2. toVerticalSizedBox,
6962 Text (
7063 'If any other feeback, please describe below' ,
@@ -103,19 +96,18 @@ class FeedbackScreen extends StatelessWidget {
10396 alignment: Alignment .bottomRight,
10497 child: BlackIconButton (
10598 onTap: () {
106- for (var rating in state.rating) {
107- if (rating == 0 ) {
108- Fluttertoast .showToast (
109- msg: "Please rate all the categories!" ,
110- toastLength: Toast .LENGTH_SHORT ,
111- gravity: ToastGravity .BOTTOM ,
112- timeInSecForIosWeb: 1 ,
113- textColor: Colors .white,
114- backgroundColor: AppTheme .red,
115- fontSize: 12. toAutoScaledFont);
116- return ;
117- }
99+ if (state.rating == 0 ) {
100+ Fluttertoast .showToast (
101+ msg: "Please rate before submitting!" ,
102+ toastLength: Toast .LENGTH_SHORT ,
103+ gravity: ToastGravity .BOTTOM ,
104+ timeInSecForIosWeb: 1 ,
105+ textColor: Colors .white,
106+ backgroundColor: AppTheme .red,
107+ fontSize: 12. toAutoScaledFont);
108+ return ;
118109 }
110+
119111 if (state.description.trim ().isEmpty) {
120112 Fluttertoast .showToast (
121113 msg: "Please describe your Feedback!" ,
@@ -160,7 +152,7 @@ class FeedbackScreen extends StatelessWidget {
160152 }
161153 if (state.error) {
162154 Fluttertoast .showToast (
163- msg: "Unable to submit feedback!" ,
155+ msg: state.description ,
164156 toastLength: Toast .LENGTH_SHORT ,
165157 gravity: ToastGravity .BOTTOM ,
166158 timeInSecForIosWeb: 1 ,
0 commit comments