From 459a727ca717228396635d9a15aeca86af56b8ce Mon Sep 17 00:00:00 2001 From: AshutoshPatole Date: Thu, 25 Nov 2021 10:56:12 +0530 Subject: [PATCH] Remove feedback menu and view --- lib/core/constants/drawer_enum.dart | 1 - lib/core/router.dart | 27 +++++++++---------- lib/core/router.json | 5 ---- lib/core/router_constants.dart | 1 - lib/views/drawer_page/drawer_ui.dart | 5 ---- .../feedback_page/feedback_page_view.dart | 22 --------------- .../feedback_page_view_model.dart | 11 -------- .../item_detail_page_view.dart | 5 ++-- .../navigation/navigation_view_model.dart | 3 --- 9 files changed, 14 insertions(+), 66 deletions(-) delete mode 100644 lib/views/feedback_page/feedback_page_view.dart delete mode 100644 lib/views/feedback_page/feedback_page_view_model.dart diff --git a/lib/core/constants/drawer_enum.dart b/lib/core/constants/drawer_enum.dart index 0e83453..8a4042e 100644 --- a/lib/core/constants/drawer_enum.dart +++ b/lib/core/constants/drawer_enum.dart @@ -1,6 +1,5 @@ enum DrawerIndex { home, - feedback, share, about, invite, diff --git a/lib/core/router.dart b/lib/core/router.dart index 722e471..3a97247 100644 --- a/lib/core/router.dart +++ b/lib/core/router.dart @@ -2,18 +2,17 @@ import 'package:flutter/material.dart'; import 'package:zerosandones/core/router_constants.dart'; -import 'package:zerosandones/views/cart_page/cart_page_view.dart' as view6; + +import 'package:zerosandones/views/login_page/login_page_view.dart' as view0; import 'package:zerosandones/views/drawer_page/drawer_page_view.dart' as view1; -import 'package:zerosandones/views/edit_profile_page/edit_profile_page_view.dart' - as view8; -import 'package:zerosandones/views/feedback_page/feedback_page_view.dart' - as view4; +import 'package:zerosandones/views/navigation/navigation_view.dart' as view2; import 'package:zerosandones/views/home_page/home_page_view.dart' as view3; import 'package:zerosandones/views/item_detail_page/item_detail_page_view.dart' - as view5; -import 'package:zerosandones/views/login_page/login_page_view.dart' as view0; -import 'package:zerosandones/views/navigation/navigation_view.dart' as view2; + as view4; +import 'package:zerosandones/views/cart_page/cart_page_view.dart' as view5; import 'package:zerosandones/views/phone_auth_page/phone_auth_page_view.dart' + as view6; +import 'package:zerosandones/views/edit_profile_page/edit_profile_page_view.dart' as view7; class Router { @@ -27,19 +26,17 @@ class Router { return MaterialPageRoute(builder: (_) => const view2.NavigationView()); case homePageViewRoute: return MaterialPageRoute(builder: (_) => view3.HomePageView()); - case feedbackPageViewRoute: - return MaterialPageRoute( - builder: (_) => const view4.FeedbackPageView()); case itemDetailPageViewRoute: - return MaterialPageRoute(builder: (_) => view5.ItemDetailPageView()); + return MaterialPageRoute( + builder: (_) => const view4.ItemDetailPageView()); case cartPageViewRoute: - return MaterialPageRoute(builder: (_) => view6.CartPageView()); + return MaterialPageRoute(builder: (_) => view5.CartPageView()); case phoneAuthPageViewRoute: return MaterialPageRoute( - builder: (_) => const view7.PhoneAuthPageView()); + builder: (_) => const view6.PhoneAuthPageView()); case editProfilePageViewRoute: return MaterialPageRoute( - builder: (_) => const view8.EditProfilePageView()); + builder: (_) => const view7.EditProfilePageView()); default: return MaterialPageRoute( builder: (_) => Scaffold( diff --git a/lib/core/router.json b/lib/core/router.json index 50f3f39..30136c3 100644 --- a/lib/core/router.json +++ b/lib/core/router.json @@ -21,11 +21,6 @@ "route_name": "home_pageViewRoute", "view_name": "HomePageView" }, - { - "file_path": "views/feedback_page/feedback_page_view.dart", - "route_name": "feedback_pageViewRoute", - "view_name": "FeedbackPageView" - }, { "file_path": "views/item_detail_page/item_detail_page_view.dart", "route_name": "item_detail_pageViewRoute", diff --git a/lib/core/router_constants.dart b/lib/core/router_constants.dart index 7abd365..8300ce0 100644 --- a/lib/core/router_constants.dart +++ b/lib/core/router_constants.dart @@ -4,7 +4,6 @@ const String loginPageViewRoute = 'loginPageViewRoute'; const String drawerPageViewRoute = 'drawerPageViewRoute'; const String navigationViewRoute = 'navigationViewRoute'; const String homePageViewRoute = 'homePageViewRoute'; -const String feedbackPageViewRoute = 'feedbackPageViewRoute'; const String itemDetailPageViewRoute = 'itemDetailPageViewRoute'; const String cartPageViewRoute = 'cartPageViewRoute'; const String phoneAuthPageViewRoute = 'phoneAuthPageViewRoute'; diff --git a/lib/views/drawer_page/drawer_ui.dart b/lib/views/drawer_page/drawer_ui.dart index 9d2849e..2341319 100644 --- a/lib/views/drawer_page/drawer_ui.dart +++ b/lib/views/drawer_page/drawer_ui.dart @@ -37,11 +37,6 @@ class _HomeDrawerState extends State { labelName: 'Home', icon: const Icon(CupertinoIcons.home), ), - DrawerList( - index: DrawerIndex.feedback, - labelName: 'Advice', - icon: const Icon(CupertinoIcons.chat_bubble_text), - ), DrawerList( index: DrawerIndex.invite, labelName: 'Invite Friend', diff --git a/lib/views/feedback_page/feedback_page_view.dart b/lib/views/feedback_page/feedback_page_view.dart deleted file mode 100644 index 29b1700..0000000 --- a/lib/views/feedback_page/feedback_page_view.dart +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:stacked/stacked.dart'; - -import 'feedback_page_view_model.dart'; - -class FeedbackPageView extends StatelessWidget { - const FeedbackPageView({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return ViewModelBuilder.reactive( - builder: (BuildContext context, FeedbackPageViewModel viewModel, _) { - return const Scaffold( - body: Center( - child: Text('FeedbackPage View'), - ), - ); - }, - viewModelBuilder: () => FeedbackPageViewModel(), - ); - } -} diff --git a/lib/views/feedback_page/feedback_page_view_model.dart b/lib/views/feedback_page/feedback_page_view_model.dart deleted file mode 100644 index 055c0d7..0000000 --- a/lib/views/feedback_page/feedback_page_view_model.dart +++ /dev/null @@ -1,11 +0,0 @@ -import 'package:logger/logger.dart'; -import 'package:stacked/stacked.dart'; -import '../../core/logger.dart'; - -class FeedbackPageViewModel extends BaseViewModel { - Logger? log; - - FeedbackPageViewModel() { - log = getLogger(runtimeType.toString()); - } -} diff --git a/lib/views/item_detail_page/item_detail_page_view.dart b/lib/views/item_detail_page/item_detail_page_view.dart index 484039c..c38c8cb 100644 --- a/lib/views/item_detail_page/item_detail_page_view.dart +++ b/lib/views/item_detail_page/item_detail_page_view.dart @@ -91,7 +91,7 @@ class ItemDetailPageView extends StatelessWidget { itemBuilder: (context, index) { final data = viewModel.ingredients[index]; return Container( - width: _size.width * 0.24, + width: _size.width * 0.20, height: _size.height * 0.1, margin: const EdgeInsets.symmetric(horizontal: 5), decoration: BoxDecoration( @@ -137,7 +137,7 @@ class ItemDetailPageView extends StatelessWidget { ), child: Center( child: Text( - data.percentage, + "${data.percentage}%", style: const TextStyle( fontWeight: FontWeight.w600, fontSize: 16.0, @@ -209,7 +209,6 @@ class ItemDetailPageView extends StatelessWidget { price: viewModel.foodPrice, quantity: 1, itemName: viewModel.foodName); - print(result); if (result == true) { // ! TODO : Fix E/flutter (14427): Typically, the Scaffold widget is introduced by the MaterialApp or WidgetsApp widget at the top of your application widget tree. ScaffoldMessenger.of(context).showSnackBar( diff --git a/lib/views/navigation/navigation_view_model.dart b/lib/views/navigation/navigation_view_model.dart index a2d1768..c253221 100644 --- a/lib/views/navigation/navigation_view_model.dart +++ b/lib/views/navigation/navigation_view_model.dart @@ -3,7 +3,6 @@ import 'package:logger/logger.dart'; import 'package:stacked/stacked.dart'; import '../../core/constants/drawer_enum.dart'; import '../../core/logger.dart'; -import '../feedback_page/feedback_page_view.dart'; import '../home_page/home_page_view.dart'; class NavigationViewModel extends BaseViewModel { @@ -20,8 +19,6 @@ class NavigationViewModel extends BaseViewModel { drawerIndex = drawerIndexdata; if (drawerIndex == DrawerIndex.home) { screenView = HomePageView(); - } else if (drawerIndex == DrawerIndex.feedback) { - screenView = const FeedbackPageView(); } else { // error screen }