diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..28a51d5
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "compile-hero.disable-compile-files-on-did-save-code": false
+}
\ No newline at end of file
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 4f51cd0..d43626c 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -38,7 +38,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "com.flutter.rcapp"
+ applicationId "com.rourkela.rcapp"
minSdkVersion 23
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
diff --git a/android/app/google-services.json b/android/app/google-services.json
index 95c0cd7..11a767f 100644
--- a/android/app/google-services.json
+++ b/android/app/google-services.json
@@ -1,34 +1,34 @@
{
"project_info": {
- "project_number": "433660739407",
- "firebase_url": "https://rcapp-de25c.firebaseio.com",
- "project_id": "rcapp-de25c",
- "storage_bucket": "rcapp-de25c.appspot.com"
+ "project_number": "946016773649",
+ "firebase_url": "https://rcapp-a57cd.firebaseio.com",
+ "project_id": "rcapp-a57cd",
+ "storage_bucket": "rcapp-a57cd.appspot.com"
},
"client": [
{
"client_info": {
- "mobilesdk_app_id": "1:433660739407:android:719770e06797fb89130f3a",
+ "mobilesdk_app_id": "1:946016773649:android:cd582a95e23ec301a933b0",
"android_client_info": {
- "package_name": "com.flutter.rcapp"
+ "package_name": "com.rourkela.rcapp"
}
},
"oauth_client": [
{
- "client_id": "433660739407-fk81st9lddi06arc3toggnlcb311li30.apps.googleusercontent.com",
+ "client_id": "946016773649-6mequs1kpd3h8o5phpd8ee1juj3c7vg0.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
- "current_key": "AIzaSyBZ2nQ3CT4od1Pt09Wj8wyyyC5JkWVD7tM"
+ "current_key": "AIzaSyCK8rzg8SncLmjZFItCFLAAg5aFzmazaJc"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
- "client_id": "433660739407-fk81st9lddi06arc3toggnlcb311li30.apps.googleusercontent.com",
+ "client_id": "946016773649-6mequs1kpd3h8o5phpd8ee1juj3c7vg0.apps.googleusercontent.com",
"client_type": 3
}
]
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index a28c09f..7fe9db4 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -5,10 +5,26 @@
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
+
+
+
+
+
+
+
+
+
+
qtyDetail = storeData.retrieveQtyDetails();
+
+ int qty = 1;
+
+ qtyDetail.forEach((key, value) {
+ if (key == item) {
+ qty = value;
+ }
+ });
+
+ if (qty > 1) {
+ storeData.StoreFoodDetails(item, price, qty);
+ } else {
+ storeData.StoreFoodDetails(item, price, 1);
+ }
+ }
@override
Widget build(BuildContext context) {
- return Container(
- width: 160,
- margin: EdgeInsets.only(right: 10.0),
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage('$imagePath'),
- fit: BoxFit.cover,
+ return areYouAdmin ? FocusedMenuHolder(
+ onPressed: () {},
+ menuItems: [
+ FocusedMenuItem(
+ title: Text('Delete the item'),
+ onPressed: () {
+ deleteMenu();
+ })
+ ],
+ child: Container(
+ width: 168,
+ margin: EdgeInsets.only(right: 10.0),
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: NetworkImage(imagePath),
+ fit: BoxFit.cover,
+ ),
+ borderRadius: BorderRadius.circular(6)),
+ child: Container(
+ padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.end,
+ children: [
+ InkWell(
+ onTap: () {
+ deleteMenu();
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ color: Colors.deepOrange,
+ borderRadius: BorderRadius.circular(5)),
+ child: Icon(
+ Icons.delete_outline,
+ color: Colors.white,
+ ),
+ ),
+ )
+ ],
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ Column(
+ mainAxisAlignment: MainAxisAlignment.end,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ width: 66,
+ child: Text(
+ categoryName,
+ style: GoogleFonts.inter(
+ fontWeight: FontWeight.bold,
+ fontSize: 16.0,
+ color: Colors.white),
+ ),
+ ),
+ Text(
+ '₹' + '$itemprice',
+ style: GoogleFonts.inter(color: Colors.white),
+ )
+ ],
+ ),
+ InkWell(
+ onTap: () {
+ addToCart(categoryName, itemprice);
+ showFlushbar(context);
+ },
+ child: Container(
+ height: 25,
+ width: 45,
+ decoration: BoxDecoration(
+ color: Colors.deepOrange,
+ border:
+ Border.all(color: Colors.black, width: 0.1),
+ borderRadius: BorderRadius.circular(5)),
+ child: Center(
+ child: Text(
+ 'Add',
+ style: GoogleFonts.inter(
+ fontWeight: FontWeight.w400,
+ color: Colors.white),
+ ),
+ ),
+ ),
+ )
+ ])
+ ],
),
- borderRadius: BorderRadius.circular(6)),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.end,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- categoryName,
- style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0, color: Colors.white),
+ )),
+ ) : Container(
+ width: 160,
+ margin: EdgeInsets.only(right: 10.0),
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: NetworkImage(imagePath),
+ fit: BoxFit.cover,
+ ),
+ borderRadius: BorderRadius.circular(6)),
+ child: Container(
+ padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.end,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ Column(
+ mainAxisAlignment: MainAxisAlignment.end,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ width: 60,
+ child: Text(
+ categoryName,
+ style: GoogleFonts.inter(
+ fontWeight: FontWeight.bold,
+ fontSize: 16.0,
+ color: Colors.white),
+ ),
+ ),
+ Text(
+ '₹' + '$itemprice',
+ style: GoogleFonts.inter(color: Colors.white),
+ )
+ ],
+ ),
+ InkWell(
+ onTap: () {
+ addToCart(categoryName, itemprice);
+ showFlushbar(context);
+ },
+ child: Container(
+ height: 25,
+ width: 45,
+ decoration: BoxDecoration(
+ color: Colors.deepOrange,
+ border:
+ Border.all(color: Colors.black, width: 0.1),
+ borderRadius: BorderRadius.circular(5)),
+ child: Center(
+ child: Text(
+ 'Add',
+ style: GoogleFonts.inter(
+ fontWeight: FontWeight.w400,
+ color: Colors.white),
+ ),
+ ),
+ ),
+ )
+ ])
+ ],
),
- Text(
- '₹' + '$itemprice',
- style: TextStyle(color: Colors.white),
- )
- ],
- ));
+ ));
}
}
diff --git a/lib/CustomWidget/foot_category.dart b/lib/CustomWidget/foot_category.dart
index 1b4d1cd..3d5073d 100644
--- a/lib/CustomWidget/foot_category.dart
+++ b/lib/CustomWidget/foot_category.dart
@@ -1,5 +1,14 @@
+import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_spinkit/flutter_spinkit.dart';
+import 'package:focused_menu/focused_menu.dart';
+import 'package:focused_menu/modals.dart';
+import 'package:google_fonts/google_fonts.dart';
+import 'package:rcapp/models/user.dart';
+import 'package:rcapp/pages/storeData.dart';
import 'food_card.dart';
+import 'package:provider/provider.dart';
+import 'package:rcapp/services/database.dart';
// DAta
import '../data/category_data.dart';
@@ -7,24 +16,56 @@ import '../data/category_data.dart';
// Model
import '../models/category_model.dart';
+// class FoodCategory extends StatefulWidget {
+// @override
+// _FoodCategoryState createState() => _FoodCategoryState();
+// }
+
class FoodCategory extends StatelessWidget {
- final List _categories = categories;
+ // final List _categories = categories;
+ final bool areYouAdmin;
+
+ FoodCategory(this.areYouAdmin);
@override
Widget build(BuildContext context) {
- return Container(
- height: 90.0,
- child: ListView.builder(
- scrollDirection: Axis.horizontal,
- itemCount: _categories.length,
- itemBuilder: (BuildContext context, int index) {
- return FoodCard(
- categoryName: _categories[index].categoryName,
- imagePath: _categories[index].imagePath,
- itemprice: _categories[index].itemprice,
- );
- },
- ),
- );
+ final _menuList = Provider.of>(context) ?? [];
+ if (_menuList.length == 0) {
+ return Container(
+ height: 90,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SpinKitCircle(
+ color: Colors.deepOrange,
+ size: 45,
+ ),
+ SizedBox(height: 20),
+ Text('LOADING', style: GoogleFonts.inter(fontWeight: FontWeight.w400))
+ ]),
+ );
+ } else {
+ return Container(
+ height: 105.0,
+ child: ListView.builder(
+ scrollDirection: Axis.horizontal,
+ itemCount: _menuList.length,
+ itemBuilder: (BuildContext context, int index) {
+ return FocusedMenuHolder(
+ onPressed: () {},
+ menuItems: [
+ FocusedMenuItem(title: Text('delete'), onPressed: () {})
+ ],
+ child: FoodCard(
+ areYouAdmin: areYouAdmin,
+ categoryName: _menuList[index].category_menu,
+ imagePath: _menuList[index].imagepath,
+ itemprice: _menuList[index].price,
+ ),
+ );
+ },
+ ),
+ );
+ }
}
}
diff --git a/lib/CustomWidget/menu_card.dart b/lib/CustomWidget/menu_card.dart
index ccb62b3..cf56587 100644
--- a/lib/CustomWidget/menu_card.dart
+++ b/lib/CustomWidget/menu_card.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import 'package:google_fonts/google_fonts.dart';
import 'package:rcapp/services/database.dart';
class MenuCard extends StatelessWidget {
@@ -32,7 +33,7 @@ class MenuCard extends StatelessWidget {
children: [
Text(
'$categoryName',
- style: TextStyle(
+ style: GoogleFonts.inter(
fontWeight: FontWeight.bold,
),
)
diff --git a/lib/CustomWidget/todays_menucard.dart b/lib/CustomWidget/todays_menucard.dart
index 2634812..cc674c9 100644
--- a/lib/CustomWidget/todays_menucard.dart
+++ b/lib/CustomWidget/todays_menucard.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import 'package:google_fonts/google_fonts.dart';
class TodayFoodCard extends StatelessWidget {
final String categoryName;
@@ -24,11 +25,11 @@ class TodayFoodCard extends StatelessWidget {
children: [
Text(
categoryName,
- style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0, color: Colors.white),
+ style: GoogleFonts.inter(fontWeight: FontWeight.bold, fontSize: 16.0, color: Colors.white),
),
Text(
'₹' + '$itemprice',
- style: TextStyle(color: Colors.white),
+ style: GoogleFonts.inter(color: Colors.white),
)
],
));
diff --git a/lib/main.dart b/lib/main.dart
index 5489e80..3c9e4cb 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -1,20 +1,58 @@
+import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_downloader/flutter_downloader.dart';
+import 'package:rcapp/pages/BlueL.dart';
import 'package:rcapp/pages/Cart.dart';
+import 'package:rcapp/pages/CategoryMenuList/Accompaniment_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/All_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/Biryani_MenuList.dart';
+import 'package:rcapp/pages/CategoryMenuList/Bread_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/Breakfast_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/Burger_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/Chinese_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/FriedRiceAndNoodles_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/MainCourse_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/Pasta_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/Pizza_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/Roll_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/Sandwich_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/Snacks_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/Soup_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/Starter_Menu.dart';
+import 'package:rcapp/pages/CategoryMenuList/Tandoori_Menu.dart';
+import 'package:rcapp/pages/Coluseum.dart';
import 'package:rcapp/pages/Food.dart';
+import 'package:rcapp/pages/Milan.dart';
+import 'package:rcapp/pages/MilapL.dart';
import 'package:rcapp/pages/NavigationBar.dart';
+import 'package:rcapp/pages/YellowL.dart';
import 'package:rcapp/pages/add_event.dart';
import 'package:rcapp/pages/address.dart';
+import 'package:rcapp/pages/adminBooking.dart';
import 'package:rcapp/pages/admin_order_confirm.dart';
import 'package:rcapp/pages/booking_calendar.dart';
import 'package:rcapp/pages/confirmOrder.dart';
+import 'package:rcapp/pages/mainhall.dart';
import 'package:rcapp/pages/orderdetails.dart';
+import 'package:rcapp/pages/previousBooking.dart';
+import 'package:rcapp/pages/previousOrder.dart';
+import 'package:rcapp/pages/uploadAvatar.dart';
+import 'package:rcapp/pages/uploadImage.dart';
+import 'package:rcapp/pages/uploadPdf.dart';
import 'package:rcapp/pages/welcome.dart';
import 'package:rcapp/services/auth.dart';
import 'pages/wrapper.dart';
import 'package:provider/provider.dart';
import 'package:rcapp/models/user.dart';
-void main() => runApp(MyApp());
+void main() async {
+ WidgetsFlutterBinding.ensureInitialized();
+ await FlutterDownloader.initialize(
+ debug: true // optional: set false to disable printing logs to console
+ );
+
+ runApp(MyApp());
+}
class MyApp extends StatelessWidget {
@override
@@ -29,13 +67,49 @@ class MyApp extends StatelessWidget {
'/bookingcalendar': (context) => Calendar(),
'/cart': (context) => Cart(),
'/adminorder': (context) => AdminOrder(),
- '/orderdetails': (context) => OrderDetails(),
+ // '/orderdetails': (context) => OrderDetails(),
'/wrapper': (context) => Wrapper(),
"/add_event": (context) => AddEventPage(),
- "/confirmOrder": (context) => ConfirmOrder(),
- "/address" : (context) => AddressForm(),
+ "/address": (context) => AddressForm(),
+ "/previousOrder": (context) => PreviousOrder(),
+ "/previousBooking": (context) => PreviousBooking(),
+ "/adminBooking": (context) => AdminBooking(),
+ // "/previousOrder": (context) => PreviousOrderDetails(),
+
+ //routes for different categories of food
+ "/allmenu": (context) => AllMenu(),
+ "/biryanimenu": (context) => Biryani_MenuList(),
+ "/breadmenu": (context) => Bread_MenuList(),
+ "/breakfastmenu": (context) => Breakfast_MenuList(),
+ "/burgermenu": (context) => Burger_MenuList(),
+ "/chinesemenu": (context) => ChineseMenuList(),
+ "/friedriceandnoodlesmenu": (context) =>
+ FriedRiceAndNoodles_MenuList(),
+ "/maincoursemenu": (context) => MainCourse_MenuList(),
+ "/pastamenu": (context) => Pasta_MenuList(),
+ "/pizzamenu": (context) => Pizza_MenuList(),
+ "/rollmenu": (context) => Roll_MenuList(),
+ "/sandwichmenu": (context) => Sandwich_MenuList(),
+ "/snacksmenu": (context) => Snacks_MenuList(),
+ "/soupmenu": (context) => Soup_MenuList(),
+ "/startermenu": (context) => StarterMenuList(),
+ "/tandoorimenu": (context) => Tandoori_MenuList(),
+ "/accompanimentmenu": (context) => Accompaniment_Menu(),
+
+ // lounge routes
+ "/bluelounge": (context) => BlueLounge(),
+ "/yellowlounge": (context) => YellowLounge(),
+ "/milanlounge": (context) => MilanLounge(),
+ "/milaplounge": (context) => MilapLounge(),
+ "/coluseum": (context) => Coluseum(),
+ "/mainhall" : (context) => MainHall(),
+
+ //Routes for admin
+ "/uploadImage": (context) => UploadImage(),
+ "/uploadPdf": (context) => UploadPdf(),
+ "/uploadAvatarImage": (context) => UploadAvatar()
},
),
);
}
-}
\ No newline at end of file
+}
diff --git a/lib/models/event.dart b/lib/models/event.dart
index 2e0dede..f728e03 100644
--- a/lib/models/event.dart
+++ b/lib/models/event.dart
@@ -4,10 +4,12 @@ class EventModel extends DatabaseItem {
final String id;
final String name;
final String personalno;
+ final int slot;
+ final int numberOfPeople;
final String Lounge;
final DateTime eventDate;
- EventModel({this.id, this.name, this.personalno, this.Lounge, this.eventDate})
+ EventModel({this.id, this.name, this.personalno, this.Lounge, this.eventDate, this.slot, this.numberOfPeople})
: super(id);
factory EventModel.fromMap(Map data) {
@@ -16,15 +18,18 @@ class EventModel extends DatabaseItem {
personalno: data['personal no'],
Lounge: data['Lounge'],
eventDate: data['event_date'],
+ slot: data['slot'],
+ numberOfPeople: data['numberOfPeople']
);
}
factory EventModel.fromDS(String id, Map data) {
return EventModel(
- id: id,
name: data['name'],
personalno: data['personal no'],
Lounge: data['Lounge'],
+ slot: data['slot'],
+ numberOfPeople: data['numberOfPeople'],
eventDate: data['event_date'].toDate(),
);
}
@@ -35,7 +40,8 @@ class EventModel extends DatabaseItem {
"personal no": personalno,
"Lounge": Lounge,
"event_date": eventDate,
- "id": id,
+ "slot": slot,
+ "numberOfPeople": numberOfPeople
};
}
}
\ No newline at end of file
diff --git a/lib/models/user.dart b/lib/models/user.dart
index a96b80c..8daf7fb 100644
--- a/lib/models/user.dart
+++ b/lib/models/user.dart
@@ -28,6 +28,150 @@ class Menu {
Menu({this.item, this.price, this.searchIndex});
}
+class BreakfastMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ BreakfastMenu({this.item, this.price, this.searchIndex});
+}
+
+class PaneerMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ PaneerMenu({this.item, this.price, this.searchIndex});
+}
+
+class MainCourseMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ MainCourseMenu({this.item, this.price, this.searchIndex});
+}
+
+class ChineseMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ ChineseMenu({this.item, this.price, this.searchIndex});
+}
+
+class StarterMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ StarterMenu({this.item, this.price, this.searchIndex});
+}
+
+class BiryaniMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ BiryaniMenu({this.item, this.price, this.searchIndex});
+}
+
+class BreadMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ BreadMenu({this.item, this.price, this.searchIndex});
+}
+
+class TandooriMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ TandooriMenu({this.item, this.price, this.searchIndex});
+}
+
+class FriedRiceAndNoodlesMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ FriedRiceAndNoodlesMenu({this.item, this.price, this.searchIndex});
+}
+
+class RollMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ RollMenu({this.item, this.price, this.searchIndex});
+}
+
+class SandwichMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ SandwichMenu({this.item, this.price, this.searchIndex});
+}
+
+class PizzaMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ PizzaMenu({this.item, this.price, this.searchIndex});
+}
+
+class SnacksMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ SnacksMenu({this.item, this.price, this.searchIndex});
+}
+
+class BurgerMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ BurgerMenu({this.item, this.price, this.searchIndex});
+}
+
+class PastaMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ PastaMenu({this.item, this.price, this.searchIndex});
+}
+
+class SoupMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ SoupMenu({this.item, this.price, this.searchIndex});
+}
+
+class AccompanimentMenu {
+ String item = '';
+ int price = 0;
+ String searchIndex = '';
+
+ AccompanimentMenu({this.item, this.price, this.searchIndex});
+}
+
+class Today_Menu {
+ String imagepath = '';
+ int price = 0;
+ String category_menu = '';
+
+ Today_Menu({this.imagepath, this.price, this.category_menu});
+}
+
class Orders {
List item;
List qty;
@@ -36,7 +180,34 @@ class Orders {
String address;
int total;
bool isConfirmed;
+ String date;
Orders(
- {this.item, this.qty, this.name, this.number, this.address, this.total, this.isConfirmed});
-}
\ No newline at end of file
+ {this.item,
+ this.qty,
+ this.name,
+ this.number,
+ this.address,
+ this.total,
+ this.isConfirmed,
+ this.date});
+}
+
+class PreviousOrders {
+ List item;
+ List qty;
+ String name;
+ String number;
+ String address;
+ int total;
+ bool isConfirmed;
+
+ PreviousOrders(
+ {this.item,
+ this.qty,
+ this.name,
+ this.number,
+ this.address,
+ this.total,
+ this.isConfirmed});
+}
diff --git a/lib/pages/Add_Food.dart b/lib/pages/Add_Food.dart
index c069c98..3fc445c 100644
--- a/lib/pages/Add_Food.dart
+++ b/lib/pages/Add_Food.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import 'package:google_fonts/google_fonts.dart';
class AddFood extends StatefulWidget {
final String id;
@@ -30,7 +31,7 @@ class _AddFoodState extends State {
),
Text(
widget.Name,
- style: TextStyle(fontSize: 17, fontWeight: FontWeight.bold),
+ style: GoogleFonts.inter(fontSize: 17, fontWeight: FontWeight.bold),
),
],
),
@@ -50,7 +51,7 @@ class _AddFoodState extends State {
),
Text(
'$FQty',
- style: TextStyle(fontSize: 17, fontWeight: FontWeight.bold),
+ style: GoogleFonts.inter(fontSize: 17, fontWeight: FontWeight.bold),
),
IconButton(
icon: Icon(
@@ -72,7 +73,7 @@ class _AddFoodState extends State {
margin: new EdgeInsets.symmetric(horizontal:50.0),
child:Text(
'₹' + widget.price.toString(),
- style: TextStyle(fontSize: 17, fontWeight: FontWeight.bold),
+ style: GoogleFonts.inter(fontSize: 17, fontWeight: FontWeight.bold),
),
),
],
diff --git a/lib/pages/BlueL.dart b/lib/pages/BlueL.dart
new file mode 100644
index 0000000..66b8421
--- /dev/null
+++ b/lib/pages/BlueL.dart
@@ -0,0 +1,65 @@
+import 'package:flutter/material.dart';
+import 'package:google_fonts/google_fonts.dart';
+
+
+class BlueLounge extends StatefulWidget {
+ @override
+ _BlueLoungeState createState() => _BlueLoungeState();
+}
+
+class _BlueLoungeState extends State {
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(
+ elevation: 10.0,
+ backgroundColor: Colors.deepOrange,
+ title: Text('Blue Lounge'),
+ ),
+ body: new Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ InkWell(
+ child: Container(
+ height: 200.0,
+ width: double.infinity,
+ padding: EdgeInsets.symmetric(horizontal: 50, vertical: 30),
+ margin: EdgeInsets.symmetric(horizontal: 10, vertical: 20),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10),
+ color: Colors.blue,
+ image: DecorationImage(
+ image: new AssetImage("assets/12.jpg"),
+ fit: BoxFit.fill)),
+ ),
+ ),
+ Text(
+ "Blue Lounge",
+ style: GoogleFonts.inter(
+ color: Colors.blueAccent,
+ fontSize: 40,
+ ),
+ ),
+ Text(
+ "The Blue Lounge is a comfortable lounge present in the ground floor of the club. Perfect for small group gatherings like office parties, get togethers amongst friends etc \n \nCapacity : 15 people\n \n \n \n ",
+ style: GoogleFonts.inter(
+ fontSize: 20
+ ),
+ ),
+ SizedBox(
+ width: double.infinity,
+ height: 60,
+ child: ButtonTheme(
+ child: RaisedButton(
+ color: Colors.deepOrange,
+ onPressed: () {
+ Navigator.pushNamed(context, "/bookingcalendar");
+ },
+ child: Text('Book',
+ style: GoogleFonts.inter(color: Colors.white, fontSize: 18))),
+ )),
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/pages/Booking.dart b/lib/pages/Booking.dart
index 61917a3..5201bc1 100644
--- a/lib/pages/Booking.dart
+++ b/lib/pages/Booking.dart
@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:carousel_pro/carousel_pro.dart';
+import 'package:google_fonts/google_fonts.dart';
+import 'package:rcapp/pages/NavigationBar.dart';
class Booking extends StatefulWidget {
@override
@@ -9,121 +11,6 @@ class Booking extends StatefulWidget {
class _BookingState extends State {
@override
Widget build(BuildContext context) {
- Widget image_carousel1 = new Container(
- height: 200.0,
- child: new Carousel(
- boxFit: BoxFit.cover,
- images: [
- Card(
- child: Container(
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage('assets/12.jpg'),
- fit: BoxFit.fitWidth,
- alignment: Alignment.topCenter,
- ),
- ),
- child: Text("The Blue Lounge",
- style: TextStyle(
- color: Colors.white,
- fontSize: 25,
- fontWeight: FontWeight.bold,
- ),
- ),
- ),
- ),
- Card(
- child: Container(
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage('assets/13.jpg'),
- fit: BoxFit.fitWidth,
- alignment: Alignment.topCenter,
- ),
- ),
- child: Text("The Yellow Lounge",
- style: TextStyle(
- color: Colors.white,
- fontSize: 25,
- fontWeight: FontWeight.bold,
- ),
- ),
- ),
- ),
- Card(
- child: Container(
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage('assets/17.jpg'),
- fit: BoxFit.fitWidth,
- alignment: Alignment.topCenter,
- ),
- ),
- child: Text("Milap Reception Hall",
- style: TextStyle(
- color: Colors.white,
- fontSize: 25,
- fontWeight: FontWeight.bold,
- ),
- ),
- ),
- ),
- ],
- autoplay: true,
- animationCurve: Curves.fastOutSlowIn,
- animationDuration: Duration(milliseconds: 1000),
- ),
- );
-
- Widget image_carousel2 = new Container(
- height: 200.0,
- child: new Carousel(
- boxFit: BoxFit.cover,
- images: [
- Card(
- child: Container(
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage('assets/15.jpg'),
- fit: BoxFit.fitWidth,
- alignment: Alignment.topCenter,
- ),
- ),
- child: Text("Main Banquet",
- style: TextStyle(
- color: Colors.white,
- fontSize: 25,
- fontWeight: FontWeight.bold,
- ),
- ),
- ),
- ),
- Card(
- child: Container(
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage('assets/16.jpg'),
- fit: BoxFit.fitWidth,
- alignment: Alignment.topCenter,
- ),
- ),
- child: Text("Wedding Reception Hall",
- style: TextStyle(
- color: Colors.white,
- fontSize: 25,
- fontWeight: FontWeight.bold,
- ),
- ),
- ),
- ),
-
- ],
- autoplay: true,
- animationCurve: Curves.fastOutSlowIn,
- animationDuration: Duration(milliseconds: 1000),
- ),
- );
-
return Scaffold(
appBar: AppBar(
@@ -140,7 +27,7 @@ class _BookingState extends State {
children: [
Text(
" Lounges",
- style: TextStyle(
+ style: GoogleFonts.inter(
color: Colors.grey,
fontSize: 25,
fontWeight: FontWeight.bold,
@@ -157,20 +44,192 @@ class _BookingState extends State {
],
),
SizedBox(height: 10.0),
- image_carousel1,
- SizedBox(height: 50.0),
+ Container(
+ margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 10),
+ height: 150.0,
+ width: double.infinity,
+ child: new Column(
+ children: [
+ Expanded(
+ child: ListView(
+ shrinkWrap: true,
+ physics: ClampingScrollPhysics(),
+ scrollDirection: Axis.horizontal,
+ children: [
+ InkWell(
+ onTap: () {
+ Navigator.pushNamed(context, "/bluelounge");
+ },
+ child: Container(
+ height: 100.0,
+ width: 150.0,
+ child: Align(
+ alignment: Alignment.bottomCenter,
+ child: Text(
+ 'Blue Lounge',
+ style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.bold),
+ ),
+ ),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10),
+ color: Colors.blue,
+ image: DecorationImage(
+ image: new AssetImage("assets/12.jpg"),
+ fit: BoxFit.fill)),
+ ),
+ ),
+ SizedBox(width: 20),
+ InkWell(
+ onTap: () {
+ Navigator.pushNamed(context, "/yellowlounge");
+ },
+ child: Container(
+ height: 100.0,
+ width: 150.0,
+ child: Align(
+ alignment: Alignment.bottomCenter,
+ child: Text(
+ 'Yellow Lounge',
+ style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.bold),
+ ),
+ ),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10),
+ color: Colors.blue,
+ image: DecorationImage(
+ image: new AssetImage("assets/13.jpg"),
+ fit: BoxFit.fill)),
+ ),
+ ),
+ SizedBox(width: 20),
+ InkWell(
+ onTap: () {
+ Navigator.pushNamed(context, "/milaplounge");
+ },
+ child: Container(
+ height: 100.0,
+ width: 150.0,
+ child: Align(
+ alignment: Alignment.bottomCenter,
+ child: Text(
+ 'Milap Hall',
+ style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.bold),
+ ),
+ ),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10),
+ color: Colors.blue,
+ image: DecorationImage(
+ image: new AssetImage("assets/17.jpg"),
+ fit: BoxFit.fill)),
+ ),
+ ),
+ SizedBox(width: 20),
+ InkWell(
+ onTap: () {
+ Navigator.pushNamed(context, "/milanlounge");
+ },
+ child: Container(
+ height: 100.0,
+ width: 150.0,
+ child: Align(
+ alignment: Alignment.bottomCenter,
+ child: Text(
+ 'Milan Lounge',
+ style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.bold),
+ ),
+ ),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10),
+ color: Colors.blue,
+ image: DecorationImage(
+ image: new AssetImage("assets/18.jpg"),
+ fit: BoxFit.fill)),
+ ),
+ ),
+ SizedBox(width: 20),
+ ],
+ ),
+ ),
+ SizedBox(height: 20),
+ ],
+ )),
+ SizedBox(height: 30.0),
Text(
" Banquet Halls",
- style: TextStyle(
+ style: GoogleFonts.inter(
color: Colors.grey,
fontSize: 25,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 10.0),
- image_carousel2,
+ Container(
+ margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 10),
+ height: 150.0,
+ width: double.infinity,
+ child: new Column(
+ children: [
+ Expanded(
+ child: ListView(
+ shrinkWrap: true,
+ physics: ClampingScrollPhysics(),
+ scrollDirection: Axis.horizontal,
+ children: [
+ InkWell(
+ onTap: () {
+ Navigator.pushNamed(context, "/mainhall");
+ },
+ child: Container(
+ height: 100.0,
+ width: 150.0,
+ child: Align(
+ alignment: Alignment.bottomCenter,
+ child: Text(
+ 'Main Hall',
+ style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.bold),
+ ),
+ ),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10),
+ color: Colors.blue,
+ image: DecorationImage(
+ image: new AssetImage("assets/15.jpg"),
+ fit: BoxFit.fill)),
+ ),
+ ),
+ SizedBox(width: 20),
+ InkWell(
+ onTap: () {
+ Navigator.pushNamed(context, "/yellowlounge");
+ },
+ child: Container(
+ height: 100.0,
+ width: 150.0,
+ child: Align(
+ alignment: Alignment.bottomCenter,
+ child: Text(
+ 'Wedding Hall',
+ style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.bold),
+ ),
+ ),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10),
+ color: Colors.blue,
+ image: DecorationImage(
+ image: new AssetImage("assets/16.jpg"),
+ fit: BoxFit.fill)),
+ ),
+ ),
+ SizedBox(width: 20),
+ ],
+ ),
+ ),
+ SizedBox(height: 20),
+ ],
+ )),
],
),
);
}
-}
\ No newline at end of file
+}
diff --git a/lib/pages/Cart.dart b/lib/pages/Cart.dart
index a0a095b..2ee1cc2 100644
--- a/lib/pages/Cart.dart
+++ b/lib/pages/Cart.dart
@@ -1,7 +1,13 @@
+import 'package:cloud_firestore/cloud_firestore.dart';
+import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_spinkit/flutter_spinkit.dart';
+import 'package:google_fonts/google_fonts.dart';
import 'package:rcapp/pages/Food.dart';
import 'package:rcapp/pages/order_cart.dart';
import 'package:rcapp/pages/storeData.dart';
+import 'package:rcapp/services/database.dart';
+import './confirmOrder.dart';
class Cart extends StatefulWidget {
@override
@@ -15,10 +21,25 @@ class _CartState extends State {
StoreData storeDataforCart = StoreData();
+ var address = '';
+
+ void init() async {
+ var user = await FirebaseAuth.instance.currentUser();
+ var _dat = await Firestore.instance
+ .collection('userInfo')
+ .document(user.uid)
+ .get();
+
+ setState(() {
+ address = _dat.data["address"];
+ });
+ }
+
@override
void initState() {
// TODO: implement initState
super.initState();
+ init();
updateTotal();
}
@@ -29,9 +50,13 @@ class _CartState extends State {
Map qtyDetail = storeDataforCart.retrieveQtyDetails();
total = 0;
+ totalquantity = 0;
setState(() {
- qtyDetail.forEach((key, value) => qtyList.add(value));
+ qtyDetail.forEach((key, value) {
+ totalquantity += value;
+ qtyList.add(value);
+ });
foodDetail.forEach((k, v) => total = total + v * qtyDetail[k]);
});
}
@@ -71,7 +96,53 @@ class _CartState extends State {
title: Text('Cart'),
),
body: Column(children: [
- SizedBox(height: 30),
+ SizedBox(height: 10),
+ Column(
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ margin: EdgeInsets.only(left: 20),
+ child: Text(
+ 'Deliver To:',
+ style: GoogleFonts.inter(
+ color: Colors.deepOrange,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ Row(children: [
+ Container(
+ child: Text(
+ 'Change/Add',
+ style: GoogleFonts.inter(
+ decoration: TextDecoration.underline,
+ color: Colors.deepOrange,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(right: 15),
+ child: IconButton(
+ icon: Icon(Icons.edit),
+ color: Colors.deepOrange,
+ onPressed: () {
+ Navigator.popAndPushNamed(context, '/address');
+ },
+ ),
+ )
+ ])
+ ],
+ ),
+ Container(
+ margin: EdgeInsets.symmetric(horizontal: 20, vertical: 0),
+ child: Text(
+ '$address',
+ style: GoogleFonts.inter(fontSize: 16),
+ ))
+ ],
+ ),
+ SizedBox(height: 20),
OrderCard(total: total),
Expanded(
child: ListView.builder(
@@ -82,9 +153,9 @@ class _CartState extends State {
int price = _foodNamePrice[keyname];
int qty = _foodQtyPrice[keyname];
return ListTile(
- onTap: () {
- removeItem(keyname);
- },
+ // onTap: () {
+ // removeItem(keyname);
+ // },
title: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@@ -104,7 +175,7 @@ class _CartState extends State {
),
Text(
keyname,
- style: TextStyle(
+ style: GoogleFonts.inter(
fontSize: 17,
fontWeight: FontWeight.bold),
),
@@ -117,17 +188,18 @@ class _CartState extends State {
qty: qty,
keyname: keyname,
quantityDecreement: quantityDecreement,
- quantityIncreement: quantityIncreement)
+ quantityIncreement: quantityIncreement,
+ removeItem: removeItem)
],
),
Row(
children: [
Container(
margin:
- new EdgeInsets.symmetric(horizontal: 50.0),
+ new EdgeInsets.symmetric(horizontal: 50.0),
child: Text(
'₹' + '$price' + ' Quantity: ' + '$qty',
- style: TextStyle(
+ style: GoogleFonts.inter(
fontSize: 15, fontWeight: FontWeight.bold),
),
),
@@ -146,16 +218,8 @@ class _CartState extends State {
);
}),
),
- Container(
- width: double.infinity,
- height: 50,
- child:FlatButton(
- color: Colors.deepOrange,
- onPressed: () {
- Navigator.pushNamed(context, '/confirmOrder');
- },
- child: Text('Proceed to Pay', style: TextStyle(color: Colors.white),))
- ),
+ // BottomItemView(total: total, qty: totalquantity),
+ ProceedAccess(address: address)
]));
}
}
@@ -168,15 +232,17 @@ class QuantityInCart extends StatefulWidget {
String keyname;
final quantityIncreement;
final quantityDecreement;
+ final removeItem;
QuantityInCart(
{this.index,
- this.price,
- this.qtyList,
- this.qty,
- this.keyname,
- this.quantityDecreement,
- this.quantityIncreement});
+ this.price,
+ this.qtyList,
+ this.qty,
+ this.keyname,
+ this.quantityDecreement,
+ this.quantityIncreement,
+ this.removeItem});
@override
_QuantityInCartState createState() => _QuantityInCartState();
}
@@ -204,7 +270,7 @@ class _QuantityInCartState extends State {
height: 25,
width: 62,
child: Center(
- child: Text('Add', style: TextStyle(color: Colors.deepOrange))),
+ child: Text('Add', style: GoogleFonts.inter(color: Colors.deepOrange))),
),
);
} else {
@@ -236,6 +302,9 @@ class _QuantityInCartState extends State {
if (widget.qtyList[widget.index] > 0) {
print(widget.key);
widget.quantityDecreement(widget.keyname);
+ if (widget.qty == 1) {
+ widget.removeItem(widget.keyname);
+ }
}
},
),
@@ -257,12 +326,12 @@ class _QuantityInCartState extends State {
width: 33,
child: Text(
'${widget.qty}',
- style: TextStyle(fontSize: 17, fontWeight: FontWeight.bold),
+ style: GoogleFonts.inter(fontSize: 17, fontWeight: FontWeight.bold),
),
),
// Text(
// '$FQty',
- // style: TextStyle(fontSize: 17, fontWeight: FontWeight.bold),
+ // style: GoogleFonts.inter(fontSize: 17, fontWeight: FontWeight.bold),
// ),
Container(
alignment: Alignment.center,
@@ -299,4 +368,90 @@ class _QuantityInCartState extends State {
);
}
}
-}
\ No newline at end of file
+}
+
+class ProceedAccess extends StatefulWidget {
+ var address;
+ ProceedAccess({this.address});
+ @override
+ _ProceedAccessState createState() => _ProceedAccessState();
+}
+
+class _ProceedAccessState extends State {
+ @override
+ Widget build(BuildContext context) {
+ if (widget.address == '') {
+ return Container(
+ width: double.infinity,
+ height: 50,
+ child: FlatButton(
+ color: Colors.deepOrange,
+ onPressed: () {
+ Navigator.pushNamed(context, '/address');
+ },
+ child: Text(
+ 'Add address to proceed',
+ style: GoogleFonts.inter(color: Colors.white),
+ )));
+ } else if (widget.address != '') {
+ return Container(
+ width: double.infinity,
+ height: 50,
+ child: FlatButton(
+ color: Colors.deepOrange,
+ onPressed: () {
+ updateTotal();
+ confirmOrder();
+ Navigator.pushReplacementNamed(context, '/navigationbar');
+ },
+ child: Text(
+ 'Proceed to Pay',
+ style: GoogleFonts.inter(color: Colors.white),
+ )));
+ } else if (widget.address == null) {
+ return Container(
+ width: double.infinity, height: 50, child: SpinKitChasingDots());
+ }
+ }
+}
+
+// class BottomItemView extends StatefulWidget {
+// @override
+// _BottomItemViewState createState() => _BottomItemViewState();
+// }
+
+class BottomItemView extends StatelessWidget {
+ int total;
+ int qty;
+ BottomItemView({this.total, this.qty});
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ width: double.maxFinite,
+ height: 54,
+ decoration: BoxDecoration(color: Colors.deepOrange),
+ child: Padding(
+ padding: EdgeInsets.symmetric(vertical: 0, horizontal: 20),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Text(
+ '${qty} ' + ' item ' + '|' + ' ' + '₹ ' + '${total}',
+ style:
+ GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.bold),
+ ),
+ InkWell(
+ onTap: (() => Navigator.pushNamed(context, '/cart')),
+ child: Text(
+ 'VIEW CART',
+ style:
+ GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.bold),
+ ),
+ )
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/pages/CategoryMenuList/Accompaniment_Menu.dart b/lib/pages/CategoryMenuList/Accompaniment_Menu.dart
new file mode 100644
index 0000000..76b6c19
--- /dev/null
+++ b/lib/pages/CategoryMenuList/Accompaniment_Menu.dart
@@ -0,0 +1,238 @@
+import 'package:flushbar/flushbar.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_spinkit/flutter_spinkit.dart';
+import 'package:rcapp/models/user.dart';
+import 'package:rcapp/pages/Cart.dart';
+import 'package:rcapp/pages/CategoryMenuList/flushbar.dart';
+import 'package:rcapp/pages/storeData.dart';
+import 'package:provider/provider.dart';
+import 'package:rcapp/services/database.dart';
+
+class Accompaniment_Menu extends StatefulWidget {
+ @override
+ _Accompaniment_MenuState createState() => _Accompaniment_MenuState();
+}
+
+class _Accompaniment_MenuState extends State {
+ StoreData dataforCart = StoreData();
+ int total = 0;
+
+ int qty = 0;
+ List qtyList = List();
+
+ @override
+ Widget build(BuildContext context) {
+ return StreamProvider>.value(
+ value: DatabaseService().accompanimentmenu,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: Colors.deepOrange,
+ title: Text('Accompaniments'),
+ actions: [
+ IconButton(
+ icon: Icon(
+ Icons.shopping_cart,
+ color: Colors.white,
+ ),
+ onPressed: () {
+ Navigator.pushNamed(context, '/cart');
+ },
+ )
+ ],
+ ),
+ body: Column(
+ children: [
+ Expanded(
+ child: AccompanimentMenuListPage(),
+ )
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class AccompanimentMenuListPage extends StatefulWidget {
+ @override
+ _AccompanimentMenuListPageState createState() =>
+ _AccompanimentMenuListPageState();
+}
+
+class _AccompanimentMenuListPageState extends State {
+ StoreData storeData = StoreData();
+ int total = 0;
+ bool checked = false;
+ Map quantityDetail = Map();
+ int qty = 0;
+ List qtyList = List();
+
+ void updateTotal() {
+ Map foodDetail = storeData.retrieveFoodDetails();
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ total = 0;
+
+ setState(() {
+ qtyDetail.forEach((key, value) => qtyList.add(value));
+ foodDetail.forEach((k, v) => total = total + v * qtyDetail[k]);
+ });
+ }
+
+ void quantityIncreement(String foodName) {
+ storeData.increaseQty(foodName);
+ updateTotal();
+ }
+
+ void quantityDecreement(String foodName) {
+ storeData.decreaseQty(foodName);
+ updateTotal();
+ }
+
+ void update() {
+ Map qtyCart = storeData.retrieveQtyDetails();
+ Map foodDetail = storeData.retrieveFoodDetails();
+
+ setState(() {
+ qty = 0;
+ qtyCart.forEach((key, value) {
+ qty += value;
+ qtyList.add(value);
+ });
+ foodDetail.forEach((k, v) => total = total + v * qtyCart[k]);
+ });
+ }
+
+ void addToCart(AccompanimentMenu post) {
+ String item = post.item;
+ int price = post.price;
+
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ int qty = 1;
+
+ qtyDetail.forEach((key, value) {
+ if (key == item) {
+ qty = value;
+ }
+ });
+
+ if (qty > 1) {
+ storeData.StoreFoodDetails(item, price, qty);
+ } else {
+ storeData.StoreFoodDetails(item, price, 1);
+ }
+ print(item);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final _menuList = Provider.of>(context) ?? [];
+ if (_menuList.length == 0) {
+ return Container(
+ height: 200,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SpinKitDualRing(
+ color: Colors.deepOrange,
+ size: 38,
+ ),
+ SizedBox(height: 20),
+ Text('LOADING', style: TextStyle(fontWeight: FontWeight.w500))
+ ]),
+ );
+ } else {
+ return Column(
+ children: [
+ Expanded(
+ child: Container(
+ child: ListView.builder(
+ physics: NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ itemCount: _menuList.length,
+ itemBuilder: (_, index) {
+ return ListTile(
+ title: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ children: [
+ // IconButton(
+ // onPressed: () {
+ // setState(() {
+ // checked = !checked;
+ // });
+ // addToCart(_menuList[index]);
+ // },
+ // icon: Icon(
+ // Icons.radio_button_unchecked,
+ // color: Colors.green,
+ // ),
+ // ),
+ SizedBox(width: 15),
+ Text(
+ '${_menuList[index].item}',
+ style: TextStyle(
+ fontSize: 17,
+ fontWeight: FontWeight.bold),
+ ),
+ ],
+ ),
+ Container(
+ height: 45,
+ width: 42,
+ margin: EdgeInsets.only(top: 6),
+ alignment: Alignment.center,
+ decoration: BoxDecoration(
+ color: Colors.deepOrange,
+ borderRadius: BorderRadius.circular(10)),
+ child: IconButton(
+ onPressed: () {
+ showFlushbar(context);
+ addToCart(_menuList[index]);
+ setState(() {
+ checked = !checked;
+ });
+ },
+ icon: Icon(
+ Icons.add,
+ color: Colors.white,
+ ),
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ Container(
+ margin: new EdgeInsets.symmetric(
+ vertical: 3, horizontal: 16.0),
+ child: Text(
+ '₹' + '${_menuList[index].price}',
+ style: TextStyle(
+ fontSize: 15,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey,
+ height: 2,
+ thickness: 1,
+ indent: 5,
+ endIndent: 5,
+ ),
+ ],
+ ),
+ );
+ })),
+ )
+ ],
+ );
+ }
+ }
+}
diff --git a/lib/pages/CategoryMenuList/All_Menu.dart b/lib/pages/CategoryMenuList/All_Menu.dart
new file mode 100644
index 0000000..95f1392
--- /dev/null
+++ b/lib/pages/CategoryMenuList/All_Menu.dart
@@ -0,0 +1,225 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_spinkit/flutter_spinkit.dart';
+import 'package:rcapp/models/user.dart';
+import 'package:rcapp/pages/CategoryMenuList/flushbar.dart';
+import 'package:rcapp/pages/storeData.dart';
+import 'package:provider/provider.dart';
+import 'package:rcapp/services/database.dart';
+import 'package:flushbar/flushbar.dart';
+
+class AllMenu extends StatefulWidget {
+ @override
+ _AllMenuState createState() => _AllMenuState();
+}
+
+class _AllMenuState extends State {
+ StoreData dataforCart = StoreData();
+ int total = 0;
+
+ int qty = 0;
+ List qtyList = List();
+
+ @override
+ Widget build(BuildContext context) {
+ return StreamProvider>.value(
+ value: DatabaseService().allmenu,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: Colors.deepOrange,
+ title: Text('All Menu'),
+ actions: [
+ IconButton(
+ icon: Icon(
+ Icons.shopping_cart,
+ color: Colors.white,
+ ),
+ onPressed: () {
+ Navigator.pushReplacementNamed(context, '/cart');
+ // Navigator.popAndPushNamed(context, '/cart');
+ },
+ )
+ ],
+ ),
+ body: Column(
+ children: [
+ Expanded(
+ child: AllMenuListPage(),
+ )
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class AllMenuListPage extends StatefulWidget {
+ @override
+ _AllMenuListPageState createState() => _AllMenuListPageState();
+}
+
+class _AllMenuListPageState extends State {
+ StoreData storeData = StoreData();
+ int total = 0;
+ bool checked = false;
+ Map quantityDetail = Map();
+ int qty = 0;
+ List qtyList = List();
+
+ void updateTotal() {
+ Map foodDetail = storeData.retrieveFoodDetails();
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ total = 0;
+
+ setState(() {
+ qtyDetail.forEach((key, value) => qtyList.add(value));
+ foodDetail.forEach((k, v) => total = total + v * qtyDetail[k]);
+ });
+ }
+
+ void quantityIncreement(String foodName) {
+ storeData.increaseQty(foodName);
+ updateTotal();
+ }
+
+ void quantityDecreement(String foodName) {
+ storeData.decreaseQty(foodName);
+ updateTotal();
+ }
+
+ void update() {
+ Map qtyCart = storeData.retrieveQtyDetails();
+ Map foodDetail = storeData.retrieveFoodDetails();
+
+ setState(() {
+ qty = 0;
+ qtyCart.forEach((key, value) {
+ qty += value;
+ qtyList.add(value);
+ });
+ foodDetail.forEach((k, v) => total = total + v * qtyCart[k]);
+ });
+ }
+
+ void addToCart(Menu post) {
+ String item = post.item;
+ int price = post.price;
+
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ int qty = 1;
+
+ qtyDetail.forEach((key, value) {
+ if (key == item) {
+ qty = value;
+ }
+ });
+
+ if (qty > 1) {
+ storeData.StoreFoodDetails(item, price, qty);
+ } else {
+ storeData.StoreFoodDetails(item, price, 1);
+ }
+ print(item);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final _menuList = Provider.of>(context) ?? [];
+ if (_menuList.length == 0) {
+ return Container(
+ height: 200,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SpinKitDualRing(
+ color: Colors.deepOrange,
+ size: 38,
+ ),
+ SizedBox(height: 20),
+ Text('LOADING', style: TextStyle(fontWeight: FontWeight.w500))
+ ]),
+ );
+ } else {
+ return Column(
+ children: [
+ Expanded(
+ child: Container(
+ child: ListView.builder(
+ physics: NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ itemCount: _menuList.length,
+ itemBuilder: (_, index) {
+ return ListTile(
+ title: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ children: [
+ SizedBox(width: 15),
+ Text(
+ '${_menuList[index].item}',
+ style: TextStyle(
+ fontSize: 17,
+ fontWeight: FontWeight.bold),
+ ),
+ ],
+ ),
+ Container(
+ height: 45,
+ width: 42,
+ margin: EdgeInsets.only(top: 6),
+ alignment: Alignment.center,
+ decoration: BoxDecoration(
+ color: Colors.deepOrange,
+ borderRadius: BorderRadius.circular(10)),
+ child: IconButton(
+ onPressed: () {
+ showFlushbar(context);
+ addToCart(_menuList[index]);
+ setState(() {
+ checked = !checked;
+ });
+ },
+ icon: Icon(
+ Icons.add,
+ color: Colors.white,
+ ),
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ Container(
+ margin: new EdgeInsets.symmetric(
+ vertical: 3, horizontal: 16.0),
+ child: Text(
+ '₹' + '${_menuList[index].price}',
+ style: TextStyle(
+ fontSize: 15,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey,
+ height: 2,
+ thickness: 1,
+ indent: 5,
+ endIndent: 5,
+ ),
+ ],
+ ),
+ );
+ })),
+ )
+ ],
+ );
+ }
+ }
+}
diff --git a/lib/pages/CategoryMenuList/Biryani_MenuList.dart b/lib/pages/CategoryMenuList/Biryani_MenuList.dart
new file mode 100644
index 0000000..f8d13a8
--- /dev/null
+++ b/lib/pages/CategoryMenuList/Biryani_MenuList.dart
@@ -0,0 +1,229 @@
+import 'package:flushbar/flushbar.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_spinkit/flutter_spinkit.dart';
+import 'package:rcapp/models/user.dart';
+import 'package:rcapp/pages/CategoryMenuList/flushbar.dart';
+import 'package:rcapp/pages/storeData.dart';
+import 'package:provider/provider.dart';
+import 'package:rcapp/services/database.dart';
+
+class Biryani_MenuList extends StatefulWidget {
+ @override
+ _Biryani_MenuListState createState() => _Biryani_MenuListState();
+}
+
+class _Biryani_MenuListState extends State {
+ StoreData dataforCart = StoreData();
+ int total = 0;
+
+ int qty = 0;
+ List qtyList = List();
+
+ @override
+ Widget build(BuildContext context) {
+ return StreamProvider>.value(
+ value: DatabaseService().biryani,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: Colors.deepOrange,
+ title: Text('Rice and Biryani'),
+ actions: [
+ IconButton(
+ icon: Icon(
+ Icons.shopping_cart,
+ color: Colors.white,
+ ),
+ onPressed: () {
+ Navigator.pushNamed(context, '/cart');
+ // Navigator.popAndPushNamed(context, '/cart');
+ },
+ )
+ ],
+ ),
+ body: Column(
+ children: [
+ Expanded(
+ child: BiryaniMenuListListPage(),
+ )
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class BiryaniMenuListListPage extends StatefulWidget {
+ @override
+ _BiryaniMenuListListPageState createState() => _BiryaniMenuListListPageState();
+}
+
+class _BiryaniMenuListListPageState extends State {
+ StoreData storeData = StoreData();
+ int total = 0;
+ bool checked = false;
+ Map quantityDetail = Map();
+ int qty = 0;
+ List qtyList = List();
+
+ void updateTotal() {
+ Map foodDetail = storeData.retrieveFoodDetails();
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ total = 0;
+
+ setState(() {
+ qtyDetail.forEach((key, value) => qtyList.add(value));
+ foodDetail.forEach((k, v) => total = total + v * qtyDetail[k]);
+ });
+ }
+
+ void quantityIncreement(String foodName) {
+ storeData.increaseQty(foodName);
+ updateTotal();
+ }
+
+ void quantityDecreement(String foodName) {
+ storeData.decreaseQty(foodName);
+ updateTotal();
+ }
+
+ void update() {
+ Map qtyCart = storeData.retrieveQtyDetails();
+ Map foodDetail = storeData.retrieveFoodDetails();
+
+ setState(() {
+ qty = 0;
+ qtyCart.forEach((key, value) {
+ qty += value;
+ qtyList.add(value);
+ });
+ foodDetail.forEach((k, v) => total = total + v * qtyCart[k]);
+ });
+ }
+
+ void addToCart(BiryaniMenu post) {
+ String item = post.item;
+ int price = post.price;
+
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ int qty = 1;
+
+ qtyDetail.forEach((key, value) {
+ if (key == item) {
+ qty = value;
+ }
+ });
+
+ if (qty > 1) {
+ storeData.StoreFoodDetails(item, price, qty);
+ } else {
+ storeData.StoreFoodDetails(item, price, 1);
+ }
+ print(item);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final _menuList = Provider.of>(context) ?? [];
+ if (_menuList.length == 0) {
+ return Container(
+ height: 200,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SpinKitDualRing(
+ color: Colors.deepOrange,
+ size: 38,
+ ),
+ SizedBox(height: 20),
+ Text('LOADING', style: TextStyle(fontWeight: FontWeight.w500))
+ ]),
+ );
+ } else {
+ return Column(
+ children: [
+ Expanded(
+ child: Container(
+ child: ListView.builder(
+ physics: NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ itemCount: _menuList.length,
+ itemBuilder: (_, index) {
+ return ListTile(
+ title: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ children: [
+ SizedBox(width: 15),
+ Text(
+ '${_menuList[index].item}',
+ style: TextStyle(
+ fontSize: 17,
+ fontWeight: FontWeight.bold),
+ ),
+ ],
+ ),
+ InkWell(
+ onTap: () {
+ addToCart(_menuList[index]);
+ },
+ child: Container(
+ height: 45,
+ width: 43,
+ margin: EdgeInsets.only(top: 6),
+ alignment: Alignment.center,
+ decoration:
+ BoxDecoration(color: Colors.deepOrange, borderRadius: BorderRadius.circular(10)),
+ child: IconButton(
+ onPressed: () {
+ showFlushbar(context);
+ addToCart(_menuList[index]);
+ setState(() {
+ checked = !checked;
+ });
+ },
+ icon: Icon(
+ Icons.add,
+ color: Colors.white,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ Container(
+ margin: new EdgeInsets.symmetric(
+ vertical: 3, horizontal: 16.0),
+ child: Text(
+ '₹' + '${_menuList[index].price}',
+ style: TextStyle(
+ fontSize: 15,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey,
+ height: 2,
+ thickness: 1,
+ indent: 5,
+ endIndent: 5,
+ ),
+ ],
+ ),
+ );
+ })),
+ )
+ ],
+ );
+ }
+ }
+}
diff --git a/lib/pages/CategoryMenuList/Bread_Menu.dart b/lib/pages/CategoryMenuList/Bread_Menu.dart
new file mode 100644
index 0000000..bed5043
--- /dev/null
+++ b/lib/pages/CategoryMenuList/Bread_Menu.dart
@@ -0,0 +1,232 @@
+import 'package:flushbar/flushbar.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_spinkit/flutter_spinkit.dart';
+import 'package:rcapp/models/user.dart';
+import 'package:rcapp/pages/CategoryMenuList/flushbar.dart';
+import 'package:rcapp/pages/storeData.dart';
+import 'package:provider/provider.dart';
+import 'package:rcapp/services/database.dart';
+
+class Bread_MenuList extends StatefulWidget {
+ @override
+ _Bread_MenuListState createState() => _Bread_MenuListState();
+}
+
+class _Bread_MenuListState extends State {
+ StoreData dataforCart = StoreData();
+ int total = 0;
+
+ int qty = 0;
+ List qtyList = List();
+
+ @override
+ Widget build(BuildContext context) {
+ return StreamProvider>.value(
+ value: DatabaseService().breadmenu,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: Colors.deepOrange,
+ title: Text('Breads'),
+ actions: [
+ IconButton(
+ icon: Icon(
+ Icons.shopping_cart,
+ color: Colors.white,
+ ),
+ onPressed: () {
+ Navigator.pushNamed(context, '/cart');
+ // Navigator.popAndPushNamed(context, '/cart');
+ },
+ )
+ ],
+ ),
+ body: Column(
+ children: [
+ Expanded(
+ child: BiryaniMenuListListPage(),
+ )
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class BiryaniMenuListListPage extends StatefulWidget {
+ @override
+ _BiryaniMenuListListPageState createState() =>
+ _BiryaniMenuListListPageState();
+}
+
+class _BiryaniMenuListListPageState extends State {
+ StoreData storeData = StoreData();
+ int total = 0;
+ bool checked = false;
+ Map quantityDetail = Map();
+ int qty = 0;
+ List qtyList = List();
+
+ void updateTotal() {
+ Map foodDetail = storeData.retrieveFoodDetails();
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ total = 0;
+
+ setState(() {
+ qtyDetail.forEach((key, value) => qtyList.add(value));
+ foodDetail.forEach((k, v) => total = total + v * qtyDetail[k]);
+ });
+ }
+
+ void quantityIncreement(String foodName) {
+ storeData.increaseQty(foodName);
+ updateTotal();
+ }
+
+ void quantityDecreement(String foodName) {
+ storeData.decreaseQty(foodName);
+ updateTotal();
+ }
+
+ void update() {
+ Map qtyCart = storeData.retrieveQtyDetails();
+ Map foodDetail = storeData.retrieveFoodDetails();
+
+ setState(() {
+ qty = 0;
+ qtyCart.forEach((key, value) {
+ qty += value;
+ qtyList.add(value);
+ });
+ foodDetail.forEach((k, v) => total = total + v * qtyCart[k]);
+ });
+ }
+
+ void addToCart(BreadMenu post) {
+ String item = post.item;
+ int price = post.price;
+
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ int qty = 1;
+
+ qtyDetail.forEach((key, value) {
+ if (key == item) {
+ qty = value;
+ }
+ });
+
+ if (qty > 1) {
+ storeData.StoreFoodDetails(item, price, qty);
+ } else {
+ storeData.StoreFoodDetails(item, price, 1);
+ }
+ print(item);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final _menuList = Provider.of>(context) ?? [];
+ if (_menuList.length == 0) {
+ return Container(
+ height: 200,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SpinKitDualRing(
+ color: Colors.deepOrange,
+ size: 38,
+ ),
+ SizedBox(height: 20),
+ Text('LOADING', style: TextStyle(fontWeight: FontWeight.w500))
+ ]),
+ );
+ } else {
+ return Column(
+ children: [
+ Expanded(
+ child: Container(
+ child: ListView.builder(
+ physics: NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ itemCount: _menuList.length,
+ itemBuilder: (_, index) {
+ return ListTile(
+ title: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ children: [
+ SizedBox(width: 15),
+ Text(
+ '${_menuList[index].item}',
+ style: TextStyle(
+ fontSize: 17,
+ fontWeight: FontWeight.bold),
+ ),
+ ],
+ ),
+ InkWell(
+ onTap: () {
+ addToCart(_menuList[index]);
+ },
+ child: Container(
+ height: 45,
+ width: 43,
+ margin: EdgeInsets.only(top: 6),
+ alignment: Alignment.center,
+ decoration: BoxDecoration(
+ color: Colors.deepOrange,
+ borderRadius:
+ BorderRadius.circular(10)),
+ child: IconButton(
+ onPressed: () {
+ showFlushbar(context);
+ addToCart(_menuList[index]);
+ setState(() {
+ checked = !checked;
+ });
+ },
+ icon: Icon(
+ Icons.add,
+ color: Colors.white,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ Container(
+ margin: new EdgeInsets.symmetric(
+ vertical: 3, horizontal: 16.0),
+ child: Text(
+ '₹' + '${_menuList[index].price}',
+ style: TextStyle(
+ fontSize: 15,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey,
+ height: 2,
+ thickness: 1,
+ indent: 5,
+ endIndent: 5,
+ ),
+ ],
+ ),
+ );
+ })),
+ )
+ ],
+ );
+ }
+ }
+}
diff --git a/lib/pages/CategoryMenuList/Breakfast_Menu.dart b/lib/pages/CategoryMenuList/Breakfast_Menu.dart
new file mode 100644
index 0000000..380c409
--- /dev/null
+++ b/lib/pages/CategoryMenuList/Breakfast_Menu.dart
@@ -0,0 +1,231 @@
+import 'package:flushbar/flushbar.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_spinkit/flutter_spinkit.dart';
+import 'package:rcapp/models/user.dart';
+import 'package:rcapp/pages/CategoryMenuList/flushbar.dart';
+import 'package:rcapp/pages/storeData.dart';
+import 'package:provider/provider.dart';
+import 'package:rcapp/services/database.dart';
+
+class Breakfast_MenuList extends StatefulWidget {
+ @override
+ _Breakfast_MenuListState createState() => _Breakfast_MenuListState();
+}
+
+class _Breakfast_MenuListState extends State {
+ StoreData dataforCart = StoreData();
+ int total = 0;
+
+ int qty = 0;
+ List qtyList = List();
+
+ @override
+ Widget build(BuildContext context) {
+ return StreamProvider>.value(
+ value: DatabaseService().breadmenu,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: Colors.deepOrange,
+ title: Text('Breakfast'),
+ actions: [
+ IconButton(
+ icon: Icon(
+ Icons.shopping_cart,
+ color: Colors.white,
+ ),
+ onPressed: () {
+ Navigator.pushNamed(context, '/cart');
+ // Navigator.popAndPushNamed(context, '/cart');
+ },
+ )
+ ],
+ ),
+ body: Column(
+ children: [
+ Expanded(
+ child: BreadMenuListListPage(),
+ )
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class BreadMenuListListPage extends StatefulWidget {
+ @override
+ _BreadMenuListListPageState createState() => _BreadMenuListListPageState();
+}
+
+class _BreadMenuListListPageState extends State {
+ StoreData storeData = StoreData();
+ int total = 0;
+ bool checked = false;
+ Map quantityDetail = Map();
+ int qty = 0;
+ List qtyList = List();
+
+ void updateTotal() {
+ Map foodDetail = storeData.retrieveFoodDetails();
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ total = 0;
+
+ setState(() {
+ qtyDetail.forEach((key, value) => qtyList.add(value));
+ foodDetail.forEach((k, v) => total = total + v * qtyDetail[k]);
+ });
+ }
+
+ void quantityIncreement(String foodName) {
+ storeData.increaseQty(foodName);
+ updateTotal();
+ }
+
+ void quantityDecreement(String foodName) {
+ storeData.decreaseQty(foodName);
+ updateTotal();
+ }
+
+ void update() {
+ Map qtyCart = storeData.retrieveQtyDetails();
+ Map foodDetail = storeData.retrieveFoodDetails();
+
+ setState(() {
+ qty = 0;
+ qtyCart.forEach((key, value) {
+ qty += value;
+ qtyList.add(value);
+ });
+ foodDetail.forEach((k, v) => total = total + v * qtyCart[k]);
+ });
+ }
+
+ void addToCart(BreadMenu post) {
+ String item = post.item;
+ int price = post.price;
+
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ int qty = 1;
+
+ qtyDetail.forEach((key, value) {
+ if (key == item) {
+ qty = value;
+ }
+ });
+
+ if (qty > 1) {
+ storeData.StoreFoodDetails(item, price, qty);
+ } else {
+ storeData.StoreFoodDetails(item, price, 1);
+ }
+ print(item);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final _menuList = Provider.of>(context) ?? [];
+ if (_menuList.length == 0) {
+ return Container(
+ height: 200,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SpinKitDualRing(
+ color: Colors.deepOrange,
+ size: 38,
+ ),
+ SizedBox(height: 20),
+ Text('LOADING', style: TextStyle(fontWeight: FontWeight.w500))
+ ]),
+ );
+ } else {
+ return Column(
+ children: [
+ Expanded(
+ child: Container(
+ child: ListView.builder(
+ physics: NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ itemCount: _menuList.length,
+ itemBuilder: (_, index) {
+ return ListTile(
+ title: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ children: [
+ SizedBox(width: 15),
+ Text(
+ '${_menuList[index].item}',
+ style: TextStyle(
+ fontSize: 17,
+ fontWeight: FontWeight.bold),
+ ),
+ ],
+ ),
+ InkWell(
+ onTap: () {
+ addToCart(_menuList[index]);
+ },
+ child: Container(
+ height: 45,
+ width: 43,
+ margin: EdgeInsets.only(top: 6),
+ alignment: Alignment.center,
+ decoration: BoxDecoration(
+ color: Colors.deepOrange,
+ borderRadius:
+ BorderRadius.circular(10)),
+ child: IconButton(
+ onPressed: () {
+ showFlushbar(context);
+ addToCart(_menuList[index]);
+ setState(() {
+ checked = !checked;
+ });
+ },
+ icon: Icon(
+ Icons.add,
+ color: Colors.white,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ Container(
+ margin: new EdgeInsets.symmetric(
+ vertical: 3, horizontal: 16.0),
+ child: Text(
+ '₹' + '${_menuList[index].price}',
+ style: TextStyle(
+ fontSize: 15,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey,
+ height: 2,
+ thickness: 1,
+ indent: 5,
+ endIndent: 5,
+ ),
+ ],
+ ),
+ );
+ })),
+ )
+ ],
+ );
+ }
+ }
+}
diff --git a/lib/pages/CategoryMenuList/Burger_Menu.dart b/lib/pages/CategoryMenuList/Burger_Menu.dart
new file mode 100644
index 0000000..600646c
--- /dev/null
+++ b/lib/pages/CategoryMenuList/Burger_Menu.dart
@@ -0,0 +1,229 @@
+import 'package:flushbar/flushbar.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_spinkit/flutter_spinkit.dart';
+import 'package:rcapp/models/user.dart';
+import 'package:rcapp/pages/CategoryMenuList/flushbar.dart';
+import 'package:rcapp/pages/storeData.dart';
+import 'package:provider/provider.dart';
+import 'package:rcapp/services/database.dart';
+
+class Burger_MenuList extends StatefulWidget {
+ @override
+ _Burger_MenuListState createState() => _Burger_MenuListState();
+}
+
+class _Burger_MenuListState extends State {
+ StoreData dataforCart = StoreData();
+ int total = 0;
+
+ int qty = 0;
+ List qtyList = List();
+
+ @override
+ Widget build(BuildContext context) {
+ return StreamProvider>.value(
+ value: DatabaseService().burgermenu,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: Colors.deepOrange,
+ title: Text('Burgers'),
+ actions: [
+ IconButton(
+ icon: Icon(
+ Icons.shopping_cart,
+ color: Colors.white,
+ ),
+ onPressed: () {
+ Navigator.pushNamed(context, '/cart');
+ // Navigator.popAndPushNamed(context, '/cart');
+ },
+ )
+ ],
+ ),
+ body: Column(
+ children: [
+ Expanded(
+ child: BurgerMenuListListPage(),
+ )
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class BurgerMenuListListPage extends StatefulWidget {
+ @override
+ _BurgerMenuListListPageState createState() => _BurgerMenuListListPageState();
+}
+
+class _BurgerMenuListListPageState extends State {
+ StoreData storeData = StoreData();
+ int total = 0;
+ bool checked = false;
+ Map quantityDetail = Map();
+ int qty = 0;
+ List qtyList = List();
+
+ void updateTotal() {
+ Map foodDetail = storeData.retrieveFoodDetails();
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ total = 0;
+
+ setState(() {
+ qtyDetail.forEach((key, value) => qtyList.add(value));
+ foodDetail.forEach((k, v) => total = total + v * qtyDetail[k]);
+ });
+ }
+
+ void quantityIncreement(String foodName) {
+ storeData.increaseQty(foodName);
+ updateTotal();
+ }
+
+ void quantityDecreement(String foodName) {
+ storeData.decreaseQty(foodName);
+ updateTotal();
+ }
+
+ void update() {
+ Map qtyCart = storeData.retrieveQtyDetails();
+ Map foodDetail = storeData.retrieveFoodDetails();
+
+ setState(() {
+ qty = 0;
+ qtyCart.forEach((key, value) {
+ qty += value;
+ qtyList.add(value);
+ });
+ foodDetail.forEach((k, v) => total = total + v * qtyCart[k]);
+ });
+ }
+
+ void addToCart(BurgerMenu post) {
+ String item = post.item;
+ int price = post.price;
+
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ int qty = 1;
+
+ qtyDetail.forEach((key, value) {
+ if (key == item) {
+ qty = value;
+ }
+ });
+
+ if (qty > 1) {
+ storeData.StoreFoodDetails(item, price, qty);
+ } else {
+ storeData.StoreFoodDetails(item, price, 1);
+ }
+ print(item);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final _menuList = Provider.of>(context) ?? [];
+ if (_menuList.length == 0) {
+ return Container(
+ height: 200,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SpinKitDualRing(
+ color: Colors.deepOrange,
+ size: 38,
+ ),
+ SizedBox(height: 20),
+ Text('LOADING', style: TextStyle(fontWeight: FontWeight.w500))
+ ]),
+ );
+ } else {
+ return Column(
+ children: [
+ Expanded(
+ child: Container(
+ child: ListView.builder(
+ physics: NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ itemCount: _menuList.length,
+ itemBuilder: (_, index) {
+ return ListTile(
+ title: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ children: [
+ SizedBox(width: 15),
+ Text(
+ '${_menuList[index].item}',
+ style: TextStyle(
+ fontSize: 17,
+ fontWeight: FontWeight.bold),
+ ),
+ ],
+ ),
+ InkWell(
+ onTap: () {
+ addToCart(_menuList[index]);
+ },
+ child: Container(
+ height: 45,
+ width: 43,
+ margin: EdgeInsets.only(top: 6),
+ alignment: Alignment.center,
+ decoration:
+ BoxDecoration(color: Colors.deepOrange, borderRadius: BorderRadius.circular(10)),
+ child: IconButton(
+ onPressed: () {
+ showFlushbar(context);
+ addToCart(_menuList[index]);
+ setState(() {
+ checked = !checked;
+ });
+ },
+ icon: Icon(
+ Icons.add,
+ color: Colors.white,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ Container(
+ margin: new EdgeInsets.symmetric(
+ vertical: 3, horizontal: 16.0),
+ child: Text(
+ '₹' + '${_menuList[index].price}',
+ style: TextStyle(
+ fontSize: 15,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey,
+ height: 2,
+ thickness: 1,
+ indent: 5,
+ endIndent: 5,
+ ),
+ ],
+ ),
+ );
+ })),
+ )
+ ],
+ );
+ }
+ }
+}
diff --git a/lib/pages/CategoryMenuList/Chinese_Menu.dart b/lib/pages/CategoryMenuList/Chinese_Menu.dart
new file mode 100644
index 0000000..b096949
--- /dev/null
+++ b/lib/pages/CategoryMenuList/Chinese_Menu.dart
@@ -0,0 +1,224 @@
+import 'package:flushbar/flushbar.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_spinkit/flutter_spinkit.dart';
+import 'package:rcapp/models/user.dart';
+import 'package:rcapp/pages/CategoryMenuList/flushbar.dart';
+import 'package:rcapp/pages/storeData.dart';
+import 'package:provider/provider.dart';
+import 'package:rcapp/services/database.dart';
+
+class ChineseMenuList extends StatefulWidget {
+ @override
+ _ChineseMenuListState createState() => _ChineseMenuListState();
+}
+
+class _ChineseMenuListState extends State {
+ StoreData dataforCart = StoreData();
+ int total = 0;
+
+ int qty = 0;
+ List qtyList = List();
+
+ @override
+ Widget build(BuildContext context) {
+ return StreamProvider>.value(
+ value: DatabaseService().chinese,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: Colors.deepOrange,
+ title: Text('Chinese'),
+ actions: [
+ IconButton(
+ icon: Icon(
+ Icons.shopping_cart,
+ color: Colors.white,
+ ),
+ onPressed: () {
+ Navigator.pushNamed(context, '/cart');
+ },
+ )
+ ],
+ ),
+ body: Column(
+ children: [
+ Expanded(
+ child: ChineseMenuListPage(),
+ )
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class ChineseMenuListPage extends StatefulWidget {
+ @override
+ _ChineseMenuListPageState createState() => _ChineseMenuListPageState();
+}
+
+class _ChineseMenuListPageState extends State {
+ StoreData storeData = StoreData();
+ int total = 0;
+ bool checked = false;
+ Map quantityDetail = Map();
+ int qty = 0;
+ List qtyList = List();
+
+ void updateTotal() {
+ Map foodDetail = storeData.retrieveFoodDetails();
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ total = 0;
+
+ setState(() {
+ qtyDetail.forEach((key, value) => qtyList.add(value));
+ foodDetail.forEach((k, v) => total = total + v * qtyDetail[k]);
+ });
+ }
+
+ void quantityIncreement(String foodName) {
+ storeData.increaseQty(foodName);
+ updateTotal();
+ }
+
+ void quantityDecreement(String foodName) {
+ storeData.decreaseQty(foodName);
+ updateTotal();
+ }
+
+ void update() {
+ Map qtyCart = storeData.retrieveQtyDetails();
+ Map foodDetail = storeData.retrieveFoodDetails();
+
+ setState(() {
+ qty = 0;
+ qtyCart.forEach((key, value) {
+ qty += value;
+ qtyList.add(value);
+ });
+ foodDetail.forEach((k, v) => total = total + v * qtyCart[k]);
+ });
+ }
+
+ void addToCart(ChineseMenu post) {
+ String item = post.item;
+ int price = post.price;
+
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ int qty = 1;
+
+ qtyDetail.forEach((key, value) {
+ if (key == item) {
+ qty = value;
+ }
+ });
+
+ if (qty > 1) {
+ storeData.StoreFoodDetails(item, price, qty);
+ } else {
+ storeData.StoreFoodDetails(item, price, 1);
+ }
+ print(item);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final _menuList = Provider.of>(context) ?? [];
+ if (_menuList.length == 0) {
+ return Container(
+ height: 200,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SpinKitDualRing(
+ color: Colors.deepOrange,
+ size: 38,
+ ),
+ SizedBox(height: 20),
+ Text('LOADING', style: TextStyle(fontWeight: FontWeight.w500))
+ ]),
+ );
+ } else {
+ return Column(
+ children: [
+ Expanded(
+ child: Container(
+ child: ListView.builder(
+ physics: NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ itemCount: _menuList.length,
+ itemBuilder: (_, index) {
+ return ListTile(
+ title: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ children: [
+ SizedBox(width: 15),
+ Text(
+ '${_menuList[index].item}',
+ style: TextStyle(
+ fontSize: 17,
+ fontWeight: FontWeight.bold),
+ ),
+ ],
+ ),
+ Container(
+ height: 45,
+ width: 43,
+ margin: EdgeInsets.only(top: 6),
+ alignment: Alignment.center,
+ decoration: BoxDecoration(
+ color: Colors.deepOrange,
+ borderRadius: BorderRadius.circular(10)),
+ child: IconButton(
+ onPressed: () {
+ showFlushbar(context);
+ addToCart(_menuList[index]);
+ setState(() {
+ checked = !checked;
+ });
+ },
+ icon: Icon(
+ Icons.add,
+ color: Colors.white,
+ ),
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ Container(
+ margin: new EdgeInsets.symmetric(
+ vertical: 3, horizontal: 16.0),
+ child: Text(
+ '₹' + '${_menuList[index].price}',
+ style: TextStyle(
+ fontSize: 15,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey,
+ height: 2,
+ thickness: 1,
+ indent: 5,
+ endIndent: 5,
+ ),
+ ],
+ ),
+ );
+ })),
+ )
+ ],
+ );
+ }
+ }
+}
diff --git a/lib/pages/CategoryMenuList/FriedRiceAndNoodles_Menu.dart b/lib/pages/CategoryMenuList/FriedRiceAndNoodles_Menu.dart
new file mode 100644
index 0000000..fce8e45
--- /dev/null
+++ b/lib/pages/CategoryMenuList/FriedRiceAndNoodles_Menu.dart
@@ -0,0 +1,229 @@
+import 'package:flushbar/flushbar.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_spinkit/flutter_spinkit.dart';
+import 'package:rcapp/models/user.dart';
+import 'package:rcapp/pages/CategoryMenuList/flushbar.dart';
+import 'package:rcapp/pages/storeData.dart';
+import 'package:provider/provider.dart';
+import 'package:rcapp/services/database.dart';
+
+class FriedRiceAndNoodles_MenuList extends StatefulWidget {
+ @override
+ _FriedRiceAndNoodles_MenuListState createState() => _FriedRiceAndNoodles_MenuListState();
+}
+
+class _FriedRiceAndNoodles_MenuListState extends State {
+ StoreData dataforCart = StoreData();
+ int total = 0;
+
+ int qty = 0;
+ List qtyList = List();
+
+ @override
+ Widget build(BuildContext context) {
+ return StreamProvider>.value(
+ value: DatabaseService().friedriceandmenu,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: Colors.deepOrange,
+ title: Text('Fried Rice and Noodles'),
+ actions: [
+ IconButton(
+ icon: Icon(
+ Icons.shopping_cart,
+ color: Colors.white,
+ ),
+ onPressed: () {
+ Navigator.pushNamed(context, '/cart');
+ // Navigator.popAndPushNamed(context, '/cart');
+ },
+ )
+ ],
+ ),
+ body: Column(
+ children: [
+ Expanded(
+ child: FriedRiceAndNoodlesMenuListListPage(),
+ )
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class FriedRiceAndNoodlesMenuListListPage extends StatefulWidget {
+ @override
+ _FriedRiceAndNoodlesMenuListListPageState createState() => _FriedRiceAndNoodlesMenuListListPageState();
+}
+
+class _FriedRiceAndNoodlesMenuListListPageState extends State {
+ StoreData storeData = StoreData();
+ int total = 0;
+ bool checked = false;
+ Map quantityDetail = Map();
+ int qty = 0;
+ List qtyList = List();
+
+ void updateTotal() {
+ Map foodDetail = storeData.retrieveFoodDetails();
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ total = 0;
+
+ setState(() {
+ qtyDetail.forEach((key, value) => qtyList.add(value));
+ foodDetail.forEach((k, v) => total = total + v * qtyDetail[k]);
+ });
+ }
+
+ void quantityIncreement(String foodName) {
+ storeData.increaseQty(foodName);
+ updateTotal();
+ }
+
+ void quantityDecreement(String foodName) {
+ storeData.decreaseQty(foodName);
+ updateTotal();
+ }
+
+ void update() {
+ Map qtyCart = storeData.retrieveQtyDetails();
+ Map foodDetail = storeData.retrieveFoodDetails();
+
+ setState(() {
+ qty = 0;
+ qtyCart.forEach((key, value) {
+ qty += value;
+ qtyList.add(value);
+ });
+ foodDetail.forEach((k, v) => total = total + v * qtyCart[k]);
+ });
+ }
+
+ void addToCart(FriedRiceAndNoodlesMenu post) {
+ String item = post.item;
+ int price = post.price;
+
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ int qty = 1;
+
+ qtyDetail.forEach((key, value) {
+ if (key == item) {
+ qty = value;
+ }
+ });
+
+ if (qty > 1) {
+ storeData.StoreFoodDetails(item, price, qty);
+ } else {
+ storeData.StoreFoodDetails(item, price, 1);
+ }
+ print(item);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final _menuList = Provider.of>(context) ?? [];
+ if (_menuList.length == 0) {
+ return Container(
+ height: 200,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SpinKitDualRing(
+ color: Colors.deepOrange,
+ size: 38,
+ ),
+ SizedBox(height: 20),
+ Text('LOADING', style: TextStyle(fontWeight: FontWeight.w500))
+ ]),
+ );
+ } else {
+ return Column(
+ children: [
+ Expanded(
+ child: Container(
+ child: ListView.builder(
+ physics: NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ itemCount: _menuList.length,
+ itemBuilder: (_, index) {
+ return ListTile(
+ title: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Row(
+ children: [
+ SizedBox(width: 15),
+ Text(
+ '${_menuList[index].item}',
+ style: TextStyle(
+ fontSize: 17,
+ fontWeight: FontWeight.bold),
+ ),
+ ],
+ ),
+ InkWell(
+ onTap: () {
+ addToCart(_menuList[index]);
+ },
+ child: Container(
+ height: 45,
+ width: 43,
+ margin: EdgeInsets.only(top: 6),
+ alignment: Alignment.center,
+ decoration:
+ BoxDecoration(color: Colors.deepOrange, borderRadius: BorderRadius.circular(10)),
+ child: IconButton(
+ onPressed: () {
+ showFlushbar(context);
+ addToCart(_menuList[index]);
+ setState(() {
+ checked = !checked;
+ });
+ },
+ icon: Icon(
+ Icons.add,
+ color: Colors.white,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ Container(
+ margin: new EdgeInsets.symmetric(
+ vertical: 3, horizontal: 16.0),
+ child: Text(
+ '₹' + '${_menuList[index].price}',
+ style: TextStyle(
+ fontSize: 15,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ ],
+ ),
+ Divider(
+ color: Colors.grey,
+ height: 2,
+ thickness: 1,
+ indent: 5,
+ endIndent: 5,
+ ),
+ ],
+ ),
+ );
+ })),
+ )
+ ],
+ );
+ }
+ }
+}
diff --git a/lib/pages/CategoryMenuList/MainCourse_Menu.dart b/lib/pages/CategoryMenuList/MainCourse_Menu.dart
new file mode 100644
index 0000000..7f19ff1
--- /dev/null
+++ b/lib/pages/CategoryMenuList/MainCourse_Menu.dart
@@ -0,0 +1,233 @@
+import 'package:flushbar/flushbar.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_spinkit/flutter_spinkit.dart';
+import 'package:rcapp/models/user.dart';
+import 'package:rcapp/pages/CategoryMenuList/flushbar.dart';
+import 'package:rcapp/pages/storeData.dart';
+import 'package:provider/provider.dart';
+import 'package:rcapp/services/database.dart';
+
+class MainCourse_MenuList extends StatefulWidget {
+ @override
+ _MainCourse_MenuListState createState() => _MainCourse_MenuListState();
+}
+
+class _MainCourse_MenuListState extends State {
+ StoreData dataforCart = StoreData();
+ int total = 0;
+
+ int qty = 0;
+ List qtyList = List();
+
+ @override
+ Widget build(BuildContext context) {
+ return StreamProvider>.value(
+ value: DatabaseService().maincourse,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: Colors.deepOrange,
+ title: Text('Main Course'),
+ actions: [
+ IconButton(
+ icon: Icon(
+ Icons.shopping_cart,
+ color: Colors.white,
+ ),
+ onPressed: () {
+ Navigator.pushNamed(context, '/cart');
+ // Navigator.popAndPushNamed(context, '/cart');
+ },
+ )
+ ],
+ ),
+ body: Column(
+ children: [
+ Expanded(
+ child: MainCourseMenuListListPage(),
+ )
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class MainCourseMenuListListPage extends StatefulWidget {
+ @override
+ _MainCourseMenuListListPageState createState() =>
+ _MainCourseMenuListListPageState();
+}
+
+class _MainCourseMenuListListPageState
+ extends State {
+ StoreData storeData = StoreData();
+ int total = 0;
+ bool checked = false;
+ Map quantityDetail = Map();
+ int qty = 0;
+ List qtyList = List();
+
+ void updateTotal() {
+ Map foodDetail = storeData.retrieveFoodDetails();
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ total = 0;
+
+ setState(() {
+ qtyDetail.forEach((key, value) => qtyList.add(value));
+ foodDetail.forEach((k, v) => total = total + v * qtyDetail[k]);
+ });
+ }
+
+ void quantityIncreement(String foodName) {
+ storeData.increaseQty(foodName);
+ updateTotal();
+ }
+
+ void quantityDecreement(String foodName) {
+ storeData.decreaseQty(foodName);
+ updateTotal();
+ }
+
+ void update() {
+ Map qtyCart = storeData.retrieveQtyDetails();
+ Map foodDetail = storeData.retrieveFoodDetails();
+
+ setState(() {
+ qty = 0;
+ qtyCart.forEach((key, value) {
+ qty += value;
+ qtyList.add(value);
+ });
+ foodDetail.forEach((k, v) => total = total + v * qtyCart[k]);
+ });
+ }
+
+ void addToCart(MainCourseMenu post) {
+ String item = post.item;
+ int price = post.price;
+
+ Map qtyDetail = storeData.retrieveQtyDetails();
+
+ int qty = 1;
+
+ qtyDetail.forEach((key, value) {
+ if (key == item) {
+ qty = value;
+ }
+ });
+
+ if (qty > 1) {
+ storeData.StoreFoodDetails(item, price, qty);
+ } else {
+ storeData.StoreFoodDetails(item, price, 1);
+ }
+ print(item);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final _menuList = Provider.of>(context) ?? [];
+ if (_menuList.length == 0) {
+ return Container(
+ height: 200,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SpinKitDualRing(
+ color: Colors.deepOrange,
+ size: 38,
+ ),
+ SizedBox(height: 20),
+ Text('LOADING', style: TextStyle(fontWeight: FontWeight.w500))
+ ]),
+ );
+ } else {
+ return Column(
+ children: