From 3c9870f00dd340782fde57c6c7aab9602fba27c1 Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Sat, 26 Sep 2020 00:57:46 +0530 Subject: [PATCH 01/19] initial commit --- lib/pages/Cart.dart | 2 +- lib/pages/Home.dart | 11 +-- lib/pages/add_event.dart | 2 +- lib/pages/address.dart | 106 +++++++++++++++++------------ lib/pages/admin_order_confirm.dart | 72 +++++++++++++++----- lib/pages/confirmOrder.dart | 71 +++++++++---------- lib/pages/customAlert.dart | 6 +- lib/pages/previousOrder.dart | 53 +++++++++++++-- 8 files changed, 207 insertions(+), 116 deletions(-) diff --git a/lib/pages/Cart.dart b/lib/pages/Cart.dart index 681cb26..4c51609 100644 --- a/lib/pages/Cart.dart +++ b/lib/pages/Cart.dart @@ -418,7 +418,7 @@ class _ProceedAccessState extends State { title: 'Order Placed!', description: 'Your Order has been placed and will be on its way to you shortly', - url: 'assets/nigga.gif', + // url: 'assets/nigga.gif', )); }, child: Text( diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart index e5b1427..74a0985 100644 --- a/lib/pages/Home.dart +++ b/lib/pages/Home.dart @@ -201,16 +201,7 @@ class _HomeState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ InkWell( - onTap: () { - showDialog( - context: context, - builder: (context) => CustomAlert( - title: 'hello world nigga', - description: - 'teri maa ki choot madarchod order karta hai bhosdiwale', - url: 'assets/nigga.gif', - )); - }, + onTap: () {}, child: Text( " Notice Board", style: GoogleFonts.inter( diff --git a/lib/pages/add_event.dart b/lib/pages/add_event.dart index 80de1fc..a5ea770 100644 --- a/lib/pages/add_event.dart +++ b/lib/pages/add_event.dart @@ -85,7 +85,7 @@ class _AddEventPageState extends State { title: 'Booking Requested', description: 'Your booking request has been forwarded to the administrator. You will get a confirmation notification within 24 hours and can view your booking in the calendar', - url: 'assets/nigga.gif', + // url: 'assets/nigga.gif', )); // Navigator.pop(context); diff --git a/lib/pages/address.dart b/lib/pages/address.dart index 4dd5b19..f87d456 100644 --- a/lib/pages/address.dart +++ b/lib/pages/address.dart @@ -19,6 +19,7 @@ class _AddressFormState extends State { String _city = ''; String _pincode = ''; String error = ''; + String number = ''; String _finaladdress = ''; @@ -88,7 +89,7 @@ class _AddressFormState extends State { SizedBox(height: 20.0), TextFormField( decoration: InputDecoration( - hintText: 'City', //hardcode to rourkela + hintText: 'City', //hardcode to rourkela fillColor: Colors.white, filled: true, enabledBorder: OutlineInputBorder( @@ -122,57 +123,76 @@ class _AddressFormState extends State { validator: (val) => val.isEmpty ? 'Please Enter Your Pincode' : null, obscureText: false, + keyboardType: TextInputType.number, onChanged: (val) { setState(() => _pincode = val); }), SizedBox(height: 20.0), - Container( - width: 64.0, - height: 40, - child:RaisedButton( - color: Colors.deepOrange, - padding: const EdgeInsets.symmetric( - horizontal: 40, vertical: 15), - child: Text( - 'Save', - style: GoogleFonts.inter( - color: Colors.white, - fontWeight: FontWeight.w400, - fontSize: 20), - ), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - onPressed: () async { - if (_formKey.currentState.validate()) { - var user = - (await FirebaseAuth.instance.currentUser()).uid; - setState(() { - _finaladdress = _houseno + - ", " + - _streetname + - ", " + - _city + - "-" + - _pincode; - }); - print(_finaladdress); - dynamic result = await _formUploader - .updateAddressData(user, _finaladdress); - if (result != null) { - setState(() => error = - 'could not upload address, please try again'); - } else { - Navigator.popAndPushNamed(context, '/cart'); - } - } - }, + TextFormField( + decoration: InputDecoration( + hintText: 'Mobile No.', + fillColor: Colors.white, + filled: true, + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.deepOrange, width: 1.0), + borderRadius: BorderRadius.circular(10)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.deepOrange, width: 3.0), + borderRadius: BorderRadius.circular(10))), + validator: (val) => + val.isEmpty ? 'Please Enter Mobile No.' : null, + obscureText: false, + keyboardType: TextInputType.number, + onChanged: (val) { + setState(() => number = val); + }), + SizedBox(height: 20.0), + RaisedButton( + color: Colors.deepOrange, + padding: const EdgeInsets.symmetric( + horizontal: 40, vertical: 15), + child: Text( + 'Save', + style: GoogleFonts.inter( + color: Colors.white, + fontWeight: FontWeight.w400, + fontSize: 25), ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + onPressed: () async { + if (_formKey.currentState.validate()) { + var user = + (await FirebaseAuth.instance.currentUser()).uid; + setState(() { + _finaladdress = _houseno + + ", " + + _streetname + + ", " + + _city + + "-" + + _pincode; + }); + print(_finaladdress); + dynamic result = await _formUploader + .updateAddressData(user, _finaladdress, number); + if (result != null) { + setState(() => error = + 'could not upload address, please try again'); + } else { + Navigator.popAndPushNamed(context, '/cart'); + } + } + }, ), SizedBox(height: 20.0), Text( error, - style: GoogleFonts.inter(color: Colors.red, fontSize: 14.0), + style: + GoogleFonts.inter(color: Colors.red, fontSize: 14.0), ) ]), )), diff --git a/lib/pages/admin_order_confirm.dart b/lib/pages/admin_order_confirm.dart index af36aaa..bed655b 100644 --- a/lib/pages/admin_order_confirm.dart +++ b/lib/pages/admin_order_confirm.dart @@ -206,8 +206,12 @@ class _AdminOrderState extends State { address: orders[index] ["address"], item: item[index], - quantity: - quantity[index]))); + quantity: quantity[index], + mobileNumber: + orders[index] + ["mobileNumber"], + price: orders[index] + ["price"]))); }, child: Container( padding: EdgeInsets.symmetric( @@ -287,7 +291,8 @@ class _AdminOrderState extends State { class AdminOrderData extends StatefulWidget { List item; List quantity; - AdminOrderData({this.item, this.quantity}); + List price; + AdminOrderData({this.item, this.quantity, this.price}); @override _AdminOrderDataState createState() => _AdminOrderDataState(); } @@ -310,6 +315,7 @@ class _AdminOrderDataState extends State { Text('${widget.item[index]} '), ])), Text('${widget.quantity[index]}'), + Text('${widget.price[index]}'), ], ); }), @@ -324,18 +330,21 @@ class AdminOrderDetails extends StatefulWidget { final String name; final String number; final String date; + final String mobileNumber; final List item; final List quantity; - AdminOrderDetails({ - this.orderNo, - this.total, - this.address, - this.name, - this.number, - this.date, - this.item, - this.quantity, - }); + final List price; + AdminOrderDetails( + {this.orderNo, + this.total, + this.address, + this.name, + this.number, + this.date, + this.item, + this.quantity, + this.mobileNumber, + this.price}); @override _AdminOrderDetailsState createState() => _AdminOrderDetailsState(); } @@ -454,6 +463,30 @@ class _AdminOrderDetailsState extends State { ]), ], ), + SizedBox(height: 10), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Mobile No. :", + style: GoogleFonts.inter( + color: Colors.grey, + fontSize: 18, + fontWeight: FontWeight.w500), + ), + SizedBox(height: 5), + Padding( + padding: EdgeInsets.fromLTRB(10, 0, 0, 0), + child: Text( + "${widget.mobileNumber}", + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400), + ), + ), + ], + ), ], ), SizedBox(height: 20), @@ -471,12 +504,17 @@ class _AdminOrderDetailsState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('Item Name', + Text('Item', + style: GoogleFonts.inter( + fontSize: 20, + fontWeight: FontWeight.w400, + decoration: TextDecoration.underline)), + Text('Qty', style: GoogleFonts.inter( fontSize: 20, fontWeight: FontWeight.w400, decoration: TextDecoration.underline)), - Text('Quantity', + Text('Price(per qty)', style: GoogleFonts.inter( fontSize: 20, fontWeight: FontWeight.w400, @@ -486,7 +524,9 @@ class _AdminOrderDetailsState extends State { ), Flexible( child: AdminOrderData( - item: widget.item, quantity: widget.quantity), + item: widget.item, + quantity: widget.quantity, + price: widget.price), ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/pages/confirmOrder.dart b/lib/pages/confirmOrder.dart index 4a60aad..d4b86ae 100644 --- a/lib/pages/confirmOrder.dart +++ b/lib/pages/confirmOrder.dart @@ -6,41 +6,42 @@ import 'package:rcapp/services/database.dart'; import 'package:flutter/material.dart'; StoreData storeData = StoreData(); - int total = 0; - int totalquantity = 1; - List itemList = List(); - List quantityList = List(); - - void updateTotal() { - Map foodDetail = storeData.retrieveFoodDetails(); - Map foodqtyDetail = storeData.retrieveQtyDetails(); - - - foodDetail.forEach((k, v) => total = total + v * foodqtyDetail[k]); - foodDetail.forEach((k, v) => totalquantity = totalquantity + v); - foodDetail.forEach((key, value) => itemList.add(key)); - foodqtyDetail.forEach((key, value) => quantityList.add(value)); - } - - void confirmOrder() async { - var user = await FirebaseAuth.instance.currentUser(); - var _dat = await Firestore.instance - .collection('userInfo') - .document(user.uid) - .get(); - - var userName = _dat.data["name"]; - var number = _dat.data["number"]; - var address = _dat.data["address"]; - - DatabaseService().confirmOrderofUser(user.uid, userName, number, address, - itemList, quantityList, total, false); - - storeData.resetStore(); - updateTotal(); - // Navigator.pushReplacementNamed(context, '/navigationbar'); - } - +int total = 0; +int totalquantity = 1; +List itemList = List(); +List priceList = List(); +List quantityList = List(); + +void updateTotal() { + Map foodDetail = storeData.retrieveFoodDetails(); + Map foodqtyDetail = storeData.retrieveQtyDetails(); + + foodDetail.forEach((k, v) => total = total + v * foodqtyDetail[k]); + foodDetail.forEach((k, v) => totalquantity = totalquantity + v); + foodDetail.forEach((key, value) { + itemList.add(key); + priceList.add(value); + }); + foodqtyDetail.forEach((key, value) => quantityList.add(value)); +} + +void confirmOrder() async { + var user = await FirebaseAuth.instance.currentUser(); + var _dat = + await Firestore.instance.collection('userInfo').document(user.uid).get(); + + var userName = _dat.data["name"]; + var number = _dat.data["number"]; + var address = _dat.data["address"]; + var mobileNumber = _dat.data["mobileNumber"]; + + DatabaseService().confirmOrderofUser(user.uid, userName, number, address, + itemList, priceList, quantityList, total, false, mobileNumber); + + storeData.resetStore(); + updateTotal(); + // Navigator.pushReplacementNamed(context, '/navigationbar'); +} // import 'package:cloud_firestore/cloud_firestore.dart'; // import 'package:firebase_auth/firebase_auth.dart'; diff --git a/lib/pages/customAlert.dart b/lib/pages/customAlert.dart index 3b2cc08..6d45e31 100644 --- a/lib/pages/customAlert.dart +++ b/lib/pages/customAlert.dart @@ -4,8 +4,8 @@ import 'package:google_fonts/google_fonts.dart'; class CustomAlert extends StatefulWidget { final title; final description; - final url; - CustomAlert({this.title, this.description, this.url}); + // final url; + CustomAlert({this.title, this.description}); @override _CustomAlertState createState() => _CustomAlertState(); } @@ -70,7 +70,7 @@ class _CustomAlertState extends State { child: CircleAvatar( backgroundColor: Colors.orangeAccent, radius: 50, - backgroundImage: AssetImage(widget.url), + // backgroundImage: AssetImage(widget.url), ), ) ], diff --git a/lib/pages/previousOrder.dart b/lib/pages/previousOrder.dart index b3eed43..211cf38 100644 --- a/lib/pages/previousOrder.dart +++ b/lib/pages/previousOrder.dart @@ -161,8 +161,11 @@ class _PreviousOrderState extends State { address: orders[index] ["address"], item: item[index], - quantity: - quantity[index]))); + quantity: quantity[index], + mobileNumber: orders[index] + ["mobileNumber"], + price: orders[index] + ["price"]))); }, child: Container( child: Text('Know More', @@ -190,7 +193,8 @@ class _PreviousOrderState extends State { class OrderData extends StatefulWidget { List item; List quantity; - OrderData({this.item, this.quantity}); + List price; + OrderData({this.item, this.quantity, this.price}); @override _OrderDataState createState() => _OrderDataState(); } @@ -213,6 +217,7 @@ class _OrderDataState extends State { Text('${widget.item[index]} '), ])), Text('${widget.quantity[index]}'), + Text('${widget.price[index]}') ], ); }), @@ -229,6 +234,8 @@ class PreviousOrderDetails extends StatefulWidget { final String date; final List item; final List quantity; + final String mobileNumber; + final List price; PreviousOrderDetails( {this.orderNo, this.total, @@ -237,7 +244,9 @@ class PreviousOrderDetails extends StatefulWidget { this.number, this.date, this.item, - this.quantity}); + this.quantity, + this.mobileNumber, + this.price}); @override _PreviousOrderDetailsState createState() => _PreviousOrderDetailsState(); } @@ -356,6 +365,29 @@ class _PreviousOrderDetailsState extends State { ]), ], ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Mobile No. :", + style: GoogleFonts.inter( + color: Colors.grey, + fontSize: 18, + fontWeight: FontWeight.w500), + ), + SizedBox(height: 5), + Padding( + padding: EdgeInsets.fromLTRB(10, 0, 0, 0), + child: Text( + "${widget.mobileNumber}", + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400), + ), + ), + ], + ), ], ), SizedBox(height: 20), @@ -373,12 +405,17 @@ class _PreviousOrderDetailsState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('Item Name', + Text('Item ', + style: GoogleFonts.inter( + fontSize: 20, + fontWeight: FontWeight.w400, + decoration: TextDecoration.underline)), + Text('Qty', style: GoogleFonts.inter( fontSize: 20, fontWeight: FontWeight.w400, decoration: TextDecoration.underline)), - Text('Quantity', + Text('Price(per qty)', style: GoogleFonts.inter( fontSize: 20, fontWeight: FontWeight.w400, @@ -388,7 +425,9 @@ class _PreviousOrderDetailsState extends State { ), Flexible( child: OrderData( - item: widget.item, quantity: widget.quantity), + item: widget.item, + quantity: widget.quantity, + price: widget.price), ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, From a3604f1d7d3dbc053c78ecabd8f4ab3c364b6438 Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Sat, 26 Sep 2020 01:13:06 +0530 Subject: [PATCH 02/19] intial commit --- lib/services/database.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/services/database.dart b/lib/services/database.dart index 9b64c22..b021705 100644 --- a/lib/services/database.dart +++ b/lib/services/database.dart @@ -80,8 +80,8 @@ class DatabaseService { }); } - Future updateAddressData(String id, String address) async { - return await userInfo.document(id).updateData({'address': address}); + Future updateAddressData(String id, String address, String number) async { + return await userInfo.document(id).updateData({'address': address, 'mobileNumber': number}); } Future updateTodayMenu(String food, int price, String url) async { @@ -121,7 +121,7 @@ class DatabaseService { } Future confirmOrderofUser(String id, String name, String number, - String address, List item, List qty, int total, bool isConfirmed) async { + String address, List item, List price, List qty, int total, bool isConfirmed, String mobileNumber) async { // var docId = '$id' + '$total'; var _date = DateTime.now().toUtc().millisecondsSinceEpoch; var forToken = await Firestore.instance.collection('userInfo').document(id).get(); @@ -132,6 +132,7 @@ class DatabaseService { 'number': number, 'address': address, 'item': item, + 'price': price, 'quantity': qty, 'total': total, 'isConfirmed': isConfirmed, @@ -141,7 +142,8 @@ class DatabaseService { '${DateTime.now().month}' + '/' + '${DateTime.now().year}', - 'token': _token + 'token': _token, + 'mobileNumber': mobileNumber }); } From 9871846861c5409c31654af6cee5451e621214df Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Sat, 26 Sep 2020 22:48:51 +0530 Subject: [PATCH 03/19] before --- assets/tick.gif | Bin 0 -> 29488 bytes firebase.json | 4 +- functions/dist/index.dev.js | 95 +++++++++++++++++++++++ functions/index.js | 31 +++----- lib/pages/BlueL.dart | 2 +- lib/pages/Booking.dart | 45 +++++------ lib/pages/Cart.dart | 45 ++++++++++- lib/pages/CategoryMenuList/flushbar.dart | 22 +++++- lib/pages/Food.dart | 2 +- lib/pages/Home.dart | 43 +--------- lib/pages/NavigationBar.dart | 57 ++++++++++++-- lib/pages/add_event.dart | 2 +- lib/pages/admin_order_confirm.dart | 63 ++++++++------- lib/pages/customAlert.dart | 2 +- lib/pages/previousOrder.dart | 67 +++++++++------- lib/pages/welcome.dart | 15 ---- lib/services/auth.dart | 8 ++ 17 files changed, 332 insertions(+), 171 deletions(-) create mode 100644 assets/tick.gif create mode 100644 functions/dist/index.dev.js diff --git a/assets/tick.gif b/assets/tick.gif new file mode 100644 index 0000000000000000000000000000000000000000..46b7247b0b046cfa4a30d9f7f697528ec3f16472 GIT binary patch literal 29488 zcmdSBbyOb9(l7kr?(XjH?h@QJxCVzH32wpN-GW^rQIZrFr*r@S)Ww7q)D$>1paB2?^2;9tFu)%OAS5R#3;uHU z{Bi(Z&Sb@Pzn}g%e%@jH^84jELh%>6f+Qdvh#C?&0Ejfb*b-oLfN*ScDhbZ zYA56=Ryn!o8DWAgg!Q4T2yZdLdTNOn!88%w!+_UcM6i9MSj zzyHbv#e^6RJG^keT$B3M@#pvynL*F%wrIY(xR1-}ZQdBl>%$tw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np7L5p}Rgh_N!g>#n@FhJHzpo-#`dtRDt@wR2_8n>awI2{>i zHTX6)oU_N8=_5(L>$BwNx9s!m5xA=tNTCN(67fZ;RxFL@LZD(KFnP~afC@BGej7n3 zh(@&2!Q{HYyM4IF@OCi+ID414I-88w>Ed5}YlDg&gaS94Yr3e;J9)o%vxPc& zO3Lkc5`QZY%HMp;Vk2-j+CkBmFP-a1Xe+{v$`H?Afc)5kN7(m?6RM=Z<_OmpNS9xS zzeF~?8hpUM>gShuMA|5CRtP}>?NFwQYPgFv_(zoF%HIh`)UBqRy}cuamA1+E08a@r zx!&AC5&PaVeH+WapB6Yo;Wu$6<~`Hmo`FTjP}Q_G2NI1HkWP+}J%xckX&uvkl+zY1 z?ksmC@Nl+SlrtDxi~aH$-PF@Nx2s+~xApxQxlp2(jUCBT { -// msgData = snapshot.data(); -// return fcm.sendToTopic('confirmedOrders', { -// notification: {title: snapshot.data().name, body: 'order has been placed',clickAction: 'FLUTTER_NOTIFICATION_CLICK'} -// }); - -// }); - -exports.adminOrderTrigger = functions.firestore.document('confirmedOrders/{id}').onCreate((snapshot, context) => { - var tokens = [ - 'd7cf7_GgXCg:APA91bF-HqKMwlAfTsy3dRv_LVuvxkDbiBOWkBMWHweu6X8wvq_9Zw7x8ws2qSepPOk1dypxySmiv-6ct72Pbzwu6nOejFCcTEy17-_k8EmvOEMvcS2BGP-ToNAqsfF9m_EbPG4jdlhu', - 'dtG7Gozeq5M:APA91bHAblBNNNJnPn9EY0DWqVLbTnT8jvZNctTDxLVI9QkYU7T0BJP_U8j_pjdRu0LYeNGYtDUHzPN22cmB1cT0z95Z1Y8NDHsJD8wuWHfPax68nwYa4OmgG4Ky6i5KjaHca7-AnWdc' - - ]; +exports.adminOrderTrigger = functions.firestore.document('confirmedOrders/{id}').onCreate(async (snapshot, context) => { + var tokens = []; + const _snap = await admin.firestore().collection('userInfo').where('isAdmin', '==', true).get(); + _snap.forEach((k) => { + tokens.push(k.data().token.toString()); + }) return fcm.sendToDevice(tokens, { notification: { title: 'New Order', @@ -33,11 +25,12 @@ exports.adminOrderTrigger = functions.firestore.document('confirmedOrders/{id}') }); -exports.adminBookingTrigger = functions.firestore.document('BookingDetails/{id}').onCreate((snapshot, context) => { - var tokens = [ - 'dtG7Gozeq5M:APA91bHAblBNNNJnPn9EY0DWqVLbTnT8jvZNctTDxLVI9QkYU7T0BJP_U8j_pjdRu0LYeNGYtDUHzPN22cmB1cT0z95Z1Y8NDHsJD8wuWHfPax68nwYa4OmgG4Ky6i5KjaHca7-AnWdc', - 'd7cf7_GgXCg:APA91bF-HqKMwlAfTsy3dRv_LVuvxkDbiBOWkBMWHweu6X8wvq_9Zw7x8ws2qSepPOk1dypxySmiv-6ct72Pbzwu6nOejFCcTEy17-_k8EmvOEMvcS2BGP-ToNAqsfF9m_EbPG4jdlhu' - ]; +exports.adminBookingTrigger = functions.firestore.document('BookingDetails/{id}').onCreate(async (snapshot, context) => { + var tokens = []; + const _snap = await admin.firestore().collection('userInfo').where('isAdmin', '==', true).get(); + _snap.forEach((k) => { + tokens.push(k.data().token.toString()); + }) return fcm.sendToDevice(tokens, { notification: { title: 'New Booking', diff --git a/lib/pages/BlueL.dart b/lib/pages/BlueL.dart index ae39e26..46340be 100644 --- a/lib/pages/BlueL.dart +++ b/lib/pages/BlueL.dart @@ -43,7 +43,7 @@ class _BlueLoungeState extends State { Text( "\nThe 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 ", style: GoogleFonts.inter( - fontSize: 20 + fontSize: 16 ), ), SizedBox( diff --git a/lib/pages/Booking.dart b/lib/pages/Booking.dart index 4df2a9e..fa8bda4 100644 --- a/lib/pages/Booking.dart +++ b/lib/pages/Booking.dart @@ -151,6 +151,29 @@ class _BookingState extends State { fit: BoxFit.fill)), ), ), + SizedBox(height: 20), + 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.w200), + ), + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.blue, + image: DecorationImage( + image: new AssetImage("assets/15.jpg"), + fit: BoxFit.fill)), + ), + ), SizedBox(width: 20), ], ), @@ -180,28 +203,6 @@ class _BookingState extends State { 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.w200), - ), - ), - 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: () { diff --git a/lib/pages/Cart.dart b/lib/pages/Cart.dart index 4c51609..617523b 100644 --- a/lib/pages/Cart.dart +++ b/lib/pages/Cart.dart @@ -387,6 +387,48 @@ class ProceedAccess extends StatefulWidget { } class _ProceedAccessState extends State { + StoreData storeData = StoreData(); + int total = 0; + int totalquantity = 1; + List itemList = List(); + List priceList = List(); + List quantityList = List(); + + void updateTotal() { + Map foodDetail = storeData.retrieveFoodDetails(); + Map foodqtyDetail = storeData.retrieveQtyDetails(); + + setState(() { + foodDetail.forEach((k, v) => total = total + v * foodqtyDetail[k]); + foodDetail.forEach((k, v) => totalquantity = totalquantity + v); + foodDetail.forEach((key, value) { + itemList.add(key); + priceList.add(value); + }); + foodqtyDetail.forEach((key, value) => quantityList.add(value)); + }); + } + + void confirmOrder() async { + var user = await FirebaseAuth.instance.currentUser(); + var _dat = await Firestore.instance + .collection('userInfo') + .document(user.uid) + .get(); + + var userName = _dat.data["name"]; + var number = _dat.data["number"]; + var address = _dat.data["address"]; + var mobileNumber = _dat.data["mobileNumber"]; + + DatabaseService().confirmOrderofUser(user.uid, userName, number, address, + itemList, priceList, quantityList, total, false, mobileNumber); + + storeData.resetStore(); + updateTotal(); + Navigator.pushReplacementNamed(context, '/navigationbar'); + } + @override Widget build(BuildContext context) { if (widget.address == '') { @@ -411,7 +453,6 @@ class _ProceedAccessState extends State { onPressed: () { updateTotal(); confirmOrder(); - Navigator.pushReplacementNamed(context, '/navigationbar'); showDialog( context: context, builder: (context) => CustomAlert( @@ -422,7 +463,7 @@ class _ProceedAccessState extends State { )); }, child: Text( - 'Confirm Order(Pay through COD', + 'Confirm Order(Pay through COD)', style: GoogleFonts.inter(color: Colors.white), ))); } else if (widget.address == null) { diff --git a/lib/pages/CategoryMenuList/flushbar.dart b/lib/pages/CategoryMenuList/flushbar.dart index 77825e9..f4649e3 100644 --- a/lib/pages/CategoryMenuList/flushbar.dart +++ b/lib/pages/CategoryMenuList/flushbar.dart @@ -15,7 +15,8 @@ void showFlushbar(context) { dismissDirection: FlushbarDismissDirection.HORIZONTAL, forwardAnimationCurve: Curves.fastLinearToSlowEaseIn, title: "Item added to the cart", - message: "Tap on the top cart icon to view your item in the cart and change quantity. Referesh to see the updated cart.") + message: + "Tap on the top cart icon to view your item in the cart and change quantity. Referesh to see the updated cart.") ..show(context); } @@ -36,3 +37,22 @@ void showFlushbarBooking(context) { message: "Please select another date or different slot") ..show(context); } + +void showFlushbarNotification(context, title, subtitle) { + Flushbar( + flushbarPosition: FlushbarPosition.TOP, + margin: EdgeInsets.all(10), + padding: EdgeInsets.all(10), + borderRadius: 8, + backgroundGradient: LinearGradient( + colors: [Colors.black54, Colors.black54], stops: [0.6, 1]), + boxShadows: [ + BoxShadow(color: Colors.black45, offset: Offset(3, 3), blurRadius: 2), + ], + duration: Duration(seconds: 5), + dismissDirection: FlushbarDismissDirection.HORIZONTAL, + forwardAnimationCurve: Curves.fastLinearToSlowEaseIn, + title: "$title", + message: "$subtitle") + ..show(context); +} diff --git a/lib/pages/Food.dart b/lib/pages/Food.dart index 438f48a..2c5e643 100644 --- a/lib/pages/Food.dart +++ b/lib/pages/Food.dart @@ -150,7 +150,7 @@ class _FoodState extends State { ], ), ), - SizedBox(height: 10.0), + SizedBox(height: 15.0), BottomItemView(total: total, qty: qty) ]), ), diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart index 74a0985..97c18bf 100644 --- a/lib/pages/Home.dart +++ b/lib/pages/Home.dart @@ -47,26 +47,7 @@ class _HomeState extends State { } } - // void exp() async { - // // var date = 1600288449003; - // // var result = await Firestore.instance - // // .collection('events') - // // .where('slot', isEqualTo: 1) - // // .getDocuments(); - // // result.documents.forEach((element) { - // // print(DateTime.fromMillisecondsSinceEpoch(date)); - // // }); - // DateTime currentPhoneDate = DateTime.now(); - // Timestamp myTimeStamp = Timestamp.fromDate(currentPhoneDate); - // DateTime myDateTime = myTimeStamp.toDate(); - // print("$currentPhoneDate"); - // print("$myDateTime"); - // var result = await Firestore.instance - // .collection('events') - // .where("slot", isEqualTo: 1) - // .getDocuments(); - // print(result.documents[0]["event_date"].toDate()); - // } + @override void initState() { @@ -476,15 +457,6 @@ class _AdminOptionState extends State { style: TextStyle(fontWeight: FontWeight.bold, fontSize: 25), ), ), - // InkWell( - // onTap: () { - // Navigator.pushNamed(context, '/adminBooking'); - // }, - // child: Text( - // 'Admin Booking', - // style: TextStyle(fontWeight: FontWeight.bold, fontSize: 25), - // ), - // ), ) ]); } else if (isAdminglobal == null || isAdminglobal == false) { @@ -625,19 +597,6 @@ class _LoadingDataState extends State { )), ), SizedBox(height: 10), - // Container( - // padding: EdgeInsets.fromLTRB(15, 0, 0, 10), - // child: InkWell( - // onTap: () { - // Navigator.pushNamed(context, '/uploadImage'); - // }, - // child: Text( - // "Upload Today's Menu", - // style: TextStyle( - // fontWeight: FontWeight.bold, fontSize: 25), - // ), - // ), - // ), SizedBox(height: 10), AdminOption(areYouadmin: snapshot.data["isAdmin"]), SizedBox(height: 10), diff --git a/lib/pages/NavigationBar.dart b/lib/pages/NavigationBar.dart index a283f00..e78154b 100644 --- a/lib/pages/NavigationBar.dart +++ b/lib/pages/NavigationBar.dart @@ -1,5 +1,8 @@ +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; import 'package:rcapp/pages/Booking.dart'; +import 'package:rcapp/pages/CategoryMenuList/flushbar.dart'; import 'package:rcapp/pages/Food.dart'; import 'package:rcapp/pages/Home.dart'; @@ -16,12 +19,50 @@ class _NavigationBarState extends State { Booking(), ]; + register() async { + final fbm = FirebaseMessaging(); + var token = await fbm.getToken(); + print('this is token ::: ' + '$token'); + var admin = await Firestore.instance + .collection('userInfo') + .where('isAdmin', isEqualTo: true) + .getDocuments(); + var admintoken = []; + admin.documents.forEach((element) { + admintoken.add(element["token"].toString()); + }); + print(admintoken); + } + + Future configure() async { + final fbm = FirebaseMessaging(); + fbm.configure(onMessage: (msg) { + print(msg); + showFlushbarNotification(context, msg['notification']['title'], + msg['notification']['body']); + return; + }, onLaunch: (msg) { + print(msg); + return; + }, onResume: (msg) { + print(msg); + return; + }); + } + void onTappedBar(int index) { setState(() { _currentIndex = index; }); } + @override + void initState() { + // TODO: implement initState + super.initState(); + configure(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -38,15 +79,15 @@ class _NavigationBarState extends State { backgroundColor: Colors.deepOrange, ), BottomNavigationBarItem( - icon: Icon(Icons.fastfood), - title: Text('Food'), - backgroundColor: Colors.deepOrange, - activeIcon: Icon(Icons.fastfood, color: Colors.deepOrange), - ), + icon: Icon(Icons.fastfood), + title: Text('Food'), + backgroundColor: Colors.deepOrange, + activeIcon: Icon(Icons.fastfood, color: Colors.deepOrange), + ), BottomNavigationBarItem( - icon: Icon(Icons.book), - title: Text('Booking'), - backgroundColor: Colors.deepOrange, + icon: Icon(Icons.book), + title: Text('Booking'), + backgroundColor: Colors.deepOrange, ), ], ), diff --git a/lib/pages/add_event.dart b/lib/pages/add_event.dart index a5ea770..5835359 100644 --- a/lib/pages/add_event.dart +++ b/lib/pages/add_event.dart @@ -85,7 +85,7 @@ class _AddEventPageState extends State { title: 'Booking Requested', description: 'Your booking request has been forwarded to the administrator. You will get a confirmation notification within 24 hours and can view your booking in the calendar', - // url: 'assets/nigga.gif', + /*url: 'assets/tick.gif',*/ )); // Navigator.pop(context); diff --git a/lib/pages/admin_order_confirm.dart b/lib/pages/admin_order_confirm.dart index bed655b..f118d72 100644 --- a/lib/pages/admin_order_confirm.dart +++ b/lib/pages/admin_order_confirm.dart @@ -95,8 +95,9 @@ class _AdminOrderState extends State { SizedBox(height: 10.0), Container( padding: EdgeInsets.all(10), - height: 190.0, - width: 370.0, + height: MediaQuery.of(context).size.height * 0.3, + width: MediaQuery.of(context).size.width * 9, + decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(12.0)), @@ -302,7 +303,7 @@ class _AdminOrderDataState extends State { Widget build(BuildContext context) { return Container( padding: EdgeInsets.fromLTRB(10, 10, 20, 0), - height: 390, + height: MediaQuery.of(context).size.height * 0.4, child: ListView.builder( itemCount: widget.item.length, itemBuilder: (_, index) { @@ -311,7 +312,6 @@ class _AdminOrderDataState extends State { children: [ Container( child: Row(children: [ - Text('${index + 1}) '), Text('${widget.item[index]} '), ])), Text('${widget.quantity[index]}'), @@ -372,8 +372,8 @@ class _AdminOrderDetailsState extends State { SizedBox(height: 20.0), Container( padding: EdgeInsets.all(10), - height: 500.0, - width: 370.0, + height: MediaQuery.of(context).size.height * 0.7, + width: MediaQuery.of(context).size.width * 0.9, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(15.0)), @@ -468,29 +468,29 @@ class _AdminOrderDetailsState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - "Mobile No. :", + "Mobile No. : ${widget.mobileNumber}", style: GoogleFonts.inter( color: Colors.grey, fontSize: 18, fontWeight: FontWeight.w500), ), SizedBox(height: 5), - Padding( + /*Padding( padding: EdgeInsets.fromLTRB(10, 0, 0, 0), child: Text( - "${widget.mobileNumber}", + "", style: GoogleFonts.inter( color: Colors.black, fontSize: 18, fontWeight: FontWeight.w400), ), - ), + ),*/ ], ), ], ), SizedBox(height: 20), - Container( + /* Container( alignment: Alignment.centerLeft, child: Text( 'Menu :', @@ -498,27 +498,36 @@ class _AdminOrderDetailsState extends State { color: Colors.grey, fontSize: 18, fontWeight: FontWeight.w500), - )), + )),*/ Container( padding: EdgeInsets.fromLTRB(10, 10, 0, 0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('Item', - style: GoogleFonts.inter( - fontSize: 20, - fontWeight: FontWeight.w400, - decoration: TextDecoration.underline)), - Text('Qty', - style: GoogleFonts.inter( - fontSize: 20, - fontWeight: FontWeight.w400, - decoration: TextDecoration.underline)), - Text('Price(per qty)', - style: GoogleFonts.inter( - fontSize: 20, - fontWeight: FontWeight.w400, - decoration: TextDecoration.underline)) + Container( + width: MediaQuery.of(context).size.width * 0.4, + child: Text('Item', + style: GoogleFonts.inter( + fontSize: 20, + fontWeight: FontWeight.w400, + decoration: TextDecoration.underline)), + ), + Container( + width: MediaQuery.of(context).size.width * 0.2, + child: Text('Qty', + style: GoogleFonts.inter( + fontSize: 20, + fontWeight: FontWeight.w400, + decoration: TextDecoration.underline)), + ), + Container( + width: MediaQuery.of(context).size.width * 0.2, + child: Text('Rate', + style: GoogleFonts.inter( + fontSize: 20, + fontWeight: FontWeight.w400, + decoration: TextDecoration.underline)), + ), ], ), ), diff --git a/lib/pages/customAlert.dart b/lib/pages/customAlert.dart index 6d45e31..0fe4593 100644 --- a/lib/pages/customAlert.dart +++ b/lib/pages/customAlert.dart @@ -70,7 +70,7 @@ class _CustomAlertState extends State { child: CircleAvatar( backgroundColor: Colors.orangeAccent, radius: 50, - // backgroundImage: AssetImage(widget.url), + backgroundImage: AssetImage('assets/tick.gif'), ), ) ], diff --git a/lib/pages/previousOrder.dart b/lib/pages/previousOrder.dart index 211cf38..e7a4622 100644 --- a/lib/pages/previousOrder.dart +++ b/lib/pages/previousOrder.dart @@ -213,7 +213,6 @@ class _OrderDataState extends State { children: [ Container( child: Row(children: [ - Text('${index + 1}) '), Text('${widget.item[index]} '), ])), Text('${widget.quantity[index]}'), @@ -274,8 +273,8 @@ class _PreviousOrderDetailsState extends State { SizedBox(height: 20.0), Container( padding: EdgeInsets.all(10), - height: 500.0, - width: 370.0, + height: MediaQuery.of(context).size.height * 0.7, + width: MediaQuery.of(context).size.width * 0.9, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(15.0)), @@ -314,14 +313,14 @@ class _PreviousOrderDetailsState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - "Personal No. :", + "Personal No. : ${widget.number}", style: GoogleFonts.inter( color: Colors.grey, fontSize: 18, fontWeight: FontWeight.w500), ), SizedBox(height: 5), - Padding( + /*Padding( padding: EdgeInsets.fromLTRB(10, 0, 0, 0), child: Text( "${widget.number}", @@ -330,7 +329,7 @@ class _PreviousOrderDetailsState extends State { fontSize: 18, fontWeight: FontWeight.w400), ), - ), + ),*/ ], ), SizedBox(height: 8), @@ -349,7 +348,7 @@ class _PreviousOrderDetailsState extends State { fontWeight: FontWeight.w500), ), Container( - width: 300, + width: MediaQuery.of(context).size.width * 0.4, child: Padding( padding: EdgeInsets.fromLTRB(10, 0, 0, 0), @@ -368,15 +367,16 @@ class _PreviousOrderDetailsState extends State { Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + SizedBox(height: 10.0,), Text( - "Mobile No. :", + "Mobile No. : ${widget.mobileNumber}", style: GoogleFonts.inter( color: Colors.grey, fontSize: 18, fontWeight: FontWeight.w500), ), SizedBox(height: 5), - Padding( + /*Padding( padding: EdgeInsets.fromLTRB(10, 0, 0, 0), child: Text( "${widget.mobileNumber}", @@ -385,13 +385,13 @@ class _PreviousOrderDetailsState extends State { fontSize: 18, fontWeight: FontWeight.w400), ), - ), + ),*/ ], ), ], ), SizedBox(height: 20), - Container( + /*Container( alignment: Alignment.centerLeft, child: Text( 'Menu :', @@ -399,27 +399,36 @@ class _PreviousOrderDetailsState extends State { color: Colors.grey, fontSize: 18, fontWeight: FontWeight.w500), - )), + )),*/ Container( padding: EdgeInsets.fromLTRB(10, 10, 0, 0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('Item ', - style: GoogleFonts.inter( - fontSize: 20, - fontWeight: FontWeight.w400, - decoration: TextDecoration.underline)), - Text('Qty', - style: GoogleFonts.inter( - fontSize: 20, - fontWeight: FontWeight.w400, - decoration: TextDecoration.underline)), - Text('Price(per qty)', - style: GoogleFonts.inter( - fontSize: 20, - fontWeight: FontWeight.w400, - decoration: TextDecoration.underline)) + Container( + width: MediaQuery.of(context).size.width * 0.4, + child: Text('Item', + style: GoogleFonts.inter( + fontSize: 20, + fontWeight: FontWeight.w400, + decoration: TextDecoration.underline)), + ), + Container( + width: MediaQuery.of(context).size.width * 0.2, + child: Text('Qty', + style: GoogleFonts.inter( + fontSize: 20, + fontWeight: FontWeight.w400, + decoration: TextDecoration.underline)), + ), + Container( + width: MediaQuery.of(context).size.width * 0.2, + child: Text('Rate', + style: GoogleFonts.inter( + fontSize: 20, + fontWeight: FontWeight.w400, + decoration: TextDecoration.underline)), + ), ], ), ), @@ -446,11 +455,11 @@ class _PreviousOrderDetailsState extends State { PreviousOrderDetails())); }, child: Container( - child: Text('Know More', + /*child: Text('Know More', style: GoogleFonts.inter( color: Colors.deepOrange, decoration: - TextDecoration.underline)), + TextDecoration.underline)),*/ ), ) ]), diff --git a/lib/pages/welcome.dart b/lib/pages/welcome.dart index c5cb5e6..e0304d4 100644 --- a/lib/pages/welcome.dart +++ b/lib/pages/welcome.dart @@ -10,26 +10,11 @@ class welcome extends StatefulWidget { } class _welcomeState extends State { - Future configure() async { - final fbm = FirebaseMessaging(); - fbm.configure(onMessage: (msg) { - print(msg); - return; - }, onLaunch: (msg) { - print(msg); - return; - }, onResume: (msg) { - print(msg); - return; - }); - - } @override void initState() { // TODO: implement initState super.initState(); - configure(); } @override diff --git a/lib/services/auth.dart b/lib/services/auth.dart index e4dd977..7751213 100644 --- a/lib/services/auth.dart +++ b/lib/services/auth.dart @@ -46,6 +46,14 @@ class AuthService { .get() .then((value) => value.data["isAdmin"]); + final FirebaseMessaging _messaging = FirebaseMessaging(); + var token = await _messaging.getToken(); + + await Firestore.instance + .collection('userInfo') + .document(userkaabba) + .updateData({'token': token}); + isAdminglobal = dat; return _userFromFirebaseUser(user); From 1e72ab48fad1a431019a3cafdd1c77dca4dbcef2 Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Sun, 27 Sep 2020 01:27:32 +0530 Subject: [PATCH 04/19] after --- lib/CustomWidget/food_card.dart | 323 +++++++++--------- lib/CustomWidget/foot_category.dart | 19 +- lib/main.dart | 2 + lib/pages/BlueL.dart | 95 +++--- lib/pages/Booking.dart | 291 ++++++++-------- lib/pages/Cart.dart | 2 +- .../CategoryMenuList/ContactDetails.dart | 18 + lib/pages/Home.dart | 34 +- lib/pages/Milan.dart | 92 ++--- lib/pages/MilapL.dart | 87 ++--- lib/pages/TennisCourt.dart | 92 ++--- lib/pages/WeddingHall.dart | 92 ++--- lib/pages/YellowL.dart | 86 ++--- lib/pages/mainhall.dart | 91 ++--- 14 files changed, 710 insertions(+), 614 deletions(-) create mode 100644 lib/pages/CategoryMenuList/ContactDetails.dart diff --git a/lib/CustomWidget/food_card.dart b/lib/CustomWidget/food_card.dart index 3c9d8bc..d367d87 100644 --- a/lib/CustomWidget/food_card.dart +++ b/lib/CustomWidget/food_card.dart @@ -13,7 +13,8 @@ class FoodCard extends StatelessWidget { final int itemprice; final bool areYouAdmin; - FoodCard({this.areYouAdmin, this.categoryName, this.imagePath, this.itemprice}); + FoodCard( + {this.areYouAdmin, this.categoryName, this.imagePath, this.itemprice}); StoreData storeData = StoreData(); @@ -51,171 +52,183 @@ class FoodCard extends StatelessWidget { @override Widget build(BuildContext context) { - 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( + return areYouAdmin + ? FocusedMenuHolder( + onPressed: () {}, + menuItems: [ + FocusedMenuItem( + title: Text('Delete the item'), + onPressed: () { + deleteMenu(); + }) + ], + child: Container( + width: MediaQuery.of(context).size.width * 0.41, + 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, - crossAxisAlignment: CrossAxisAlignment.end, children: [ - Column( + Row( mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: MediaQuery.of(context).size.width*0.25, - height: MediaQuery.of(context).size.height*0.03, - child: Text( - categoryName, - style: GoogleFonts.inter( - fontWeight: FontWeight.bold, - fontSize: 13.0, - color: Colors.white), - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.left, + InkWell( + onTap: () { + deleteMenu(); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.deepOrange, + borderRadius: BorderRadius.circular(5)), + child: Icon( + Icons.delete_outline, + color: Colors.white, + ), ), - ), - Container( - width: MediaQuery.of(context).size.width*0.2, - height: MediaQuery.of(context).size.height*0.03, - - child:Text( - '₹' + '$itemprice', - style: GoogleFonts.inter(color: Colors.white), - ) ) ], ), - InkWell( - onTap: () { - addToCart(categoryName, itemprice); - showFlushbar(context); - }, - child: Container( - height: 25, - width: MediaQuery.of(context).size.width*0.1, - 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), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: + MediaQuery.of(context).size.width * 0.25, + height: + MediaQuery.of(context).size.height * 0.03, + child: Text( + categoryName, + style: GoogleFonts.inter( + fontWeight: FontWeight.bold, + fontSize: 13.0, + color: Colors.white), + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.left, + ), + ), + Container( + width: + MediaQuery.of(context).size.width * 0.2, + height: MediaQuery.of(context).size.height * + 0.03, + child: Text( + '₹' + '$itemprice', + style: GoogleFonts.inter( + 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), + InkWell( + onTap: () { + addToCart(categoryName, itemprice); + showFlushbar(context); + }, + child: Container( + height: 25, + width: MediaQuery.of(context).size.width * 0.1, + 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), + ), + ), + ), + ) + ]) + ], + ), + )), + ) + : Container( + width: MediaQuery.of(context).size.width * 0.41, + 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: MediaQuery.of(context).size.width * 0.25, + height: MediaQuery.of(context).size.height * 0.03, + child: Text( + categoryName, + style: GoogleFonts.inter( + fontWeight: FontWeight.bold, + fontSize: 13.0, + color: Colors.white), + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.left, + ), ), - ), - 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), + Container( + width: MediaQuery.of(context).size.width * 0.2, + height: MediaQuery.of(context).size.height * 0.03, + child: 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), + ), ), ), - ), - ) - ]) - ], - ), - )); + ) + ]) + ], + ), + )); } } diff --git a/lib/CustomWidget/foot_category.dart b/lib/CustomWidget/foot_category.dart index 3d5073d..ebd4538 100644 --- a/lib/CustomWidget/foot_category.dart +++ b/lib/CustomWidget/foot_category.dart @@ -41,7 +41,8 @@ class FoodCategory extends StatelessWidget { size: 45, ), SizedBox(height: 20), - Text('LOADING', style: GoogleFonts.inter(fontWeight: FontWeight.w400)) + Text('LOADING', + style: GoogleFonts.inter(fontWeight: FontWeight.w400)) ]), ); } else { @@ -51,17 +52,11 @@ class FoodCategory extends StatelessWidget { 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, - ), + return FoodCard( + areYouAdmin: areYouAdmin, + categoryName: _menuList[index].category_menu, + imagePath: _menuList[index].imagepath, + itemprice: _menuList[index].price, ); }, ), diff --git a/lib/main.dart b/lib/main.dart index 20ee121..c6bf276 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -10,6 +10,7 @@ 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/ContactDetails.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'; @@ -76,6 +77,7 @@ class MyApp extends StatelessWidget { "/previousOrder": (context) => PreviousOrder(), "/previousBooking": (context) => PreviousBooking(), "/adminBooking": (context) => AdminBooking(), + "/contactDetails": (context) => ContactDetails(), // "/previousOrder": (context) => PreviousOrderDetails(), //routes for different categories of food diff --git a/lib/pages/BlueL.dart b/lib/pages/BlueL.dart index 46340be..733ad90 100644 --- a/lib/pages/BlueL.dart +++ b/lib/pages/BlueL.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:google_fonts/google_fonts.dart'; - class BlueLounge extends StatefulWidget { @override _BlueLoungeState createState() => _BlueLoungeState(); @@ -16,50 +16,57 @@ class _BlueLoungeState extends State { 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, - ), + body: Container( + height: MediaQuery.of(context).size.height * 0.88, + child: 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: MediaQuery.of(context).size.width * 0.075, + ), + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 15, vertical: 0), + child: Text( + "\nThe 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 ", + style: GoogleFonts.inter( + fontSize: MediaQuery.of(context).size.width * 0.05), + textAlign: TextAlign.left, + ), + ), + 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))), + )), + ], ), - Text( - "\nThe 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 ", - style: GoogleFonts.inter( - fontSize: 16 - ), - ), - 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 fa8bda4..d13c09d 100644 --- a/lib/pages/Booking.dart +++ b/lib/pages/Booking.dart @@ -11,16 +11,16 @@ class Booking extends StatefulWidget { class _BookingState extends State { @override Widget build(BuildContext context) { - return Scaffold( appBar: AppBar( automaticallyImplyLeading: false, elevation: 10.0, backgroundColor: Colors.deepOrange, title: Container( - margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.13), - child:Text('Booking', style: GoogleFonts.inter()), - ), //repeat for menu and booking + margin: + EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.13), + child: Text('Booking', style: GoogleFonts.inter()), + ), //repeat for menu and booking ), body: new ListView( children: [ @@ -48,139 +48,148 @@ class _BookingState extends State { ), SizedBox(height: 10.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.w300), - ), - ), - 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.w300), - ), - ), - 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.w300), - ), - ), - 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.w300 - ), - ), - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.blue, - image: DecorationImage( - image: new AssetImage("assets/18.jpg"), - fit: BoxFit.fill)), - ), - ), - SizedBox(height: 20), - 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.w200), - ), - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.blue, - image: DecorationImage( - image: new AssetImage("assets/15.jpg"), - fit: BoxFit.fill)), - ), - ), - SizedBox(width: 20), - ], - ), - ), - SizedBox(height: 20), - ], - )), + 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.w300), + ), + ), + 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.w300), + ), + ), + 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.w300), + ), + ), + 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.w300), + ), + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.blue, + image: DecorationImage( + image: new AssetImage("assets/18.jpg"), + fit: BoxFit.fill)), + ), + ), + SizedBox(width: 20), + 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.w200), + ), + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.blue, + image: DecorationImage( + image: new AssetImage("assets/15.jpg"), + fit: BoxFit.fill)), + ), + ), + SizedBox(width: 20), + ], + ), + ), + SizedBox(height: 20), + ], + )), SizedBox(height: 30.0), Text( " Banquet Halls", @@ -215,7 +224,9 @@ class _BookingState extends State { alignment: Alignment.bottomCenter, child: Text( 'Wedding Hall', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w200), + style: GoogleFonts.inter( + color: Colors.white, + fontWeight: FontWeight.w200), ), ), decoration: BoxDecoration( @@ -238,7 +249,9 @@ class _BookingState extends State { alignment: Alignment.bottomCenter, child: Text( 'Tennis Court', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w200), + style: GoogleFonts.inter( + color: Colors.white, + fontWeight: FontWeight.w200), ), ), decoration: BoxDecoration( diff --git a/lib/pages/Cart.dart b/lib/pages/Cart.dart index 617523b..138dd5e 100644 --- a/lib/pages/Cart.dart +++ b/lib/pages/Cart.dart @@ -176,7 +176,7 @@ class _CartState extends State { ), ), SizedBox( - width: 200, + width: MediaQuery.of(context).size.width * 0.56, child: Text( keyname, style: GoogleFonts.inter( diff --git a/lib/pages/CategoryMenuList/ContactDetails.dart b/lib/pages/CategoryMenuList/ContactDetails.dart new file mode 100644 index 0000000..474e0f3 --- /dev/null +++ b/lib/pages/CategoryMenuList/ContactDetails.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; + +class ContactDetails extends StatefulWidget { + @override + _ContactDetailsState createState() => _ContactDetailsState(); +} + +class _ContactDetailsState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Contact'), + backgroundColor: Colors.deepOrange, + ), + ); + } +} diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart index 97c18bf..af76e08 100644 --- a/lib/pages/Home.dart +++ b/lib/pages/Home.dart @@ -47,8 +47,6 @@ class _HomeState extends State { } } - - @override void initState() { // TODO: implement initState @@ -536,7 +534,7 @@ class _LoadingDataState extends State { context, '/uploadAvatarImage'); }, child: CircleAvatar( - radius: 60.0, + radius: MediaQuery.of(context).size.width * 0.15, backgroundImage: NetworkImage( 'https://www.pngitem.com/pimgs/m/146-1468479_my-profile-icon-blank-profile-picture-circle-hd.png'), backgroundColor: Colors.transparent, @@ -549,7 +547,7 @@ class _LoadingDataState extends State { context, '/uploadAvatarImage'); }, child: CircleAvatar( - radius: 60.0, + radius: MediaQuery.of(context).size.width * 0.15, backgroundImage: NetworkImage('${snapshot.data["avatar"]}'), backgroundColor: Colors.transparent, @@ -561,12 +559,19 @@ class _LoadingDataState extends State { children: [ Text( '${snapshot.data["name"]}', - style: TextStyle( - fontWeight: FontWeight.bold, fontSize: 20), + style: GoogleFonts.inter( + fontWeight: FontWeight.bold, + fontSize: + MediaQuery.of(context).size.width * + 0.05), ), Text( - 'Personal No. ${snapshot.data["number"]}', - style: TextStyle(color: Colors.grey[700]), + 'Personal No: ${snapshot.data["number"]}', + style: GoogleFonts.inter( + color: Colors.grey[700], + fontSize: + MediaQuery.of(context).size.width * + 0.026), ), ]) ]), @@ -600,6 +605,19 @@ class _LoadingDataState extends State { SizedBox(height: 10), AdminOption(areYouadmin: snapshot.data["isAdmin"]), SizedBox(height: 10), + Container( + padding: EdgeInsets.fromLTRB(15, 0, 0, 10), + child: InkWell( + onTap: () { + Navigator.pushNamed(context, '/contactDetails'); + }, + child: Text( + 'Contact', + style: TextStyle( + fontWeight: FontWeight.bold, fontSize: 25), + )), + ), + SizedBox(height: 10), Container( padding: EdgeInsets.fromLTRB(15, 0, 0, 10), child: InkWell( diff --git a/lib/pages/Milan.dart b/lib/pages/Milan.dart index 461d369..cd06963 100644 --- a/lib/pages/Milan.dart +++ b/lib/pages/Milan.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; - class MilanLounge extends StatefulWidget { @override _MilanLoungeState createState() => _MilanLoungeState(); @@ -14,51 +13,58 @@ class _MilanLoungeState extends State { appBar: AppBar( elevation: 10.0, backgroundColor: Colors.deepOrange, - title: Text('Blue Lounge'), + title: Text('Milan 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/18.jpg"), - fit: BoxFit.fill)), + body: Container( + height: MediaQuery.of(context).size.height * 0.88, + child: 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/18.jpg"), + fit: BoxFit.fill)), + ), ), - ), - Text( - "Milan Lounge", - style: GoogleFonts.inter( - color: Colors.blueAccent, - fontSize: 40, + Text( + "Milan Lounge", + style: GoogleFonts.inter( + color: Colors.blueAccent, + fontSize: MediaQuery.of(context).size.width * 0.075, + ), ), - ), - Text( - "The Milan Lounge is a cozy lounge. 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 + Container( + padding: EdgeInsets.symmetric(horizontal: 15, vertical: 0), + child: Text( + "The Milan Lounge is a cozy lounge. 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: MediaQuery.of(context).size.width * 0.05), + ), ), - ), - 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))), - )), - ], + 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/MilapL.dart b/lib/pages/MilapL.dart index 92bef04..8fa6d0d 100644 --- a/lib/pages/MilapL.dart +++ b/lib/pages/MilapL.dart @@ -1,8 +1,6 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; - - class MilapLounge extends StatefulWidget { @override _MilapLoungeState createState() => _MilapLoungeState(); @@ -17,49 +15,54 @@ class _MilapLoungeState extends State { backgroundColor: Colors.deepOrange, title: Text('Milap 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/17.jpg"), - fit: BoxFit.fill)), + body: Container( + height: MediaQuery.of(context).size.height * 0.88, + child: 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/17.jpg"), + fit: BoxFit.fill)), + ), ), - ), - Text( - "Milap Reception Hall", - style: GoogleFonts.inter( - color: Colors.blueAccent, - fontSize: 40, + Text( + "Milap Reception Hall", + style: GoogleFonts.inter( + color: Colors.blueAccent, + fontSize: MediaQuery.of(context).size.width * 0.075, + ), ), - ), - Text( - " \nThe Milap Reception Hall is a large hall present in the first floor of the club. Perfect for medium group gatherings like office parties, departmental dinners etc \n \nCapacity : 70 people\n \n \n ", - style: GoogleFonts.inter( - fontSize: 20 + Container( + padding: EdgeInsets.symmetric(horizontal: 15, vertical: 0), + child: Text( + " \nThe Milap Reception Hall is a large hall present in the first floor of the club. Perfect for medium group gatherings like office parties, departmental dinners etc \n \nCapacity : 70 people\n \n \n ", + style: GoogleFonts.inter(fontSize: MediaQuery.of(context).size.width*0.05), + ), ), - ), - 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))), - )), - ], + 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/TennisCourt.dart b/lib/pages/TennisCourt.dart index 400685b..3216e3a 100644 --- a/lib/pages/TennisCourt.dart +++ b/lib/pages/TennisCourt.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; - class TennisCourt extends StatefulWidget { @override _TennisCourtState createState() => _TennisCourtState(); @@ -16,50 +15,55 @@ class _TennisCourtState extends State { backgroundColor: Colors.deepOrange, title: Text('Tennis Court'), ), - 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/51.jpg"), - fit: BoxFit.fill)), + body: Container( + height: MediaQuery.of(context).size.height * 0.88, + child: 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/51.jpg"), + fit: BoxFit.fill)), + ), ), - ), - Text("Tennis Court", - style: GoogleFonts.inter( - color: Colors.green, - fontSize: 30 - ),), - Container( - padding: EdgeInsets.all(10), - child:Text("The Open Tennis court is perfect for sporting events, and for large group gettogethers like Anniversaries, Birthdays, Office picnics etc \n \n" - "Capacity - 250 people", + Text( + "Tennis Court", style: GoogleFonts.inter( - color: Colors.black, - 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))), - )), - ], + color: Colors.green, + fontSize: MediaQuery.of(context).size.width * 0.075), + ), + Container( + padding: EdgeInsets.all(10), + child: Text( + "The Open Tennis court is perfect for sporting events, and for large group gettogethers like Anniversaries, Birthdays, Office picnics etc \n \n" + "Capacity - 250 people", + style: GoogleFonts.inter(color: Colors.black, fontSize: MediaQuery.of(context).size.width * 0.05), + ), + ), + 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/WeddingHall.dart b/lib/pages/WeddingHall.dart index 801aa8f..9111384 100644 --- a/lib/pages/WeddingHall.dart +++ b/lib/pages/WeddingHall.dart @@ -13,52 +13,58 @@ class _WeddingHallState extends State { appBar: AppBar( elevation: 10.0, backgroundColor: Colors.deepOrange, - title: Text('Wedding Recption Hall'), + title: Text('Wedding Reception Hall'), ), - 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/16.jpg"), - fit: BoxFit.fill)), + body: Container( + height: MediaQuery.of(context).size.height * 0.88, + child: 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/16.jpg"), + fit: BoxFit.fill)), + ), ), - ), - Text("Wedding Reception Hall", - style: GoogleFonts.inter( - color: Colors.blueGrey, - fontSize: 30 - ),), - Container( - padding: EdgeInsets.all(10), - child:Text("Located near the swimming pool area, the wedding reception hall is meant for big gatherings in occasions like marriages, receptions, birthday parties etc. \n \n" - "Capacity - 250 people", + Text( + "Wedding Reception Hall", style: GoogleFonts.inter( - color: Colors.black, - 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))), - )), - ], + color: Colors.blueGrey, + fontSize: MediaQuery.of(context).size.width * 0.075), + ), + Container( + padding: EdgeInsets.all(10), + child: Text( + "Located near the swimming pool area, the wedding reception hall is meant for big gatherings in occasions like marriages, receptions, birthday parties etc. \n \n" + "Capacity - 250 people", + style: GoogleFonts.inter( + color: Colors.black, + fontSize: MediaQuery.of(context).size.width * 0.05), + ), + ), + 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/YellowL.dart b/lib/pages/YellowL.dart index 4d6555c..65cb729 100644 --- a/lib/pages/YellowL.dart +++ b/lib/pages/YellowL.dart @@ -16,49 +16,55 @@ class _YellowLoungeState extends State { backgroundColor: Colors.deepOrange, title: Text('Yellow 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/13.jpg"), - fit: BoxFit.fill)), + body: Container( + height: MediaQuery.of(context).size.height*0.88, + child: 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/13.jpg"), + fit: BoxFit.fill)), + ), ), - ), - Text( - "Yellow Lounge", - style: GoogleFonts.inter( - color: Colors.orange, - fontSize: 40, + Text( + "Yellow Lounge", + style: GoogleFonts.inter( + color: Colors.orange, + fontSize: MediaQuery.of(context).size.width * 0.075, + ), ), - ), - Text( - "The Yellow Lounge is a large, comfortable lounge in the ground floor of the club. It is decorated with plush sofas and a warm ambience. Perfect for medium gatherings like office gettogethers, birthday parties etc \n \nCapacity : 25 people", - style: GoogleFonts.inter( - fontSize: 20 + Container( + padding: EdgeInsets.symmetric(horizontal: 15, vertical: 0), + child: Text( + "The Yellow Lounge is a large, comfortable lounge in the ground floor of the club. It is decorated with plush sofas and a warm ambience. Perfect for medium gatherings like office gettogethers, birthday parties etc \n \nCapacity : 25 people", + style: GoogleFonts.inter( + fontSize: MediaQuery.of(context).size.width*0.05 + ), + ), ), - ), - 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))), - )), - ], + 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/mainhall.dart b/lib/pages/mainhall.dart index 201a5ca..c236445 100644 --- a/lib/pages/mainhall.dart +++ b/lib/pages/mainhall.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; - class MainHall extends StatefulWidget { @override _MainHallState createState() => _MainHallState(); @@ -16,50 +15,56 @@ class _MainHallState extends State { backgroundColor: Colors.deepOrange, title: Text('Main Recption Hall'), ), - 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/15.jpg"), - fit: BoxFit.fill)), + body: Container( + padding: EdgeInsets.symmetric(horizontal: 15, vertical: 0), + child: 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/15.jpg"), + fit: BoxFit.fill)), + ), ), - ), - Text("The Main Banquet Hall", - style: GoogleFonts.inter( - color: Colors.redAccent, - fontSize: 30 - ),), - Container( - padding: EdgeInsets.all(10), - child:Text("Present in front of the entrance, the main Banquet Hall is for major occasion s and for big group gatherings, such as musical events, social gatherings, large office parties, marriage receptions, etc \n \n" - "Capacity - 250 people", + Text( + "The Main Banquet Hall", style: GoogleFonts.inter( - color: Colors.black, - 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))), - )), - ], + color: Colors.redAccent, + fontSize: MediaQuery.of(context).size.width * 0.075), + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 15, vertical: 0), + child: Text( + "Present in front of the entrance, the main Banquet Hall is for major occasion s and for big group gatherings, such as musical events, social gatherings, large office parties, marriage receptions, etc \n \n" + "Capacity - 250 people", + style: GoogleFonts.inter( + color: Colors.black, + fontSize: MediaQuery.of(context).size.width * 0.05), + ), + ), + 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))), + )), + ], + ), ), ); } From 0005d224b4f14f81864f9d44085a966790a985bb Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Sun, 27 Sep 2020 15:00:27 +0530 Subject: [PATCH 05/19] aligned orders --- lib/pages/BlueL.dart | 4 +- lib/pages/Booking.dart | 72 ++++++++++--------- lib/pages/Cart.dart | 5 +- .../CategoryMenuList/ContactDetails.dart | 57 +++++++++++++++ lib/pages/Milan.dart | 4 +- lib/pages/MilapL.dart | 6 +- lib/pages/TennisCourt.dart | 4 +- lib/pages/WeddingHall.dart | 4 +- lib/pages/YellowL.dart | 4 +- lib/pages/add_event.dart | 8 ++- lib/pages/admin_order_confirm.dart | 29 ++++++-- lib/pages/mainhall.dart | 4 +- lib/pages/previousOrder.dart | 38 +++++++--- 13 files changed, 171 insertions(+), 68 deletions(-) diff --git a/lib/pages/BlueL.dart b/lib/pages/BlueL.dart index 733ad90..6235b4e 100644 --- a/lib/pages/BlueL.dart +++ b/lib/pages/BlueL.dart @@ -14,10 +14,10 @@ class _BlueLoungeState extends State { appBar: AppBar( elevation: 10.0, backgroundColor: Colors.deepOrange, - title: Text('Blue Lounge'), + title: Text('Lounges'), ), body: Container( - height: MediaQuery.of(context).size.height * 0.88, + height: MediaQuery.of(context).size.height * 1, child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/pages/Booking.dart b/lib/pages/Booking.dart index d13c09d..787a88a 100644 --- a/lib/pages/Booking.dart +++ b/lib/pages/Booking.dart @@ -25,30 +25,34 @@ class _BookingState extends State { body: new ListView( children: [ SizedBox(height: 30.0), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - " Lounges", - style: GoogleFonts.inter( - color: Colors.grey, - fontSize: 18, - fontWeight: FontWeight.w600, + Container( + margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 10), + child:Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + " Lounges", + style: GoogleFonts.inter( + color: Colors.grey, + fontSize: 18, + fontWeight: FontWeight.w600, + ), ), - ), - OutlineButton( - onPressed: () { - Navigator.pushNamed(context, '/bookingcalendar'); - }, - shape: new RoundedRectangleBorder( - borderRadius: new BorderRadius.circular(30.0)), - color: Colors.grey, - child: Text('Calendar')), - ], + OutlineButton( + onPressed: () { + Navigator.pushNamed(context, '/bookingcalendar'); + }, + shape: new RoundedRectangleBorder( + borderRadius: new BorderRadius.circular(30.0)), + color: Colors.grey, + child: Text('Book')), + ], + ), ), SizedBox(height: 10.0), Container( margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 10), + alignment: Alignment.centerLeft, height: 150.0, width: double.infinity, child: new Column( @@ -72,7 +76,7 @@ class _BookingState extends State { 'Blue Lounge', style: GoogleFonts.inter( color: Colors.white, - fontWeight: FontWeight.w300), + fontWeight: FontWeight.bold), ), ), decoration: BoxDecoration( @@ -97,7 +101,7 @@ class _BookingState extends State { 'Yellow Lounge', style: GoogleFonts.inter( color: Colors.white, - fontWeight: FontWeight.w300), + fontWeight: FontWeight.bold), ), ), decoration: BoxDecoration( @@ -122,7 +126,7 @@ class _BookingState extends State { 'Milap Hall', style: GoogleFonts.inter( color: Colors.white, - fontWeight: FontWeight.w300), + fontWeight: FontWeight.bold), ), ), decoration: BoxDecoration( @@ -147,7 +151,7 @@ class _BookingState extends State { 'Milan Lounge', style: GoogleFonts.inter( color: Colors.white, - fontWeight: FontWeight.w300), + fontWeight: FontWeight.bold), ), ), decoration: BoxDecoration( @@ -172,7 +176,7 @@ class _BookingState extends State { 'Main Hall', style: GoogleFonts.inter( color: Colors.white, - fontWeight: FontWeight.w200), + fontWeight: FontWeight.bold), ), ), decoration: BoxDecoration( @@ -191,17 +195,21 @@ class _BookingState extends State { ], )), SizedBox(height: 30.0), - Text( - " Banquet Halls", - style: GoogleFonts.inter( - color: Colors.grey, - fontSize: 18, - fontWeight: FontWeight.w600, + Container( + margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 10), + child:Text( + " Banquet Halls", + style: GoogleFonts.inter( + color: Colors.grey, + fontSize: 18, + fontWeight: FontWeight.w600, + ), ), ), SizedBox(height: 10.0), Container( margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 10), + alignment: Alignment.centerLeft, height: 150.0, width: double.infinity, child: new Column( @@ -226,7 +234,7 @@ class _BookingState extends State { 'Wedding Hall', style: GoogleFonts.inter( color: Colors.white, - fontWeight: FontWeight.w200), + fontWeight: FontWeight.bold), ), ), decoration: BoxDecoration( @@ -251,7 +259,7 @@ class _BookingState extends State { 'Tennis Court', style: GoogleFonts.inter( color: Colors.white, - fontWeight: FontWeight.w200), + fontWeight: FontWeight.bold), ), ), decoration: BoxDecoration( diff --git a/lib/pages/Cart.dart b/lib/pages/Cart.dart index 138dd5e..85c35ae 100644 --- a/lib/pages/Cart.dart +++ b/lib/pages/Cart.dart @@ -426,7 +426,7 @@ class _ProceedAccessState extends State { storeData.resetStore(); updateTotal(); - Navigator.pushReplacementNamed(context, '/navigationbar'); + /*Navigator.pushReplacementNamed(context, '/navigationbar');*/ } @override @@ -453,12 +453,13 @@ class _ProceedAccessState extends State { onPressed: () { updateTotal(); confirmOrder(); + Navigator.pushReplacementNamed(context, '/navigationbar'); showDialog( context: context, builder: (context) => CustomAlert( title: 'Order Placed!', description: - 'Your Order has been placed and will be on its way to you shortly', + 'Your Order has been placed and will be on its way to you shortly. For further queries regarding your order, please contact - Mr. Debabrata Mohanty - +919438208969', // url: 'assets/nigga.gif', )); }, diff --git a/lib/pages/CategoryMenuList/ContactDetails.dart b/lib/pages/CategoryMenuList/ContactDetails.dart index 474e0f3..18c1058 100644 --- a/lib/pages/CategoryMenuList/ContactDetails.dart +++ b/lib/pages/CategoryMenuList/ContactDetails.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; class ContactDetails extends StatefulWidget { @override @@ -13,6 +14,62 @@ class _ContactDetailsState extends State { title: Text('Contact'), backgroundColor: Colors.deepOrange, ), + body: Container( + height: MediaQuery.of(context).size.height*1, + decoration: BoxDecoration(color: Colors.grey[200]), + child:Column( + children: [ + SizedBox(height: 20), + Container( + height: MediaQuery.of(context).size.height*0.22, + width: MediaQuery.of(context).size.width*0.95, + decoration: BoxDecoration(color: Colors.white), + margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0), + child: Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.symmetric(horizontal: 0, vertical: 0), + height: MediaQuery.of(context).size.height*0.1, + width: MediaQuery.of(context).size.width*0.9, + child: Text( + "For order related queries, please contact: \n \nMr. Debabrata Mohanty - +919438208969 \n", + style: TextStyle( + fontSize: 17.5 + ), + ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(12.0)), + border: Border.all(color: Colors.grey)), + + ), + ), + SizedBox(height: 20), + Container( + height: MediaQuery.of(context).size.height*0.22, + width: MediaQuery.of(context).size.width*0.95, + decoration: BoxDecoration(color: Colors.white), + margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0), + child: Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.symmetric(horizontal: 0, vertical: 0), + height: MediaQuery.of(context).size.height*0.1, + width: MediaQuery.of(context).size.width*0.9, + child: Text( + "For booking related queries, please contact: \n \nMr. Pramod Kumar Pattnaik - +919437116141 \n", + style: TextStyle( + fontSize: 17.5 + ), + ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(12.0)), + border: Border.all(color: Colors.grey)), + + ), + ), + ], + ) + ) ); } } diff --git a/lib/pages/Milan.dart b/lib/pages/Milan.dart index cd06963..53d2969 100644 --- a/lib/pages/Milan.dart +++ b/lib/pages/Milan.dart @@ -13,10 +13,10 @@ class _MilanLoungeState extends State { appBar: AppBar( elevation: 10.0, backgroundColor: Colors.deepOrange, - title: Text('Milan Lounge'), + title: Text('Lounges'), ), body: Container( - height: MediaQuery.of(context).size.height * 0.88, + height: MediaQuery.of(context).size.height * 1, child: new Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/pages/MilapL.dart b/lib/pages/MilapL.dart index 8fa6d0d..4600b2f 100644 --- a/lib/pages/MilapL.dart +++ b/lib/pages/MilapL.dart @@ -13,10 +13,10 @@ class _MilapLoungeState extends State { appBar: AppBar( elevation: 10.0, backgroundColor: Colors.deepOrange, - title: Text('Milap Lounge'), + title: Text('Lounges'), ), body: Container( - height: MediaQuery.of(context).size.height * 0.88, + height: MediaQuery.of(context).size.height * 1, child: new Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -44,7 +44,7 @@ class _MilapLoungeState extends State { Container( padding: EdgeInsets.symmetric(horizontal: 15, vertical: 0), child: Text( - " \nThe Milap Reception Hall is a large hall present in the first floor of the club. Perfect for medium group gatherings like office parties, departmental dinners etc \n \nCapacity : 70 people\n \n \n ", + " \nThe Milap Reception Hall is a large hall present in the first floor of the club. Perfect for medium group gatherings like office parties, departmental dinners etc \n \nCapacity : 70 people\n \n ", style: GoogleFonts.inter(fontSize: MediaQuery.of(context).size.width*0.05), ), ), diff --git a/lib/pages/TennisCourt.dart b/lib/pages/TennisCourt.dart index 3216e3a..185d3a6 100644 --- a/lib/pages/TennisCourt.dart +++ b/lib/pages/TennisCourt.dart @@ -13,10 +13,10 @@ class _TennisCourtState extends State { appBar: AppBar( elevation: 10.0, backgroundColor: Colors.deepOrange, - title: Text('Tennis Court'), + title: Text('Banquets'), ), body: Container( - height: MediaQuery.of(context).size.height * 0.88, + height: MediaQuery.of(context).size.height * 1, child: new Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/pages/WeddingHall.dart b/lib/pages/WeddingHall.dart index 9111384..02fe549 100644 --- a/lib/pages/WeddingHall.dart +++ b/lib/pages/WeddingHall.dart @@ -13,10 +13,10 @@ class _WeddingHallState extends State { appBar: AppBar( elevation: 10.0, backgroundColor: Colors.deepOrange, - title: Text('Wedding Reception Hall'), + title: Text('Banquets'), ), body: Container( - height: MediaQuery.of(context).size.height * 0.88, + height: MediaQuery.of(context).size.height * 1, child: new Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/pages/YellowL.dart b/lib/pages/YellowL.dart index 65cb729..5771122 100644 --- a/lib/pages/YellowL.dart +++ b/lib/pages/YellowL.dart @@ -14,10 +14,10 @@ class _YellowLoungeState extends State { appBar: AppBar( elevation: 10.0, backgroundColor: Colors.deepOrange, - title: Text('Yellow Lounge'), + title: Text('Lounges'), ), body: Container( - height: MediaQuery.of(context).size.height*0.88, + height: MediaQuery.of(context).size.height*1, child: new Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/pages/add_event.dart b/lib/pages/add_event.dart index 5835359..ca3f9e4 100644 --- a/lib/pages/add_event.dart +++ b/lib/pages/add_event.dart @@ -84,7 +84,7 @@ class _AddEventPageState extends State { builder: (context) => CustomAlert( title: 'Booking Requested', description: - 'Your booking request has been forwarded to the administrator. You will get a confirmation notification within 24 hours and can view your booking in the calendar', + 'Your booking request has been forwarded to the administrator. You will get a confirmation notification within 24 hours and can view your booking in the calendar. For further queries, please contact - Mr. Pramod Kumar Pattnaik - +919437116141', /*url: 'assets/tick.gif',*/ )); @@ -155,6 +155,7 @@ class _AddEventPageState extends State { }), SizedBox(height: 10), TextFormField( + keyboardType: TextInputType.number, initialValue: _personalno, decoration: InputDecoration( hintText: 'Personal No.', @@ -175,6 +176,7 @@ class _AddEventPageState extends State { }), SizedBox(height: 10), TextFormField( + keyboardType: TextInputType.number, decoration: InputDecoration( hintText: 'Number of People', fillColor: Colors.white, @@ -227,11 +229,11 @@ class _AddEventPageState extends State { value: _value2, items: [ DropdownMenuItem( - child: Text("Slot 1"), + child: Text("Lunch Slot"), value: 1, ), DropdownMenuItem( - child: Text("Slot 2"), + child: Text("Dinner Slot"), value: 2, ), ], diff --git a/lib/pages/admin_order_confirm.dart b/lib/pages/admin_order_confirm.dart index f118d72..ac5d328 100644 --- a/lib/pages/admin_order_confirm.dart +++ b/lib/pages/admin_order_confirm.dart @@ -97,7 +97,6 @@ class _AdminOrderState extends State { padding: EdgeInsets.all(10), height: MediaQuery.of(context).size.height * 0.3, width: MediaQuery.of(context).size.width * 9, - decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(12.0)), @@ -311,11 +310,27 @@ class _AdminOrderDataState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - child: Row(children: [ - Text('${widget.item[index]} '), - ])), - Text('${widget.quantity[index]}'), - Text('${widget.price[index]}'), + // decoration: BoxDecoration(color: Colors.deepOrange), + width: MediaQuery.of(context).size.width * 0.34, + child: Text( + '${widget.item[index]}', + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.left, + )), + Container( + // decoration: BoxDecoration(color: Colors.deepOrange), + width: MediaQuery.of(context).size.width * 0.2, + child: Text( + '${widget.quantity[index]}', + textAlign: TextAlign.center, + )), + Container( + // decoration: BoxDecoration(color: Colors.deepOrange), + width: MediaQuery.of(context).size.width * 0.2, + child: Text( + '${widget.price[index]}', + textAlign: TextAlign.center, + )), ], ); }), @@ -490,7 +505,7 @@ class _AdminOrderDetailsState extends State { ], ), SizedBox(height: 20), - /* Container( + /* Container( alignment: Alignment.centerLeft, child: Text( 'Menu :', diff --git a/lib/pages/mainhall.dart b/lib/pages/mainhall.dart index c236445..b1995f9 100644 --- a/lib/pages/mainhall.dart +++ b/lib/pages/mainhall.dart @@ -13,10 +13,10 @@ class _MainHallState extends State { appBar: AppBar( elevation: 10.0, backgroundColor: Colors.deepOrange, - title: Text('Main Recption Hall'), + title: Text('Lounges'), ), body: Container( - padding: EdgeInsets.symmetric(horizontal: 15, vertical: 0), + height: MediaQuery.of(context).size.height * 1, child: new Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/pages/previousOrder.dart b/lib/pages/previousOrder.dart index e7a4622..17e47b2 100644 --- a/lib/pages/previousOrder.dart +++ b/lib/pages/previousOrder.dart @@ -212,11 +212,27 @@ class _OrderDataState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - child: Row(children: [ - Text('${widget.item[index]} '), - ])), - Text('${widget.quantity[index]}'), - Text('${widget.price[index]}') + // decoration: BoxDecoration(color: Colors.deepOrange), + width: MediaQuery.of(context).size.width * 0.34, + child: Text( + '${widget.item[index]}', + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.left, + )), + Container( + // decoration: BoxDecoration(color: Colors.deepOrange), + width: MediaQuery.of(context).size.width * 0.2, + child: Text( + '${widget.quantity[index]}', + textAlign: TextAlign.center, + )), + Container( + // decoration: BoxDecoration(color: Colors.deepOrange), + width: MediaQuery.of(context).size.width * 0.2, + child: Text( + '${widget.price[index]}', + textAlign: TextAlign.center, + )), ], ); }), @@ -348,7 +364,9 @@ class _PreviousOrderDetailsState extends State { fontWeight: FontWeight.w500), ), Container( - width: MediaQuery.of(context).size.width * 0.4, + width: + MediaQuery.of(context).size.width * + 0.4, child: Padding( padding: EdgeInsets.fromLTRB(10, 0, 0, 0), @@ -367,7 +385,9 @@ class _PreviousOrderDetailsState extends State { Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - SizedBox(height: 10.0,), + SizedBox( + height: 10.0, + ), Text( "Mobile No. : ${widget.mobileNumber}", style: GoogleFonts.inter( @@ -455,12 +475,12 @@ class _PreviousOrderDetailsState extends State { PreviousOrderDetails())); }, child: Container( - /*child: Text('Know More', + /*child: Text('Know More', style: GoogleFonts.inter( color: Colors.deepOrange, decoration: TextDecoration.underline)),*/ - ), + ), ) ]), ], From af6491a2ecd9cfe6b1b5a168e12d1531ff7a848d Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Sun, 27 Sep 2020 18:08:38 +0530 Subject: [PATCH 06/19] fixed bug and added cart quantity icon feature --- lib/pages/Cart.dart | 54 +++---------- lib/pages/Food.dart | 144 +++++++++++++++++++++++++++-------- lib/pages/Home.dart | 3 + lib/pages/NavigationBar.dart | 59 +++++++------- lib/pages/storeData.dart | 11 ++- pubspec.lock | 9 ++- pubspec.yaml | 3 + 7 files changed, 177 insertions(+), 106 deletions(-) diff --git a/lib/pages/Cart.dart b/lib/pages/Cart.dart index 85c35ae..ad7785e 100644 --- a/lib/pages/Cart.dart +++ b/lib/pages/Cart.dart @@ -96,6 +96,15 @@ class _CartState extends State { backgroundColor: Colors.deepOrange, title: Text('Cart', style: GoogleFonts.inter()), //repeat for menu and booking + leading: Builder(builder: (BuildContext context) { + return IconButton( + onPressed: () { + refreshVar = !refreshVar; + Navigator.pop(context); + }, + icon: Icon(Icons.arrow_back), + ); + }), ), body: Column(children: [ SizedBox(height: 10), @@ -176,7 +185,8 @@ class _CartState extends State { ), ), SizedBox( - width: MediaQuery.of(context).size.width * 0.56, + width: + MediaQuery.of(context).size.width * 0.56, child: Text( keyname, style: GoogleFonts.inter( @@ -225,7 +235,6 @@ class _CartState extends State { ); }), ), - // BottomItemView(total: total, qty: totalquantity), ProceedAccess(address: address) ])); } @@ -473,44 +482,3 @@ class _ProceedAccessState extends State { } } } - -// 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/Food.dart b/lib/pages/Food.dart index 2c5e643..4bc3cf9 100644 --- a/lib/pages/Food.dart +++ b/lib/pages/Food.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:rcapp/CustomWidget/foot_category.dart'; @@ -21,6 +22,8 @@ import 'package:rcapp/services/database.dart'; // Orders newOrder; +bool refreshVar = true; + class Food extends StatefulWidget { @override _FoodState createState() => _FoodState(); @@ -69,6 +72,8 @@ class _FoodState extends State { @override Widget build(BuildContext context) { + final store = Provider.of(context); + updateTotal(); return StreamProvider>.value( value: DatabaseService().today_Menu, @@ -78,19 +83,29 @@ class _FoodState extends State { elevation: 10.0, backgroundColor: Colors.deepOrange, title: Container( - margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.13), - child:Text('Menu', style: GoogleFonts.inter()), - ), //repeat for menu and booking + margin: + EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.13), + child: Text('Menu', style: GoogleFonts.inter()), + ), //repeat for menu and booking actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column(children: [ @@ -151,7 +166,7 @@ class _FoodState extends State { ), ), SizedBox(height: 15.0), - BottomItemView(total: total, qty: qty) + BottomItemView(total: total, qty: qty), ]), ), ); @@ -188,8 +203,9 @@ class _QuantityState extends State { ), height: 25, width: 62, - child: - Center(child: Text('Add', style: GoogleFonts.inter(color: Colors.white))), + child: Center( + child: + Text('Add', style: GoogleFonts.inter(color: Colors.white))), ), ); } else { @@ -207,7 +223,8 @@ class _QuantityState extends State { height: 25, width: 66, child: Center( - child: Text('Remove', style: GoogleFonts.inter(color: Colors.white))), + child: Text('Remove', + style: GoogleFonts.inter(color: Colors.white))), ), ); } @@ -260,7 +277,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Main Course', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -283,7 +301,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Breads', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -306,7 +325,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Biryani', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -329,7 +349,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Tandoori', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -362,7 +383,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Chinese', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -385,7 +407,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Noodles', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -408,7 +431,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Rolls', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -431,7 +455,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Pizza', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -464,7 +489,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Snacks', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -487,7 +513,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Sandwiches', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -510,7 +537,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Burgers', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -533,7 +561,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Pasta', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -566,7 +595,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Soup', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -589,7 +619,10 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Accompaniment', - style: GoogleFonts.inter(fontSize: 12, color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + fontSize: 12, + color: Colors.white, + fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -612,7 +645,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Starters', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -635,7 +669,8 @@ class _ListPageState extends State { alignment: Alignment.bottomCenter, child: Text( 'Breakfast', - style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.w300), + style: GoogleFonts.inter( + color: Colors.white, fontWeight: FontWeight.w300), ), ), decoration: BoxDecoration( @@ -654,3 +689,50 @@ class _ListPageState extends State { )); } } + +class BottomItemView extends StatefulWidget { + int total; + int qty; + BottomItemView({this.total, this.qty}); + + @override + _BottomItemViewState createState() => _BottomItemViewState(); +} + +class _BottomItemViewState extends State { + @override + Widget build(BuildContext context) { + final store = Provider.of(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( + '${widget.qty} ' + + ' item ' + + '|' + + ' ' + + '₹ ' + + '${widget.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/Home.dart b/lib/pages/Home.dart index af76e08..ce7d9cf 100644 --- a/lib/pages/Home.dart +++ b/lib/pages/Home.dart @@ -635,3 +635,6 @@ class _LoadingDataState extends State { })); } } + + + diff --git a/lib/pages/NavigationBar.dart b/lib/pages/NavigationBar.dart index e78154b..c593bd3 100644 --- a/lib/pages/NavigationBar.dart +++ b/lib/pages/NavigationBar.dart @@ -5,6 +5,8 @@ import 'package:rcapp/pages/Booking.dart'; import 'package:rcapp/pages/CategoryMenuList/flushbar.dart'; import 'package:rcapp/pages/Food.dart'; import 'package:rcapp/pages/Home.dart'; +import 'package:provider/provider.dart'; +import 'package:rcapp/pages/storeData.dart'; class NavigationBar extends StatefulWidget { @override @@ -38,8 +40,8 @@ class _NavigationBarState extends State { final fbm = FirebaseMessaging(); fbm.configure(onMessage: (msg) { print(msg); - showFlushbarNotification(context, msg['notification']['title'], - msg['notification']['body']); + showFlushbarNotification( + context, msg['notification']['title'], msg['notification']['body']); return; }, onLaunch: (msg) { print(msg); @@ -65,31 +67,34 @@ class _NavigationBarState extends State { @override Widget build(BuildContext context) { - return Scaffold( - body: _children[_currentIndex], - bottomNavigationBar: BottomNavigationBar( - unselectedItemColor: Colors.black, - selectedItemColor: Colors.deepOrange, - onTap: onTappedBar, - currentIndex: _currentIndex, - items: [ - BottomNavigationBarItem( - icon: Icon(Icons.home), - title: Text('Home'), - backgroundColor: Colors.deepOrange, - ), - BottomNavigationBarItem( - icon: Icon(Icons.fastfood), - title: Text('Food'), - backgroundColor: Colors.deepOrange, - activeIcon: Icon(Icons.fastfood, color: Colors.deepOrange), - ), - BottomNavigationBarItem( - icon: Icon(Icons.book), - title: Text('Booking'), - backgroundColor: Colors.deepOrange, - ), - ], + return ChangeNotifierProvider( + create: (ctx) => StoreData(), + child: Scaffold( + body: _children[_currentIndex], + bottomNavigationBar: BottomNavigationBar( + unselectedItemColor: Colors.black, + selectedItemColor: Colors.deepOrange, + onTap: onTappedBar, + currentIndex: _currentIndex, + items: [ + BottomNavigationBarItem( + icon: Icon(Icons.home), + title: Text('Home'), + backgroundColor: Colors.deepOrange, + ), + BottomNavigationBarItem( + icon: Icon(Icons.fastfood), + title: Text('Food'), + backgroundColor: Colors.deepOrange, + activeIcon: Icon(Icons.fastfood, color: Colors.deepOrange), + ), + BottomNavigationBarItem( + icon: Icon(Icons.book), + title: Text('Booking'), + backgroundColor: Colors.deepOrange, + ), + ], + ), ), ); } diff --git a/lib/pages/storeData.dart b/lib/pages/storeData.dart index 42fcb76..beeb76b 100644 --- a/lib/pages/storeData.dart +++ b/lib/pages/storeData.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -class StoreData { +class StoreData with ChangeNotifier { StoreData._privateConstructor(); static final StoreData _instance = StoreData._privateConstructor(); @@ -11,31 +11,34 @@ class StoreData { Map _foodNamePrice = Map(); Map _foodNameQuantity = Map(); - getInstance() {} - void StoreFoodDetails(String foodName, int foodPrice, int value) { _foodNamePrice[foodName] = foodPrice; _foodNameQuantity[foodName] = value; + notifyListeners(); } void removeFoodDetails(String foodName) { _foodNamePrice.remove(foodName); _foodNameQuantity.remove(foodName); + notifyListeners(); } void increaseQty(String foodName) { ++_foodNameQuantity[foodName]; + notifyListeners(); } void decreaseQty(String foodName) { if (_foodNameQuantity[foodName] != 0) { --_foodNameQuantity[foodName]; } + notifyListeners(); } void resetStore() { _foodNamePrice.clear(); _foodNameQuantity.clear(); + notifyListeners(); } Map retrieveFoodDetails() { @@ -45,4 +48,4 @@ class StoreData { Map retrieveQtyDetails() { return _foodNameQuantity; } -} \ No newline at end of file +} diff --git a/pubspec.lock b/pubspec.lock index 0a55f72..389fab0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -29,6 +29,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.4.2" + badges: + dependency: "direct main" + description: + name: badges + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.3" boolean_selector: dependency: transitive description: @@ -479,7 +486,7 @@ packages: source: hosted version: "3.0.13" provider: - dependency: "direct dev" + dependency: "direct main" description: name: provider url: "https://pub.dartlang.org" diff --git a/pubspec.yaml b/pubspec.yaml index 3ce1235..6d9a219 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -48,6 +48,9 @@ dependencies: google_fonts: ^1.1.0 flutter_launcher_icons: ^0.8.0 fluttertoast: ^7.1.1 + provider: ^3.1.0 + badges: ^1.1.3 + flutter_icons: From 22c50bcd5976adb72d1821145e576e7a7f3a0d22 Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Sun, 27 Sep 2020 22:45:01 +0530 Subject: [PATCH 07/19] breakfast_menu changed --- lib/pages/CategoryMenuList/All_Menu.dart | 52 +++++++++++++----- .../CategoryMenuList/Breakfast_Menu.dart | 53 +++++++++++++++---- lib/pages/Food.dart | 13 +---- 3 files changed, 82 insertions(+), 36 deletions(-) diff --git a/lib/pages/CategoryMenuList/All_Menu.dart b/lib/pages/CategoryMenuList/All_Menu.dart index 78e59ad..18c8e57 100644 --- a/lib/pages/CategoryMenuList/All_Menu.dart +++ b/lib/pages/CategoryMenuList/All_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:rcapp/models/user.dart'; @@ -14,10 +15,24 @@ class AllMenu extends StatefulWidget { class _AllMenuState extends State { StoreData dataforCart = StoreData(); - int total = 0; - int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + qty = 0; + setState(() { + qtyDetail.forEach((key, value) { + qty += value; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,22 +43,30 @@ class _AllMenuState extends State { backgroundColor: Colors.deepOrange, title: Text('All Menu'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushReplacementNamed(context, '/cart'); - // Navigator.popAndPushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: AllMenuListPage(), + child: AllMenuListPage(updateTotal: updateTotal), ) ], ), @@ -53,6 +76,8 @@ class _AllMenuState extends State { } class AllMenuListPage extends StatefulWidget { + final updateTotal; + AllMenuListPage({this.updateTotal}); @override _AllMenuListPageState createState() => _AllMenuListPageState(); } @@ -185,6 +210,7 @@ class _AllMenuListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/Breakfast_Menu.dart b/lib/pages/CategoryMenuList/Breakfast_Menu.dart index 093a35e..e44d95d 100644 --- a/lib/pages/CategoryMenuList/Breakfast_Menu.dart +++ b/lib/pages/CategoryMenuList/Breakfast_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _Breakfast_MenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,22 +48,30 @@ class _Breakfast_MenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Breakfast'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - // Navigator.popAndPushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: BreadMenuListListPage(), + child: BreadMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -53,6 +81,8 @@ class _Breakfast_MenuListState extends State { } class BreadMenuListListPage extends StatefulWidget { + final updateTotal; + BreadMenuListListPage({this.updateTotal}); @override _BreadMenuListListPageState createState() => _BreadMenuListListPageState(); } @@ -190,6 +220,7 @@ class _BreadMenuListListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/Food.dart b/lib/pages/Food.dart index 4bc3cf9..2223503 100644 --- a/lib/pages/Food.dart +++ b/lib/pages/Food.dart @@ -35,17 +35,8 @@ class _FoodState extends State { int qty = 0; - // @override - // void initState() { - // // TODO: implement initState - // super.initState(); - // updateTotal(); - // } - - List qtyList = List(); void updateTotal() { - Map foodDetail = dataforCart.retrieveFoodDetails(); Map qtyDetail = dataforCart.retrieveQtyDetails(); total = 0; @@ -53,10 +44,8 @@ class _FoodState extends State { setState(() { qtyDetail.forEach((key, value) { - qty += value; - qtyList.add(value); + ++qty; }); - foodDetail.forEach((k, v) => total = total + v * qtyDetail[k]); }); } From 9c57396cafb45b4d6aa20059370692903e5033cc Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Mon, 28 Sep 2020 13:27:32 +0530 Subject: [PATCH 08/19] changes made to all category pages --- .../CategoryMenuList/Accompaniment_Menu.dart | 52 +++++++++++--- lib/pages/CategoryMenuList/All_Menu.dart | 2 +- .../CategoryMenuList/Biryani_MenuList.dart | 53 +++++++++++--- lib/pages/CategoryMenuList/Bread_Menu.dart | 53 +++++++++++--- lib/pages/CategoryMenuList/Burger_Menu.dart | 59 +++++++++++---- lib/pages/CategoryMenuList/Chinese_Menu.dart | 52 +++++++++++--- .../FriedRiceAndNoodles_Menu.dart | 72 ++++++++++++++----- .../CategoryMenuList/MainCourse_Menu.dart | 53 +++++++++++--- lib/pages/CategoryMenuList/Pasta_Menu.dart | 52 +++++++++++--- lib/pages/CategoryMenuList/Pizza_Menu.dart | 58 +++++++++++---- lib/pages/CategoryMenuList/Roll_Menu.dart | 58 +++++++++++---- lib/pages/CategoryMenuList/Sandwich_Menu.dart | 52 +++++++++++--- lib/pages/CategoryMenuList/Snacks_Menu.dart | 52 +++++++++++--- lib/pages/CategoryMenuList/Soup_Menu.dart | 59 +++++++++++---- lib/pages/CategoryMenuList/Starter_Menu.dart | 51 ++++++++++--- lib/pages/CategoryMenuList/Tandoori_Menu.dart | 51 ++++++++++--- 16 files changed, 658 insertions(+), 171 deletions(-) diff --git a/lib/pages/CategoryMenuList/Accompaniment_Menu.dart b/lib/pages/CategoryMenuList/Accompaniment_Menu.dart index f68c48f..9efebd6 100644 --- a/lib/pages/CategoryMenuList/Accompaniment_Menu.dart +++ b/lib/pages/CategoryMenuList/Accompaniment_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -18,7 +19,26 @@ class _Accompaniment_MenuState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -29,21 +49,30 @@ class _Accompaniment_MenuState extends State { backgroundColor: Colors.deepOrange, title: Text('Accompaniments'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: AccompanimentMenuListPage(), + child: AccompanimentMenuListPage(updateTotal: updateTotal), ) ], ), @@ -53,6 +82,8 @@ class _Accompaniment_MenuState extends State { } class AccompanimentMenuListPage extends StatefulWidget { + final updateTotal; + AccompanimentMenuListPage({this.updateTotal}); @override _AccompanimentMenuListPageState createState() => _AccompanimentMenuListPageState(); @@ -198,6 +229,7 @@ class _AccompanimentMenuListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/All_Menu.dart b/lib/pages/CategoryMenuList/All_Menu.dart index 18c8e57..640e79b 100644 --- a/lib/pages/CategoryMenuList/All_Menu.dart +++ b/lib/pages/CategoryMenuList/All_Menu.dart @@ -22,7 +22,7 @@ class _AllMenuState extends State { qty = 0; setState(() { qtyDetail.forEach((key, value) { - qty += value; + ++qty; }); }); } diff --git a/lib/pages/CategoryMenuList/Biryani_MenuList.dart b/lib/pages/CategoryMenuList/Biryani_MenuList.dart index fa6ced5..101f2d8 100644 --- a/lib/pages/CategoryMenuList/Biryani_MenuList.dart +++ b/lib/pages/CategoryMenuList/Biryani_MenuList.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _Biryani_MenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,22 +48,30 @@ class _Biryani_MenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Rice and Biryani'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - // Navigator.popAndPushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: BiryaniMenuListListPage(), + child: BiryaniMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -53,6 +81,8 @@ class _Biryani_MenuListState extends State { } class BiryaniMenuListListPage extends StatefulWidget { + final updateTotal; + BiryaniMenuListListPage({this.updateTotal}); @override _BiryaniMenuListListPageState createState() => _BiryaniMenuListListPageState(); @@ -193,6 +223,7 @@ class _BiryaniMenuListListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/Bread_Menu.dart b/lib/pages/CategoryMenuList/Bread_Menu.dart index c866d5a..c721509 100644 --- a/lib/pages/CategoryMenuList/Bread_Menu.dart +++ b/lib/pages/CategoryMenuList/Bread_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _Bread_MenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,22 +48,30 @@ class _Bread_MenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Breads'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - // Navigator.popAndPushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: BiryaniMenuListListPage(), + child: BiryaniMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -53,6 +81,8 @@ class _Bread_MenuListState extends State { } class BiryaniMenuListListPage extends StatefulWidget { + final updateTotal; + BiryaniMenuListListPage({this.updateTotal}); @override _BiryaniMenuListListPageState createState() => _BiryaniMenuListListPageState(); @@ -191,6 +221,7 @@ class _BiryaniMenuListListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/Burger_Menu.dart b/lib/pages/CategoryMenuList/Burger_Menu.dart index 4db1b6a..24e8f9c 100644 --- a/lib/pages/CategoryMenuList/Burger_Menu.dart +++ b/lib/pages/CategoryMenuList/Burger_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _Burger_MenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,22 +48,30 @@ class _Burger_MenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Burgers'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - // Navigator.popAndPushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: BurgerMenuListListPage(), + child: BurgerMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -53,6 +81,8 @@ class _Burger_MenuListState extends State { } class BurgerMenuListListPage extends StatefulWidget { + final updateTotal; + BurgerMenuListListPage({this.updateTotal}); @override _BurgerMenuListListPageState createState() => _BurgerMenuListListPageState(); } @@ -179,8 +209,10 @@ class _BurgerMenuListListPageState extends State { width: 43, margin: EdgeInsets.only(top: 6), alignment: Alignment.center, - decoration: - BoxDecoration(color: Colors.deepOrange, borderRadius: BorderRadius.circular(10)), + decoration: BoxDecoration( + color: Colors.deepOrange, + borderRadius: + BorderRadius.circular(10)), child: IconButton( onPressed: () { showFlushbar(context); @@ -188,6 +220,7 @@ class _BurgerMenuListListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/Chinese_Menu.dart b/lib/pages/CategoryMenuList/Chinese_Menu.dart index 27410d9..81d9a36 100644 --- a/lib/pages/CategoryMenuList/Chinese_Menu.dart +++ b/lib/pages/CategoryMenuList/Chinese_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _ChineseMenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,21 +48,30 @@ class _ChineseMenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Chinese'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: ChineseMenuListPage(), + child: ChineseMenuListPage(updateTotal: updateTotal), ) ], ), @@ -52,6 +81,8 @@ class _ChineseMenuListState extends State { } class ChineseMenuListPage extends StatefulWidget { + final updateTotal; + ChineseMenuListPage({this.updateTotal}); @override _ChineseMenuListPageState createState() => _ChineseMenuListPageState(); } @@ -184,6 +215,7 @@ class _ChineseMenuListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/FriedRiceAndNoodles_Menu.dart b/lib/pages/CategoryMenuList/FriedRiceAndNoodles_Menu.dart index 92dd9bc..7969dcc 100644 --- a/lib/pages/CategoryMenuList/FriedRiceAndNoodles_Menu.dart +++ b/lib/pages/CategoryMenuList/FriedRiceAndNoodles_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -9,15 +10,36 @@ import 'package:rcapp/services/database.dart'; class FriedRiceAndNoodles_MenuList extends StatefulWidget { @override - _FriedRiceAndNoodles_MenuListState createState() => _FriedRiceAndNoodles_MenuListState(); + _FriedRiceAndNoodles_MenuListState createState() => + _FriedRiceAndNoodles_MenuListState(); } -class _FriedRiceAndNoodles_MenuListState extends State { +class _FriedRiceAndNoodles_MenuListState + extends State { StoreData dataforCart = StoreData(); int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,22 +50,31 @@ class _FriedRiceAndNoodles_MenuListState extends State[ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - // Navigator.popAndPushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: FriedRiceAndNoodlesMenuListListPage(), + child: + FriedRiceAndNoodlesMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -53,11 +84,15 @@ class _FriedRiceAndNoodles_MenuListState extends State _FriedRiceAndNoodlesMenuListListPageState(); + _FriedRiceAndNoodlesMenuListListPageState createState() => + _FriedRiceAndNoodlesMenuListListPageState(); } -class _FriedRiceAndNoodlesMenuListListPageState extends State { +class _FriedRiceAndNoodlesMenuListListPageState + extends State { StoreData storeData = StoreData(); int total = 0; bool checked = false; @@ -179,8 +214,10 @@ class _FriedRiceAndNoodlesMenuListListPageState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,22 +48,30 @@ class _MainCourse_MenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Main Course'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - // Navigator.popAndPushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: MainCourseMenuListListPage(), + child: MainCourseMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -53,6 +81,8 @@ class _MainCourse_MenuListState extends State { } class MainCourseMenuListListPage extends StatefulWidget { + final updateTotal; + MainCourseMenuListListPage({this.updateTotal}); @override _MainCourseMenuListListPageState createState() => _MainCourseMenuListListPageState(); @@ -192,6 +222,7 @@ class _MainCourseMenuListListPageState setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/Pasta_Menu.dart b/lib/pages/CategoryMenuList/Pasta_Menu.dart index 2f3af0d..36815f6 100644 --- a/lib/pages/CategoryMenuList/Pasta_Menu.dart +++ b/lib/pages/CategoryMenuList/Pasta_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _Pasta_MenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,21 +48,30 @@ class _Pasta_MenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Pasta'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: PastaMenuListListPage(), + child: PastaMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -52,6 +81,8 @@ class _Pasta_MenuListState extends State { } class PastaMenuListListPage extends StatefulWidget { + final updateTotal; + PastaMenuListListPage({this.updateTotal}); @override _PastaMenuListListPageState createState() => _PastaMenuListListPageState(); } @@ -186,6 +217,7 @@ class _PastaMenuListListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/Pizza_Menu.dart b/lib/pages/CategoryMenuList/Pizza_Menu.dart index 7e85da8..4056cb3 100644 --- a/lib/pages/CategoryMenuList/Pizza_Menu.dart +++ b/lib/pages/CategoryMenuList/Pizza_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _Pizza_MenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,21 +48,30 @@ class _Pizza_MenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Pizza'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: PizzaMenuListListPage(), + child: PizzaMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -52,6 +81,8 @@ class _Pizza_MenuListState extends State { } class PizzaMenuListListPage extends StatefulWidget { + final updateTotal; + PizzaMenuListListPage({this.updateTotal}); @override _PizzaMenuListListPageState createState() => _PizzaMenuListListPageState(); } @@ -178,8 +209,10 @@ class _PizzaMenuListListPageState extends State { width: 43, margin: EdgeInsets.only(top: 6), alignment: Alignment.center, - decoration: - BoxDecoration(color: Colors.deepOrange, borderRadius: BorderRadius.circular(10)), + decoration: BoxDecoration( + color: Colors.deepOrange, + borderRadius: + BorderRadius.circular(10)), child: IconButton( onPressed: () { showFlushbar(context); @@ -187,6 +220,7 @@ class _PizzaMenuListListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/Roll_Menu.dart b/lib/pages/CategoryMenuList/Roll_Menu.dart index 5cff1fc..9ac875b 100644 --- a/lib/pages/CategoryMenuList/Roll_Menu.dart +++ b/lib/pages/CategoryMenuList/Roll_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _Roll_MenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,21 +48,30 @@ class _Roll_MenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Roll'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: RollMenuListListPage(), + child: RollMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -52,6 +81,8 @@ class _Roll_MenuListState extends State { } class RollMenuListListPage extends StatefulWidget { + final updateTotal; + RollMenuListListPage({this.updateTotal}); @override _RollMenuListListPageState createState() => _RollMenuListListPageState(); } @@ -178,8 +209,10 @@ class _RollMenuListListPageState extends State { width: 43, margin: EdgeInsets.only(top: 6), alignment: Alignment.center, - decoration: - BoxDecoration(color: Colors.deepOrange, borderRadius: BorderRadius.circular(10)), + decoration: BoxDecoration( + color: Colors.deepOrange, + borderRadius: + BorderRadius.circular(10)), child: IconButton( onPressed: () { showFlushbar(context); @@ -187,6 +220,7 @@ class _RollMenuListListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/Sandwich_Menu.dart b/lib/pages/CategoryMenuList/Sandwich_Menu.dart index 9598e50..c1f1252 100644 --- a/lib/pages/CategoryMenuList/Sandwich_Menu.dart +++ b/lib/pages/CategoryMenuList/Sandwich_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _Sandwich_MenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,21 +48,30 @@ class _Sandwich_MenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Sandwich'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: SandwichMenuListListPage(), + child: SandwichMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -52,6 +81,8 @@ class _Sandwich_MenuListState extends State { } class SandwichMenuListListPage extends StatefulWidget { + final updateTotal; + SandwichMenuListListPage({this.updateTotal}); @override _SandwichMenuListListPageState createState() => _SandwichMenuListListPageState(); @@ -190,6 +221,7 @@ class _SandwichMenuListListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/Snacks_Menu.dart b/lib/pages/CategoryMenuList/Snacks_Menu.dart index 898c736..707d793 100644 --- a/lib/pages/CategoryMenuList/Snacks_Menu.dart +++ b/lib/pages/CategoryMenuList/Snacks_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _Snacks_MenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,21 +48,30 @@ class _Snacks_MenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Snacks'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: SnacksMenuListListPage(), + child: SnacksMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -52,6 +81,8 @@ class _Snacks_MenuListState extends State { } class SnacksMenuListListPage extends StatefulWidget { + final updateTotal; + SnacksMenuListListPage({this.updateTotal}); @override _SnacksMenuListListPageState createState() => _SnacksMenuListListPageState(); } @@ -189,6 +220,7 @@ class _SnacksMenuListListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/Soup_Menu.dart b/lib/pages/CategoryMenuList/Soup_Menu.dart index b30a31f..edde5fb 100644 --- a/lib/pages/CategoryMenuList/Soup_Menu.dart +++ b/lib/pages/CategoryMenuList/Soup_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _Soup_MenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,22 +48,30 @@ class _Soup_MenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Soup'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - // Navigator.popAndPushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: SoupMenuListListPage(), + child: SoupMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -53,6 +81,8 @@ class _Soup_MenuListState extends State { } class SoupMenuListListPage extends StatefulWidget { + final updateTotal; + SoupMenuListListPage({this.updateTotal}); @override _SoupMenuListListPageState createState() => _SoupMenuListListPageState(); } @@ -179,8 +209,10 @@ class _SoupMenuListListPageState extends State { width: 43, margin: EdgeInsets.only(top: 6), alignment: Alignment.center, - decoration: - BoxDecoration(color: Colors.deepOrange, borderRadius: BorderRadius.circular(10)), + decoration: BoxDecoration( + color: Colors.deepOrange, + borderRadius: + BorderRadius.circular(10)), child: IconButton( onPressed: () { showFlushbar(context); @@ -188,6 +220,7 @@ class _SoupMenuListListPageState extends State { setState(() { checked = !checked; }); + widget.updateTotal(); }, icon: Icon( Icons.add, diff --git a/lib/pages/CategoryMenuList/Starter_Menu.dart b/lib/pages/CategoryMenuList/Starter_Menu.dart index bf78dc5..956dfc8 100644 --- a/lib/pages/CategoryMenuList/Starter_Menu.dart +++ b/lib/pages/CategoryMenuList/Starter_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _StarterMenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,21 +48,30 @@ class _StarterMenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Starters'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: StarterMenuListListPage(), + child: StarterMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -52,6 +81,8 @@ class _StarterMenuListState extends State { } class StarterMenuListListPage extends StatefulWidget { + final updateTotal; + StarterMenuListListPage({this.updateTotal}); @override _StarterMenuListListPageState createState() => _StarterMenuListListPageState(); diff --git a/lib/pages/CategoryMenuList/Tandoori_Menu.dart b/lib/pages/CategoryMenuList/Tandoori_Menu.dart index f1f0e7c..df37850 100644 --- a/lib/pages/CategoryMenuList/Tandoori_Menu.dart +++ b/lib/pages/CategoryMenuList/Tandoori_Menu.dart @@ -1,3 +1,4 @@ +import 'package:badges/badges.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -17,7 +18,26 @@ class _Tandoori_MenuListState extends State { int total = 0; int qty = 0; - List qtyList = List(); + + void updateTotal() { + Map qtyDetail = dataforCart.retrieveQtyDetails(); + + total = 0; + qty = 0; + + setState(() { + qtyDetail.forEach((key, value) { + ++qty; + }); + }); + } + + @override + void initState() { + // TODO: implement initState + super.initState(); + updateTotal(); + } @override Widget build(BuildContext context) { @@ -28,21 +48,30 @@ class _Tandoori_MenuListState extends State { backgroundColor: Colors.deepOrange, title: Text('Tandoor'), actions: [ - IconButton( - icon: Icon( - Icons.shopping_cart, - color: Colors.white, + Container( + margin: EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.pushNamed(context, '/cart'); + }, + icon: Badge( + toAnimate: true, + badgeColor: Colors.yellow, + badgeContent: Text('$qty'), + child: Icon( + Icons.shopping_cart, + color: Colors.white, + size: 35, + ), + ), ), - onPressed: () { - Navigator.pushNamed(context, '/cart'); - }, - ) + ), ], ), body: Column( children: [ Expanded( - child: TandooriMenuListListPage(), + child: TandooriMenuListListPage(updateTotal: updateTotal), ) ], ), @@ -52,6 +81,8 @@ class _Tandoori_MenuListState extends State { } class TandooriMenuListListPage extends StatefulWidget { + final updateTotal; + TandooriMenuListListPage({this.updateTotal}); @override _TandooriMenuListListPageState createState() => _TandooriMenuListListPageState(); From 07f217ee70c8aa38526109ef6f4a9743fff4cfed Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Mon, 28 Sep 2020 14:57:36 +0530 Subject: [PATCH 09/19] confirm order bug fixed --- lib/pages/Booking.dart | 10 ++++++++-- lib/pages/Cart.dart | 2 +- lib/pages/Food.dart | 5 +++++ lib/pages/Home.dart | 8 ++++++++ lib/pages/NavigationBar.dart | 9 ++++++++- lib/pages/customAlert.dart | 4 +++- 6 files changed, 33 insertions(+), 5 deletions(-) diff --git a/lib/pages/Booking.dart b/lib/pages/Booking.dart index 787a88a..b52d500 100644 --- a/lib/pages/Booking.dart +++ b/lib/pages/Booking.dart @@ -27,7 +27,7 @@ class _BookingState extends State { SizedBox(height: 30.0), Container( margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 10), - child:Row( + child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( @@ -197,7 +197,7 @@ class _BookingState extends State { SizedBox(height: 30.0), Container( margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 10), - child:Text( + child: Text( " Banquet Halls", style: GoogleFonts.inter( color: Colors.grey, @@ -280,4 +280,10 @@ class _BookingState extends State { ), ); } + + @override + void dispose() { + // TODO: implement dispose + super.dispose(); + } } diff --git a/lib/pages/Cart.dart b/lib/pages/Cart.dart index ad7785e..2eb4ab3 100644 --- a/lib/pages/Cart.dart +++ b/lib/pages/Cart.dart @@ -462,7 +462,6 @@ class _ProceedAccessState extends State { onPressed: () { updateTotal(); confirmOrder(); - Navigator.pushReplacementNamed(context, '/navigationbar'); showDialog( context: context, builder: (context) => CustomAlert( @@ -471,6 +470,7 @@ class _ProceedAccessState extends State { 'Your Order has been placed and will be on its way to you shortly. For further queries regarding your order, please contact - Mr. Debabrata Mohanty - +919438208969', // url: 'assets/nigga.gif', )); + // Navigator.pop(context); }, child: Text( 'Confirm Order(Pay through COD)', diff --git a/lib/pages/Food.dart b/lib/pages/Food.dart index 2223503..dbc7023 100644 --- a/lib/pages/Food.dart +++ b/lib/pages/Food.dart @@ -160,6 +160,11 @@ class _FoodState extends State { ), ); } + @override + void dispose() { + // TODO: implement dispose + super.dispose(); + } } class Quantity extends StatefulWidget { diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart index ce7d9cf..d0aada5 100644 --- a/lib/pages/Home.dart +++ b/lib/pages/Home.dart @@ -276,6 +276,12 @@ class _HomeState extends State { ), ); } + + @override + void dispose() { + // TODO: implement dispose + super.dispose(); + } } class HomeListPage extends StatefulWidget { @@ -634,6 +640,8 @@ class _LoadingDataState extends State { } })); } + + } diff --git a/lib/pages/NavigationBar.dart b/lib/pages/NavigationBar.dart index c593bd3..bd3036b 100644 --- a/lib/pages/NavigationBar.dart +++ b/lib/pages/NavigationBar.dart @@ -14,6 +14,7 @@ class NavigationBar extends StatefulWidget { } class _NavigationBarState extends State { + StoreData storeData = StoreData(); int _currentIndex = 0; final List _children = [ Home(), @@ -68,7 +69,7 @@ class _NavigationBarState extends State { @override Widget build(BuildContext context) { return ChangeNotifierProvider( - create: (ctx) => StoreData(), + create: (ctx) => storeData, child: Scaffold( body: _children[_currentIndex], bottomNavigationBar: BottomNavigationBar( @@ -98,4 +99,10 @@ class _NavigationBarState extends State { ), ); } + + @override + void dispose() { + // TODO: implement dispose + super.dispose(); + } } diff --git a/lib/pages/customAlert.dart b/lib/pages/customAlert.dart index 0fe4593..2274c72 100644 --- a/lib/pages/customAlert.dart +++ b/lib/pages/customAlert.dart @@ -56,7 +56,9 @@ class _CustomAlertState extends State { alignment: Alignment.bottomRight, child: InkWell( onTap: () { - Navigator.pop(context); + Navigator.popUntil( + context, ModalRoute.withName('/wrapper')); + // Navigator.pop(context); }, child: Text('OK')), ) From be3f12130df16ef020e21b6a371f0288972ec970 Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Mon, 28 Sep 2020 17:17:44 +0530 Subject: [PATCH 10/19] reject functionality and notification added --- functions/dist/index.dev.js | 74 ++++++++++++--- functions/index.js | 32 +++++-- lib/pages/admin_order_confirm.dart | 142 +++++++++++++++++++++-------- lib/services/database.dart | 3 +- 4 files changed, 191 insertions(+), 60 deletions(-) diff --git a/functions/dist/index.dev.js b/functions/dist/index.dev.js index a96cd10..243b78f 100644 --- a/functions/dist/index.dev.js +++ b/functions/dist/index.dev.js @@ -73,23 +73,69 @@ exports.adminBookingTrigger = functions.firestore.document('BookingDetails/{id}' } }); }); -exports.confirmNotification = functions.firestore.document('confirmedOrders/{id}').onUpdate(function (snapshot, context) { - var token = snapshot.after.data().token; - return fcm.sendToDevice(token, { - notification: { - title: 'Order Confirmation', - body: 'Your order has been confirmed', - clickAction: 'FLUTTER_NOTIFICATION_CLICK' +exports.confirmNotification = functions.firestore.document('confirmedOrders/{id}').onUpdate(function _callee3(snapshot, context) { + var token, rejected, confirmed; + return regeneratorRuntime.async(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + token = snapshot.after.data().token; + rejected = snapshot.after.data().isRejected; + confirmed = snapshot.after.data().isConfirmed; + + if (!(confirmed === true)) { + _context3.next = 7; + break; + } + + return _context3.abrupt("return", fcm.sendToDevice(token, { + notification: { + title: 'Order Confirmation', + body: 'Your order has been confirmed', + clickAction: 'FLUTTER_NOTIFICATION_CLICK' + } + })); + + case 7: + if (!(rejected === true)) { + _context3.next = 9; + break; + } + + return _context3.abrupt("return", fcm.sendToDevice(token, { + notification: { + title: 'Order rejected', + body: 'Your order has been rejected', + clickAction: 'FLUTTER_NOTIFICATION_CLICK' + } + })); + + case 9: + case "end": + return _context3.stop(); + } } }); }); -exports.BookingNotification = functions.firestore.document('BookingDetails/{id}').onUpdate(function (snapshot, context) { - var token = snapshot.after.data().token; - return fcm.sendToDevice(token, { - notification: { - title: 'Booking Confirmation', - body: 'Your Booking has been confirmed', - clickAction: 'FLUTTER_NOTIFICATION_CLICK' +exports.BookingNotification = functions.firestore.document('BookingDetails/{id}').onUpdate(function _callee4(snapshot, context) { + var token; + return regeneratorRuntime.async(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + token = snapshot.after.data().token; + return _context4.abrupt("return", fcm.sendToDevice(token, { + notification: { + title: 'Booking Confirmation', + body: 'Your Booking has been confirmed', + clickAction: 'FLUTTER_NOTIFICATION_CLICK' + } + })); + + case 2: + case "end": + return _context4.stop(); + } } }); }); \ No newline at end of file diff --git a/functions/index.js b/functions/index.js index 1e5c7bd..590ac11 100644 --- a/functions/index.js +++ b/functions/index.js @@ -40,19 +40,33 @@ exports.adminBookingTrigger = functions.firestore.document('BookingDetails/{id}' }) }); -exports.confirmNotification = functions.firestore.document('confirmedOrders/{id}').onUpdate((snapshot, context) => { +exports.confirmNotification = functions.firestore.document('confirmedOrders/{id}').onUpdate(async(snapshot, context) => { var token = snapshot.after.data().token; - return fcm.sendToDevice(token, { - notification: { - title: 'Order Confirmation', - body: 'Your order has been confirmed', - clickAction: 'FLUTTER_NOTIFICATION_CLICK' - } - }) + var rejected = snapshot.after.data().isRejected; + var confirmed = snapshot.after.data().isConfirmed; + + if(confirmed === true) { + return fcm.sendToDevice(token, { + notification: { + title: 'Order Confirmation', + body: 'Your order has been confirmed', + clickAction: 'FLUTTER_NOTIFICATION_CLICK' + } + }); + } else if(rejected === true) { + return fcm.sendToDevice(token, { + notification: { + title: 'Order rejected', + body: 'Your order has been rejected', + clickAction: 'FLUTTER_NOTIFICATION_CLICK' + } + }); + } + }); -exports.BookingNotification = functions.firestore.document('BookingDetails/{id}').onUpdate((snapshot, context) => { +exports.BookingNotification = functions.firestore.document('BookingDetails/{id}').onUpdate(async(snapshot, context) => { var token = snapshot.after.data().token; return fcm.sendToDevice(token, { notification: { diff --git a/lib/pages/admin_order_confirm.dart b/lib/pages/admin_order_confirm.dart index ac5d328..c5c2db0 100644 --- a/lib/pages/admin_order_confirm.dart +++ b/lib/pages/admin_order_confirm.dart @@ -28,6 +28,16 @@ class _AdminOrderState extends State { }); } + void rejectOrder(int index, int date) async { + await Firestore.instance + .collection('confirmedOrders') + .document('$date') + .updateData({"isRejected": true}); + setState(() { + orders[index]["isRejected"] = true; + }); + } + void deleteOrder(int index, int date) async { await Firestore.instance .collection('confirmedOrders') @@ -95,7 +105,7 @@ class _AdminOrderState extends State { SizedBox(height: 10.0), Container( padding: EdgeInsets.all(10), - height: MediaQuery.of(context).size.height * 0.3, + height: MediaQuery.of(context).size.height * 0.32, width: MediaQuery.of(context).size.width * 9, decoration: BoxDecoration( color: Colors.white, @@ -111,7 +121,42 @@ class _AdminOrderState extends State { style: GoogleFonts.inter( color: Colors.deepOrange, fontSize: 22), ), - Flexible(child: Text('${orders[index]["date"]}')), + // Flexible(child: Text('${orders[index]["date"]}')), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + AdminOrderDetails( + total: orders[index]["total"], + orderNo: orderNo, + name: orders[index]["name"], + date: orders[index]["date"], + number: orders[index] + ["number"], + address: orders[index] + ["address"], + item: item[index], + quantity: quantity[index], + mobileNumber: orders[index] + ["mobileNumber"], + price: orders[index] + ["price"]))); + }, + child: Container( + padding: EdgeInsets.symmetric( + horizontal: 5, vertical: 4), + decoration: BoxDecoration( + color: Colors.orange, + border: Border.all(color: Colors.black), + borderRadius: BorderRadius.circular(5)), + child: Text('View', + style: GoogleFonts.inter( + color: Colors.white, + )), + ), + ), ], ), SizedBox(height: 8), @@ -137,8 +182,7 @@ class _AdminOrderState extends State { MainAxisAlignment.spaceBetween, children: [ Text( - "Personal No : " + - "${orders[index]["number"]}", + "Date : " + "${orders[index]["date"]}", style: GoogleFonts.inter( color: Colors.black, fontSize: 18, @@ -147,32 +191,77 @@ class _AdminOrderState extends State { ], ), SizedBox(height: 8), - if (orders[index]["isConfirmed"]) ...[ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + "Mobile No : " + + "${orders[index]["mobileNumber"]}", + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400), + ), + ], + ), + SizedBox(height: 8), + if (orders[index]["isConfirmed"] && + !orders[index]["isRejected"]) ...[ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, children: [ Text( - "Status: Confirmed", + "Status: ", style: GoogleFonts.inter( color: Colors.black, fontSize: 18, fontWeight: FontWeight.w400), ), + Text( + "Confirmed", + style: GoogleFonts.inter( + color: Colors.green, + fontSize: 18, + fontWeight: FontWeight.w400), + ), + ], + ), + ] else if (orders[index]["isRejected"]) ...[ + Row( + children: [ + Text( + "Status: ", + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400), + ), + Text( + "Rejected", + style: GoogleFonts.inter( + color: Colors.red[800], + fontSize: 18, + fontWeight: FontWeight.w400), + ), ], ), ] else ...[ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, children: [ Text( - "Status: Not Confirmed", + "Status: ", style: GoogleFonts.inter( color: Colors.black, fontSize: 18, fontWeight: FontWeight.w400), ), + Text( + "Not Confirmed", + style: GoogleFonts.inter( + color: Colors.orange, + fontSize: 18, + fontWeight: FontWeight.w400), + ), ], ), ] @@ -189,29 +278,10 @@ class _AdminOrderState extends State { Row(children: [ InkWell( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - AdminOrderDetails( - total: orders[index] - ["total"], - orderNo: orderNo, - name: orders[index] - ["name"], - date: orders[index] - ["date"], - number: orders[index] - ["number"], - address: orders[index] - ["address"], - item: item[index], - quantity: quantity[index], - mobileNumber: - orders[index] - ["mobileNumber"], - price: orders[index] - ["price"]))); + if (!orders[index]["isConfirmed"]) { + rejectOrder( + index, orders[index]["_date"]); + } }, child: Container( padding: EdgeInsets.symmetric( @@ -222,14 +292,14 @@ class _AdminOrderState extends State { Border.all(color: Colors.black), borderRadius: BorderRadius.circular(5)), - child: Text('View', + child: Text('Reject', style: GoogleFonts.inter( color: Colors.white, )), ), ), SizedBox(width: 10), - if (!orders[index]["isConfirmed"]) ...[ + if (!orders[index]["isConfirmed"] && !orders[index]["isRejected"]) ...[ InkWell( onTap: () { confirmOrder( diff --git a/lib/services/database.dart b/lib/services/database.dart index b021705..4ccc9b8 100644 --- a/lib/services/database.dart +++ b/lib/services/database.dart @@ -143,7 +143,8 @@ class DatabaseService { '/' + '${DateTime.now().year}', 'token': _token, - 'mobileNumber': mobileNumber + 'mobileNumber': mobileNumber, + 'isRejected': false }); } From f443c012b2ff4363933df23c07133744b14132f3 Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Mon, 28 Sep 2020 18:24:08 +0530 Subject: [PATCH 11/19] added pdf and image option for notice board --- lib/main.dart | 2 + lib/pages/Food.dart | 6 +- lib/pages/Home.dart | 23 ++- lib/pages/customAlert.dart | 4 +- lib/pages/customConfirmAlerts.dart | 83 ++++++++ lib/pages/uploadPdfImage.dart | 298 +++++++++++++++++++++++++++++ 6 files changed, 408 insertions(+), 8 deletions(-) create mode 100644 lib/pages/customConfirmAlerts.dart create mode 100644 lib/pages/uploadPdfImage.dart diff --git a/lib/main.dart b/lib/main.dart index c6bf276..cab8b11 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -42,6 +42,7 @@ 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/uploadPdfImage.dart'; import 'package:rcapp/pages/welcome.dart'; import 'package:rcapp/services/auth.dart'; import 'pages/wrapper.dart'; @@ -113,6 +114,7 @@ class MyApp extends StatelessWidget { //Routes for admin "/uploadImage": (context) => UploadImage(), "/uploadPdf": (context) => UploadPdf(), + "/uploadPdfImage": (context) => UploadPdfImage(), "/uploadAvatarImage": (context) => UploadAvatar() }, ), diff --git a/lib/pages/Food.dart b/lib/pages/Food.dart index dbc7023..c0efadb 100644 --- a/lib/pages/Food.dart +++ b/lib/pages/Food.dart @@ -35,9 +35,9 @@ class _FoodState extends State { int qty = 0; - void updateTotal() { Map qtyDetail = dataforCart.retrieveQtyDetails(); + Map foodDetail = dataforCart.retrieveFoodDetails(); total = 0; qty = 0; @@ -46,6 +46,9 @@ class _FoodState extends State { qtyDetail.forEach((key, value) { ++qty; }); + foodDetail.forEach((key, value) { + total = total + value * qtyDetail[key]; + }); }); } @@ -160,6 +163,7 @@ class _FoodState extends State { ), ); } + @override void dispose() { // TODO: implement dispose diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart index d0aada5..48d57e0 100644 --- a/lib/pages/Home.dart +++ b/lib/pages/Home.dart @@ -201,7 +201,23 @@ class _HomeState extends State { shape: new RoundedRectangleBorder( borderRadius: new BorderRadius.circular(10.0)), child: Text( - 'Add To List', + 'Add Pdf', + style: TextStyle(color: Colors.white), + ), + color: Colors.deepOrange, + ), + ), + SizedBox(width: 10), + Container( + height: 28, + child: FlatButton( + onPressed: () { + Navigator.pushNamed(context, '/uploadPdfImage'); + }, + shape: new RoundedRectangleBorder( + borderRadius: new BorderRadius.circular(10.0)), + child: Text( + 'Add Image', style: TextStyle(color: Colors.white), ), color: Colors.deepOrange, @@ -640,9 +656,4 @@ class _LoadingDataState extends State { } })); } - - } - - - diff --git a/lib/pages/customAlert.dart b/lib/pages/customAlert.dart index 2274c72..e710b3b 100644 --- a/lib/pages/customAlert.dart +++ b/lib/pages/customAlert.dart @@ -60,7 +60,9 @@ class _CustomAlertState extends State { context, ModalRoute.withName('/wrapper')); // Navigator.pop(context); }, - child: Text('OK')), + child: Container( + padding: EdgeInsets.all(10), + child: Text('OK'))), ) ], ), diff --git a/lib/pages/customConfirmAlerts.dart b/lib/pages/customConfirmAlerts.dart new file mode 100644 index 0000000..e710b3b --- /dev/null +++ b/lib/pages/customConfirmAlerts.dart @@ -0,0 +1,83 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +class CustomAlert extends StatefulWidget { + final title; + final description; + // final url; + CustomAlert({this.title, this.description}); + @override + _CustomAlertState createState() => _CustomAlertState(); +} + +class _CustomAlertState extends State { + @override + Widget build(BuildContext context) { + return Dialog( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + elevation: 0, + backgroundColor: Colors.transparent, + child: dialogContext(context), + ); + } + + dialogContext(BuildContext context) { + return Stack( + children: [ + Container( + padding: EdgeInsets.fromLTRB(16, 100, 16, 16), + margin: EdgeInsets.only(top: 16), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black26, + blurRadius: 10, + offset: Offset(0, 10)) + ]), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + widget.title, + style: GoogleFonts.inter(), + ), + SizedBox(height: 24), + Text( + widget.description, + style: GoogleFonts.inter(), + ), + SizedBox( + height: 24, + ), + Align( + alignment: Alignment.bottomRight, + child: InkWell( + onTap: () { + Navigator.popUntil( + context, ModalRoute.withName('/wrapper')); + // Navigator.pop(context); + }, + child: Container( + padding: EdgeInsets.all(10), + child: Text('OK'))), + ) + ], + ), + ), + Positioned( + top: 0, + left: 16, + right: 16, + child: CircleAvatar( + backgroundColor: Colors.orangeAccent, + radius: 50, + backgroundImage: AssetImage('assets/tick.gif'), + ), + ) + ], + ); + } +} diff --git a/lib/pages/uploadPdfImage.dart b/lib/pages/uploadPdfImage.dart new file mode 100644 index 0000000..aaa4e82 --- /dev/null +++ b/lib/pages/uploadPdfImage.dart @@ -0,0 +1,298 @@ +import 'dart:io'; +import 'package:firebase_storage/firebase_storage.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:path/path.dart'; +import 'package:rcapp/services/database.dart'; + +class UploadPdfImage extends StatefulWidget { + @override + _UploadPdfImageState createState() => _UploadPdfImageState(); +} + +class _UploadPdfImageState extends State { + @override + Widget build(BuildContext context) { + return ImageCapture(); + } +} + +class ImageCapture extends StatefulWidget { + @override + _ImageCaptureState createState() => _ImageCaptureState(); +} + +class _ImageCaptureState extends State { + File _pickedImage; + + bool showOptions = false; + + String title = ''; + String subtitle = ''; + + void _pickImage(ImageSource source) async { + final pickedImageFile = await ImagePicker.pickImage( + source: source, imageQuality: 100, maxWidth: 350, maxHeight: 280); + setState(() { + _pickedImage = pickedImageFile; + }); + } + + void _clear() { + setState(() => _pickedImage = null); + } + + void toggle() { + setState(() { + showOptions = !showOptions; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Colors.deepOrange, + title: Text('Upload Image'), + ), + bottomNavigationBar: BottomAppBar( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + if (showOptions == true) ...[ + Container( + height: 90, + child: Column(children: [ + IconButton( + iconSize: 40, + color: Colors.deepOrange, + icon: Icon(Icons.photo_library), + onPressed: () => _pickImage(ImageSource.gallery), + ), + Text( + 'File Explorer', + style: GoogleFonts.inter( + color: Colors.black, fontWeight: FontWeight.bold), + ) + ]), + ), + Container( + height: 90, + child: Column(children: [ + IconButton( + iconSize: 40, + color: Colors.deepOrange, + icon: Icon(Icons.camera), + onPressed: () => _pickImage(ImageSource.camera), + ), + Text('Camera', + style: GoogleFonts.inter( + color: Colors.black, fontWeight: FontWeight.bold)) + ]), + ) + ] + ], + ), + ), + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.fromLTRB(40, 10, 40, 0), + child: Column(children: [ + if (_pickedImage == null) ...[ + Center( + child: Container( + width: 320, + height: 250, + decoration: BoxDecoration( + border: + Border.all(color: Colors.deepOrange, width: 2.0), + borderRadius: BorderRadius.circular(10)), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + onPressed: () { + toggle(); + }, + iconSize: 40, + icon: Icon(Icons.image), + ), + SizedBox(height: 5), + Text('ADD AN IMAGE', + style: GoogleFonts.inter( + fontWeight: FontWeight.w500, fontSize: 20)) + ], + ), + ), + ), + SizedBox(height: 10), + TextFormField( + decoration: InputDecoration( + hintText: 'Title', + fillColor: Colors.white, + filled: true, + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.deepOrange, width: 1.0), + borderRadius: BorderRadius.circular(10)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.deepOrange, width: 3.0), + borderRadius: BorderRadius.circular(10))), + validator: (val) => val.isEmpty ? 'Enter Title' : null, + onChanged: (val) { + setState(() => title = val); + }), + SizedBox(height: 10), + TextFormField( + decoration: InputDecoration( + hintText: 'Sub-Title', + fillColor: Colors.white, + filled: true, + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.deepOrange, width: 1.0), + borderRadius: BorderRadius.circular(10)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.deepOrange, width: 3.0), + borderRadius: BorderRadius.circular(10))), + validator: (val) => val.isEmpty ? 'Enter Subtitle' : null, + onChanged: (val) { + setState(() => subtitle = val); + }) + ], + if (_pickedImage != null) ...[ + Image.file(_pickedImage), + SizedBox(height: 10), + TextFormField( + decoration: InputDecoration( + hintText: 'Title', + fillColor: Colors.white, + filled: true, + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.deepOrange, width: 1.0), + borderRadius: BorderRadius.circular(10)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.deepOrange, width: 3.0), + borderRadius: BorderRadius.circular(10))), + validator: (val) => val.isEmpty ? 'Enter Title' : null, + onChanged: (val) { + setState(() => title = val); + }), + SizedBox(height: 10), + TextFormField( + decoration: InputDecoration( + hintText: 'Sub-Title', + fillColor: Colors.white, + filled: true, + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.deepOrange, width: 1.0), + borderRadius: BorderRadius.circular(10)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.deepOrange, width: 3.0), + borderRadius: BorderRadius.circular(10))), + validator: (val) => val.isEmpty ? 'Enter Subtitle' : null, + onChanged: (val) { + setState(() => subtitle = val); + }), + SizedBox(height: 10), + Uploader(file: _pickedImage, title: title, subtitle: subtitle), + SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + FlatButton( + color: Colors.deepOrange, + child: Icon(Icons.refresh), + onPressed: _clear, + shape: new RoundedRectangleBorder( + borderRadius: new BorderRadius.circular(10.0)), + ), + ]), + ] + ]), + ), + )); + } +} + +class Uploader extends StatefulWidget { + final title; + final subtitle; + final file; + Uploader({this.file, this.title, this.subtitle}); + @override + _UploaderState createState() => _UploaderState(); +} + +class _UploaderState extends State { + final FirebaseStorage _storage = + FirebaseStorage(storageBucket: 'gs://rcapp-de25c.appspot.com'); + // StorageUploadTask _uploadTask; + + var _uploadTask; + + final DatabaseService _pdfUploader = DatabaseService(); + + Future _startUpload(String title, String subtitle) async { + try { + final ref = FirebaseStorage.instance + .ref() + .child('pdf_store') + .child('${DateTime.now()}.jpg'); + + setState(() { + _uploadTask = ref.putFile(widget.file); + }); + + await ref.putFile(widget.file).onComplete; + + final url = await ref.getDownloadURL(); + + _pdfUploader.updatePdf(title, subtitle, url); + print(url); + } catch (e) { + print(e.toString()); + } + } + + @override + Widget build(BuildContext context) { + if (_uploadTask != null) { + return StreamBuilder( + stream: _uploadTask.events, + builder: (context, snapshot) { + var event = snapshot?.data?.snapshot; + double progressPercent = + event != null ? event.bytesTransferred / event.totalByteCount : 0; + + return Column(children: [ + if (_uploadTask.isComplete) Text("Uploaded To Database"), + LinearProgressIndicator(value: progressPercent), + Text('${(progressPercent * 100).toStringAsFixed(2)} %') + ]); + }, + ); + } else { + return FlatButton.icon( + onPressed: () { + _startUpload(widget.title, widget.subtitle); + }, + icon: Icon(Icons.cloud_upload), + label: Text( + 'Save Data To List', + style: GoogleFonts.inter(fontSize: 17), + ), + shape: new RoundedRectangleBorder( + borderRadius: new BorderRadius.circular(10.0)), + color: Colors.deepOrange, + ); + } + } +} From b19edb7c81a3281bb5901d9f62b551bfbbec1fc3 Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Tue, 29 Sep 2020 10:57:22 +0530 Subject: [PATCH 12/19] orders and booking pages --- functions/dist/index.dev.js | 26 +++++++- functions/index.js | 27 ++++++-- lib/pages/Cart.dart | 7 -- lib/pages/add_event.dart | 23 ++++++- lib/pages/adminBooking.dart | 115 ++++++++++++++++++++++++--------- lib/pages/previousBooking.dart | 54 +++++++++++++++- lib/pages/previousOrder.dart | 56 +++++++++++++++- lib/services/database.dart | 6 +- 8 files changed, 261 insertions(+), 53 deletions(-) diff --git a/functions/dist/index.dev.js b/functions/dist/index.dev.js index 243b78f..fa09e48 100644 --- a/functions/dist/index.dev.js +++ b/functions/dist/index.dev.js @@ -118,12 +118,20 @@ exports.confirmNotification = functions.firestore.document('confirmedOrders/{id} }); }); exports.BookingNotification = functions.firestore.document('BookingDetails/{id}').onUpdate(function _callee4(snapshot, context) { - var token; + var token, isConfirmed, isRejected; return regeneratorRuntime.async(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: token = snapshot.after.data().token; + isConfirmed = snapshot.after.data().isConfirmed; + isRejected = snapshot.after.data().isRejected; + + if (!(isConfirmed === true)) { + _context4.next = 7; + break; + } + return _context4.abrupt("return", fcm.sendToDevice(token, { notification: { title: 'Booking Confirmation', @@ -132,7 +140,21 @@ exports.BookingNotification = functions.firestore.document('BookingDetails/{id}' } })); - case 2: + case 7: + if (!(isRejected === true)) { + _context4.next = 9; + break; + } + + return _context4.abrupt("return", fcm.sendToDevice(token, { + notification: { + title: 'Booking Rejection', + body: 'Your Booking has been rejected', + clickAction: 'FLUTTER_NOTIFICATION_CLICK' + } + })); + + case 9: case "end": return _context4.stop(); } diff --git a/functions/index.js b/functions/index.js index 590ac11..fa3c7e8 100644 --- a/functions/index.js +++ b/functions/index.js @@ -68,11 +68,24 @@ exports.confirmNotification = functions.firestore.document('confirmedOrders/{id} exports.BookingNotification = functions.firestore.document('BookingDetails/{id}').onUpdate(async(snapshot, context) => { var token = snapshot.after.data().token; - return fcm.sendToDevice(token, { - notification: { - title: 'Booking Confirmation', - body: 'Your Booking has been confirmed', - clickAction: 'FLUTTER_NOTIFICATION_CLICK' - } - }) + var isConfirmed = snapshot.after.data().isConfirmed; + var isRejected = snapshot.after.data().isRejected; + if(isConfirmed === true) { + return fcm.sendToDevice(token, { + notification: { + title: 'Booking Confirmation', + body: 'Your Booking has been confirmed', + clickAction: 'FLUTTER_NOTIFICATION_CLICK' + } + }); + } else if(isRejected === true) { + return fcm.sendToDevice(token, { + notification: { + title: 'Booking Rejection', + body: 'Your Booking has been rejected', + clickAction: 'FLUTTER_NOTIFICATION_CLICK' + } + }); + } }); + diff --git a/lib/pages/Cart.dart b/lib/pages/Cart.dart index 2eb4ab3..b4cd501 100644 --- a/lib/pages/Cart.dart +++ b/lib/pages/Cart.dart @@ -63,13 +63,6 @@ class _CartState extends State { } void removeItem(String item) { - // if ((cartList.singleWhere((element) => element.item == item, - // orElse: () => null)) != - // null) { - // return; - // } else { - // cartList.add(Orders(item, price, 1)); - // } storeDataforCart.removeFoodDetails(item); updateTotal(); print(item); diff --git a/lib/pages/add_event.dart b/lib/pages/add_event.dart index ca3f9e4..6f34d3b 100644 --- a/lib/pages/add_event.dart +++ b/lib/pages/add_event.dart @@ -26,6 +26,7 @@ class _AddEventPageState extends State { String _name = ''; String _personalno = ''; + String _mobileno = ''; int slot = 1; DateTime _eventDate; int numberOfPeople = 1; @@ -77,7 +78,7 @@ class _AddEventPageState extends State { } }); if (!exits) { - _booking.bookDetails(id, _name, _personalno, numberOfPeople, + _booking.bookDetails(id, _name, _personalno, _mobileno, numberOfPeople, loungeColor[_value1 - 1], slot, _eventDate); showDialog( context: context, @@ -175,6 +176,26 @@ class _AddEventPageState extends State { setState(() => _personalno = val); }), SizedBox(height: 10), + TextFormField( + keyboardType: TextInputType.number, + decoration: InputDecoration( + hintText: 'Mobile No.', + fillColor: Colors.white, + filled: true, + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.deepOrange, width: 1.0), + borderRadius: BorderRadius.circular(10)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.deepOrange, width: 3.0), + borderRadius: BorderRadius.circular(10))), + validator: (val) => + val.isEmpty ? 'Enter your Personal No.' : null, + onChanged: (val) { + setState(() => _mobileno = val); + }), + SizedBox(height: 10), TextFormField( keyboardType: TextInputType.number, decoration: InputDecoration( diff --git a/lib/pages/adminBooking.dart b/lib/pages/adminBooking.dart index f7b8df5..a311b25 100644 --- a/lib/pages/adminBooking.dart +++ b/lib/pages/adminBooking.dart @@ -43,7 +43,7 @@ class _AdminBookingState extends State { }); } - void rejectBookinHistory(int _eventDate, int index) async { + void deleteBookinHistory(int _eventDate, int index) async { await Firestore.instance .collection('BookingDetails') .document('$_eventDate') @@ -53,6 +53,16 @@ class _AdminBookingState extends State { }); } + void rejectBooking(int _eventDate, int index) async { + await Firestore.instance + .collection('BookingDetails') + .document('$_eventDate') + .updateData({'isRejected': true}); + setState(() { + bookings[index]["isRejected"] = true; + }); + } + void confirmBooking( String _name, String _personalno, @@ -141,7 +151,7 @@ class _AdminBookingState extends State { SizedBox(height: 10.0), Container( padding: EdgeInsets.all(10), - height: 240.0, + height: MediaQuery.of(context).size.height * 0.4, width: 380.0, decoration: BoxDecoration( color: Colors.white, @@ -194,6 +204,21 @@ class _AdminBookingState extends State { ], ), SizedBox(height: 10), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + "Mobile No. : " + + "${bookings[index]["mobileNumber"]}", + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400), + ), + ], + ), + SizedBox(height: 10), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -214,26 +239,37 @@ class _AdminBookingState extends State { MainAxisAlignment.spaceBetween, children: [ Text( - 'Slot: ${bookings[index]["slot"]}', + bookings[index]["slot"] == 1 + ? 'Slot: Lunch ' + : 'Slot: Dinner ', style: GoogleFonts.inter( color: Colors.black, fontSize: 18, fontWeight: FontWeight.w400), ), - Text( - bookings[index]["isConfirmed"] - ? 'Status: Confirmed' - : 'Status: Not Confirmed', - style: GoogleFonts.inter( - color: Colors.black, - fontSize: 18, - fontWeight: FontWeight.w400)), - SizedBox(width: 30) ], ), SizedBox(height: 10), + if (!bookings[index]["isRejected"]) ...[ + Text( + bookings[index]["isConfirmed"] + ? 'Status: Confirmed' + : 'Status: Not Confirmed', + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400)), + ] else ...[ + Text('Status: Rejected', + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400)), + ], + SizedBox(height: 10), ]), - if (!bookings[index]["isConfirmed"]) ...[ + if (!bookings[index]["isConfirmed"] && + !bookings[index]["isRejected"]) ...[ Row( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -243,8 +279,11 @@ class _AdminBookingState extends State { width: 110, child: FlatButton( onPressed: () { - rejectBookinHistory( - bookings[index]["_date"], index); + if (!bookings[index]["isConfirmed"]) { + rejectBooking( + bookings[index]["_date"], + index); + } }, color: Colors.red[700], child: Row( @@ -273,15 +312,22 @@ class _AdminBookingState extends State { width: 110, child: FlatButton( onPressed: () { - confirmBooking( - bookings[index]["name"], - bookings[index]["number"], - bookings[index]["lounge"], - bookings[index]["slot"], - bookings[index]["numberOfPeople"], - bookings[index]["_date"], - bookings[index]["bookingDate"], - index); + if (!bookings[index]["isConfirmed"]) { + confirmBooking( + bookings[index]["name"], + bookings[index]["number"], + bookings[index]["lounge"], + bookings[index]["slot"], + bookings[index] + ["numberOfPeople"], + bookings[index]["_date"], + bookings[index]["bookingDate"], + index); + } else { + deleteBookinHistory( + bookings[index]["_date"], + index); + } }, color: Colors.deepOrange, child: Row( @@ -293,11 +339,20 @@ class _AdminBookingState extends State { size: 17, color: Colors.white, ), - Text( - 'Confirm', - style: GoogleFonts.inter( - color: Colors.white), - ), + if (!bookings[index] + ["isConfirmed"]) ...[ + Text( + 'Confirm', + style: GoogleFonts.inter( + color: Colors.white), + ), + ] else ...[ + Text( + 'Delete', + style: GoogleFonts.inter( + color: Colors.white), + ) + ] ]), shape: new RoundedRectangleBorder( borderRadius: @@ -315,7 +370,7 @@ class _AdminBookingState extends State { width: 100, child: FlatButton( onPressed: () { - rejectBookinHistory( + deleteBookinHistory( bookings[index]["_date"], index); }, color: Colors.red[700], diff --git a/lib/pages/previousBooking.dart b/lib/pages/previousBooking.dart index 16dd044..f9c48e0 100644 --- a/lib/pages/previousBooking.dart +++ b/lib/pages/previousBooking.dart @@ -15,6 +15,7 @@ class _PreviousBookingState extends State { List bookings = []; String name = ''; + String mobileNumber = ''; String number = ''; String lounge = ''; int slot; @@ -34,6 +35,7 @@ class _PreviousBookingState extends State { bookings.add(res.data); name = res.data["name"]; number = res.data["number"]; + mobileNumber = res.data["mobileNumber"]; lounge = res.data["lounge"]; slot = res.data["slot"]; }); @@ -96,7 +98,7 @@ class _PreviousBookingState extends State { SizedBox(height: 10.0), Container( padding: EdgeInsets.all(10), - height: 220.0, + height: MediaQuery.of(context).size.height * 0.3, width: 370.0, decoration: BoxDecoration( color: Colors.white, @@ -149,6 +151,21 @@ class _PreviousBookingState extends State { ], ), SizedBox(height: 10), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + "Mobile No. : " + + "${bookings[index]["mobileNumber"]}", + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400), + ), + ], + ), + SizedBox(height: 10), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -175,6 +192,41 @@ class _PreviousBookingState extends State { fontSize: 18, fontWeight: FontWeight.w400), ), + if (!bookings[index]["isConfirmed"]) ...[ + Row(children: [ + Text('Status: ', + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400)), + if (bookings[index]["isRejected"]) ...[ + Text('Rejected', + style: GoogleFonts.inter( + color: Colors.red[800], + fontSize: 18, + fontWeight: FontWeight.w400)) + ] else ...[ + Text('Not Confirmed', + style: GoogleFonts.inter( + color: Colors.orange, + fontSize: 18, + fontWeight: FontWeight.w400)) + ] + ]) + ] else ...[ + Row(children: [ + Text('Status: ', + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400)), + Text('Confirmed', + style: GoogleFonts.inter( + color: Colors.green, + fontSize: 18, + fontWeight: FontWeight.w400)) + ]) + ] ], ), ]), diff --git a/lib/pages/previousOrder.dart b/lib/pages/previousOrder.dart index 17e47b2..502c2df 100644 --- a/lib/pages/previousOrder.dart +++ b/lib/pages/previousOrder.dart @@ -97,7 +97,7 @@ class _PreviousOrderState extends State { SizedBox(height: 10.0), Container( padding: EdgeInsets.all(10), - height: 140.0, + height: MediaQuery.of(context).size.height * 0.3, width: 370.0, decoration: BoxDecoration( color: Colors.white, @@ -133,9 +133,59 @@ class _PreviousOrderState extends State { ), ], ), - SizedBox(height: 8), ]), - SizedBox(height: 15), + SizedBox(height: 10), + Row( + children: [ + Text( + "Mobile No: ${orders[index]["mobileNumber"]}", + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400), + ) + ], + ), + SizedBox( + height: 10, + ), + Row(children: [ + Text( + "Status : ", + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400), + ), + if (!orders[index]["isConfirmed"] && !orders[index]["isRejected"]) ...[ + Text( + "Not Confirmed", + style: GoogleFonts.inter( + color: Colors.orange, + fontSize: 18, + fontWeight: FontWeight.w400), + ), + ] else if(orders[index]["isRejected"])...[ + Text( + "Rejected", + style: GoogleFonts.inter( + color: Colors.red[800], + fontSize: 18, + fontWeight: FontWeight.w400), + ), + ] else ...[ + Text( + "Confirmed", + style: GoogleFonts.inter( + color: Colors.green, + fontSize: 18, + fontWeight: FontWeight.w400), + ), + ] + ]), + SizedBox( + height: 15, + ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/services/database.dart b/lib/services/database.dart index 4ccc9b8..e579704 100644 --- a/lib/services/database.dart +++ b/lib/services/database.dart @@ -100,7 +100,7 @@ class DatabaseService { .setData({'title': title, 'subtitle': subtitle, 'downloadLink': url}); } - Future bookDetails(String id, String name, String number, int numberOfPeople, + Future bookDetails(String id, String name, String number, String mobileNumber, int numberOfPeople, String lounge, int slot, DateTime date) async { var _date = DateTime.now().toUtc().millisecondsSinceEpoch; var forToken = await Firestore.instance.collection('userInfo').document(id).get(); @@ -111,12 +111,14 @@ class DatabaseService { 'name': name, 'isConfirmed': false, 'number': number, + 'mobileNumber': mobileNumber, 'numberOfPeople': numberOfPeople, 'lounge': lounge, 'slot': slot, 'date': '${date.day}' + '/' + '${date.month}' + '/' + '${date.year}', 'bookingDate': date, - 'token': _token + 'token': _token, + 'isRejected': false }); } From 8bf54fae8d2969a55871e647acb10c063609784d Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Tue, 29 Sep 2020 21:17:02 +0530 Subject: [PATCH 13/19] club_rate added --- lib/pages/Booking.dart | 354 +++++++++++++++++--------------- lib/pages/Cart.dart | 2 +- lib/pages/Search.dart | 2 +- lib/pages/add_event.dart | 4 +- lib/pages/adminBooking.dart | 2 +- lib/pages/booking_calendar.dart | 13 +- lib/pages/previousBooking.dart | 17 +- lib/services/database.dart | 34 +-- 8 files changed, 229 insertions(+), 199 deletions(-) diff --git a/lib/pages/Booking.dart b/lib/pages/Booking.dart index b52d500..78f1abd 100644 --- a/lib/pages/Booking.dart +++ b/lib/pages/Booking.dart @@ -26,7 +26,7 @@ class _BookingState extends State { children: [ SizedBox(height: 30.0), Container( - margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 10), + margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 20), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -58,145 +58,148 @@ class _BookingState extends State { 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), + child: Container( + padding: EdgeInsets.fromLTRB(20, 0, 7, 0), + 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)), ), - 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), + 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)), ), - 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), + 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)), ), - 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), + 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)), ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.blue, - image: DecorationImage( - image: new AssetImage("assets/18.jpg"), - fit: BoxFit.fill)), ), - ), - SizedBox(width: 20), - 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), + SizedBox(width: 20), + 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)), ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.blue, - image: DecorationImage( - image: new AssetImage("assets/15.jpg"), - fit: BoxFit.fill)), ), - ), - SizedBox(width: 20), - ], - ), + SizedBox(width: 20), + ], + ), + ) ), SizedBox(height: 20), ], )), SizedBox(height: 30.0), Container( - margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 10), + margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 20), child: Text( " Banquet Halls", style: GoogleFonts.inter( @@ -206,7 +209,7 @@ class _BookingState extends State { ), ), ), - SizedBox(height: 10.0), + SizedBox(height: 15.0), Container( margin: const EdgeInsets.symmetric(vertical: 0, horizontal: 10), alignment: Alignment.centerLeft, @@ -215,63 +218,72 @@ class _BookingState extends State { child: new Column( children: [ Expanded( - child: ListView( - shrinkWrap: true, - physics: ClampingScrollPhysics(), - scrollDirection: Axis.horizontal, - children: [ - SizedBox(width: 20), - InkWell( - onTap: () { - Navigator.pushNamed(context, "/weddinghall"); - }, - 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), + child: Container( + padding: EdgeInsets.fromLTRB(0, 0, 0, 0), + child:ListView( + shrinkWrap: true, + physics: ClampingScrollPhysics(), + scrollDirection: Axis.horizontal, + children: [ + SizedBox(width: 20), + InkWell( + onTap: () { + Navigator.pushNamed(context, "/weddinghall"); + }, + 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)), ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.blue, - image: DecorationImage( - image: new AssetImage("assets/16.jpg"), - fit: BoxFit.fill)), ), - ), - SizedBox(width: 20), - InkWell( - onTap: () { - Navigator.pushNamed(context, "/tenniscourt"); - }, - child: Container( - height: 100.0, - width: 150.0, - child: Align( - alignment: Alignment.bottomCenter, - child: Text( - 'Tennis Court', - style: GoogleFonts.inter( - color: Colors.white, - fontWeight: FontWeight.bold), + SizedBox(width: 20), + InkWell( + onTap: () { + Navigator.pushNamed(context, "/tenniscourt"); + }, + child: Container( + height: 100.0, + width: 150.0, + child: Align( + alignment: Alignment.bottomCenter, + child: Text( + 'Tennis Court', + style: GoogleFonts.inter( + color: Colors.white, + fontWeight: FontWeight.bold), + ), ), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.blue, + image: DecorationImage( + image: new AssetImage("assets/51.jpg"), + fit: BoxFit.fill)), + ), + ), + InkWell( + child: Container( + height: 100.0, + width: 300.0, ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.blue, - image: DecorationImage( - image: new AssetImage("assets/51.jpg"), - fit: BoxFit.fill)), ), - ), - ], - ), + ], + ), + ) ), SizedBox(height: 20), ], diff --git a/lib/pages/Cart.dart b/lib/pages/Cart.dart index b4cd501..8a83bc8 100644 --- a/lib/pages/Cart.dart +++ b/lib/pages/Cart.dart @@ -179,7 +179,7 @@ class _CartState extends State { ), SizedBox( width: - MediaQuery.of(context).size.width * 0.56, + MediaQuery.of(context).size.width * 0.52, child: Text( keyname, style: GoogleFonts.inter( diff --git a/lib/pages/Search.dart b/lib/pages/Search.dart index c00c717..b5b6992 100644 --- a/lib/pages/Search.dart +++ b/lib/pages/Search.dart @@ -264,7 +264,7 @@ class _SearchListState extends State { ), SearchQuantity( item: widget.tempSearchStore[index]['item'], - price: widget.tempSearchStore[index]['price']), + price: widget.tempSearchStore[index]['club_rate']), ], ), ); diff --git a/lib/pages/add_event.dart b/lib/pages/add_event.dart index 6f34d3b..0670a00 100644 --- a/lib/pages/add_event.dart +++ b/lib/pages/add_event.dart @@ -250,11 +250,11 @@ class _AddEventPageState extends State { value: _value2, items: [ DropdownMenuItem( - child: Text("Lunch Slot"), + child: Text("Lunch Slot(12PM - 3PM)"), value: 1, ), DropdownMenuItem( - child: Text("Dinner Slot"), + child: Text("Dinner Slot(7:30PM - 10.30PM)"), value: 2, ), ], diff --git a/lib/pages/adminBooking.dart b/lib/pages/adminBooking.dart index a311b25..ba4287c 100644 --- a/lib/pages/adminBooking.dart +++ b/lib/pages/adminBooking.dart @@ -151,7 +151,7 @@ class _AdminBookingState extends State { SizedBox(height: 10.0), Container( padding: EdgeInsets.all(10), - height: MediaQuery.of(context).size.height * 0.4, + height: MediaQuery.of(context).size.height * 0.43, width: 380.0, decoration: BoxDecoration( color: Colors.white, diff --git a/lib/pages/booking_calendar.dart b/lib/pages/booking_calendar.dart index da0c8fa..f2f1fb3 100644 --- a/lib/pages/booking_calendar.dart +++ b/lib/pages/booking_calendar.dart @@ -111,23 +111,26 @@ class _CalendarState extends State { calendarController: _controller, ), ..._selectedEvents.map((event) => Container( - height: 35, - width: 250, + height: MediaQuery.of(context).size.height * 0.08, + width: MediaQuery.of(context).size.width * 0.8, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10)), color: Colors.white, ), margin: EdgeInsets.symmetric(horizontal: 20, vertical: 0), child:ListTile( - title: Text("${event.Lounge}"+" Room booked for slot " + "${event.slot}", style: TextStyle(color: Colors.deepOrange),), - onTap: () { + title: Text(/*"${event.Lounge}"+" Room booked for slot " + "${event.slot}"*/ + event.slot == 1 + ? "${event.Lounge} Room booked for Lunch Slot" + : "${event.Lounge} Room booked for Dinner Slot", style: TextStyle(color: Colors.deepOrange),), + /*onTap: () { Navigator.push( context, MaterialPageRoute( builder: (_) => EventDetailsPage( event: event, ))); - }, + },*/ ), ), ), diff --git a/lib/pages/previousBooking.dart b/lib/pages/previousBooking.dart index f9c48e0..2924afe 100644 --- a/lib/pages/previousBooking.dart +++ b/lib/pages/previousBooking.dart @@ -98,7 +98,7 @@ class _PreviousBookingState extends State { SizedBox(height: 10.0), Container( padding: EdgeInsets.all(10), - height: MediaQuery.of(context).size.height * 0.3, + height: MediaQuery.of(context).size.height * 0.38, width: 370.0, decoration: BoxDecoration( color: Colors.white, @@ -181,6 +181,21 @@ class _PreviousBookingState extends State { ], ), SizedBox(height: 10), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + "Number of people : " + + "${bookings[index]["numberOfPeople"]}", + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.w400), + ), + ], + ), + SizedBox(height: 10), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/services/database.dart b/lib/services/database.dart index e579704..1bd1457 100644 --- a/lib/services/database.dart +++ b/lib/services/database.dart @@ -162,7 +162,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return Menu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -171,7 +171,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return MainCourseMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -180,7 +180,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return ChineseMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -189,7 +189,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return StarterMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -198,7 +198,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return BiryaniMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -216,7 +216,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return BreadMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -225,7 +225,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return TandooriMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -235,7 +235,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return FriedRiceAndNoodlesMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -244,7 +244,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return RollMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -253,7 +253,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return SandwichMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -262,7 +262,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return PizzaMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -271,7 +271,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return SnacksMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -280,7 +280,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return BurgerMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -289,7 +289,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return PastaMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -298,7 +298,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return SoupMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -308,7 +308,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return AccompanimentMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } @@ -317,7 +317,7 @@ class DatabaseService { return snapshot.documents.map((doc) { return BreakfastMenu( item: doc.data["item"] ?? '', - price: doc.data["price"] ?? 0, + price: doc.data["club_rate"] ?? 0, searchIndex: doc.data["search_index"] ?? ''); }).toList(); } From 346450453d7ceb0633c2117ac82794ec11c17b8c Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Tue, 29 Sep 2020 23:27:49 +0530 Subject: [PATCH 14/19] cart error fixed --- lib/main.dart | 115 ++++++++++++++++++----------------- lib/pages/Booking.dart | 10 +-- lib/pages/Cart.dart | 28 +++++++-- lib/pages/Food.dart | 10 +-- lib/pages/Home.dart | 13 ++-- lib/pages/NavigationBar.dart | 63 +++++++++---------- 6 files changed, 130 insertions(+), 109 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index cab8b11..7c7ac94 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -39,6 +39,7 @@ 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/storeData.dart'; import 'package:rcapp/pages/uploadAvatar.dart'; import 'package:rcapp/pages/uploadImage.dart'; import 'package:rcapp/pages/uploadPdf.dart'; @@ -49,12 +50,13 @@ import 'pages/wrapper.dart'; import 'package:provider/provider.dart'; import 'package:rcapp/models/user.dart'; + void main() async { WidgetsFlutterBinding.ensureInitialized(); await FlutterDownloader.initialize( debug: true // optional: set false to disable printing logs to console ); - + runApp(MyApp()); } @@ -62,62 +64,65 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return StreamProvider.value( - value: AuthService().user, - child: MaterialApp( - debugShowCheckedModeBanner: false, - home: welcome(), - routes: { - '/navigationbar': (context) => NavigationBar(), - '/bookingcalendar': (context) => Calendar(), - '/cart': (context) => Cart(), - '/adminorder': (context) => AdminOrder(), - // '/orderdetails': (context) => OrderDetails(), - '/wrapper': (context) => Wrapper(), - "/add_event": (context) => AddEventPage(), - "/address": (context) => AddressForm(), - "/previousOrder": (context) => PreviousOrder(), - "/previousBooking": (context) => PreviousBooking(), - "/adminBooking": (context) => AdminBooking(), - "/contactDetails": (context) => ContactDetails(), - // "/previousOrder": (context) => PreviousOrderDetails(), + value: AuthService().user, + child: ChangeNotifierProvider( + create: (context) => StoreData(), + child: MaterialApp( + debugShowCheckedModeBanner: false, + home: welcome(), + routes: { + '/navigationbar': (context) => NavigationBar(), + '/bookingcalendar': (context) => Calendar(), + '/cart': (context) => Cart(), + '/adminorder': (context) => AdminOrder(), + // '/orderdetails': (context) => OrderDetails(), + '/wrapper': (context) => Wrapper(), + "/add_event": (context) => AddEventPage(), + "/address": (context) => AddressForm(), + "/previousOrder": (context) => PreviousOrder(), + "/previousBooking": (context) => PreviousBooking(), + "/adminBooking": (context) => AdminBooking(), + "/contactDetails": (context) => ContactDetails(), + // "/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(), + //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(), - "/weddinghall": (context) => WeddingHall(), - "/tenniscourt": (context) => TennisCourt(), + // lounge routes + "/bluelounge": (context) => BlueLounge(), + "/yellowlounge": (context) => YellowLounge(), + "/milanlounge": (context) => MilanLounge(), + "/milaplounge": (context) => MilapLounge(), + "/coluseum": (context) => Coluseum(), + "/mainhall" : (context) => MainHall(), + "/weddinghall": (context) => WeddingHall(), + "/tenniscourt": (context) => TennisCourt(), - //Routes for admin - "/uploadImage": (context) => UploadImage(), - "/uploadPdf": (context) => UploadPdf(), - "/uploadPdfImage": (context) => UploadPdfImage(), - "/uploadAvatarImage": (context) => UploadAvatar() - }, - ), - ); + //Routes for admin + "/uploadImage": (context) => UploadImage(), + "/uploadPdf": (context) => UploadPdf(), + "/uploadPdfImage": (context) => UploadPdfImage(), + "/uploadAvatarImage": (context) => UploadAvatar() + }, + ), + ), + ); } } diff --git a/lib/pages/Booking.dart b/lib/pages/Booking.dart index 78f1abd..beebcf5 100644 --- a/lib/pages/Booking.dart +++ b/lib/pages/Booking.dart @@ -293,9 +293,9 @@ class _BookingState extends State { ); } - @override - void dispose() { - // TODO: implement dispose - super.dispose(); - } + // @override + // void dispose() { + // // TODO: implement dispose + // super.dispose(); + // } } diff --git a/lib/pages/Cart.dart b/lib/pages/Cart.dart index 8a83bc8..e61aa88 100644 --- a/lib/pages/Cart.dart +++ b/lib/pages/Cart.dart @@ -23,6 +23,7 @@ class _CartState extends State { StoreData storeDataforCart = StoreData(); var address = ''; + bool isData = false; void init() async { var user = await FirebaseAuth.instance.currentUser(); @@ -59,6 +60,11 @@ class _CartState extends State { qtyList.add(value); }); foodDetail.forEach((k, v) => total = total + v * qtyDetail[k]); + if (totalquantity == 0) { + isData = false; + } else { + isData = true; + } }); } @@ -228,7 +234,7 @@ class _CartState extends State { ); }), ), - ProceedAccess(address: address) + ProceedAccess(address: address, isData: isData) ])); } } @@ -382,8 +388,9 @@ class _QuantityInCartState extends State { } class ProceedAccess extends StatefulWidget { + var isData; var address; - ProceedAccess({this.address}); + ProceedAccess({this.address, this.isData}); @override _ProceedAccessState createState() => _ProceedAccessState(); } @@ -446,7 +453,7 @@ class _ProceedAccessState extends State { 'Add address to proceed', style: GoogleFonts.inter(color: Colors.white), ))); - } else if (widget.address != '') { + } else if (widget.address != '' && widget.isData == true) { return Container( width: double.infinity, height: 50, @@ -469,9 +476,18 @@ class _ProceedAccessState extends State { 'Confirm Order(Pay through COD)', style: GoogleFonts.inter(color: Colors.white), ))); - } else if (widget.address == null) { - return Container( - width: double.infinity, height: 50, child: SpinKitChasingDots()); + } else if (widget.isData == false) { + return Container( + width: double.infinity, + height: 50, + child: FlatButton( + color: Colors.deepOrange, + onPressed: () { + }, + child: Text( + 'Add Item To Cart', + style: GoogleFonts.inter(color: Colors.white), + ))); } } } diff --git a/lib/pages/Food.dart b/lib/pages/Food.dart index c0efadb..6aa7b08 100644 --- a/lib/pages/Food.dart +++ b/lib/pages/Food.dart @@ -164,11 +164,11 @@ class _FoodState extends State { ); } - @override - void dispose() { - // TODO: implement dispose - super.dispose(); - } + // @override + // void dispose() { + // // TODO: implement dispose + // super.dispose(); + // } } class Quantity extends StatefulWidget { diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart index 48d57e0..ade561c 100644 --- a/lib/pages/Home.dart +++ b/lib/pages/Home.dart @@ -11,6 +11,7 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:rcapp/CustomWidget/foot_category.dart'; import 'package:rcapp/models/user.dart'; import 'package:rcapp/pages/customAlert.dart'; +import 'package:rcapp/pages/storeData.dart'; import 'package:rcapp/services/auth.dart'; import 'package:provider/provider.dart'; import 'package:rcapp/services/database.dart'; @@ -293,11 +294,11 @@ class _HomeState extends State { ); } - @override - void dispose() { - // TODO: implement dispose - super.dispose(); - } + // @override + // void dispose() { + // // TODO: implement dispose + // super.dispose(); + // } } class HomeListPage extends StatefulWidget { @@ -523,6 +524,7 @@ class _LoadingDataState extends State { @override Widget build(BuildContext context) { final AuthService _auth = AuthService(); + StoreData _storedata = StoreData(); return Container( child: FutureBuilder( @@ -644,6 +646,7 @@ class _LoadingDataState extends State { padding: EdgeInsets.fromLTRB(15, 0, 0, 10), child: InkWell( onTap: () async { + _storedata.resetStore(); await _auth.signOut(); }, child: Text( diff --git a/lib/pages/NavigationBar.dart b/lib/pages/NavigationBar.dart index bd3036b..d88df31 100644 --- a/lib/pages/NavigationBar.dart +++ b/lib/pages/NavigationBar.dart @@ -68,41 +68,38 @@ class _NavigationBarState extends State { @override Widget build(BuildContext context) { - return ChangeNotifierProvider( - create: (ctx) => storeData, - child: Scaffold( - body: _children[_currentIndex], - bottomNavigationBar: BottomNavigationBar( - unselectedItemColor: Colors.black, - selectedItemColor: Colors.deepOrange, - onTap: onTappedBar, - currentIndex: _currentIndex, - items: [ - BottomNavigationBarItem( - icon: Icon(Icons.home), - title: Text('Home'), - backgroundColor: Colors.deepOrange, - ), - BottomNavigationBarItem( - icon: Icon(Icons.fastfood), - title: Text('Food'), - backgroundColor: Colors.deepOrange, - activeIcon: Icon(Icons.fastfood, color: Colors.deepOrange), - ), - BottomNavigationBarItem( - icon: Icon(Icons.book), - title: Text('Booking'), - backgroundColor: Colors.deepOrange, - ), - ], - ), + return Scaffold( + body: _children[_currentIndex], + bottomNavigationBar: BottomNavigationBar( + unselectedItemColor: Colors.black, + selectedItemColor: Colors.deepOrange, + onTap: onTappedBar, + currentIndex: _currentIndex, + items: [ + BottomNavigationBarItem( + icon: Icon(Icons.home), + title: Text('Home'), + backgroundColor: Colors.deepOrange, + ), + BottomNavigationBarItem( + icon: Icon(Icons.fastfood), + title: Text('Food'), + backgroundColor: Colors.deepOrange, + activeIcon: Icon(Icons.fastfood, color: Colors.deepOrange), + ), + BottomNavigationBarItem( + icon: Icon(Icons.book), + title: Text('Booking'), + backgroundColor: Colors.deepOrange, + ), + ], ), ); } - @override - void dispose() { - // TODO: implement dispose - super.dispose(); - } + // @override + // void dispose() { + // // TODO: implement dispose + // super.dispose(); + // } } From 689dad4916d1be537e8b0566f2e05ccc3fe25eeb Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Wed, 30 Sep 2020 01:46:57 +0530 Subject: [PATCH 15/19] added confirm order token change when signed to other device --- lib/pages/Cart.dart | 27 +++++++++++++++++++++------ lib/services/auth.dart | 11 +++++++++++ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/lib/pages/Cart.dart b/lib/pages/Cart.dart index e61aa88..fb61fc6 100644 --- a/lib/pages/Cart.dart +++ b/lib/pages/Cart.dart @@ -24,6 +24,7 @@ class _CartState extends State { var address = ''; bool isData = false; + bool loading = true; void init() async { var user = await FirebaseAuth.instance.currentUser(); @@ -34,6 +35,7 @@ class _CartState extends State { setState(() { address = _dat.data["address"]; + loading = false; }); } @@ -234,7 +236,7 @@ class _CartState extends State { ); }), ), - ProceedAccess(address: address, isData: isData) + ProceedAccess(address: address, isData: isData, loading: loading) ])); } } @@ -389,8 +391,9 @@ class _QuantityInCartState extends State { class ProceedAccess extends StatefulWidget { var isData; + var loading; var address; - ProceedAccess({this.address, this.isData}); + ProceedAccess({this.address, this.isData, this.loading}); @override _ProceedAccessState createState() => _ProceedAccessState(); } @@ -440,7 +443,20 @@ class _ProceedAccessState extends State { @override Widget build(BuildContext context) { - if (widget.address == '') { + if (widget.loading == true) { + return Container( + width: double.infinity, + height: 50, + child: FlatButton( + color: Colors.deepOrange, + onPressed: () { + Navigator.pushNamed(context, '/address'); + }, + child: Text( + 'Please Wait ...', + style: GoogleFonts.inter(color: Colors.white), + ))); + } else if (widget.address == '' && widget.loading == false) { return Container( width: double.infinity, height: 50, @@ -477,13 +493,12 @@ class _ProceedAccessState extends State { style: GoogleFonts.inter(color: Colors.white), ))); } else if (widget.isData == false) { - return Container( + return Container( width: double.infinity, height: 50, child: FlatButton( color: Colors.deepOrange, - onPressed: () { - }, + onPressed: () {}, child: Text( 'Add Item To Cart', style: GoogleFonts.inter(color: Colors.white), diff --git a/lib/services/auth.dart b/lib/services/auth.dart index 7751213..4cffb0d 100644 --- a/lib/services/auth.dart +++ b/lib/services/auth.dart @@ -53,6 +53,17 @@ class AuthService { .collection('userInfo') .document(userkaabba) .updateData({'token': token}); + var _tokendata = await Firestore.instance + .collection('confirmedOrders') + .where('id', isEqualTo: userkaabba) + .getDocuments(); + + _tokendata.documents.forEach((element) { + Firestore.instance + .collection('confirmedOrders') + .document('${element.data["_date"]}') + .updateData({'token': token}); + }); isAdminglobal = dat; From e7888b9106cc062fa1dceb6744355e8272c089da Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Fri, 2 Oct 2020 17:48:08 +0530 Subject: [PATCH 16/19] le le bhai --- lib/pages/adminBooking.dart | 14 ++++++++++---- lib/pages/admin_order_confirm.dart | 31 +++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/lib/pages/adminBooking.dart b/lib/pages/adminBooking.dart index ba4287c..afa6d69 100644 --- a/lib/pages/adminBooking.dart +++ b/lib/pages/adminBooking.dart @@ -122,17 +122,23 @@ class _AdminBookingState extends State { } else if (documentlength == 0) { return Scaffold( body: Center( + child: Scaffold( + appBar: AppBar( + title: Text('Admin Booking'), backgroundColor: Colors.deepOrange), + body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Icon(Icons.all_inclusive), - Text('No data') - ])), + Icon(Icons.all_inclusive), + Text('No Bookings Pending') + ]), + ), + )), ); } else { return Scaffold( appBar: AppBar( - title: Text('Your Booking'), + title: Text('Admin Booking'), backgroundColor: Colors.deepOrange, ), body: Container( diff --git a/lib/pages/admin_order_confirm.dart b/lib/pages/admin_order_confirm.dart index c5c2db0..da835fb 100644 --- a/lib/pages/admin_order_confirm.dart +++ b/lib/pages/admin_order_confirm.dart @@ -16,6 +16,7 @@ class _AdminOrderState extends State { List item = []; List quantity = []; List total = []; + bool loading = true; void confirmOrder(int index, int date) async { // var docId = '${orders[index]["id"]}' + '${orders[index]["total"]}'; @@ -61,6 +62,12 @@ class _AdminOrderState extends State { total.add(res.data["total"]); }); }); + print(result.documents.length); + if (result.documents.length == 0) { + setState(() { + loading = false; + }); + } } @override @@ -73,7 +80,10 @@ class _AdminOrderState extends State { @override Widget build(BuildContext context) { int orderNo = 110; - if (orders.length == 0 && item.length == 0 && quantity.length == 0) { + if (orders.length == 0 && + item.length == 0 && + quantity.length == 0 && + loading == true) { return Scaffold( body: Center( child: Column( @@ -83,7 +93,7 @@ class _AdminOrderState extends State { Text('Loading data') ])), ); - } else { + } else if (orders.length != 0) { return Scaffold( appBar: AppBar( title: Text('Your Orders'), @@ -299,7 +309,8 @@ class _AdminOrderState extends State { ), ), SizedBox(width: 10), - if (!orders[index]["isConfirmed"] && !orders[index]["isRejected"]) ...[ + if (!orders[index]["isConfirmed"] && + !orders[index]["isRejected"]) ...[ InkWell( onTap: () { confirmOrder( @@ -354,6 +365,20 @@ class _AdminOrderState extends State { ), ), ); + } else { + return Scaffold( + appBar: AppBar( + title: Text('Admin Orders'), backgroundColor: Colors.deepOrange), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(Icons.add_shopping_cart, size: 40, color: Colors.deepOrange), + Text('No Orders Pending', + style: GoogleFonts.inter( + color: Colors.black, fontWeight: FontWeight.bold)) + ])), + ); } } } From 77d6631227431a62aa98ecda8559cc7c800e620c Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Sat, 3 Oct 2020 15:05:56 +0530 Subject: [PATCH 17/19] noticeboard bug fixed --- lib/pages/Home.dart | 10 +++++++--- lib/services/database.dart | 34 ++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart index ade561c..41f256b 100644 --- a/lib/pages/Home.dart +++ b/lib/pages/Home.dart @@ -311,7 +311,10 @@ class _HomeListPageState extends State { Future getPosts() async { var firestore = Firestore.instance; - QuerySnapshot qn = await firestore.collection("noticeBoard").getDocuments(); + QuerySnapshot qn = await firestore + .collection("noticeBoard") + .orderBy('_date', descending: true) + .getDocuments(); print(qn); return qn.documents; } @@ -320,8 +323,9 @@ class _HomeListPageState extends State { void initState() { // TODO: implement initState super.initState(); - - _data = getPosts(); + setState(() { + _data = getPosts(); + }); } @override diff --git a/lib/services/database.dart b/lib/services/database.dart index 1bd1457..ca2cd0c 100644 --- a/lib/services/database.dart +++ b/lib/services/database.dart @@ -81,7 +81,9 @@ class DatabaseService { } Future updateAddressData(String id, String address, String number) async { - return await userInfo.document(id).updateData({'address': address, 'mobileNumber': number}); + return await userInfo + .document(id) + .updateData({'address': address, 'mobileNumber': number}); } Future updateTodayMenu(String food, int price, String url) async { @@ -95,15 +97,17 @@ class DatabaseService { } Future updatePdf(String title, String subtitle, String url) async { + var _date = DateTime.now().toUtc().millisecondsSinceEpoch; return await notice_pdfData - .document() - .setData({'title': title, 'subtitle': subtitle, 'downloadLink': url}); + .document('$_date') + .setData({'_date': _date,'title': title, 'subtitle': subtitle, 'downloadLink': url}); } - Future bookDetails(String id, String name, String number, String mobileNumber, int numberOfPeople, - String lounge, int slot, DateTime date) async { + Future bookDetails(String id, String name, String number, String mobileNumber, + int numberOfPeople, String lounge, int slot, DateTime date) async { var _date = DateTime.now().toUtc().millisecondsSinceEpoch; - var forToken = await Firestore.instance.collection('userInfo').document(id).get(); + var forToken = + await Firestore.instance.collection('userInfo').document(id).get(); var _token = forToken.data["token"]; return await bookingDetails.document('$_date').setData({ '_date': _date, @@ -122,11 +126,21 @@ class DatabaseService { }); } - Future confirmOrderofUser(String id, String name, String number, - String address, List item, List price, List qty, int total, bool isConfirmed, String mobileNumber) async { + Future confirmOrderofUser( + String id, + String name, + String number, + String address, + List item, + List price, + List qty, + int total, + bool isConfirmed, + String mobileNumber) async { // var docId = '$id' + '$total'; var _date = DateTime.now().toUtc().millisecondsSinceEpoch; - var forToken = await Firestore.instance.collection('userInfo').document(id).get(); + var forToken = + await Firestore.instance.collection('userInfo').document(id).get(); var _token = forToken.data["token"]; return await confirmedOrders.document('$_date').setData({ 'id': id, @@ -144,7 +158,7 @@ class DatabaseService { '${DateTime.now().month}' + '/' + '${DateTime.now().year}', - 'token': _token, + 'token': _token, 'mobileNumber': mobileNumber, 'isRejected': false }); From 2c0e5eac218131d236cb80a84b84ffe8cb036004 Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Sun, 4 Oct 2020 14:55:10 +0530 Subject: [PATCH 18/19] added media query in search field and textcapitalization of words in input --- lib/pages/Search.dart | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/pages/Search.dart b/lib/pages/Search.dart index b5b6992..81ccad1 100644 --- a/lib/pages/Search.dart +++ b/lib/pages/Search.dart @@ -54,6 +54,7 @@ class _SearchState extends State { onChanged: (val) { initiateSearch(val); }, + textCapitalization: TextCapitalization.words, decoration: InputDecoration( prefixIcon: IconButton( color: Colors.black, @@ -123,8 +124,9 @@ class _SearchQuantityState extends State { ), height: 25, width: 62, - child: - Center(child: Text('Add', style: GoogleFonts.inter(color: Colors.white))), + child: Center( + child: + Text('Add', style: GoogleFonts.inter(color: Colors.white))), ), ); } else { @@ -178,7 +180,8 @@ class _SearchQuantityState extends State { width: 33, child: Text( '$FQty', - style: GoogleFonts.inter(fontSize: 17, fontWeight: FontWeight.bold), + style: + GoogleFonts.inter(fontSize: 17, fontWeight: FontWeight.bold), ), ), Container( @@ -258,9 +261,14 @@ class _SearchListState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - '${widget.tempSearchStore[index]['item']}', - style: GoogleFonts.inter(fontSize: 17, fontWeight: FontWeight.bold), + Container( + width: MediaQuery.of(context).size.width * 0.6, + child: Text( + '${widget.tempSearchStore[index]['item']}', + overflow: TextOverflow.ellipsis, + style: GoogleFonts.inter( + fontSize: 17, fontWeight: FontWeight.bold), + ), ), SearchQuantity( item: widget.tempSearchStore[index]['item'], From c1ac7ccd11ff7cde00b35aef4adbc6d533676087 Mon Sep 17 00:00:00 2001 From: "naiyar.2000" Date: Thu, 15 Oct 2020 15:51:57 +0530 Subject: [PATCH 19/19] final build --- lib/pages/Booking.dart | 4 +- lib/pages/Food.dart | 2 +- lib/pages/Home.dart | 17 +++- lib/pages/Login.dart | 6 +- lib/pages/TennisCourt.dart | 2 +- lib/pages/WeddingHall.dart | 2 +- lib/pages/add_event.dart | 2 + lib/pages/booking_calendar.dart | 168 +++++++++++++++++--------------- pubspec.yaml | 1 + 9 files changed, 114 insertions(+), 90 deletions(-) diff --git a/lib/pages/Booking.dart b/lib/pages/Booking.dart index beebcf5..4116fb3 100644 --- a/lib/pages/Booking.dart +++ b/lib/pages/Booking.dart @@ -246,7 +246,7 @@ class _BookingState extends State { borderRadius: BorderRadius.circular(10), color: Colors.blue, image: DecorationImage( - image: new AssetImage("assets/16.jpg"), + image: new AssetImage("assets/56.jpg"), fit: BoxFit.fill)), ), ), @@ -271,7 +271,7 @@ class _BookingState extends State { borderRadius: BorderRadius.circular(10), color: Colors.blue, image: DecorationImage( - image: new AssetImage("assets/51.jpg"), + image: new AssetImage("assets/55.jpg"), fit: BoxFit.fill)), ), ), diff --git a/lib/pages/Food.dart b/lib/pages/Food.dart index 6aa7b08..b1b26ca 100644 --- a/lib/pages/Food.dart +++ b/lib/pages/Food.dart @@ -93,7 +93,7 @@ class _FoodState extends State { child: Icon( Icons.shopping_cart, color: Colors.white, - size: 35, + size: 28, ), ), ), diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart index 41f256b..4092f31 100644 --- a/lib/pages/Home.dart +++ b/lib/pages/Home.dart @@ -269,8 +269,19 @@ class _HomeState extends State { Container( padding: EdgeInsets.symmetric(horizontal: 10, vertical: 0), child: FoodCategory(areYouadmin)), - SizedBox(height: 20.0), - Text( + SizedBox(height: 48.0), + Container( + padding: EdgeInsets.symmetric(horizontal: 10, vertical: 0), + child: Text( + " Designed by : Aswin Kumar Raju \n Developed by : Sounmay Mishra & Naiyar Imam", + style: GoogleFonts.inter( + color: Colors.black, + fontSize: 8, + fontWeight: FontWeight.w600, + ) + ), + ), + /*Text( " Upcoming Events", style: TextStyle( color: Colors.grey, @@ -286,7 +297,7 @@ class _HomeState extends State { color: Colors.black12, borderRadius: BorderRadius.circular(10)), child: Center(child: Text('No Current Events')), - ), + ),*/ SizedBox(height: 50) ], ), diff --git a/lib/pages/Login.dart b/lib/pages/Login.dart index 945e153..d957a84 100644 --- a/lib/pages/Login.dart +++ b/lib/pages/Login.dart @@ -75,6 +75,7 @@ class _LoginState extends State { child: logincarousel), SizedBox(height: 18.0), TextFormField( + keyboardType: TextInputType.number, decoration: InputDecoration( hintText: 'Personal Number', fillColor: Colors.white, @@ -95,6 +96,7 @@ class _LoginState extends State { }), SizedBox(height: 20.0), TextFormField( + keyboardType: TextInputType.number, decoration: InputDecoration( hintText: 'Password', fillColor: Colors.white, @@ -154,7 +156,7 @@ class _LoginState extends State { style: GoogleFonts.inter(color: Colors.red, fontSize: 14.0), ), SizedBox(height: 15.0), - Row( + /*Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( @@ -172,7 +174,7 @@ class _LoginState extends State { decoration: TextDecoration.underline, fontSize: 15)), ) - ]) + ])*/ ]), )), ), diff --git a/lib/pages/TennisCourt.dart b/lib/pages/TennisCourt.dart index 185d3a6..0b79349 100644 --- a/lib/pages/TennisCourt.dart +++ b/lib/pages/TennisCourt.dart @@ -30,7 +30,7 @@ class _TennisCourtState extends State { borderRadius: BorderRadius.circular(10), color: Colors.blue, image: DecorationImage( - image: new AssetImage("assets/51.jpg"), + image: new AssetImage("assets/55.jpg"), fit: BoxFit.fill)), ), ), diff --git a/lib/pages/WeddingHall.dart b/lib/pages/WeddingHall.dart index 02fe549..b03c18b 100644 --- a/lib/pages/WeddingHall.dart +++ b/lib/pages/WeddingHall.dart @@ -30,7 +30,7 @@ class _WeddingHallState extends State { borderRadius: BorderRadius.circular(10), color: Colors.blue, image: DecorationImage( - image: new AssetImage("assets/16.jpg"), + image: new AssetImage("assets/56.jpg"), fit: BoxFit.fill)), ), ), diff --git a/lib/pages/add_event.dart b/lib/pages/add_event.dart index 0670a00..0b669c6 100644 --- a/lib/pages/add_event.dart +++ b/lib/pages/add_event.dart @@ -107,6 +107,8 @@ class _AddEventPageState extends State { @override Widget build(BuildContext context) { + _eventDate = ModalRoute.of(context).settings.arguments; + if (_name == '' && _personalno == '') { return Scaffold( appBar: AppBar( diff --git a/lib/pages/booking_calendar.dart b/lib/pages/booking_calendar.dart index f2f1fb3..0f44b45 100644 --- a/lib/pages/booking_calendar.dart +++ b/lib/pages/booking_calendar.dart @@ -16,6 +16,7 @@ class _CalendarState extends State { CalendarController _controller; Map> _events; List _selectedEvents; + var _selectedDate = DateTime.now(); @override void initState() { @@ -55,75 +56,80 @@ class _CalendarState extends State { _selectedEvents = []; } } - return SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - TableCalendar( - events: _events, - initialCalendarFormat: CalendarFormat.month, - calendarStyle: CalendarStyle( - canEventMarkersOverflow: true, - todayColor: Colors.orange, - selectedColor: Theme.of(context).primaryColor, - - todayStyle: GoogleFonts.inter( - fontWeight: FontWeight.bold, - fontSize: 18.0, - color: Colors.white)), - headerStyle: HeaderStyle( - centerHeaderTitle: true, - formatButtonDecoration: BoxDecoration( - color: Colors.orange, - borderRadius: BorderRadius.circular(20.0), + return SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + TableCalendar( + events: _events, + initialCalendarFormat: CalendarFormat.month, + calendarStyle: CalendarStyle( + canEventMarkersOverflow: true, + todayColor: Colors.orange, + selectedColor: Theme.of(context).primaryColor, + todayStyle: GoogleFonts.inter( + fontWeight: FontWeight.bold, + fontSize: 18.0, + color: Colors.white)), + headerStyle: HeaderStyle( + centerHeaderTitle: true, + formatButtonDecoration: BoxDecoration( + color: Colors.orange, + borderRadius: BorderRadius.circular(20.0), + ), + formatButtonTextStyle: + GoogleFonts.inter(color: Colors.white), + formatButtonShowsNext: false, ), - formatButtonTextStyle: GoogleFonts.inter(color: Colors.white), - formatButtonShowsNext: false, - ), - startingDayOfWeek: StartingDayOfWeek.monday, - onDaySelected: (date, events) { - setState(() { - _selectedEvents = events; - }); - }, - builders: CalendarBuilders( - selectedDayBuilder: (context, date, events) => Container( - margin: const EdgeInsets.all(4.0), - alignment: Alignment.center, - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.circular(10.0)), - child: Text( - date.day.toString(), - style: GoogleFonts.inter(color: Colors.white), - )), - todayDayBuilder: (context, date, events) => Container( - margin: const EdgeInsets.all(4.0), - alignment: Alignment.center, - decoration: BoxDecoration( - color: Colors.orange, - borderRadius: BorderRadius.circular(10.0)), - child: Text( - date.day.toString(), - style: GoogleFonts.inter(color: Colors.white), - )), - ), - calendarController: _controller, - ), - ..._selectedEvents.map((event) => Container( - height: MediaQuery.of(context).size.height * 0.08, - width: MediaQuery.of(context).size.width * 0.8, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10)), - color: Colors.white, + startingDayOfWeek: StartingDayOfWeek.monday, + onDaySelected: (date, events) { + setState(() { + _selectedEvents = events; + _selectedDate = date; + }); + }, + builders: CalendarBuilders( + selectedDayBuilder: (context, date, events) => Container( + margin: const EdgeInsets.all(4.0), + alignment: Alignment.center, + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.circular(10.0)), + child: Text( + date.day.toString(), + style: GoogleFonts.inter(color: Colors.white), + )), + todayDayBuilder: (context, date, events) => Container( + margin: const EdgeInsets.all(4.0), + alignment: Alignment.center, + decoration: BoxDecoration( + color: Colors.orange, + borderRadius: BorderRadius.circular(10.0)), + child: Text( + date.day.toString(), + style: GoogleFonts.inter(color: Colors.white), + )), + ), + calendarController: _controller, ), - margin: EdgeInsets.symmetric(horizontal: 20, vertical: 0), - child:ListTile( - title: Text(/*"${event.Lounge}"+" Room booked for slot " + "${event.slot}"*/ - event.slot == 1 - ? "${event.Lounge} Room booked for Lunch Slot" - : "${event.Lounge} Room booked for Dinner Slot", style: TextStyle(color: Colors.deepOrange),), - /*onTap: () { + ..._selectedEvents.map( + (event) => Container( + height: MediaQuery.of(context).size.height * 0.08, + width: MediaQuery.of(context).size.width * 0.8, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(10)), + color: Colors.white, + ), + margin: EdgeInsets.symmetric(horizontal: 20, vertical: 0), + child: ListTile( + title: Text( + /*"${event.Lounge}"+" Room booked for slot " + "${event.slot}"*/ + event.slot == 1 + ? "${event.Lounge} Room booked for Lunch Slot" + : "${event.Lounge} Room booked for Dinner Slot", + style: TextStyle(color: Colors.deepOrange), + ), + /*onTap: () { Navigator.push( context, MaterialPageRoute( @@ -131,22 +137,24 @@ class _CalendarState extends State { event: event, ))); },*/ + ), ), - ), - ), - ], - ), - ); - } - ), + ), + ], + ), + ); + }), floatingActionButton: FloatingActionButton( backgroundColor: Colors.deepOrange, - child: Text('Book', - style: GoogleFonts.inter( - color: Colors.white - ),), - onPressed: () => Navigator.pushNamed(context, '/add_event'), + child: Text( + 'Book', + style: GoogleFonts.inter(color: Colors.white), + ), + onPressed: () => { + // print(_selectedDate) + Navigator.pushNamed(context, '/add_event', arguments: _selectedDate) + }, ), ); } -} \ No newline at end of file +} diff --git a/pubspec.yaml b/pubspec.yaml index 6d9a219..1b0c69d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -50,6 +50,7 @@ dependencies: fluttertoast: ^7.1.1 provider: ^3.1.0 badges: ^1.1.3 + marquee: ^1.6.1