From 9b8103bfd6ebfcaac57fc0e981255eb71e57a406 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Mon, 7 Dec 2020 10:21:34 +0300 Subject: [PATCH 001/103] fixe order and order details --- assets/images/pharmacy/compare.png | Bin 0 -> 704 bytes lib/config/config.dart | 3 +- lib/config/localized_values.dart | 5 + .../PharmacyAddressesViewModel.dart | 16 +- .../order_model_view_model.dart | 23 +- lib/pages/landing/home_page.dart | 2 +- lib/pages/pharmacy/order/Order.dart | 753 +++++++++++------- lib/pages/pharmacy/order/OrderDetails.dart | 334 +++++--- lib/pages/pharmacy/order/ProductReview.dart | 93 ++- .../pharmacyAddresses/PharmacyAddresses.dart | 34 +- lib/pages/pharmacy/profile/profile.dart | 685 ++++++++-------- .../cancelOrder_service.dart | 39 + .../pharmacy_services/order_service.dart | 22 +- .../pharmacyAddress_service.dart | 10 +- lib/uitl/translations_delegate_base.dart | 5 + lib/widgets/pharmacy/product_tile.dart | 117 +-- 16 files changed, 1318 insertions(+), 823 deletions(-) create mode 100644 assets/images/pharmacy/compare.png create mode 100644 lib/services/pharmacy_services/cancelOrder_service.dart diff --git a/assets/images/pharmacy/compare.png b/assets/images/pharmacy/compare.png new file mode 100644 index 0000000000000000000000000000000000000000..11a49dfbf18881a724bae6e3ba9698ac4bd98eba GIT binary patch literal 704 zcmeAS@N?(olHy`uVBq!ia0vp^N!KqY3LE{-7{yi2FNExm2P z80zAbU2&bP`mqLqi*5E)hY|PEhLnm&f-@L zcK*|rAJBed&eA0r?5~VHrBq~-=7);^*j~V{y<^EFU*5z8Z6R##w%aldw%R|kuxOlg zL_EV`)q*LF(-KlkGMwM2SNvdPl~H`v@Gz0}{DTFmyhW_>lQWv%KIB`M$UiCPXkBA_ zNcJ4}6_XYmzt@oGbN#}+R$YxU{`5?NlY9UD`)@eId_z04i9+TB)rb>IWu~)!{~`C~ zoW+fUR%_NeK01Bsp7h*~jum(MKQ0U{wVJqMOL~v)qs}?Z2UkRX<#@!Yk#nH&UDg_% zPPQ%o8o6vt!~-`Nxr_2Yv&~$e`2KQ)UB|2!7oP;x ztoc>7z(_cFT^cK$OSR%gArva4o-DepSASuYGt#fwUmV*9^)?0L8PG`ptf6@%#^ z8*kp8u$L)nep<$}i0ap$97`sCKXv(lPp%OA&UsND`~LlyH`&Vel4WgN^b2mwhQ8vy iGLe<{8d`VW`oo;=**tObr%78uDaq5-&t;ucLK6Ti>MnNx literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index e7341682..5b03e49f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -349,7 +349,8 @@ const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/"; const GET_WISHLIST = "epharmacy/api/shopping_cart_items/"; const GET_ORDER = "orders?"; const GET_ORDER_DETAILS ="epharmacy/api/orders/"; -const GET_ADDRESS ="epharmacy/api/Customers/272843?fields=addresses"; +const GET_ADDRESS ="Customers/"; +const GET_Cancel_ORDER ="cancelorder/"; // Home Health Care const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c2a81962..a7358d90 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -642,6 +642,11 @@ const Map> localizedValues = { "cancelled": {"en": "Cancelled", "ar": " ملغي"}, "writeReview": {"en": "Write Review", "ar": " اكتب تقييمك"}, "shareReview": {"en": "SHARE REVIEW", "ar": " اكتب تقييمك"}, + "review": {"en": " reviews", "ar": " تقييمات"}, + "deliveredOrder": {"en": " DELIVERED", "ar": " تم التوصيل"}, + "compare": {"en": " Compare", "ar": "مقارنه"}, + "medicationsRefill": {"en": " Medication Refill", "ar": "اعادة تعبئة الدواء"}, + "myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"}, "backMyAccount": { "en": "BACK TO MY ACCOUNT ", "ar": " الرجوع لحسابي الشخصي" diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart index 75a178fa..a2e3b924 100644 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -6,19 +6,19 @@ import '../../../locator.dart'; import '../base_view_model.dart'; class PharmacyAddressesViewModel extends BaseViewModel { - PharmacyAddressService _PharmacyAddressService = locator(); + PharmacyAddressService _pharmacyAddressService = locator(); + List get address => _pharmacyAddressService.address; - List get address => _PharmacyAddressService.address; - - Future getAddress() async { + Future getAddress(address) async { setState(ViewState.Busy); - await _PharmacyAddressService.getAddress(); - if (_PharmacyAddressService.hasError) { - error = _PharmacyAddressService.error; + await _pharmacyAddressService.getAddress(address); + if (_pharmacyAddressService.hasError) { + error = _pharmacyAddressService.error; setState(ViewState.Error); } else { - + print(address.length); } } + } \ No newline at end of file diff --git a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart index beb62a53..04cbe8e3 100644 --- a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart @@ -1,3 +1,5 @@ +//import 'dart:html'; + import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; @@ -6,6 +8,7 @@ import '../../../locator.dart'; import '../base_view_model.dart'; class OrderModelViewModel extends BaseViewModel { + OrderService _orderService = locator(); List get order => _orderService.orderList; @@ -22,7 +25,9 @@ class OrderModelViewModel extends BaseViewModel { error = _orderService.error; setState(ViewState.Error); } else { - + //order = _orderService.orderList; + print(order.length); + setState(ViewState.Idle); } } @@ -36,4 +41,20 @@ class OrderModelViewModel extends BaseViewModel { } } + + Future getProductReview(orderId) async { + setState(ViewState.Busy); + await _orderService.getProductReview(orderId); + if (_orderService.hasError) { + error = _orderService.error; + setState(ViewState.Error); + } else { + //order = _orderService.orderList; + print(order.length); + setState(ViewState.Idle); + } + } + + + } \ No newline at end of file diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 57fc074a..3cde289c 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -489,7 +489,7 @@ class _HomePageState extends State { ), DashboardItem( onTap: () => Navigator.push( - context, FadePage(page: OrderPage())), + context, FadePage(page: PharmacyProfilePage())), child: Center( child: Padding( diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart index 17849c47..f46eb08f 100644 --- a/lib/pages/pharmacy/order/Order.dart +++ b/lib/pages/pharmacy/order/Order.dart @@ -8,11 +8,13 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; class OrderPage extends StatefulWidget { // orderList({this.customerId, this.pageId}); - + var languageID ; @override _OrderPageState createState() => _OrderPageState(); } @@ -21,17 +23,19 @@ class _OrderPageState extends State with SingleTickerProviderStateMix String customerId=""; String page_id=""; - List delivered = [] ; - List processing = []; - List cancelled = []; - List pending = []; + List orderList = [] ; + List deliveredOrderList = [] ; + List processingOrderList = []; + List cancelledOrderList = []; + List pendingOrderList = []; + TabController _tabController; AppSharedPreferences sharedPref = AppSharedPreferences(); @override void initState() { // WidgetsBinding.instance.addPostFrameCallback((_) => getOrder()); - + getLanguageID(); super.initState(); _tabController = new TabController(length: 4, vsync: this,); } @@ -41,11 +45,8 @@ class _OrderPageState extends State with SingleTickerProviderStateMix return BaseView( onModelReady: (model) => model.getOrder(customerId, page_id), builder: (_,model, wi )=> AppScaffold( - appBarTitle:(TranslationBase.of(context).order), -// backgroundColor: Colors.green , -// centerTitle: true, -// title: Text(TranslationBase.of(context).order, style: TextStyle(color:Colors.white)), -// backgroundColor: Colors.green, + appBarTitle:TranslationBase.of(context).order, + baseViewModel: model, isShowAppBar: true, isPharmacy:true , body: Container( @@ -54,7 +55,6 @@ class _OrderPageState extends State with SingleTickerProviderStateMix TabBar( tabs: [ Tab(text: TranslationBase.of(context).delivered), -// Tab(text: model.order.length.toString()), Tab(text: TranslationBase.of(context).processing), Tab(text: TranslationBase.of(context).pending), Tab(text: TranslationBase.of(context).cancelled), @@ -87,10 +87,19 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ); } + + Widget getDeliveredOrder(OrderModelViewModel model){ + for(int i=0 ; i< model.order.length; i++){ + if( model.order[i].orderStatusId == 30 || model.order[i].orderStatusId == 997 + || model.order[i].orderStatusId == 994 + ){ + deliveredOrderList.add(model.order[i]); + } + } return Container( width: MediaQuery.of(context).size.width, - child: model.order.length != 0 && model.order[0].orderStatusId == 30 + child: model.order.length != 0 ? SingleChildScrollView( child: Column( children: [ @@ -98,7 +107,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix scrollDirection: Axis.vertical, shrinkWrap: true, physics: ScrollPhysics(), - itemCount: 2 , + itemCount: deliveredOrderList.length, itemBuilder: (context, index){ return Container( child: Column( @@ -121,7 +130,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), ), Container( - child: Text(model.order[0].id.toString(), + child: Text(deliveredOrderList[index].id.toString(), style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, ), ), @@ -140,7 +149,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), ), Container( - child: Text(model.order[0].createdOnUtc.toString(), + child: Text(deliveredOrderList[index].createdOnUtc.toString().substring(0,11), style: TextStyle(fontSize: 14.0, ), ), @@ -155,7 +164,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix child: InkWell( onTap: () { Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage())); + MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:deliveredOrderList[index]))); }, child: SvgPicture.asset( 'assets/images/pharmacy/arrow_right.svg', @@ -175,27 +184,25 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - padding: EdgeInsets.only(left: 13.0, right: 13.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.blue[700], - style: BorderStyle.solid, - width: 5.0, - ), + Container( + margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), + padding: EdgeInsets.only(left: 13.0, right: 13.0), + decoration: BoxDecoration( + border: Border.all( color: Colors.blue[700], - borderRadius: BorderRadius.circular(30.0) - ), - child: Text( - model.order[0].orderStatus.toString(), -// TranslationBase.of(context).delivered, - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, + style: BorderStyle.solid, + width: 5.0, ), + color: Colors.blue[700], + borderRadius: BorderRadius.circular(30.0) + ), + child: Text( +// deliveredOrderList[0].orderStatus.toString().substring(12), + TranslationBase.of(context).deliveredOrder, + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, ), ), ), @@ -208,7 +215,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix children: [ Container( margin: EdgeInsets.only(left: 5), - child: Text(model.order[0].orderTotal.toString(), + child: Text(deliveredOrderList[index].orderTotal.toString(), style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, ), ), @@ -227,7 +234,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Row( children: [ Container( - child: Text('12', + child: Text(deliveredOrderList[index].orderItems.length.toString(), style: TextStyle(fontSize: 14.0, ), ), @@ -267,7 +274,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Image.asset( + SvgPicture.asset( 'assets/images/pharmacy/empty_box.svg'), Container( margin: EdgeInsets.only(top: 10.0), @@ -284,189 +291,391 @@ class _OrderPageState extends State with SingleTickerProviderStateMix } Widget getProcessingOrder(OrderModelViewModel model){ + for(int i=0 ; i< model.order.length; i++){ + if( model.order[i].orderStatusId == 20 || model.order[i].orderStatusId == 995 || + model.order[i].orderStatusId == 998 || model.order[i].orderStatusId == 999){ + processingOrderList.add(model.order[i]); + } + } return Container( - child: model.order.length != 0 && model.order[0].orderStatusId == 20 - ? SingleChildScrollView( - child: Column( + width: MediaQuery.of(context).size.width, + child: model.order.length != 0 + ? SingleChildScrollView( + child: Column( children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderNumber, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - child: Text(model.order[0].id.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderDate, - style: TextStyle(fontSize: 14.0, + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: processingOrderList.length, + itemBuilder: (context, index){ + return Container( + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5), + child: Text(TranslationBase.of(context).orderNumber, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, + ), + ), + ), + Container( + child: Text(processingOrderList[index].id.toString(), + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + SizedBox( + height: 5,), + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5), + child: Text(TranslationBase.of(context).orderDate, + style: TextStyle(fontSize: 14.0, + ), + ), + ), + Container( + child: Text(processingOrderList[index].createdOnUtc.toString().substring(0,11), + style: TextStyle(fontSize: 14.0, + ), + ), + ), + ], + ), + ], ), ), - ), - Container( - child: Text(model.order[0].createdOnUtc.toString(), - style: TextStyle(fontSize: 14.0, + Container( + margin: EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:processingOrderList[index]))); + }, + child: SvgPicture.asset( + 'assets/images/pharmacy/arrow_right.svg', + height: 20, + width: 20,), ), ), - ), - ], - ), - ], - ), - ), - Container( - margin: EdgeInsets.all(8), - child: InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage())); - }, - child: SvgPicture.asset( - 'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20,), - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - padding: EdgeInsets.only(left: 13.0, right: 13.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 5.0, + ], ), - color: Colors.green, - borderRadius: BorderRadius.circular(30.0) - ), - child: Text( - model.order[0].orderStatus.toString(), -// TranslationBase.of(context).processing, - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - child: Column( -// crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text(model.order[0].orderTotal.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, + Divider( + color: Colors.grey[350], + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), + padding: EdgeInsets.only(left: 13.0, right: 13.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.green, + style: BorderStyle.solid, + width: 5.0, + ), + color: Colors.green, + borderRadius: BorderRadius.circular(30.0) ), - ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - child: Text('12', - style: TextStyle(fontSize: 14.0, + child: Text( + processingOrderList[index].orderStatus.toString().substring(12), + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), ), ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).itemsNo, - style: TextStyle(fontSize: 14.0, + Container( + margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), + child: Column( +// crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Row( + children: [ + Container( + margin: EdgeInsets.only(left: 5), + child: Text(processingOrderList[index].orderTotal.toString(), + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, + ), + ), + ), + Container( + margin: EdgeInsets.only(left: 5), + child: Text(TranslationBase.of(context).sar, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + SizedBox( + height: 5,), + Row( + children: [ + Container( + child: Text(processingOrderList[index].orderItems.length.toString(), + style: TextStyle(fontSize: 14.0, + ), + ), + ), + Container( + margin: EdgeInsets.only(left: 5), + child: Text(TranslationBase.of(context).itemsNo, + style: TextStyle(fontSize: 14.0, + ), + ), + ), + ], + ), + ], ), ), - ), - ], - ), - ], - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, - ), + ], + ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 8, + indent: 0, + endIndent: 0, + ), + ], + ), + ); + } + ) ], ), ) : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/pharmacy/empty_box.svg'), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noOrder, - style: TextStyle( - fontSize: 16.0, - )), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/empty_box.svg'), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(TranslationBase.of(context).noOrder, + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), ), - ], - ), - ), - ), + ), ); +// return Container( +// child: model.order.length != 0 +// ? SingleChildScrollView( +// child: Column( +// children: [ +// ListView.builder( +// child: Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Container( +// margin: EdgeInsets.all(8), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Row( +// children: [ +// Container( +// margin: EdgeInsets.only(right: 5), +// child: Text(TranslationBase.of(context).orderNumber, +// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, +// ), +// ), +// ), +// Container( +// child: Text(processingOrderList[0].id.toString(), +// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, +// ), +// ), +// ), +// ], +// ), +// SizedBox( +// height: 5,), +// Row( +// children: [ +// Container( +// margin: EdgeInsets.only(right: 5), +// child: Text(TranslationBase.of(context).orderDate, +// style: TextStyle(fontSize: 14.0, +// ), +// ), +// ), +// Container( +// child: Text(processingOrderList[0].createdOnUtc.toString().substring(0,11), +// style: TextStyle(fontSize: 14.0, +// ), +// ), +// ), +// ], +// ), +// ], +// ), +// ), +// Container( +// margin: EdgeInsets.all(8), +// child: InkWell( +// onTap: () { +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:processingOrderList[0]))); +// }, +// child: SvgPicture.asset( +// 'assets/images/pharmacy/arrow_right.svg', +// height: 20, +// width: 20,), +// ), +// ), +// ], +// ), +// ), +// Divider( +// color: Colors.grey[350], +// height: 20, +// thickness: 1, +// indent: 0, +// endIndent: 0, +// ), +// Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Container( +// margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), +// padding: EdgeInsets.only(left: 13.0, right: 13.0), +// decoration: BoxDecoration( +// border: Border.all( +// color: Colors.green, +// style: BorderStyle.solid, +// width: 5.0, +// ), +// color: Colors.green, +// borderRadius: BorderRadius.circular(30.0) +// ), +// child: Text( widget.languageID == "ar" +// ? processingOrderList[0].orderStatusn.toString() +// : processingOrderList[0].orderStatus.toString().substring(12), +//// TranslationBase.of(context).processing, +// style: TextStyle( +// color: Colors.white, +// fontSize: 15.0, +// fontWeight: FontWeight.bold, +// ), +// ), +// ), +// Container( +// margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), +// child: Column( +//// crossAxisAlignment: CrossAxisAlignment.end, +// children: [ +// Row( +// children: [ +// Container( +// margin: EdgeInsets.only(left: 5), +// child: Text(processingOrderList[0].orderTotal.toString(), +// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, +// ), +// ), +// ), +// Container( +// margin: EdgeInsets.only(left: 5), +// child: Text(TranslationBase.of(context).sar, +// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, +// ), +// ), +// ), +// ], +// ), +// SizedBox( +// height: 5,), +// Row( +// children: [ +// Container( +// child: Text(processingOrderList[0].orderItems[0].quantity.toString(), +// style: TextStyle(fontSize: 14.0, +// ), +// ), +// ), +// Container( +// margin: EdgeInsets.only(left: 5), +// child: Text(TranslationBase.of(context).itemsNo, +// style: TextStyle(fontSize: 14.0, +// ), +// ), +// ), +// ], +// ), +// ], +// ), +// ), +// ], +// ), +// Divider( +// color: Colors.grey[350], +// height: 20, +// thickness: 8, +// indent: 0, +// endIndent: 0, +// ), +// ], +// ), +// ) +// : Container( +// child: Center( +// child: Column( +// mainAxisAlignment: MainAxisAlignment.center, +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// SvgPicture.asset( +// 'assets/images/pharmacy/empty_box.svg'), +// Container( +// margin: EdgeInsets.only(top: 10.0), +// child: Text(TranslationBase.of(context).noOrder, +// style: TextStyle( +// fontSize: 16.0, +// )), +// ), +// ], +// ), +// ), +// ), +// ); } Widget getPendingOrder(OrderModelViewModel model){ + for(int i=0 ; i< model.order.length; i++){ + if( model.order[i].orderStatusId == 10){ + pendingOrderList.add(model.order[i]); + } + } return Container( - child: model.order.length != 0 && model.order[0].orderStatusId == 10 + child: model.order.length != 0 ? SingleChildScrollView( child: Column( children: [ @@ -474,7 +683,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix scrollDirection: Axis.vertical, shrinkWrap: true, physics: ScrollPhysics(), - itemCount: 2 , + itemCount: pendingOrderList.length , itemBuilder: (context, index){ return Container( child: SingleChildScrollView( @@ -498,7 +707,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), ), Container( - child: Text(model.order[0].id.toString(), + child: Text(pendingOrderList[index].id.toString(), style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, ), ), @@ -517,7 +726,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), ), Container( - child: Text(model.order[0].createdOnUtc.toString(), + child: Text(pendingOrderList[index].createdOnUtc.toString().substring(0,11), style: TextStyle(fontSize: 14.0, ), ), @@ -532,7 +741,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix child: InkWell( onTap: () { Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage())); + MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:pendingOrderList[index]))); }, child: SvgPicture.asset( 'assets/images/pharmacy/arrow_right.svg', @@ -552,28 +761,29 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded( - child:Container( - margin: EdgeInsets.all(8.0), - padding: EdgeInsets.only(left: 13.0, right: 13.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.orange[300], - style: BorderStyle.solid, - width: 5.0, - ), - color: Colors.orange[300], - borderRadius: BorderRadius.circular(30.0) - ), - child: Text( - model.order[0].orderStatus.toString(), - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), + Container( + margin: EdgeInsets.all(8.0), + padding: EdgeInsets.only(left: 13.0, right: 13.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.orange[300], + style: BorderStyle.solid, + width: 5.0, ), - ), ), + color: Colors.orange[300], + borderRadius: BorderRadius.circular(30.0) + ), + child: Text( + widget.languageID == "ar" + ? pendingOrderList[index].orderStatusn.toString() + : pendingOrderList[index].orderStatus.toString().substring(12), + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ), + ), Container( margin: EdgeInsets.all(8.0), child: Column( @@ -583,7 +793,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix children: [ Container( margin: EdgeInsets.only(left: 5), - child: Text(model.order[0].orderTotal.toString(), + child: Text(pendingOrderList[index].orderTotal.toString(), style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, ), ), @@ -602,7 +812,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Row( children: [ Container( - child: Text('12', + child: Text(pendingOrderList[index].orderItems.length.toString(), style: TextStyle(fontSize: 14.0, ), ), @@ -644,7 +854,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Image.asset( + SvgPicture.asset( 'assets/images/pharmacy/empty_box.svg'), Container( margin: EdgeInsets.only(top: 10.0), @@ -662,8 +872,14 @@ class _OrderPageState extends State with SingleTickerProviderStateMix } Widget getCancelledOrder(OrderModelViewModel model){ + for(int i=0 ; i< model.order.length; i++){ + if( model.order[i].orderStatusId == 40 || model.order[i].orderStatusId == 996 + || model.order[i].orderStatusId == 200){ + cancelledOrderList.add(model.order[i]); + } + } return Container( - child: model.order.length != 0 && model.order[0].orderStatusId == 40 + child: model.order.length != 0 ? SingleChildScrollView( child: Column( children: [ @@ -671,7 +887,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix scrollDirection: Axis.vertical, shrinkWrap: true, physics: ScrollPhysics(), - itemCount: 2 , + itemCount: cancelledOrderList.length, itemBuilder: (context, index){ return Container( child: SingleChildScrollView( @@ -695,7 +911,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), ), Container( - child: Text(model.order[0].id.toString(), + child: Text(cancelledOrderList[index].id.toString(), style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, ), ), @@ -714,7 +930,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), ), Container( - child: Text(model.order[0].createdOnUtc.toString(), + child: Text(cancelledOrderList[index].createdOnUtc.toString().substring(0,11), style: TextStyle(fontSize: 14.0, ), ), @@ -729,7 +945,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix child: InkWell( onTap: () { Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage())); + MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:cancelledOrderList[index]))); }, child: SvgPicture.asset( 'assets/images/pharmacy/arrow_right.svg', @@ -749,28 +965,28 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded( - child:Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - padding: EdgeInsets.only(left: 10.0, right: 10.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.red[900], - style: BorderStyle.solid, - width: 5.0, - ), - color: Colors.red[900], - borderRadius: BorderRadius.circular(30.0) - ), - child: Text( - model.order[0].orderStatus.toString(), - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), + Container( + margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), + padding: EdgeInsets.only(left: 10.0, right: 10.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.red[900], + style: BorderStyle.solid, + width: 5.0, ), - ), ), + color: Colors.red[900], + borderRadius: BorderRadius.circular(30.0) + ), + child: Text( widget.languageID == "ar" + ? cancelledOrderList[index].orderStatusn.toString() + : cancelledOrderList[index].orderStatus.toString().substring(12), + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ), + ), Container( margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), child: Column( @@ -780,7 +996,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix children: [ Container( margin: EdgeInsets.only(left: 5), - child: Text(model.order[0].orderTotal.toString(), + child: Text(cancelledOrderList[index].orderTotal.toString(), style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, ), ), @@ -799,7 +1015,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Row( children: [ Container( - child: Text('12', + child: Text(cancelledOrderList[index].orderItems.length.toString(), style: TextStyle(fontSize: 14.0, ), ), @@ -841,7 +1057,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Image.asset( + SvgPicture.asset( 'assets/images/pharmacy/empty_box.svg'), Container( margin: EdgeInsets.only(top: 10.0), @@ -856,26 +1072,17 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), ); } -} + getLanguageID() async { + var languageID = await sharedPref.getString(APP_LANGUAGE); + setState(() { + widget.languageID = languageID; + }); + } +} -// filterOrders() { -// for () { -// if (order.order_status_id === 30 || order.order_status_id === 997 || order.order_status_id === 994) { // complete -// this.delivered.push(order); -// } else if (order.order_status_id === 40 || order.order_status_id === 200 || order.order_status_id === 996) { // cancelled & order refunded -// this.cancelled.push(order); -// } else if (order.order_status_id === 10) { // Pending -// this.pending.push(order); -// } else if (order.order_status_id === 20 || order.order_status_id === 995 || order.order_status_id === 998 || order.order_status_id === 999) { // Processing -// this.processing.push(order); -// } else { // Processing & other all other status -// this.other.push(order); -// } -// } -//} diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart index d406e7f5..3c6e62b1 100644 --- a/lib/pages/pharmacy/order/OrderDetails.dart +++ b/lib/pages/pharmacy/order/OrderDetails.dart @@ -1,6 +1,8 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -9,11 +11,24 @@ import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + class OrderDetailsPage extends StatefulWidget { + var languageID ; + + + OrderModel orderModel; + OrderDetailsPage({ + @required this.orderModel +}); + @override _OrderDetailsPageState createState() => _OrderDetailsPageState(); } @@ -23,20 +38,28 @@ class _OrderDetailsPageState extends State { String customerId=""; String page_id=""; String orderId="3516"; + var model; + var isCancel = false; + var isRefund = false; + var dataIsCancel; + var dataIsRefund; + + @override void initState() { - WidgetsBinding.instance.addPostFrameCallback((_) => getOrderDetails()); super.initState(); + getLanguageID(); + + getCancelOrder(widget.orderModel.id); +// cancelOrderDetail(widget.orderModel.id); } @override Widget build(BuildContext context) { return BaseView( - onModelReady:(model) => model.getOrderDetails(orderId), + onModelReady:(model) => model.getOrderDetails(widget.orderModel.id), builder: (_,model, wi )=> AppScaffold( - appBarTitle: (TranslationBase.of(context).orderDetail), -// title: Text(TranslationBase.of(context).orderDetail, style: TextStyle(color:Colors.white)), -// backgroundColor: Colors.green, + appBarTitle: TranslationBase.of(context).orderDetail, isShowAppBar: true, isPharmacy:true , body: Container( @@ -62,39 +85,43 @@ class _OrderDetailsPageState extends State { ], ), ), - Container( - margin: EdgeInsets.only(top: 15.0, right: 10.0), - padding: EdgeInsets.only(left: 11.0, right: 11.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.blue, - style: BorderStyle.solid, - width: 5.0, + Container( + + margin: EdgeInsets.only(top: 15.0, right: 10.0), + padding: EdgeInsets.only(left: 11.0, right: 11.0), + decoration: BoxDecoration( + border: Border.all( + color: getStatusBackgroundColor(), + style: BorderStyle.solid, + width: 5.0, + ), + color: getStatusBackgroundColor(), + borderRadius: BorderRadius.circular(30.0) + ), + child: Text(widget.orderModel.orderStatus.toString().substring(12), +// widget.languageID == "ar" +// ? widget.orderModel.orderStatusn.toString() +// : widget.orderModel.orderStatus.toString().substring(12) , +// TranslationBase.of(context).delivered, + style: TextStyle( + color: Colors.white, + fontSize: 13.0, + fontWeight: FontWeight.bold, ), - color: Colors.blue, - borderRadius: BorderRadius.circular(30.0) - ), - child: Text( - TranslationBase.of(context).delivered, - style: TextStyle( - color: Colors.white, - fontSize: 13.0, - fontWeight: FontWeight.bold, ), ), - ), ], ), Container( margin: EdgeInsets.only(left: 10.0, top: 13.0), child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('NAME', - style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, - ), + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(model.order[0].shippingAddress.firstName.toString().substring(10) + ' ' +model.order[0].shippingAddress.lastName.toString().substring(9), + style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, ), - ], + ), + ] ), ), Container( @@ -102,7 +129,7 @@ class _OrderDetailsPageState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('Cloud Solutions', + Text(model.order[0].shippingAddress.address1.toString().substring(9), style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, color: Colors.grey, ), @@ -110,22 +137,37 @@ class _OrderDetailsPageState extends State { ], ), ), - Row( - children: [ - Container( - margin: EdgeInsets.fromLTRB(10.0, 5.0, 8.0, 5.0), - child: SvgPicture.asset( - 'assets/images/pharmacy/mobile_number_icon.svg', - height: 13,), + Container( + margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(model.order[0].shippingAddress.address2.toString().substring(9), + style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, + color: Colors.grey, + ), ), - Container( - margin: EdgeInsets.only(top: 5.0, bottom: 5.0), - child: Text('588888778', - style: TextStyle(fontSize: 15.0, + ] + ), + ), + Container( + child: Row( + children: [ + Container( + margin: EdgeInsets.fromLTRB(10.0, 5.0, 8.0, 5.0), + child: SvgPicture.asset( + 'assets/images/pharmacy/mobile_number_icon.svg', + height: 13,), + ), + Container( + margin: EdgeInsets.only(top: 5.0, bottom: 5.0), + child: Text(model.order[0].shippingAddress.phoneNumber.toString(), + style: TextStyle(fontSize: 15.0, + ), ), ), - ), - ], + ], + ), ), Divider( color: Colors.grey[350], @@ -151,11 +193,21 @@ class _OrderDetailsPageState extends State { ), ), Container( - margin: EdgeInsets.only(bottom: 10.0, top: 10.0), - child: SvgPicture.asset( - 'assets/images/pharmacy/hmg_shipping_logo.svg', - height: 25, - width: 25,), + child: model.order[0].shippingRateComputationMethodSystemName == "Shipping.FixedOrByWeight" + ? Container( + margin: EdgeInsets.only(bottom: 10.0, top: 10.0), + child: SvgPicture.asset( + 'assets/images/pharmacy/hmg_shipping_logo.svg', + height: 25, + width: 25,), + ) + : Container( + margin: EdgeInsets.only(bottom: 10.0, top: 10.0), + child: SvgPicture.asset( + 'assets/images/pharmacy/aramex_shipping_logo.svg', + height: 25, + width: 25,), + ), ), ], ), @@ -184,7 +236,7 @@ class _OrderDetailsPageState extends State { ), Container( margin: EdgeInsets.only(bottom: 10.0, top: 10.0), - child:Text('Mada', + child:Text(model.order[0].paymentName.toString().substring(12), style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold, ), ), @@ -211,10 +263,23 @@ class _OrderDetailsPageState extends State { ], ), ), - Container( - child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00, - productReviews:4, totalPrice: '10.00', qyt: '3',), + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount:widget.orderModel.orderItems.length, + itemBuilder: (context, index){ + return Container( + child: productTile(productName: widget.orderModel.orderItems[index].product.name.toString(), + productPrice: widget.orderModel.orderItems[index].product.price.toString(), + productRate: widget.orderModel.orderItems[index].product.approvedRatingSum.toDouble(), + productReviews:widget.orderModel.orderItems[index].product.approvedTotalReviews, + totalPrice: widget.orderModel.orderItems[index].priceExclTax.toString(), + qyt: widget.orderModel.orderItems[index].quantity.toString(),), + ); + } ), + Container( padding: EdgeInsets.only(bottom: 10.0), margin: EdgeInsets.only(left: 10.0, top: 5.0), @@ -253,7 +318,7 @@ class _OrderDetailsPageState extends State { ), ), ), - Text('343.55', + Text(model.order[0].orderSubtotalExclTax.toString(), style: TextStyle(fontSize: 13.0, ), ), @@ -287,7 +352,7 @@ class _OrderDetailsPageState extends State { ), ), ), - Text('343.55', + Text(model.order[0].orderShippingExclTax.toString(), style: TextStyle(fontSize: 13.0, ), ), @@ -321,7 +386,7 @@ class _OrderDetailsPageState extends State { ), ), ), - Text('343.55', + Text(model.order[0].orderTax.toString(), style: TextStyle(fontSize: 13.0, ), ), @@ -353,7 +418,7 @@ class _OrderDetailsPageState extends State { ), ), ), - Text('343.55', + Text(model.order[0].orderTotal.toString(), style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, ), ), @@ -362,14 +427,16 @@ class _OrderDetailsPageState extends State { ), ], ), - InkWell( + widget.orderModel.orderStatusId == 10 ? InkWell( onTap: (){ - }, + // payOnline link + }, child: Container( - margin: EdgeInsets.only(top: 20.0), +// margin: EdgeInsets.only(top: 20.0), height: 50.0, color: Colors.transparent, child: Container( + padding: EdgeInsets.only(left: 150.0, right: 150.0), decoration: BoxDecoration( border: Border.all( color: Colors.green, @@ -390,27 +457,30 @@ class _OrderDetailsPageState extends State { ), ), ), - ), - InkWell( + ) : Container(), + +// getCancelOrder(canCancel, canRefund), + isCancel ? InkWell( onTap: () { -// confirmDelete(snapshot.data[index]["id"]); - cancelOrder("id"); + Navigator.push(context, + MaterialPageRoute(builder: (context) => presentConfirmDialog())); }, child: Container( +// padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), height: 50.0, color: Colors.transparent, - child: Center( - child: Text( - TranslationBase.of(context).cancelOrder, - style: TextStyle( + child: Center( + child: Text( + TranslationBase.of(context).cancelOrder, + style: TextStyle( color: Colors.red[900], fontWeight: FontWeight.bold, decoration: TextDecoration.underline - ), ), ), ), - ), + ), + ) : Container(), ], ), ), @@ -418,58 +488,88 @@ class _OrderDetailsPageState extends State { ), ); } - cancelOrder(id){ - showDialog( + + + + Color getStatusBackgroundColor() { + print(widget.orderModel.orderStatusId); +// if(orderStatus == 'delivered') + if(widget.orderModel.orderStatusId == 30 ||widget.orderModel.orderStatusId == 997 + ||widget.orderModel.orderStatusId == 994) + return Colors.blue[700]; + else if (widget.orderModel.orderStatusId == 20 ||widget.orderModel.orderStatusId == 995 + ||widget.orderModel.orderStatusId == 998 ||widget.orderModel.orderStatusId == 999) + return Colors.green; + else if (widget.orderModel.orderStatusId == 10) + return Colors.orange[300]; + else if (widget.orderModel.orderStatusId == 40 ||widget.orderModel.orderStatusId == 996 + ||widget.orderModel.orderStatusId == 200) + return Colors.red[900]; + } + + + getCancelOrder(dataIsCancel){ + if(widget.orderModel.canCancel && widget.orderModel.canRefund) + { + setState(() { + isCancel = true; + isRefund = false; + }); + } + else if (widget.orderModel.canCancel ){ + setState(() { + isCancel = true; + isRefund = false; + }); + + } + else if (widget.orderModel.canRefund){ + setState(() { + isCancel = false; + isRefund = true; + }); + } + else { + setState(() { + isCancel = false; + isRefund = false; + }); + } +} + + presentConfirmDialog(){ + ConfirmDialog dialog = new ConfirmDialog( context: context, - builder: (BuildContext context)=> AlertDialog( - title: Text(TranslationBase.of(context).confirm, - style: TextStyle( - fontWeight: FontWeight.bold, - ),), - content: Text(TranslationBase.of(context).confirmCancellation, - style: TextStyle( - color: Colors.grey, - ),), - actions:[ - FlatButton( - child: Text(TranslationBase.of(context).cancel, - style: TextStyle( - color: Colors.red, - fontWeight: FontWeight.bold, - fontSize: 16, - ),), - onPressed: (){ - Navigator.pop(context); - }, - ), - FlatButton( - child: Text(TranslationBase.of(context).ok, - style: TextStyle( - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 16, - ),), - onPressed: (){ -// http.delete(""https://uat.hmgwebservices.com/epharmacy/api/orders/$id"); - Navigator.push(context, - MaterialPageRoute(builder: (context)=> OrderDetailsPage())); - }, - ), - ], - ) - ); + confirmMessage: TranslationBase.of(context).confirmCancellation, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => { + cancelOrderDetail(widget.orderModel.id), + ConfirmDialog.closeAlertDialog(context) + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + + cancelOrderDetail(order){ + if(widget.orderModel.canCancel && widget.orderModel.canRefund == false){ +// setState(() { + cancelOrderDetail(order); + AppToast.showSuccessToast(message: "Request Sent Successfully"); +// }); +// return OrderPage(); + } + else{} + } + + getLanguageID() async { + var languageID = await sharedPref.getString(APP_LANGUAGE); + setState(() { + widget.languageID = languageID; + }); } } - getOrderDetails() { - print("getOrderDetails 5466"); - OrderDetailsService service = new OrderDetailsService(); - service.getOrderDetails(AppGlobal.context).then((res) { - print(res); - }); - } - getPayOrder(){ - } diff --git a/lib/pages/pharmacy/order/ProductReview.dart b/lib/pages/pharmacy/order/ProductReview.dart index 9de67849..0f9217b7 100644 --- a/lib/pages/pharmacy/order/ProductReview.dart +++ b/lib/pages/pharmacy/order/ProductReview.dart @@ -1,3 +1,6 @@ +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -6,6 +9,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; import 'package:rating_bar/rating_bar.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart'; class ProductReviewPage extends StatefulWidget { @@ -15,35 +19,45 @@ class ProductReviewPage extends StatefulWidget { } class _ProductReviewPageState extends State { + String orderId ="3516"; + var pharmacyUser =""; + var product =""; + var CustomerId =""; + String submitTxt =""; + var doctorRating= ""; + var reviewObj = {}; + AppSharedPreferences sharedPref = AppSharedPreferences(); + @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - centerTitle: true, - title: Text(TranslationBase.of(context).writeReview, style: TextStyle(color:Colors.white)), - backgroundColor: Colors.green, - ), + return BaseView( + onModelReady: (model)=>model.getProductReview(orderId), + builder: (_,model, wi )=> AppScaffold( + appBarTitle: TranslationBase.of(context).writeReview, + isShowAppBar: true, + isPharmacy:true , body: Container( color: Colors.white, child: SingleChildScrollView( - child: Column( - children: [ -// Container( + child: Column( + children: [ +// Container( // child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00, // productReviews:4, ), // ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - margin: EdgeInsets.only(left: 10), - child: Image( - image: - AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + margin: EdgeInsets.only(left: 10), + child: SvgPicture.asset( +// model.order[0].orderItems[0].product.images[0].src.toString(), + 'assets/images/al-habib_onlne_pharmacy_bg.png', fit: BoxFit.cover, width: 80, height: 80, ), + ),] ), Container( margin: EdgeInsets.only(top :15.0, bottom: 15.0), @@ -51,7 +65,7 @@ class _ProductReviewPageState extends State { children: [ Row( children: [ - Text('medication name', + Text(model.order[0].orderItems[0].product.name.toString(), style: TextStyle(fontSize: 16.0, ), ), @@ -61,14 +75,14 @@ class _ProductReviewPageState extends State { children: [ Container( margin: EdgeInsets.only(left: 5), - child: Text('90.00', + child: Text(model.order[0].orderItems[0].product.price.toString(), style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, ), ), ), Container( margin: EdgeInsets.only(left: 5), - child: Text('SAR', + child: Text(TranslationBase.of(context).sar, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, ), ), @@ -94,14 +108,15 @@ class _ProductReviewPageState extends State { ), ), Container( - child: Text('4.9', + child: Text(model.order[0].orderItems[0].product.approvedRatingSum.toString(), style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, ), ), ), Container( margin: EdgeInsets.only(left: 5), - child: Text('10 (reviews)', + child: Text("(" + model.order[0].orderItems[0].product.approvedTotalReviews.toString() + + ' ' + TranslationBase.of(context).review +")", style: TextStyle(fontSize: 12.0, ), ), @@ -111,8 +126,6 @@ class _ProductReviewPageState extends State { ], ), ), - ], - ), Divider( color: Colors.grey[350], height: 20, @@ -165,7 +178,8 @@ class _ProductReviewPageState extends State { ), InkWell( onTap: () { - +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => )); }, child: Container( height: 50.0, @@ -196,11 +210,14 @@ class _ProductReviewPageState extends State { ), ], ), - ), - ), - ); + ), + ),), + ); } + + + //new screen is showing after submitting the review Widget getReviewedProduct(){ return Column( @@ -309,4 +326,24 @@ class _ProductReviewPageState extends State { ], ); } + +// submit(){ +// this.orderId.id = "0"; +// this.reviewObj.position = 0; +// this.reviewObj.customerId = this.pharmacyUser.CustomerId; +// this.reviewObj.productId = this.product.id; +// this.reviewObj.storeId = 2; +// this.reviewObj.isApproved = false; +// this.reviewObj.title =''; +// this.reviewObj.reviewText = this.submitTxt; +// this.reviewObj.rating = this.doctorRating; +// this.reviewObj.replyText = null; +// this.reviewObj.helpfulYesTotal = 0; +// this.reviewObj.helpfulNoTotal = 0; +// this.reviewObj.createdOnUtc = new Date().toString(); +// this.submitProductReview(); +// } + submitProductReview(){ + + } } diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart index 44df964d..07862645 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart @@ -7,9 +7,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyAddressesModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; class PharmacyAddressesPage extends StatefulWidget{ @override @@ -17,13 +19,11 @@ class PharmacyAddressesPage extends StatefulWidget{ } class _PharmacyAddressesState extends State{ - + String address=""; int selectedRadio; bool _value = false; AppSharedPreferences sharedPref = AppSharedPreferences(); - - @override void initState(){ // WidgetsBinding.instance.addPostFrameCallback((_) => getAllAddress()); @@ -39,12 +39,10 @@ class _PharmacyAddressesState extends State{ Widget build (BuildContext context){ return BaseView( - onModelReady: (model) => model.getAddress(), + onModelReady: (model) => model.getAddress(address), builder: (_,model, wi )=> AppScaffold( - appBarTitle: "", -// centerTitle: true, -// title: Text(TranslationBase.of(context).changeAddress, style: TextStyle(color:Colors.white)), -// backgroundColor: Colors.green, + appBarTitle:TranslationBase.of(context).changeAddress, + baseViewModel: model, isShowAppBar: true, isPharmacy:true , body: Container( @@ -55,7 +53,7 @@ class _PharmacyAddressesState extends State{ scrollDirection: Axis.vertical, shrinkWrap: true, physics: ScrollPhysics(), - itemCount: 5 , + itemCount: model.address.length, itemBuilder: (context, index){ return Container( child: Padding( @@ -111,14 +109,19 @@ class _PharmacyAddressesState extends State{ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('NAME', + Text('name', +// model.address[0].customers[0].addresses[0].firstName, style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, ), ), SizedBox( height: 5,), - Text('Address', - style: TextStyle(fontSize: 15.0, color: Colors.grey, + Expanded( + child: Text(model.address[0].customers[0].addresses[0].address1+ ''+ + model.address[0].customers[0].addresses[0].address2+ '' + + model.address[0].customers[0].addresses[0].zipPostalCode, + style: TextStyle(fontSize: 15.0, color: Colors.grey, + ), ), ), SizedBox( @@ -354,11 +357,6 @@ class _PharmacyAddressesState extends State{ } getAllAddress() { -// print("ADDRESSES"); -// PharmacyAddressService service = new PharmacyAddressService(); -// service.getAddress(AppGlobal.context).then((res) { -// print(res); -// }); } diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index 272ef0d4..ec19ae8d 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -1,7 +1,21 @@ +import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; +import 'package:diplomaticquarterapp/pages/family/my-family.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; + class PharmacyProfilePage extends StatefulWidget { @override @@ -9,370 +23,411 @@ class PharmacyProfilePage extends StatefulWidget { } class _ProfilePageState extends State { + AppSharedPreferences sharedPref = AppSharedPreferences(); + String customerId=""; + String page_id=""; + @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - centerTitle: true, - title: Text(TranslationBase.of(context).myAccount, style: TextStyle(color:Colors.white)), - backgroundColor: Colors.green, - ), - body: Container( - child:SingleChildScrollView( - child: Column( - children:[ - Container( - child:Row( - children: [ - Container( - padding:EdgeInsets.only(top:20.0, left:10.0, right:10.0, bottom:10.0,), - child: LargeAvatar(name: "profile", url:'' ,), - ), - Container( - child: Column( - children: [ - Text( - TranslationBase.of(context).welcome, - style: TextStyle(fontSize: 14.0, - fontWeight: FontWeight.bold, - color:Colors.grey - ), - ), - Text( - 'NAME', - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold - ), - ), - ], - ), - ) - ], - ), - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 15, - ), - Container( + return BaseView( + onModelReady: (model) => model.getOrder(customerId, page_id), + builder: (_,model, wi )=> AppScaffold( + appBarTitle: TranslationBase.of(context).myAccount, + isShowAppBar: true, + isPharmacy:true , + body: Container( + child:SingleChildScrollView( + child: Column( + children:[ + Container( child:Row( children: [ - Expanded( - child: InkWell( - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/orders_icon.svg', - width: 50, - height: 50,), - SizedBox( - height: 5, + Container( + padding:EdgeInsets.only(top:20.0, left:10.0, right:10.0, bottom:10.0,), + child: LargeAvatar(name: "profile", url:'' ,), + ), + Container( + child: Column( + children: [ + Text( + TranslationBase.of(context).welcome, + style: TextStyle(fontSize: 14.0, + fontWeight: FontWeight.bold, + color:Colors.grey ), - Text( - TranslationBase.of(context).orders, - style: TextStyle(fontSize: 13.0, - fontWeight: FontWeight.bold,), + ), + Text("Name", +// model.order[0].customer.firstName.toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold ), - ], + ), + ], + ), + ) + ], + ), + ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 5, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 15, + ), + Container( + child:Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => OrderPage())); + }, + child: Column( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/orders_icon.svg', + width: 50, + height: 50,), + SizedBox( + height: 5, + ), + Text( + TranslationBase.of(context).orders, + style: TextStyle(fontSize: 13.0, + fontWeight: FontWeight.bold,), + ), + ], + ), ), ), - ), - Expanded( - child: InkWell( - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/lakum_icon.svg', - width: 50, - height: 50,), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).lakum, - style: TextStyle(fontSize: 13.0, - fontWeight: FontWeight.bold + Expanded( + child: InkWell( + child: Column( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/lakum_icon.svg', + width: 50, + height: 50,), + SizedBox( + height: 5, ), - ), - ], + Text( + TranslationBase.of(context).lakum, + style: TextStyle(fontSize: 13.0, + fontWeight: FontWeight.bold + ), + ), + ], + ), ), ), - ), - Expanded( - child: InkWell( - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/wishlist_icon.svg', - width: 50, - height: 50,), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).wishlist, - style: TextStyle(fontSize: 13.0, - fontWeight: FontWeight.bold,), - ), - ], + Expanded( + child: InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => WishlistPage())); + }, + child: Column( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/wishlist_icon.svg', + width: 50, + height: 50,), + SizedBox( + height: 5, + ), + Text( + TranslationBase.of(context).wishlist, + style: TextStyle(fontSize: 13.0, + fontWeight: FontWeight.bold,), + ), + ], + ), ), ), + Expanded( + child: InkWell( + child: Column( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/review_icon.svg', + width: 50, + height: 50,), + SizedBox( + height: 5, + ), + Text( + TranslationBase.of(context).reviews, + style: TextStyle(fontSize: 13.0, + fontWeight: FontWeight.bold,), + ), + ], + ), + ), + ), + ], + ) + ), + SizedBox( + height: 15, + ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 5, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 10, + ), + Container( + padding: EdgeInsets.only(left: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).myAccount, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold + ), ), - Expanded( - child: InkWell( - child: Column( + SizedBox( + height: 10, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => HomePrescriptionsPage())); + }, + child: Row( children: [ SvgPicture.asset( - 'assets/images/pharmacy/review_icon.svg', - width: 50, - height: 50,), + 'assets/images/pharmacy/my_prescription_icon.svg', + width: 28, + height: 28,), SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).reviews, - style: TextStyle(fontSize: 13.0, - fontWeight: FontWeight.bold,), + width: 15, ), + Text(TranslationBase.of(context).myPrescription, + style: TextStyle(fontSize: 13.0, + ), + ), ], ), - ), - ), - ], - ) - ), - SizedBox( - height: 15, - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 10, - ), - Container( - padding: EdgeInsets.only(left: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).myAccount, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold ), - ), - SizedBox( - height: 10, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => MyFamily())); + }, + child: Row( children: [ SvgPicture.asset( - 'assets/images/pharmacy/my_prescription_icon.svg', + 'assets/images/pharmacy/compare.png', width: 28, height: 28,), SizedBox( width: 15, ), - Text(TranslationBase.of(context).myPrescriptions, - style: TextStyle(fontSize: 13.0, - ), + Text(TranslationBase.of(context).compare, + style: TextStyle(fontSize: 13.0, ), + ), ], ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/medication_refill_icon.svg', - width: 28, - height: 28,), - SizedBox( - width: 15, - ), - Text(TranslationBase.of(context).medicationRefill, - style: TextStyle(fontSize: 13.0, - ), - ), - ], ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/pill_reminder_icon.svg', - width: 30, - height: 30,), - SizedBox( - width: 20, - ), - Text(TranslationBase.of(context).pillReminder, - style: TextStyle(fontSize: 13.0, - ), - ), - ], + SizedBox( + height: 5, ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/my_family_icon.svg', - width: 20, - height: 20,), - SizedBox( - width: 20, - ), - Text(TranslationBase.of(context).family, - style: TextStyle(fontSize: 13.0, - ), - ), - ], + Divider( + color: Colors.grey, + height: 20, ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/shipping_addresses_icon.svg', - width: 30, - height: 30,), - SizedBox( - width: 20, - ), - Text(TranslationBase.of(context).shippingAddresses, - style: TextStyle(fontSize: 13.0, + InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => HomePrescriptionsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/medication_refill_icon.svg', + width: 30, + height: 30,), + SizedBox( + width: 20, ), - ), - ], + Text(TranslationBase.of(context).medicationsRefill, + style: TextStyle(fontSize: 13.0, + ), + ), + ], + ), ), - ), - ], - ), - ), - SizedBox( - height: 10, - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 10, - ), - Container( - padding: EdgeInsets.only(left: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).reachUs, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold + SizedBox( + height: 5, ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => MyFamily())); + }, + child: Row( children: [ SvgPicture.asset( - 'assets/images/pharmacy/contact_us_icon.svg', + 'assets/images/pharmacy/my_family_icon.svg', width: 20, height: 20,), SizedBox( width: 20, ), - Text( - TranslationBase.of(context).contactUs, - style: TextStyle(fontSize: 13.0), + Text(TranslationBase.of(context).family, + style: TextStyle(fontSize: 13.0, + ), ), ], ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/our_locations_icon.svg', - width: 30, - height: 30,), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).ourLocations, - style: TextStyle(fontSize: 13.0), - ), - ], ), - ) - ], + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => PharmacyAddressesPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/shipping_addresses_icon.svg', + width: 30, + height: 30,), + SizedBox( + width: 20, + ), + Text(TranslationBase.of(context).shippingAddresses, + style: TextStyle(fontSize: 13.0, + ), + ), + ], + ), + ), + ], + ), ), - ) - ], + SizedBox( + height: 10, + ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 5, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 10, + ), + Container( + padding: EdgeInsets.only(left: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).reachUs, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => LiveChatPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/contact_us_icon.svg', + width: 20, + height: 20,), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).contactUs, + style: TextStyle(fontSize: 13.0), + ), + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => FindUsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/our_locations_icon.svg', + width: 30, + height: 30,), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).ourLocations, + style: TextStyle(fontSize: 13.0), + ), + ], + ), + ) + ], + ), + ) + ], + ), ), ), ), diff --git a/lib/services/pharmacy_services/cancelOrder_service.dart b/lib/services/pharmacy_services/cancelOrder_service.dart new file mode 100644 index 00000000..de80a473 --- /dev/null +++ b/lib/services/pharmacy_services/cancelOrder_service.dart @@ -0,0 +1,39 @@ + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/material.dart'; + + +class CancelOrderService extends BaseService{ + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + List get orderDetails => orderDetails; + List _orderList = List(); + List get orderList => _orderList; + String url =""; + + + Future cancelOrderDetail(order) async { + print("step 1"); + hasError = false; + await baseAppClient.getPharmacy(GET_Cancel_ORDER+order, + onSuccess: (dynamic response, int statusCode) { + _orderList.clear(); + response['orders'].forEach((item) { + _orderList.add(OrderModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } +} \ No newline at end of file diff --git a/lib/services/pharmacy_services/order_service.dart b/lib/services/pharmacy_services/order_service.dart index d43d417b..70523da1 100644 --- a/lib/services/pharmacy_services/order_service.dart +++ b/lib/services/pharmacy_services/order_service.dart @@ -16,7 +16,7 @@ class OrderService extends BaseService{ List _orderList = List(); List get orderList => _orderList; -String url =""; + String url =""; Future getOrder(custmerId, page_id) async { print("step 1"); @@ -30,6 +30,7 @@ String url =""; response['orders'].forEach((item) { _orderList.add(OrderModel.fromJson(item)); }); + print(_orderList.length); print(response); }, onFailure: (String error, int statusCode) { hasError = true; @@ -38,6 +39,25 @@ String url =""; } + Future getProductReview(orderId) async { + print("step 1"); + hasError = false; + url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; +// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$page_id&limit=200&customer_id=$custmerId"; + print(url); + await baseAppClient.getPharmacy(url, + onSuccess: (dynamic response, int statusCode) { + _orderList.clear(); + response['orders'].forEach((item) { + _orderList.add(OrderModel.fromJson(item)); + }); + print(_orderList.length); + print(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } // Future getOrder(BuildContext context ) async { // // if (await this.sharedPref.getObject(USER_PROFILE) != null) { diff --git a/lib/services/pharmacy_services/pharmacyAddress_service.dart b/lib/services/pharmacy_services/pharmacyAddress_service.dart index eae5ac8c..3ff2a2d3 100644 --- a/lib/services/pharmacy_services/pharmacyAddress_service.dart +++ b/lib/services/pharmacy_services/pharmacyAddress_service.dart @@ -9,21 +9,23 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyAddressesMode class PharmacyAddressService extends BaseService{ - List get address => address; AppSharedPreferences sharedPref = AppSharedPreferences(); AppGlobal appGlobal = new AppGlobal(); AuthenticatedUser authUser = new AuthenticatedUser(); AuthProvider authProvider = new AuthProvider(); + List get address => address; List _addressList = List(); List get reviewList => _addressList; + String url =""; - - Future getAddress() async { + Future getAddress(address) async { print("step 1"); hasError = false; - await baseAppClient.getPharmacy(GET_ORDER, + url =GET_ADDRESS+"272843?fields=addresses"; + print(url); + await baseAppClient.getPharmacy(url, onSuccess: (dynamic response, int statusCode) { _addressList.clear(); response['customers'].forEach((item) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 345592d7..b21558cd 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -764,6 +764,11 @@ class TranslationBase { String get orderDate => localizedValues['orderDate'][locale.languageCode]; String get itemsNo => localizedValues['itemsNo'][locale.languageCode]; String get noOrder => localizedValues['noOrder'][locale.languageCode]; + String get review => localizedValues['review'][locale.languageCode]; + String get deliveredOrder => localizedValues['deliveredOrder'][locale.languageCode]; + String get compare => localizedValues['compare'][locale.languageCode]; + String get medicationsRefill => localizedValues['medicationsRefill'][locale.languageCode]; + String get myPrescription => localizedValues['myPrescription'][locale.languageCode]; // pharmacy module // String get medicationRefill => localizedValues['medicationRefill'][locale.languageCode]; diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart index e0182f08..f16ff7e5 100644 --- a/lib/widgets/pharmacy/product_tile.dart +++ b/lib/widgets/pharmacy/product_tile.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; + class productTile extends StatelessWidget { final String productName; final String productPrice; @@ -25,7 +26,7 @@ class productTile extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - height: 150, + height: 180, width: double.infinity, color: Colors.white, child: Column( @@ -115,7 +116,7 @@ class productTile extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Container( -// margin: EdgeInsets.all(5), + margin: EdgeInsets.only(bottom: 5.0), child: RichText( text: TextSpan( text: 'QYT: $qyt', @@ -161,68 +162,72 @@ class productTile extends StatelessWidget { ], ), ): Container(), - this.isOrderDetails == true ?Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RatingBar.readOnly( - initialRating: productRate, - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, +// this.isOrderDetails == true && model.order[0].orderStatusId == 30? + this.isOrderDetails == true? + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( +// margin: EdgeInsets.all(5.0), + child: Align( + alignment: Alignment.topLeft, + child: RatingBar.readOnly( + initialRating: productRate, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), ), ), - ), - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: TextSpan( - text: '($productReviews reviews)', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.grey, - fontSize: 13), + Container( +// margin: EdgeInsets.all(5), + child: Align( +// alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: '($productReviews reviews)', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.grey, + fontSize: 13), + ), ), ), ), - ), - InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => ProductReviewPage())); - }, - child: Container( - padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), - height: 30.0, - decoration: BoxDecoration( - border: Border.all( - color: Colors.orange, - style: BorderStyle.solid, - width: 1.0 + InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => ProductReviewPage())); + }, + child: Container( + padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), + height: 30.0, + decoration: BoxDecoration( + border: Border.all( + color: Colors.orange, + style: BorderStyle.solid, + width: 1.0 + ), + color: Colors.transparent, + borderRadius: BorderRadius.circular(5.0) + ), + child: Text( + TranslationBase.of(context).writeReview, + style: TextStyle( + fontSize:12, + color: Colors.orange, + ), ), - color: Colors.transparent, - borderRadius: BorderRadius.circular(5.0) - ), - child: Text( - TranslationBase.of(context).writeReview, - style: TextStyle( - fontSize:12, - color: Colors.orange, ), - ), ), - ), - ], - ) : Container(), + ], + ), + ) : Container(), ], ), ); From ed68eed9dfcbd2e863d204551b3565b09312e11e Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Mon, 7 Dec 2020 12:18:57 +0300 Subject: [PATCH 002/103] added links for profile --- lib/pages/landing/landing_page_pharmcy.dart | 8 +++++--- lib/pages/pharmacy/order/OrderDetails.dart | 22 ++++++++++----------- lib/pages/pharmacy/profile/profile.dart | 2 +- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index 4308e186..59492370 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/parent_categorise_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart'; import 'package:diplomaticquarterapp/pages/search_products_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -136,9 +137,10 @@ class _LandingPagePharmacyState extends State { PharmacyPage(), PharmacyCategorisePage(), OffersCategorisePage(), - Container( - child: Text('text'), - ), + PharmacyProfilePage(), +// Container( +// child: Text('text'), +// ), CartOrderPage(), ], // Please do not remove the BookingOptions from this array ), diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart index 3c6e62b1..94b1aba2 100644 --- a/lib/pages/pharmacy/order/OrderDetails.dart +++ b/lib/pages/pharmacy/order/OrderDetails.dart @@ -544,23 +544,23 @@ class _OrderDetailsPageState extends State { okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => { - cancelOrderDetail(widget.orderModel.id), +// cancelOrderDetail(widget.orderModel.id), ConfirmDialog.closeAlertDialog(context) }, cancelFunction: () => {}); dialog.showAlertDialog(context); } - cancelOrderDetail(order){ - if(widget.orderModel.canCancel && widget.orderModel.canRefund == false){ -// setState(() { - cancelOrderDetail(order); - AppToast.showSuccessToast(message: "Request Sent Successfully"); -// }); -// return OrderPage(); - } - else{} - } +// cancelOrderDetail(order){ +// if(widget.orderModel.canCancel && widget.orderModel.canRefund == false){ +//// setState(() { +// cancelOrderDetail(order); +// AppToast.showSuccessToast(message: "Request Sent Successfully"); +//// }); +//// return OrderPage(); +// } +// else{} +// } getLanguageID() async { var languageID = await sharedPref.getString(APP_LANGUAGE); diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index ec19ae8d..0336370c 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -1,6 +1,6 @@ import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; -import 'package:diplomaticquarterapp/pages/family/my-family.dart'; +import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; From 888a74fb9bf5178af8c1470b550c4110afdd55ee Mon Sep 17 00:00:00 2001 From: enadhilal Date: Mon, 7 Dec 2020 12:33:03 +0300 Subject: [PATCH 003/103] =?UTF-8?q?add=20these=20pages=20=E2=80=8BProduct?= =?UTF-8?q?=20Tile=20Component=20Product=20Detail=20Page=20=E2=80=8BWishli?= =?UTF-8?q?st=20Page=20=E2=80=8BReviews=20Page=20Brands=20Page=20+=20Searc?= =?UTF-8?q?h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/images/offer.png | Bin 0 -> 2631 bytes assets/images/offer_ar.png | Bin 0 -> 2626 bytes lib/config/config.dart | 14 +- lib/core/service/client/base_app_client.dart | 42 +- .../pharmacyModule/brand_view_model.dart | 41 + .../product_detail_view_model.dart | 43 + .../pharmacyModule/review_view_model.dart | 26 + .../pharmacyModule/wishlist_view_model.dart | 36 + lib/locator.dart | 17 + lib/models/pharmacy/Wishlist.dart | 881 +++++++++++++++++ lib/models/pharmacy/brandModel.dart | 157 ++++ lib/models/pharmacy/locationModel.dart | 159 ++++ lib/models/pharmacy/productDetailModel.dart | 249 +++++ lib/models/pharmacy/products.dart | 835 ++++++++++++++++ lib/models/pharmacy/reviewModel.dart | 803 ++++++++++++++++ lib/models/pharmacy/topBrandsModel.dart | 137 +++ lib/pages/base/base_view.dart | 7 +- lib/pages/landing/home_page.dart | 7 +- .../pharmacies/ProductCheckTypeWidget.dart | 55 ++ lib/pages/pharmacies/compare.dart | 597 ++++++++++++ lib/pages/pharmacies/my_reviews.dart | 194 ++++ lib/pages/pharmacies/product-brands.dart | 284 ++++++ lib/pages/pharmacies/product_detail.dart | 888 ++++++++++++++++++ lib/pages/pharmacies/wishlist.dart | 90 +- .../pharmacy_services/brands_service.dart | 44 + .../product_detail_service.dart | 61 ++ .../pharmacy_services/review_service.dart | 28 + .../pharmacy_services/wishList_service.dart | 74 +- lib/widgets/others/app_scaffold_widget.dart | 10 +- lib/widgets/pharmacy/product_tile.dart | 114 ++- 30 files changed, 5814 insertions(+), 79 deletions(-) create mode 100644 assets/images/offer.png create mode 100644 assets/images/offer_ar.png create mode 100644 lib/core/viewModels/pharmacyModule/brand_view_model.dart create mode 100644 lib/core/viewModels/pharmacyModule/product_detail_view_model.dart create mode 100644 lib/core/viewModels/pharmacyModule/review_view_model.dart create mode 100644 lib/core/viewModels/pharmacyModule/wishlist_view_model.dart create mode 100644 lib/models/pharmacy/Wishlist.dart create mode 100644 lib/models/pharmacy/brandModel.dart create mode 100644 lib/models/pharmacy/locationModel.dart create mode 100644 lib/models/pharmacy/productDetailModel.dart create mode 100644 lib/models/pharmacy/products.dart create mode 100644 lib/models/pharmacy/reviewModel.dart create mode 100644 lib/models/pharmacy/topBrandsModel.dart create mode 100644 lib/pages/pharmacies/ProductCheckTypeWidget.dart create mode 100644 lib/pages/pharmacies/compare.dart create mode 100644 lib/pages/pharmacies/my_reviews.dart create mode 100644 lib/pages/pharmacies/product-brands.dart create mode 100644 lib/pages/pharmacies/product_detail.dart create mode 100644 lib/services/pharmacy_services/brands_service.dart create mode 100644 lib/services/pharmacy_services/product_detail_service.dart create mode 100644 lib/services/pharmacy_services/review_service.dart diff --git a/assets/images/offer.png b/assets/images/offer.png new file mode 100644 index 0000000000000000000000000000000000000000..b9977670cc0f532b5704938259829151d67ed875 GIT binary patch literal 2631 zcmV-N3b^%&P)q$q3BLTds|Vv;z-O}rJ3 z78#THx)<9!)jvLGIXgbPJ7>ckC*62w9*jdAKQ3|bzKw|PH063t*>A3M&E|Ye9h`NRD9^oR>WFufOa*`90C4N7uM-g!=b$?gFea~IUhg+dtGmW7 zd1o$@9t!#(sg8IjF*Y^)rXY`}eI0=a#UAo=A92e)9yYBT5Tmmz9UoggoPY1CuM=^Z z@0KpAx+*9UQp8CSC-7An1X3OGHkZNU9*w>L=WlK~`?C+@YTjhn?aAr?SAGm>HQ=mctXPx!KL8iwKRHk z)74;XTn9}{mq6^sbyvQ%3gWweb3u3`|U$8dhiM1XhjB&g0HF3aitq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5XR>6lx*9@{mxLjh2xh@+oS2ARYKsOE* ze4RsfLTN*2^u~a%%i{4)YY@QIHX&*UAtK-nybaSjUW-0Mh+yHF2*e82i{zg}?RVWQOUeD2L+FJ{9-)V$2g0z>fbdjD pAo>9B*W8)Qq_vn#3ZW1H@PD47K5?G}_gVk|002ovPDHLkV1hU-3I6~9 literal 0 HcmV?d00001 diff --git a/assets/images/offer_ar.png b/assets/images/offer_ar.png new file mode 100644 index 0000000000000000000000000000000000000000..1fdbf749c13f25315123508b1935dc771cc382d6 GIT binary patch literal 2626 zcmV-I3cdA-P) z1bk^6nOes7o$dR{ZS|I!&D`GJ-R|w|?%a7l$(1%7t3;@G&_hW$g5tgO#v(xX20hhm4YczUV}tqyJH&)H}$r^*;7#m)ldqcvqYnn;L$dg^xKx!{iajG|@{)akN>~Ix#x? zx5;J`cilKPfF5#MRaIMF3cV|a!$|CgOekSU*@&_GcvrmJ;NI;Ty$suLlV<;R?06dz zLRD4Eo=TDx98f60`*WFeZ;)AZ2}I1r8KbW!QyW*@I5wa)r>bhmO1n6S2mu};hh}n_ zbS%g$asZ>?*?E1n+t;028UYxyemcR z&Sj(2Gb{)qn1pSvD0r_ip3TuKntFs> zCT)3rrs;^_mxA{LW7A1`RmV9MEssF*_ol289YoAEz0u8JH-}IS)FbSmDO`~=b|Ncy zuQ7g;L~{rU9+##>=q6&RUy_x$2xKrQ`1nFLx)~;75GFTD`15TqJ?cZGM65BLEFv`pLFdyNVd*Beb5qH zT5=o-(b=~TCR2|={vQ{)UpJL6&`mCSE<(z_Op82lda%(}f3pZWBvI>~YoM5#t2&}1 zn^x&$146jM*vBB9(^o5FbnPlwuTdz(TKfo1^1D_2<>J?NTC_E#v{bbus4FK~71lV$TZ z?$7?^Aap$O^!015xdi~qiNKjT-%TIlo}g7jF))%&3|71PB!jis0Cg` zaFjue?fiu{l5mvOgZ5wlK+^=3NI;Q4_p!d+vZQvVTiI+bIBNmFN9N=^P#F0TvhSXE z^3#-oDPf=C*{)+EkVT}rfuk+dVJ&ty1AbPy_q&>UpW69!RRv$1n%B3(U%07e+m!?- z3p9G}+z{kPMj$_O844%IT#X`_5_YZ&f;>EeGa@hwydKccruP5V){0*xwcoO&&Gb0c z1TZT5|0yu#MJl z+;zP#)00}HAqoK~m=bob&xmM9j}YomO7`0x`W{60++lf&K@T$jYH7rPB)~9`wlRD7 zd0|L!>9$31Ce{k0*8pA`JWCG?M+DE)%NS~w>{kijYKb`{K-f#5s>id`g zNU?uYCaz(p!Z8)8)X7nhs?24Wd^2IKa?=Zy-#tA;hmBI3q`QJ{A`{W{loxG`q;q$bGI@Y-P1eIoD#vY zM?j>HzNOF8DA<<$^#x6}U;Ffmc1+sv)e

^SEDPjv5^m{DoxddfwmuBIarK7Im+U zZU#rsP#W)wB1}8-Dv`&##@PkuH9$}lX3f>P0Ndy}UFV&DR#Oi_3tH5_6 zm@4>Vb&0wDMhx3Tfu}@Z6+EYfm!?$ke!w-cXu9y?JO|$&7~LH>Awo$#xT%7-Z}iiK zk-i`mydS8G2&9Dl@aV0|ncqSFnLxoeJ{)BhL!l6^KK{$XsR@IS3ydxp+*ovK*oBvc z3?79ko>kEVa1X&dodRg6>y^Ngtn4B$g$U3ju;mfR!#R(VcLj>{2KN9CVc8?#^O=bb zSSRq?+XK`IOGF@VYJY`EA~}93bpWwYb!s4Q2s1uWH4#h;%?B$U;aS6b1%qj!31L|* k5}`<6&>gG+G!p>e|HhcBcl3n_`Tzg`07*qoM6N<$g2Wg0G5`Po literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index c3a47bde..936657e3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -2,12 +2,13 @@ import 'dart:io'; import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; const MAX_SMALL_SCREEN = 660; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com//'; + +const BASE_URL = 'https://hmgwebservices.com/'; +//const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/'; +const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; @@ -351,7 +352,12 @@ const GET_CMC_ORDER_DETAIL_BY_ID = const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; //Pharmacy wishlist -const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; +const GET_WISHLIST = "shopping_cart_items/"; +const GET_REVIEW = "customerreviews/"; +const GET_BRANDS = "manufacturer"; +const GET_TOP_BRANDS = "topmanufacturer?page=1&limit=8"; +const GET_PRODUCT_DETAIL = "products/"; +const GET_LOCATION = "Services/Patients.svc/REST/GetPharmcyListBySKU"; const TIMER_MIN = 10; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 11319d96..a17dcba6 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -114,7 +114,7 @@ class BaseAppClient { onFailure( parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logout(); + // logout(); } } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { @@ -141,9 +141,9 @@ class BaseAppClient { get(String endPoint, {Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - bool isAllowAny = false, - Map queryParams}) async { + Function(String error, int statusCode) onFailure, + bool isAllowAny = false, + Map queryParams}) async { String url = BASE_URL + endPoint; if (queryParams != null) { String queryString = Uri(queryParameters: queryParams).query; @@ -171,6 +171,38 @@ class BaseAppClient { } } + getPharmacy(String endPoint, + {Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + bool isAllowAny = false, + Map queryParams}) async { + String url = BASE_PHARMACY_URL + endPoint; + if (queryParams != null) { + String queryString = Uri(queryParameters: queryParams).query; + url += '?' + queryString; + } + + print("URL : $url"); + + if (await Utils.checkConnection()) { + final response = await http.get(url.trim(), headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }); + final int statusCode = response.statusCode; + print("statusCode :$statusCode"); + + if (statusCode < 200 || statusCode >= 400 || json == null) { + onFailure('Error While Fetching data', statusCode); + } else { + var parsed = json.decode(response.body.toString()); + onSuccess(parsed, statusCode); + } + } else { + onFailure('Please Check The Internet Connection', -1); + } + } + logout() async { await sharedPref.remove(LOGIN_TOKEN_ID); Navigator.of(AppGlobal.context).pushReplacementNamed(LOGIN_TYPE); @@ -180,4 +212,4 @@ class BaseAppClient { ///return id.replaceAll(RegExp('/[^\w\s]/'), ''); // return id.replaceAll(RegExp('/[^a-zA-Z ]'), ''); } -} +} \ No newline at end of file diff --git a/lib/core/viewModels/pharmacyModule/brand_view_model.dart b/lib/core/viewModels/pharmacyModule/brand_view_model.dart new file mode 100644 index 00000000..2984632b --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/brand_view_model.dart @@ -0,0 +1,41 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/brands_service.dart'; + + +import '../../../locator.dart'; + +class BrandsViewModel extends BaseViewModel{ + BrandsService _brandsService = locator(); + List get brandsListList => _brandsService.brandsList; + + BrandsService _topBrandsService = locator(); + List get topBrandsListList => _topBrandsService.topBrandsList; + + bool hasError = false; + + + Future getBrandsData() async { + hasError = false; + setState(ViewState.Busy); + await _brandsService.getBrands(); + if (_brandsService.hasError) { + error = _brandsService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getTopBrandsData() async { + hasError = false; + setState(ViewState.Busy); + await _topBrandsService.getTopBrands(); + if (_topBrandsService.hasError) { + error = _topBrandsService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} \ No newline at end of file diff --git a/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart b/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart new file mode 100644 index 00000000..aa693602 --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart @@ -0,0 +1,43 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/product_detail_service.dart'; + + +import '../../../locator.dart'; + +class ProductDetailViewModel extends BaseViewModel{ + ProductDetailService _productDetailService = locator(); + + List get productDetailService => _productDetailService.productDetailList; + + List get productLocationService => _productDetailService.productLocationList; + + bool hasError = false; + + + Future getProductReviewsData() async { + hasError = false; + setState(ViewState.Busy); + await _productDetailService.getProductReviews(); + if (_productDetailService.hasError) { + error = _productDetailService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getProductLocationData() async { + hasError = false; + setState(ViewState.Busy); + await _productDetailService.getProductAvailabiltyDetail(); + if (_productDetailService.hasError) { + error = _productDetailService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + +} \ No newline at end of file diff --git a/lib/core/viewModels/pharmacyModule/review_view_model.dart b/lib/core/viewModels/pharmacyModule/review_view_model.dart new file mode 100644 index 00000000..3661820b --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/review_view_model.dart @@ -0,0 +1,26 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/reviewModel.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/review_service.dart'; + +import '../../../locator.dart'; + +class ReviewViewModel extends BaseViewModel{ + ReviewService _reviewService = locator(); + + List get reviewListList => _reviewService.reviewList; + + bool hasError = false; + + + Future getReviewData() async { + hasError = false; + setState(ViewState.Busy); + await _reviewService.getReview(); + if (_reviewService.hasError) { + error = _reviewService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} \ No newline at end of file diff --git a/lib/core/viewModels/pharmacyModule/wishlist_view_model.dart b/lib/core/viewModels/pharmacyModule/wishlist_view_model.dart new file mode 100644 index 00000000..788b7f3c --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/wishlist_view_model.dart @@ -0,0 +1,36 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/wishList_service.dart'; + +import '../../../locator.dart'; + +class WishListViewModel extends BaseViewModel{ + WishListService _wishlistService = locator(); + + List get wishListList => _wishlistService.wishListProducts; + bool hasError = false; + + +// Future getWishlistData() async { +// setState(ViewState.Busy); +// await _wishlistService.getWishlist(); +// if (_wishlistService.hasError) { +// error = _wishlistService.error; +// setState(ViewState.Error); +// } else { +// setState(ViewState.Idle); +// } +// } + + Future getWishlistData() async { + hasError = false; + setState(ViewState.Busy); + await _wishlistService.getWishlist(); + if (_wishlistService.hasError) { + error = _wishlistService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 203bd8a0..ebf002b4 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -4,6 +4,8 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_v import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/review_service.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/wishList_service.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; @@ -80,10 +82,16 @@ import 'core/viewModels/pharmacies_view_model.dart'; import 'core/service/pharmacies_service.dart'; import 'core/service/insurance_service.dart'; import 'core/viewModels/insurance_card_View_model.dart'; +import 'core/viewModels/pharmacyModule/brand_view_model.dart'; import 'core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; +import 'core/viewModels/pharmacyModule/product_detail_view_model.dart'; +import 'core/viewModels/pharmacyModule/review_view_model.dart'; +import 'core/viewModels/pharmacyModule/wishlist_view_model.dart'; import 'core/viewModels/qr_view_model.dart'; import 'core/viewModels/vaccine_view_model.dart'; import 'core/service/vaccine_service.dart'; +import 'services/pharmacy_services/brands_service.dart'; +import 'services/pharmacy_services/product_detail_service.dart'; GetIt locator = GetIt.instance; @@ -139,6 +147,10 @@ void setupLocator() { locator.registerLazySingleton(() => PharmacyModuleService()); + locator.registerLazySingleton(() => WishListService()); + locator.registerLazySingleton(() => ReviewService()); + locator.registerLazySingleton(() => BrandsService()); + locator.registerLazySingleton(() => ProductDetailService()); /// View Model @@ -190,5 +202,10 @@ void setupLocator() { locator.registerFactory(() => PharmacyModuleViewModel()); + locator.registerFactory(() => WishListViewModel()); + locator.registerFactory(() => ReviewViewModel()); + locator.registerFactory(() => BrandsViewModel()); + locator.registerFactory(() => ProductDetailViewModel()); + } diff --git a/lib/models/pharmacy/Wishlist.dart b/lib/models/pharmacy/Wishlist.dart new file mode 100644 index 00000000..41704ede --- /dev/null +++ b/lib/models/pharmacy/Wishlist.dart @@ -0,0 +1,881 @@ +// To parse this JSON data, do +// +// final wishlist = wishlistFromJson(jsonString); + +import 'dart:convert'; + +List wishlistFromJson(String str) => List.from(json.decode(str).map((x) => Wishlist.fromJson(x))); + +String wishlistToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class Wishlist { + Wishlist({ + this.languageId, + this.id, + this.productAttributes, + this.customerEnteredPrice, + this.quantity, + this.discountAmountInclTax, + this.subtotal, + this.subtotalWithVat, + this.subtotalVatAmount, + this.subtotalVatRate, + this.currency, + this.currencyn, + this.rentalStartDateUtc, + this.rentalEndDateUtc, + this.createdOnUtc, + this.updatedOnUtc, + this.shoppingCartType, + this.productId, + this.product, + this.customerId, + this.customer, + }); + + dynamic languageId; + dynamic id; + List productAttributes; + dynamic customerEnteredPrice; + dynamic quantity; + dynamic discountAmountInclTax; + dynamic subtotal; + dynamic subtotalWithVat; + dynamic subtotalVatAmount; + dynamic subtotalVatRate; + dynamic currency; + dynamic currencyn; + dynamic rentalStartDateUtc; + dynamic rentalEndDateUtc; + dynamic createdOnUtc; + dynamic updatedOnUtc; + dynamic shoppingCartType; + dynamic productId; + dynamic product; + dynamic customerId; + Customer customer; + + factory Wishlist.fromJson(Map json) => Wishlist( + languageId: json["language_id"], + id: json["id"], + productAttributes: List.from(json["product_attributes"].map((x) => x)), + customerEnteredPrice: json["customer_entered_price"], + quantity: json["quantity"], + discountAmountInclTax: json["discount_amount_incl_tax"], + subtotal: json["subtotal"], + subtotalWithVat: json["subtotal_with_vat"], + subtotalVatAmount: json["subtotal_vat_amount"], + subtotalVatRate: json["subtotal_vat_rate"], + currency: json["currency"], + currencyn: json["currencyn"], + rentalStartDateUtc: json["rental_start_date_utc"], + rentalEndDateUtc: json["rental_end_date_utc"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + updatedOnUtc: DateTime.parse(json["updated_on_utc"]), + shoppingCartType: json["shopping_cart_type"], + productId: json["product_id"], + product: Product.fromJson(json["product"]), + customerId: json["customer_id"], + customer: Customer.fromJson(json["customer"]), + ); + + Map toJson() => { + "language_id": languageId, + "id": id, + "product_attributes": List.from(productAttributes.map((x) => x)), + "customer_entered_price": customerEnteredPrice, + "quantity": quantity, + "discount_amount_incl_tax": discountAmountInclTax, + "subtotal": subtotal, + "subtotal_with_vat": subtotalWithVat, + "subtotal_vat_amount": subtotalVatAmount, + "subtotal_vat_rate": subtotalVatRate, + "currency": currency, + "currencyn": currencyn, + "rental_start_date_utc": rentalStartDateUtc, + "rental_end_date_utc": rentalEndDateUtc, + "created_on_utc": createdOnUtc.toIso8601String(), + "updated_on_utc": updatedOnUtc.toIso8601String(), + "shopping_cart_type": shoppingCartType, + "product_id": productId, + "product": product.toJson(), + "customer_id": customerId, + "customer": customer.toJson(), + }; +} + +class Customer { + Customer({ + this.billingAddress, + this.shippingAddress, + this.addresses, + this.id, + this.username, + this.email, + this.firstName, + this.lastName, + this.languageId, + this.adminComment, + this.isTaxExempt, + this.hasShoppingCartItems, + this.active, + this.deleted, + this.isSystemAccount, + this.systemName, + this.lastIpAddress, + this.createdOnUtc, + this.lastLoginDateUtc, + this.lastActivityDateUtc, + this.registeredInStoreId, + this.roleIds, + }); + + Address billingAddress; + Address shippingAddress; + List

addresses; + String id; + String username; + String email; + dynamic firstName; + dynamic lastName; + dynamic languageId; + dynamic adminComment; + bool isTaxExempt; + bool hasShoppingCartItems; + bool active; + bool deleted; + bool isSystemAccount; + dynamic systemName; + String lastIpAddress; + DateTime createdOnUtc; + DateTime lastLoginDateUtc; + DateTime lastActivityDateUtc; + dynamic registeredInStoreId; + List roleIds; + + factory Customer.fromJson(Map json) => Customer( + billingAddress: Address.fromJson(json["billing_address"]), + shippingAddress: Address.fromJson(json["shipping_address"]), + addresses: List
.from(json["addresses"].map((x) => Address.fromJson(x))), + id: json["id"], + username: json["username"], + email: json["email"], + firstName: json["first_name"], + lastName: json["last_name"], + languageId: json["language_id"], + adminComment: json["admin_comment"], + isTaxExempt: json["is_tax_exempt"], + hasShoppingCartItems: json["has_shopping_cart_items"], + active: json["active"], + deleted: json["deleted"], + isSystemAccount: json["is_system_account"], + systemName: json["system_name"], + lastIpAddress: json["last_ip_address"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + lastLoginDateUtc: DateTime.parse(json["last_login_date_utc"]), + lastActivityDateUtc: DateTime.parse(json["last_activity_date_utc"]), + registeredInStoreId: json["registered_in_store_id"], + roleIds: List.from(json["role_ids"].map((x) => x)), + ); + + Map toJson() => { + "billing_address": billingAddress.toJson(), + "shipping_address": shippingAddress.toJson(), + "addresses": List.from(addresses.map((x) => x.toJson())), + "id": id, + "username": username, + "email": email, + "first_name": firstName, + "last_name": lastName, + "language_id": languageId, + "admin_comment": adminComment, + "is_tax_exempt": isTaxExempt, + "has_shopping_cart_items": hasShoppingCartItems, + "active": active, + "deleted": deleted, + "is_system_account": isSystemAccount, + "system_name": systemName, + "last_ip_address": lastIpAddress, + "created_on_utc": createdOnUtc.toIso8601String(), + "last_login_date_utc": lastLoginDateUtc.toIso8601String(), + "last_activity_date_utc": lastActivityDateUtc.toIso8601String(), + "registered_in_store_id": registeredInStoreId, + "role_ids": List.from(roleIds.map((x) => x)), + }; +} + +class Address { + Address({ + this.id, + this.firstName, + this.lastName, + this.email, + this.company, + this.countryId, + this.country, + this.stateProvinceId, + this.city, + this.address1, + this.address2, + this.zipPostalCode, + this.phoneNumber, + this.faxNumber, + this.customerAttributes, + this.createdOnUtc, + this.province, + this.latLong, + }); + + String id; + FirstName firstName; + LastName lastName; + Email email; + dynamic company; + dynamic countryId; + Country country; + dynamic stateProvinceId; + City city; + String address1; + String address2; + String zipPostalCode; + String phoneNumber; + dynamic faxNumber; + String customerAttributes; + DateTime createdOnUtc; + dynamic province; + String latLong; + + factory Address.fromJson(Map json) => Address( + id: json["id"], + firstName: firstNameValues.map[json["first_name"]], + lastName: lastNameValues.map[json["last_name"]], + email: emailValues.map[json["email"]], + company: json["company"], + countryId: json["country_id"], + country: countryValues.map[json["country"]], + stateProvinceId: json["state_province_id"], + city: cityValues.map[json["city"]], + address1: json["address1"], + address2: json["address2"], + zipPostalCode: json["zip_postal_code"], + phoneNumber: json["phone_number"], + faxNumber: json["fax_number"], + customerAttributes: json["customer_attributes"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + province: json["province"], + latLong: json["lat_long"], + ); + + Map toJson() => { + "id": id, + "first_name": firstNameValues.reverse[firstName], + "last_name": lastNameValues.reverse[lastName], + "email": emailValues.reverse[email], + "company": company, + "country_id": countryId, + "country": countryValues.reverse[country], + "state_province_id": stateProvinceId, + "city": cityValues.reverse[city], + "address1": address1, + "address2": address2, + "zip_postal_code": zipPostalCode, + "phone_number": phoneNumber, + "fax_number": faxNumber, + "customer_attributes": customerAttributes, + "created_on_utc": createdOnUtc.toIso8601String(), + "province": province, + "lat_long": latLong, + }; +} + +enum City { RIYADH, AL_OYUN } + +final cityValues = EnumValues({ + "Al Oyun": City.AL_OYUN, + "Riyadh": City.RIYADH +}); + +enum Country { SAUDI_ARABIA } + +final countryValues = EnumValues({ + "Saudi Arabia": Country.SAUDI_ARABIA +}); + +enum Email { TAMER_FANASHEH_GMAIL_COM, TAMER_DASDASDAS_GMAIL_COM } + +final emailValues = EnumValues({ + "Tamer.dasdasdas@gmail.com": Email.TAMER_DASDASDAS_GMAIL_COM, + "Tamer.fanasheh@gmail.com": Email.TAMER_FANASHEH_GMAIL_COM +}); + +enum FirstName { TAMER, TAMER_FANASHEH } + +final firstNameValues = EnumValues({ + "TAMER": FirstName.TAMER, + "TAMER FANASHEH": FirstName.TAMER_FANASHEH +}); + +enum LastName { FANASHEH, MUSA } + +final lastNameValues = EnumValues({ + "FANASHEH": LastName.FANASHEH, + "MUSA": LastName.MUSA +}); + +class Product { + Product({ + this.id, + this.visibleIndividually, + this.name, + this.namen, + this.localizedNames, + this.shortDescription, + this.shortDescriptionn, + this.fullDescription, + this.fullDescriptionn, + this.markasNew, + this.showOnHomePage, + this.metaKeywords, + this.metaDescription, + this.metaTitle, + this.allowCustomerReviews, + this.approvedRatingSum, + this.notApprovedRatingSum, + this.approvedTotalReviews, + this.notApprovedTotalReviews, + this.sku, + this.isRx, + this.prescriptionRequired, + this.rxMessage, + this.rxMessagen, + this.manufacturerPartNumber, + this.gtin, + this.isGiftCard, + this.requireOtherProducts, + this.automaticallyAddRequiredProducts, + this.isDownload, + this.unlimitedDownloads, + this.maxNumberOfDownloads, + this.downloadExpirationDays, + this.hasSampleDownload, + this.hasUserAgreement, + this.isRecurring, + this.recurringCycleLength, + this.recurringTotalCycles, + this.isRental, + this.rentalPriceLength, + this.isShipEnabled, + this.isFreeShipping, + this.shipSeparately, + this.additionalShippingCharge, + this.isTaxExempt, + this.isTelecommunicationsOrBroadcastingOrElectronicServices, + this.useMultipleWarehouses, + this.manageInventoryMethodId, + this.stockQuantity, + this.stockAvailability, + this.stockAvailabilityn, + this.displayStockAvailability, + this.displayStockQuantity, + this.minStockQuantity, + this.notifyAdminForQuantityBelow, + this.allowBackInStockSubscriptions, + this.orderMinimumQuantity, + this.orderMaximumQuantity, + this.allowedQuantities, + this.allowAddingOnlyExistingAttributeCombinations, + this.disableBuyButton, + this.disableWishlistButton, + this.availableForPreOrder, + this.preOrderAvailabilityStartDateTimeUtc, + this.callForPrice, + this.price, + this.oldPrice, + this.productCost, + this.specialPrice, + this.specialPriceStartDateTimeUtc, + this.specialPriceEndDateTimeUtc, + this.customerEntersPrice, + this.minimumCustomerEnteredPrice, + this.maximumCustomerEnteredPrice, + this.basepriceEnabled, + this.basepriceAmount, + this.basepriceBaseAmount, + this.hasTierPrices, + this.hasDiscountsApplied, + this.discountName, + this.discountNamen, + this.discountDescription, + this.discountDescriptionn, + this.discountPercentage, + this.currency, + this.currencyn, + this.weight, + this.length, + this.width, + this.height, + this.availableStartDateTimeUtc, + this.availableEndDateTimeUtc, + this.displayOrder, + this.published, + this.deleted, + this.createdOnUtc, + this.updatedOnUtc, + this.productType, + this.parentGroupedProductId, + this.roleIds, + this.discountIds, + this.storeIds, + this.manufacturerIds, + this.reviews, + this.images, + this.attributes, + this.specifications, + this.associatedProductIds, + this.tags, + this.vendorId, + this.seName, + }); + + String id; + bool visibleIndividually; + String name; + String namen; + List localizedNames; + String shortDescription; + String shortDescriptionn; + String fullDescription; + String fullDescriptionn; + bool markasNew; + bool showOnHomePage; + dynamic metaKeywords; + dynamic metaDescription; + dynamic metaTitle; + bool allowCustomerReviews; + dynamic approvedRatingSum; + dynamic notApprovedRatingSum; + dynamic approvedTotalReviews; + dynamic notApprovedTotalReviews; + String sku; + bool isRx; + bool prescriptionRequired; + dynamic rxMessage; + dynamic rxMessagen; + dynamic manufacturerPartNumber; + dynamic gtin; + bool isGiftCard; + bool requireOtherProducts; + bool automaticallyAddRequiredProducts; + bool isDownload; + bool unlimitedDownloads; + dynamic maxNumberOfDownloads; + dynamic downloadExpirationDays; + bool hasSampleDownload; + bool hasUserAgreement; + bool isRecurring; + dynamic recurringCycleLength; + dynamic recurringTotalCycles; + bool isRental; + dynamic rentalPriceLength; + bool isShipEnabled; + bool isFreeShipping; + bool shipSeparately; + dynamic additionalShippingCharge; + bool isTaxExempt; + bool isTelecommunicationsOrBroadcastingOrElectronicServices; + bool useMultipleWarehouses; + dynamic manageInventoryMethodId; + dynamic stockQuantity; + String stockAvailability; + String stockAvailabilityn; + bool displayStockAvailability; + bool displayStockQuantity; + dynamic minStockQuantity; + dynamic notifyAdminForQuantityBelow; + bool allowBackInStockSubscriptions; + dynamic orderMinimumQuantity; + dynamic orderMaximumQuantity; + dynamic allowedQuantities; + bool allowAddingOnlyExistingAttributeCombinations; + bool disableBuyButton; + bool disableWishlistButton; + bool availableForPreOrder; + dynamic preOrderAvailabilityStartDateTimeUtc; + bool callForPrice; + double price; + dynamic oldPrice; + double productCost; + dynamic specialPrice; + dynamic specialPriceStartDateTimeUtc; + dynamic specialPriceEndDateTimeUtc; + bool customerEntersPrice; + dynamic minimumCustomerEnteredPrice; + dynamic maximumCustomerEnteredPrice; + bool basepriceEnabled; + dynamic basepriceAmount; + dynamic basepriceBaseAmount; + bool hasTierPrices; + bool hasDiscountsApplied; + dynamic discountName; + dynamic discountNamen; + dynamic discountDescription; + dynamic discountDescriptionn; + dynamic discountPercentage; + String currency; + String currencyn; + double weight; + dynamic length; + dynamic width; + dynamic height; + dynamic availableStartDateTimeUtc; + dynamic availableEndDateTimeUtc; + dynamic displayOrder; + bool published; + bool deleted; + DateTime createdOnUtc; + DateTime updatedOnUtc; + String productType; + dynamic parentGroupedProductId; + List roleIds; + List discountIds; + List storeIds; + List manufacturerIds; + List reviews; + List images; + List attributes; + List specifications; + List associatedProductIds; + List tags; + dynamic vendorId; + String seName; + + factory Product.fromJson(Map json) => Product( + id: json["id"], + visibleIndividually: json["visible_individually"], + name: json["name"], + namen: json["namen"], + localizedNames: List.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))), + shortDescription: json["short_description"], + shortDescriptionn: json["short_descriptionn"], + fullDescription: json["full_description"], + fullDescriptionn: json["full_descriptionn"], + markasNew: json["markas_new"], + showOnHomePage: json["show_on_home_page"], + metaKeywords: json["meta_keywords"], + metaDescription: json["meta_description"], + metaTitle: json["meta_title"], + allowCustomerReviews: json["allow_customer_reviews"], + approvedRatingSum: json["approved_rating_sum"], + notApprovedRatingSum: json["not_approved_rating_sum"], + approvedTotalReviews: json["approved_total_reviews"], + notApprovedTotalReviews: json["not_approved_total_reviews"], + sku: json["sku"], + isRx: json["is_rx"], + prescriptionRequired: json["prescription_required"], + rxMessage: json["rx_message"], + rxMessagen: json["rx_messagen"], + manufacturerPartNumber: json["manufacturer_part_number"], + gtin: json["gtin"], + isGiftCard: json["is_gift_card"], + requireOtherProducts: json["require_other_products"], + automaticallyAddRequiredProducts: json["automatically_add_required_products"], + isDownload: json["is_download"], + unlimitedDownloads: json["unlimited_downloads"], + maxNumberOfDownloads: json["max_number_of_downloads"], + downloadExpirationDays: json["download_expiration_days"], + hasSampleDownload: json["has_sample_download"], + hasUserAgreement: json["has_user_agreement"], + isRecurring: json["is_recurring"], + recurringCycleLength: json["recurring_cycle_length"], + recurringTotalCycles: json["recurring_total_cycles"], + isRental: json["is_rental"], + rentalPriceLength: json["rental_price_length"], + isShipEnabled: json["is_ship_enabled"], + isFreeShipping: json["is_free_shipping"], + shipSeparately: json["ship_separately"], + additionalShippingCharge: json["additional_shipping_charge"], + isTaxExempt: json["is_tax_exempt"], + isTelecommunicationsOrBroadcastingOrElectronicServices: json["is_telecommunications_or_broadcasting_or_electronic_services"], + useMultipleWarehouses: json["use_multiple_warehouses"], + manageInventoryMethodId: json["manage_inventory_method_id"], + stockQuantity: json["stock_quantity"], + stockAvailability: json["stock_availability"], + stockAvailabilityn: json["stock_availabilityn"], + displayStockAvailability: json["display_stock_availability"], + displayStockQuantity: json["display_stock_quantity"], + minStockQuantity: json["min_stock_quantity"], + notifyAdminForQuantityBelow: json["notify_admin_for_quantity_below"], + allowBackInStockSubscriptions: json["allow_back_in_stock_subscriptions"], + orderMinimumQuantity: json["order_minimum_quantity"], + orderMaximumQuantity: json["order_maximum_quantity"], + allowedQuantities: json["allowed_quantities"], + allowAddingOnlyExistingAttributeCombinations: json["allow_adding_only_existing_attribute_combinations"], + disableBuyButton: json["disable_buy_button"], + disableWishlistButton: json["disable_wishlist_button"], + availableForPreOrder: json["available_for_pre_order"], + preOrderAvailabilityStartDateTimeUtc: json["pre_order_availability_start_date_time_utc"], + callForPrice: json["call_for_price"], + price: json["price"].toDouble(), + oldPrice: json["old_price"], + productCost: json["product_cost"].toDouble(), + specialPrice: json["special_price"], + specialPriceStartDateTimeUtc: json["special_price_start_date_time_utc"], + specialPriceEndDateTimeUtc: json["special_price_end_date_time_utc"], + customerEntersPrice: json["customer_enters_price"], + minimumCustomerEnteredPrice: json["minimum_customer_entered_price"], + maximumCustomerEnteredPrice: json["maximum_customer_entered_price"], + basepriceEnabled: json["baseprice_enabled"], + basepriceAmount: json["baseprice_amount"], + basepriceBaseAmount: json["baseprice_base_amount"], + hasTierPrices: json["has_tier_prices"], + hasDiscountsApplied: json["has_discounts_applied"], + discountName: json["discount_name"], + discountNamen: json["discount_namen"], + discountDescription: json["discount_description"], + discountDescriptionn: json["discount_Descriptionn"], + discountPercentage: json["discount_percentage"], + currency: json["currency"], + currencyn: json["currencyn"], + weight: json["weight"].toDouble(), + length: json["length"], + width: json["width"], + height: json["height"], + availableStartDateTimeUtc: json["available_start_date_time_utc"], + availableEndDateTimeUtc: json["available_end_date_time_utc"], + displayOrder: json["display_order"], + published: json["published"], + deleted: json["deleted"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + updatedOnUtc: DateTime.parse(json["updated_on_utc"]), + productType: json["product_type"], + parentGroupedProductId: json["parent_grouped_product_id"], + roleIds: List.from(json["role_ids"].map((x) => x)), + discountIds: List.from(json["discount_ids"].map((x) => x)), + storeIds: List.from(json["store_ids"].map((x) => x)), + manufacturerIds: List.from(json["manufacturer_ids"].map((x) => x)), + reviews: List.from(json["reviews"].map((x) => x)), + images: List.from(json["images"].map((x) => Image.fromJson(x))), + attributes: List.from(json["attributes"].map((x) => x)), + specifications: List.from(json["specifications"].map((x) => Specification.fromJson(x))), + associatedProductIds: List.from(json["associated_product_ids"].map((x) => x)), + tags: List.from(json["tags"].map((x) => x)), + vendorId: json["vendor_id"], + seName: json["se_name"], + ); + + Map toJson() => { + "id": id, + "visible_individually": visibleIndividually, + "name": name, + "namen": namen, + "localized_names": List.from(localizedNames.map((x) => x.toJson())), + "short_description": shortDescription, + "short_descriptionn": shortDescriptionn, + "full_description": fullDescription, + "full_descriptionn": fullDescriptionn, + "markas_new": markasNew, + "show_on_home_page": showOnHomePage, + "meta_keywords": metaKeywords, + "meta_description": metaDescription, + "meta_title": metaTitle, + "allow_customer_reviews": allowCustomerReviews, + "approved_rating_sum": approvedRatingSum, + "not_approved_rating_sum": notApprovedRatingSum, + "approved_total_reviews": approvedTotalReviews, + "not_approved_total_reviews": notApprovedTotalReviews, + "sku": sku, + "is_rx": isRx, + "prescription_required": prescriptionRequired, + "rx_message": rxMessage, + "rx_messagen": rxMessagen, + "manufacturer_part_number": manufacturerPartNumber, + "gtin": gtin, + "is_gift_card": isGiftCard, + "require_other_products": requireOtherProducts, + "automatically_add_required_products": automaticallyAddRequiredProducts, + "is_download": isDownload, + "unlimited_downloads": unlimitedDownloads, + "max_number_of_downloads": maxNumberOfDownloads, + "download_expiration_days": downloadExpirationDays, + "has_sample_download": hasSampleDownload, + "has_user_agreement": hasUserAgreement, + "is_recurring": isRecurring, + "recurring_cycle_length": recurringCycleLength, + "recurring_total_cycles": recurringTotalCycles, + "is_rental": isRental, + "rental_price_length": rentalPriceLength, + "is_ship_enabled": isShipEnabled, + "is_free_shipping": isFreeShipping, + "ship_separately": shipSeparately, + "additional_shipping_charge": additionalShippingCharge, + "is_tax_exempt": isTaxExempt, + "is_telecommunications_or_broadcasting_or_electronic_services": isTelecommunicationsOrBroadcastingOrElectronicServices, + "use_multiple_warehouses": useMultipleWarehouses, + "manage_inventory_method_id": manageInventoryMethodId, + "stock_quantity": stockQuantity, + "stock_availability": stockAvailability, + "stock_availabilityn": stockAvailabilityn, + "display_stock_availability": displayStockAvailability, + "display_stock_quantity": displayStockQuantity, + "min_stock_quantity": minStockQuantity, + "notify_admin_for_quantity_below": notifyAdminForQuantityBelow, + "allow_back_in_stock_subscriptions": allowBackInStockSubscriptions, + "order_minimum_quantity": orderMinimumQuantity, + "order_maximum_quantity": orderMaximumQuantity, + "allowed_quantities": allowedQuantities, + "allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations, + "disable_buy_button": disableBuyButton, + "disable_wishlist_button": disableWishlistButton, + "available_for_pre_order": availableForPreOrder, + "pre_order_availability_start_date_time_utc": preOrderAvailabilityStartDateTimeUtc, + "call_for_price": callForPrice, + "price": price, + "old_price": oldPrice, + "product_cost": productCost, + "special_price": specialPrice, + "special_price_start_date_time_utc": specialPriceStartDateTimeUtc, + "special_price_end_date_time_utc": specialPriceEndDateTimeUtc, + "customer_enters_price": customerEntersPrice, + "minimum_customer_entered_price": minimumCustomerEnteredPrice, + "maximum_customer_entered_price": maximumCustomerEnteredPrice, + "baseprice_enabled": basepriceEnabled, + "baseprice_amount": basepriceAmount, + "baseprice_base_amount": basepriceBaseAmount, + "has_tier_prices": hasTierPrices, + "has_discounts_applied": hasDiscountsApplied, + "discount_name": discountName, + "discount_namen": discountNamen, + "discount_description": discountDescription, + "discount_Descriptionn": discountDescriptionn, + "discount_percentage": discountPercentage, + "currency": currency, + "currencyn": currencyn, + "weight": weight, + "length": length, + "width": width, + "height": height, + "available_start_date_time_utc": availableStartDateTimeUtc, + "available_end_date_time_utc": availableEndDateTimeUtc, + "display_order": displayOrder, + "published": published, + "deleted": deleted, + "created_on_utc": createdOnUtc.toIso8601String(), + "updated_on_utc": updatedOnUtc.toIso8601String(), + "product_type": productType, + "parent_grouped_product_id": parentGroupedProductId, + "role_ids": List.from(roleIds.map((x) => x)), + "discount_ids": List.from(discountIds.map((x) => x)), + "store_ids": List.from(storeIds.map((x) => x)), + "manufacturer_ids": List.from(manufacturerIds.map((x) => x)), + "reviews": List.from(reviews.map((x) => x)), + "images": List.from(images.map((x) => x.toJson())), + "attributes": List.from(attributes.map((x) => x)), + "specifications": List.from(specifications.map((x) => x.toJson())), + "associated_product_ids": List.from(associatedProductIds.map((x) => x)), + "tags": List.from(tags.map((x) => x)), + "vendor_id": vendorId, + "se_name": seName, + }; +} + +class Image { + Image({ + this.id, + this.position, + this.src, + this.thumb, + this.attachment, + }); + + dynamic id; + dynamic position; + String src; + String thumb; + String attachment; + + factory Image.fromJson(Map json) => Image( + id: json["id"], + position: json["position"], + src: json["src"], + thumb: json["thumb"], + attachment: json["attachment"], + ); + + Map toJson() => { + "id": id, + "position": position, + "src": src, + "thumb": thumb, + "attachment": attachment, + }; +} + +class LocalizedName { + LocalizedName({ + this.languageId, + this.localizedName, + }); + + dynamic languageId; + String localizedName; + + factory LocalizedName.fromJson(Map json) => LocalizedName( + languageId: json["language_id"], + localizedName: json["localized_name"], + ); + + Map toJson() => { + "language_id": languageId, + "localized_name": localizedName, + }; +} + +class Specification { + Specification({ + this.id, + this.displayOrder, + this.defaultValue, + this.defaultValuen, + this.name, + this.nameN, + }); + + dynamic id; + dynamic displayOrder; + String defaultValue; + String defaultValuen; + String name; + String nameN; + + factory Specification.fromJson(Map json) => Specification( + id: json["id"], + displayOrder: json["display_order"], + defaultValue: json["default_value"], + defaultValuen: json["default_valuen"], + name: json["name"], + nameN: json["nameN"], + ); + + Map toJson() => { + "id": id, + "display_order": displayOrder, + "default_value": defaultValue, + "default_valuen": defaultValuen, + "name": name, + "nameN": nameN, + }; +} + +class EnumValues { + Map map; + Map reverseMap; + + EnumValues(this.map); + + Map get reverse { + if (reverseMap == null) { + reverseMap = map.map((k, v) => new MapEntry(v, k)); + } + return reverseMap; + } +} diff --git a/lib/models/pharmacy/brandModel.dart b/lib/models/pharmacy/brandModel.dart new file mode 100644 index 00000000..b20afa33 --- /dev/null +++ b/lib/models/pharmacy/brandModel.dart @@ -0,0 +1,157 @@ +// To parse this JSON data, do +// +// final brand = brandFromJson(jsonString); + +import 'dart:convert'; + +List brandFromJson(String str) => List.from(json.decode(str).map((x) => Brand.fromJson(x))); + +String brandToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class Brand { + Brand({ + this.id, + this.name, + this.namen, + this.localizedNames, + this.description, + this.manufacturerTemplateId, + this.metaKeywords, + this.metaDescription, + this.metaTitle, + this.pageSize, + this.pageSizeOptions, + this.priceRanges, + this.published, + this.deleted, + this.displayOrder, + this.createdOnUtc, + this.updatedOnUtc, + this.image, + }); + + String id; + String name; + String namen; + List localizedNames; + String description; + int manufacturerTemplateId; + String metaKeywords; + dynamic metaDescription; + dynamic metaTitle; + int pageSize; + PageSizeOptions pageSizeOptions; + dynamic priceRanges; + bool published; + bool deleted; + int displayOrder; + DateTime createdOnUtc; + DateTime updatedOnUtc; + Image image; + + factory Brand.fromJson(Map json) => Brand( + id: json["id"], + name: json["name"], + namen: json["namen"], + localizedNames: List.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))), + description: json["description"] == null ? null : json["description"], + manufacturerTemplateId: json["manufacturer_template_id"], + metaKeywords: json["meta_keywords"], + metaDescription: json["meta_description"], + metaTitle: json["meta_title"], + pageSize: json["page_size"], + pageSizeOptions: pageSizeOptionsValues.map[json["page_size_options"]], + priceRanges: json["price_ranges"], + published: json["published"], + deleted: json["deleted"], + displayOrder: json["display_order"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + updatedOnUtc: DateTime.parse(json["updated_on_utc"]), + image: json["image"] == null ? null : Image.fromJson(json["image"]), + ); + + Map toJson() => { + "id": id, + "name": name, + "namen": namen, + "localized_names": List.from(localizedNames.map((x) => x.toJson())), + "description": description == null ? null : description, + "manufacturer_template_id": manufacturerTemplateId, + "meta_keywords": metaKeywords, + "meta_description": metaDescription, + "meta_title": metaTitle, + "page_size": pageSize, + "page_size_options": pageSizeOptionsValues.reverse[pageSizeOptions], + "price_ranges": priceRanges, + "published": published, + "deleted": deleted, + "display_order": displayOrder, + "created_on_utc": createdOnUtc.toIso8601String(), + "updated_on_utc": updatedOnUtc.toIso8601String(), + "image": image == null ? null : image.toJson(), + }; +} + +class Image { + Image({ + this.src, + this.thumb, + this.attachment, + }); + + String src; + dynamic thumb; + dynamic attachment; + + factory Image.fromJson(Map json) => Image( + src: json["src"], + thumb: json["thumb"], + attachment: json["attachment"], + ); + + Map toJson() => { + "src": src, + "thumb": thumb, + "attachment": attachment, + }; +} + +class LocalizedName { + LocalizedName({ + this.languageId, + this.localizedName, + }); + + int languageId; + String localizedName; + + factory LocalizedName.fromJson(Map json) => LocalizedName( + languageId: json["language_id"], + localizedName: json["localized_name"], + ); + + Map toJson() => { + "language_id": languageId, + "localized_name": localizedName, + }; +} + +enum PageSizeOptions { THE_2460100 } + +final pageSizeOptionsValues = EnumValues({ + "24, 60, 100": PageSizeOptions.THE_2460100 +}); + +class EnumValues { + Map map; + Map reverseMap; + + EnumValues(this.map); + + Map get reverse { + if (reverseMap == null) { + reverseMap = map.map((k, v) => new MapEntry(v, k)); + } + return reverseMap; + } +} diff --git a/lib/models/pharmacy/locationModel.dart b/lib/models/pharmacy/locationModel.dart new file mode 100644 index 00000000..36ee7350 --- /dev/null +++ b/lib/models/pharmacy/locationModel.dart @@ -0,0 +1,159 @@ +// To parse this JSON data, do +// +// final locationModel = locationModelFromJson(jsonString); + +import 'dart:convert'; + +List locationModelFromJson(String str) => List.from(json.decode(str).map((x) => LocationModel.fromJson(x))); + +String locationModelToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class LocationModel { + LocationModel({ + this.expiryDate, + this.sellingPrice, + this.quantity, + this.itemId, + this.locationId, + this.projectId, + this.setupId, + this.locationDescription, + this.locationDescriptionN, + this.itemDescription, + this.itemDescriptionN, + this.alias, + this.locationTypeId, + this.barcode, + this.companybarcode, + this.cityId, + this.cityName, + this.distanceInKilometers, + this.latitude, + this.locationType, + this.longitude, + this.phoneNumber, + this.projectImageUrl, + this.sortOrder, + }); + + ExpiryDate expiryDate; + double sellingPrice; + int quantity; + int itemId; + int locationId; + int projectId; + String setupId; + String locationDescription; + dynamic locationDescriptionN; + ItemDescription itemDescription; + dynamic itemDescriptionN; + Alias alias; + int locationTypeId; + int barcode; + dynamic companybarcode; + int cityId; + CityName cityName; + int distanceInKilometers; + String latitude; + int locationType; + String longitude; + String phoneNumber; + String projectImageUrl; + int sortOrder; + + factory LocationModel.fromJson(Map json) => LocationModel( + expiryDate: expiryDateValues.map[json["ExpiryDate"]], + sellingPrice: json["SellingPrice"].toDouble(), + quantity: json["Quantity"], + itemId: json["ItemID"], + locationId: json["LocationID"], + projectId: json["ProjectID"], + setupId: json["SetupID"], + locationDescription: json["LocationDescription"], + locationDescriptionN: json["LocationDescriptionN"], + itemDescription: itemDescriptionValues.map[json["ItemDescription"]], + itemDescriptionN: json["ItemDescriptionN"], + alias: aliasValues.map[json["Alias"]], + locationTypeId: json["LocationTypeID"], + barcode: json["Barcode"], + companybarcode: json["Companybarcode"], + cityId: json["CityID"], + cityName: cityNameValues.map[json["CityName"]], + distanceInKilometers: json["DistanceInKilometers"], + latitude: json["Latitude"], + locationType: json["LocationType"], + longitude: json["Longitude"], + phoneNumber: json["PhoneNumber"], + projectImageUrl: json["ProjectImageURL"], + sortOrder: json["SortOrder"], + ); + + Map toJson() => { + "ExpiryDate": expiryDateValues.reverse[expiryDate], + "SellingPrice": sellingPrice, + "Quantity": quantity, + "ItemID": itemId, + "LocationID": locationId, + "ProjectID": projectId, + "SetupID": setupId, + "LocationDescription": locationDescription, + "LocationDescriptionN": locationDescriptionN, + "ItemDescription": itemDescriptionValues.reverse[itemDescription], + "ItemDescriptionN": itemDescriptionN, + "Alias": aliasValues.reverse[alias], + "LocationTypeID": locationTypeId, + "Barcode": barcode, + "Companybarcode": companybarcode, + "CityID": cityId, + "CityName": cityNameValues.reverse[cityName], + "DistanceInKilometers": distanceInKilometers, + "Latitude": latitude, + "LocationType": locationType, + "Longitude": longitude, + "PhoneNumber": phoneNumber, + "ProjectImageURL": projectImageUrl, + "SortOrder": sortOrder, + }; +} + +enum Alias { CAPSULE } + +final aliasValues = EnumValues({ + "CAPSULE": Alias.CAPSULE +}); + +enum CityName { RIYADH, KHOBAR, QASSIM } + +final cityNameValues = EnumValues({ + "Khobar": CityName.KHOBAR, + "Qassim": CityName.QASSIM, + "Riyadh": CityName.RIYADH +}); + +enum ExpiryDate { DATE_16223220000000300, DATE_16250004000000300, DATE_16538580000000300 } + +final expiryDateValues = EnumValues({ + "/Date(1622322000000+0300)/": ExpiryDate.DATE_16223220000000300, + "/Date(1625000400000+0300)/": ExpiryDate.DATE_16250004000000300, + "/Date(1653858000000+0300)/": ExpiryDate.DATE_16538580000000300 +}); + +enum ItemDescription { XERACTAN_20_MG_CAP_30_S } + +final itemDescriptionValues = EnumValues({ + "XERACTAN 20 MG CAP 30'S": ItemDescription.XERACTAN_20_MG_CAP_30_S +}); + +class EnumValues { + Map map; + Map reverseMap; + + EnumValues(this.map); + + Map get reverse { + if (reverseMap == null) { + reverseMap = map.map((k, v) => new MapEntry(v, k)); + } + return reverseMap; + } +} diff --git a/lib/models/pharmacy/productDetailModel.dart b/lib/models/pharmacy/productDetailModel.dart new file mode 100644 index 00000000..d2e8f010 --- /dev/null +++ b/lib/models/pharmacy/productDetailModel.dart @@ -0,0 +1,249 @@ +// To parse this JSON data, do +// +// final productDetail = productDetailFromJson(jsonString); + +import 'dart:convert'; + +List productDetailFromJson(String str) => List.from(json.decode(str).map((x) => ProductDetail.fromJson(x))); + +String productDetailToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class ProductDetail { + ProductDetail({ + this.reviews, + }); + + List reviews; + + factory ProductDetail.fromJson(Map json) => ProductDetail( + reviews: List.from(json["reviews"].map((x) => Review.fromJson(x))), + ); + + Map toJson() => { + "reviews": List.from(reviews.map((x) => x.toJson())), + }; +} + +class Review { + Review({ + this.id, + this.position, + this.reviewId, + this.customerId, + this.productId, + this.storeId, + this.isApproved, + this.title, + this.reviewText, + this.replyText, + this.rating, + this.helpfulYesTotal, + this.helpfulNoTotal, + this.createdOnUtc, + this.customer, + this.product, + }); + + int id; + int position; + int reviewId; + int customerId; + int productId; + int storeId; + bool isApproved; + String title; + String reviewText; + dynamic replyText; + int rating; + int helpfulYesTotal; + int helpfulNoTotal; + DateTime createdOnUtc; + Customer customer; + dynamic product; + + factory Review.fromJson(Map json) => Review( + id: json["id"], + position: json["position"], + reviewId: json["review_id"], + customerId: json["customer_id"], + productId: json["product_id"], + storeId: json["store_id"], + isApproved: json["is_approved"], + title: json["title"], + reviewText: json["review_text"], + replyText: json["reply_text"], + rating: json["rating"], + helpfulYesTotal: json["helpful_yes_total"], + helpfulNoTotal: json["helpful_no_total"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + customer: Customer.fromJson(json["customer"]), + product: json["product"], + ); + + Map toJson() => { + "id": id, + "position": position, + "review_id": reviewId, + "customer_id": customerId, + "product_id": productId, + "store_id": storeId, + "is_approved": isApproved, + "title": title, + "review_text": reviewText, + "reply_text": replyText, + "rating": rating, + "helpful_yes_total": helpfulYesTotal, + "helpful_no_total": helpfulNoTotal, + "created_on_utc": createdOnUtc.toIso8601String(), + "customer": customer.toJson(), + "product": product, + }; +} + +class Customer { + Customer({ + this.fileNumber, + this.iqamaNumber, + this.isOutSa, + this.patientType, + this.gender, + this.birthDate, + this.phone, + this.countryCode, + this.yahalaAccountno, + this.billingAddress, + this.shippingAddress, + this.id, + this.username, + this.email, + this.firstName, + this.lastName, + this.languageId, + this.adminComment, + this.isTaxExempt, + this.hasShoppingCartItems, + this.active, + this.deleted, + this.isSystemAccount, + this.systemName, + this.lastIpAddress, + this.createdOnUtc, + this.lastLoginDateUtc, + this.lastActivityDateUtc, + this.registeredInStoreId, + }); + + dynamic fileNumber; + dynamic iqamaNumber; + int isOutSa; + int patientType; + dynamic gender; + DateTime birthDate; + dynamic phone; + dynamic countryCode; + dynamic yahalaAccountno; + dynamic billingAddress; + dynamic shippingAddress; + String id; + Email username; + Email email; + dynamic firstName; + dynamic lastName; + dynamic languageId; + dynamic adminComment; + dynamic isTaxExempt; + dynamic hasShoppingCartItems; + dynamic active; + dynamic deleted; + dynamic isSystemAccount; + dynamic systemName; + dynamic lastIpAddress; + dynamic createdOnUtc; + dynamic lastLoginDateUtc; + dynamic lastActivityDateUtc; + dynamic registeredInStoreId; + + factory Customer.fromJson(Map json) => Customer( + fileNumber: json["file_number"], + iqamaNumber: json["iqama_number"], + isOutSa: json["is_out_sa"], + patientType: json["patient_type"], + gender: json["gender"], + birthDate: DateTime.parse(json["birth_date"]), + phone: json["phone"], + countryCode: json["country_code"], + yahalaAccountno: json["yahala_accountno"], + billingAddress: json["billing_address"], + shippingAddress: json["shipping_address"], + id: json["id"], + username: emailValues.map[json["username"]], + email: emailValues.map[json["email"]], + firstName: json["first_name"], + lastName: json["last_name"], + languageId: json["language_id"], + adminComment: json["admin_comment"], + isTaxExempt: json["is_tax_exempt"], + hasShoppingCartItems: json["has_shopping_cart_items"], + active: json["active"], + deleted: json["deleted"], + isSystemAccount: json["is_system_account"], + systemName: json["system_name"], + lastIpAddress: json["last_ip_address"], + createdOnUtc: json["created_on_utc"], + lastLoginDateUtc: json["last_login_date_utc"], + lastActivityDateUtc: json["last_activity_date_utc"], + registeredInStoreId: json["registered_in_store_id"], + ); + + Map toJson() => { + "file_number": fileNumber, + "iqama_number": iqamaNumber, + "is_out_sa": isOutSa, + "patient_type": patientType, + "gender": gender, + "birth_date": birthDate.toIso8601String(), + "phone": phone, + "country_code": countryCode, + "yahala_accountno": yahalaAccountno, + "billing_address": billingAddress, + "shipping_address": shippingAddress, + "id": id, + "username": emailValues.reverse[username], + "email": emailValues.reverse[email], + "first_name": firstName, + "last_name": lastName, + "language_id": languageId, + "admin_comment": adminComment, + "is_tax_exempt": isTaxExempt, + "has_shopping_cart_items": hasShoppingCartItems, + "active": active, + "deleted": deleted, + "is_system_account": isSystemAccount, + "system_name": systemName, + "last_ip_address": lastIpAddress, + "created_on_utc": createdOnUtc, + "last_login_date_utc": lastLoginDateUtc, + "last_activity_date_utc": lastActivityDateUtc, + "registered_in_store_id": registeredInStoreId, + }; +} + +enum Email { STEVE_GATES_NOP_COMMERCE_COM } + +final emailValues = EnumValues({ + "steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM +}); + +class EnumValues { + Map map; + Map reverseMap; + + EnumValues(this.map); + + Map get reverse { + if (reverseMap == null) { + reverseMap = map.map((k, v) => new MapEntry(v, k)); + } + return reverseMap; + } +} diff --git a/lib/models/pharmacy/products.dart b/lib/models/pharmacy/products.dart new file mode 100644 index 00000000..b4833c64 --- /dev/null +++ b/lib/models/pharmacy/products.dart @@ -0,0 +1,835 @@ +// To parse this JSON data, do +// +// final products = productsFromJson(jsonString); + +import 'dart:convert'; + +Products productsFromJson(String str) => Products.fromJson(json.decode(str)); + +String productsToJson(Products data) => json.encode(data.toJson()); + +class Products { + Products({ + this.messageStatus, + this.products, + }); + + dynamic messageStatus; + List products; + + factory Products.fromJson(Map json) => Products( + messageStatus: json["MessageStatus"], + products: List.from(json["products"].map((x) => Product.fromJson(x))), + ); + + Map toJson() => { + "MessageStatus": messageStatus, + "products": List.from(products.map((x) => x.toJson())), + }; +} + +class Product { + Product({ + this.id, + this.visibleIndividually, + this.name, + this.namen, + this.localizedNames, + this.shortDescription, + this.shortDescriptionn, + this.fullDescription, + this.fullDescriptionn, + this.markasNew, + this.showOnHomePage, + this.metaKeywords, + this.metaDescription, + this.metaTitle, + this.allowCustomerReviews, + this.approvedRatingSum, + this.notApprovedRatingSum, + this.approvedTotalReviews, + this.notApprovedTotalReviews, + this.sku, + this.isRx, + this.prescriptionRequired, + this.rxMessage, + this.rxMessagen, + this.manufacturerPartNumber, + this.gtin, + this.isGiftCard, + this.requireOtherProducts, + this.automaticallyAddRequiredProducts, + this.isDownload, + this.unlimitedDownloads, + this.maxNumberOfDownloads, + this.downloadExpirationDays, + this.hasSampleDownload, + this.hasUserAgreement, + this.isRecurring, + this.recurringCycleLength, + this.recurringTotalCycles, + this.isRental, + this.rentalPriceLength, + this.isShipEnabled, + this.isFreeShipping, + this.shipSeparately, + this.additionalShippingCharge, + this.isTaxExempt, + this.isTelecommunicationsOrBroadcastingOrElectronicServices, + this.useMultipleWarehouses, + this.manageInventoryMethodId, + this.stockQuantity, + this.stockAvailability, + this.stockAvailabilityn, + this.displayStockAvailability, + this.displayStockQuantity, + this.minStockQuantity, + this.notifyAdminForQuantityBelow, + this.allowBackInStockSubscriptions, + this.orderMinimumQuantity, + this.orderMaximumQuantity, + this.allowedQuantities, + this.allowAddingOnlyExistingAttributeCombinations, + this.disableBuyButton, + this.disableWishlistButton, + this.availableForPreOrder, + this.preOrderAvailabilityStartDateTimeUtc, + this.callForPrice, + this.price, + this.oldPrice, + this.productCost, + this.specialPrice, + this.specialPriceStartDateTimeUtc, + this.specialPriceEndDateTimeUtc, + this.customerEntersPrice, + this.minimumCustomerEnteredPrice, + this.maximumCustomerEnteredPrice, + this.basepriceEnabled, + this.basepriceAmount, + this.basepriceBaseAmount, + this.hasTierPrices, + this.hasDiscountsApplied, + this.discountName, + this.discountNamen, + this.discountDescription, + this.discountDescriptionn, + this.discountPercentage, + this.currency, + this.currencyn, + this.weight, + this.length, + this.width, + this.height, + this.availableStartDateTimeUtc, + this.availableEndDateTimeUtc, + this.displayOrder, + this.published, + this.deleted, + this.createdOnUtc, + this.updatedOnUtc, + this.productType, + this.parentGroupedProductId, + this.roleIds, + this.discountIds, + this.storeIds, + this.manufacturerIds, + this.reviews, + this.images, + this.attributes, + this.specifications, + this.associatedProductIds, + this.tags, + this.vendorId, + this.seName, + }); + + String id; + bool visibleIndividually; + String name; + String namen; + List localizedNames; + String shortDescription; + String shortDescriptionn; + String fullDescription; + String fullDescriptionn; + bool markasNew; + bool showOnHomePage; + String metaKeywords; + String metaDescription; + String metaTitle; + bool allowCustomerReviews; + int approvedRatingSum; + int notApprovedRatingSum; + int approvedTotalReviews; + int notApprovedTotalReviews; + String sku; + bool isRx; + bool prescriptionRequired; + String rxMessage; + String rxMessagen; + dynamic manufacturerPartNumber; + dynamic gtin; + bool isGiftCard; + bool requireOtherProducts; + bool automaticallyAddRequiredProducts; + bool isDownload; + bool unlimitedDownloads; + int maxNumberOfDownloads; + dynamic downloadExpirationDays; + bool hasSampleDownload; + bool hasUserAgreement; + bool isRecurring; + int recurringCycleLength; + int recurringTotalCycles; + bool isRental; + int rentalPriceLength; + bool isShipEnabled; + bool isFreeShipping; + bool shipSeparately; + int additionalShippingCharge; + bool isTaxExempt; + bool isTelecommunicationsOrBroadcastingOrElectronicServices; + bool useMultipleWarehouses; + int manageInventoryMethodId; + int stockQuantity; + String stockAvailability; + String stockAvailabilityn; + bool displayStockAvailability; + bool displayStockQuantity; + int minStockQuantity; + int notifyAdminForQuantityBelow; + bool allowBackInStockSubscriptions; + int orderMinimumQuantity; + int orderMaximumQuantity; + dynamic allowedQuantities; + bool allowAddingOnlyExistingAttributeCombinations; + bool disableBuyButton; + bool disableWishlistButton; + bool availableForPreOrder; + dynamic preOrderAvailabilityStartDateTimeUtc; + bool callForPrice; + double price; + int oldPrice; + double productCost; + dynamic specialPrice; + dynamic specialPriceStartDateTimeUtc; + dynamic specialPriceEndDateTimeUtc; + bool customerEntersPrice; + int minimumCustomerEnteredPrice; + int maximumCustomerEnteredPrice; + bool basepriceEnabled; + int basepriceAmount; + int basepriceBaseAmount; + bool hasTierPrices; + bool hasDiscountsApplied; + String discountName; + String discountNamen; + String discountDescription; + String discountDescriptionn; + String discountPercentage; + String currency; + String currencyn; + double weight; + int length; + int width; + int height; + dynamic availableStartDateTimeUtc; + dynamic availableEndDateTimeUtc; + int displayOrder; + bool published; + bool deleted; + DateTime createdOnUtc; + DateTime updatedOnUtc; + String productType; + int parentGroupedProductId; + List roleIds; + List discountIds; + List storeIds; + List manufacturerIds; + List reviews; + List images; + List attributes; + List specifications; + List associatedProductIds; + List tags; + int vendorId; + String seName; + + factory Product.fromJson(Map json) => Product( + id: json["id"], + visibleIndividually: json["visible_individually"], + name: json["name"], + namen: json["namen"], + localizedNames: List.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))), + shortDescription: json["short_description"] == null ? null : json["short_description"], + shortDescriptionn: json["short_descriptionn"] == null ? null : json["short_descriptionn"], + fullDescription: json["full_description"], + fullDescriptionn: json["full_descriptionn"], + markasNew: json["markas_new"], + showOnHomePage: json["show_on_home_page"], + metaKeywords: json["meta_keywords"] == null ? null : json["meta_keywords"], + metaDescription: json["meta_description"] == null ? null : json["meta_description"], + metaTitle: json["meta_title"] == null ? null : json["meta_title"], + allowCustomerReviews: json["allow_customer_reviews"], + approvedRatingSum: json["approved_rating_sum"], + notApprovedRatingSum: json["not_approved_rating_sum"], + approvedTotalReviews: json["approved_total_reviews"], + notApprovedTotalReviews: json["not_approved_total_reviews"], + sku: json["sku"], + isRx: json["is_rx"], + prescriptionRequired: json["prescription_required"], + rxMessage: json["rx_message"] == null ? null : json["rx_message"], + rxMessagen: json["rx_messagen"] == null ? null : json["rx_messagen"], + manufacturerPartNumber: json["manufacturer_part_number"], + gtin: json["gtin"], + isGiftCard: json["is_gift_card"], + requireOtherProducts: json["require_other_products"], + automaticallyAddRequiredProducts: json["automatically_add_required_products"], + isDownload: json["is_download"], + unlimitedDownloads: json["unlimited_downloads"], + maxNumberOfDownloads: json["max_number_of_downloads"], + downloadExpirationDays: json["download_expiration_days"], + hasSampleDownload: json["has_sample_download"], + hasUserAgreement: json["has_user_agreement"], + isRecurring: json["is_recurring"], + recurringCycleLength: json["recurring_cycle_length"], + recurringTotalCycles: json["recurring_total_cycles"], + isRental: json["is_rental"], + rentalPriceLength: json["rental_price_length"], + isShipEnabled: json["is_ship_enabled"], + isFreeShipping: json["is_free_shipping"], + shipSeparately: json["ship_separately"], + additionalShippingCharge: json["additional_shipping_charge"], + isTaxExempt: json["is_tax_exempt"], + isTelecommunicationsOrBroadcastingOrElectronicServices: json["is_telecommunications_or_broadcasting_or_electronic_services"], + useMultipleWarehouses: json["use_multiple_warehouses"], + manageInventoryMethodId: json["manage_inventory_method_id"], + stockQuantity: json["stock_quantity"], + stockAvailability: json["stock_availability"], + stockAvailabilityn: json["stock_availabilityn"], + displayStockAvailability: json["display_stock_availability"], + displayStockQuantity: json["display_stock_quantity"], + minStockQuantity: json["min_stock_quantity"], + notifyAdminForQuantityBelow: json["notify_admin_for_quantity_below"], + allowBackInStockSubscriptions: json["allow_back_in_stock_subscriptions"], + orderMinimumQuantity: json["order_minimum_quantity"], + orderMaximumQuantity: json["order_maximum_quantity"], + allowedQuantities: json["allowed_quantities"], + allowAddingOnlyExistingAttributeCombinations: json["allow_adding_only_existing_attribute_combinations"], + disableBuyButton: json["disable_buy_button"], + disableWishlistButton: json["disable_wishlist_button"], + availableForPreOrder: json["available_for_pre_order"], + preOrderAvailabilityStartDateTimeUtc: json["pre_order_availability_start_date_time_utc"], + callForPrice: json["call_for_price"], + price: json["price"].toDouble(), + oldPrice: json["old_price"], + productCost: json["product_cost"].toDouble(), + specialPrice: json["special_price"], + specialPriceStartDateTimeUtc: json["special_price_start_date_time_utc"], + specialPriceEndDateTimeUtc: json["special_price_end_date_time_utc"], + customerEntersPrice: json["customer_enters_price"], + minimumCustomerEnteredPrice: json["minimum_customer_entered_price"], + maximumCustomerEnteredPrice: json["maximum_customer_entered_price"], + basepriceEnabled: json["baseprice_enabled"], + basepriceAmount: json["baseprice_amount"], + basepriceBaseAmount: json["baseprice_base_amount"], + hasTierPrices: json["has_tier_prices"], + hasDiscountsApplied: json["has_discounts_applied"], + discountName: json["discount_name"] == null ? null : json["discount_name"], + discountNamen: json["discount_namen"] == null ? null : json["discount_namen"], + discountDescription: json["discount_description"] == null ? null : json["discount_description"], + discountDescriptionn: json["discount_Descriptionn"] == null ? null : json["discount_Descriptionn"], + discountPercentage: json["discount_percentage"] == null ? null : json["discount_percentage"], + currency: json["currency"], + currencyn: json["currencyn"], + weight: json["weight"].toDouble(), + length: json["length"], + width: json["width"], + height: json["height"], + availableStartDateTimeUtc: json["available_start_date_time_utc"], + availableEndDateTimeUtc: json["available_end_date_time_utc"], + displayOrder: json["display_order"], + published: json["published"], + deleted: json["deleted"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + updatedOnUtc: DateTime.parse(json["updated_on_utc"]), + productType: json["product_type"], + parentGroupedProductId: json["parent_grouped_product_id"], + roleIds: List.from(json["role_ids"].map((x) => x)), + discountIds: List.from(json["discount_ids"].map((x) => x)), + storeIds: List.from(json["store_ids"].map((x) => x)), + manufacturerIds: List.from(json["manufacturer_ids"].map((x) => x)), + reviews: List.from(json["reviews"].map((x) => Review.fromJson(x))), + images: List.from(json["images"].map((x) => Image.fromJson(x))), + attributes: List.from(json["attributes"].map((x) => x)), + specifications: List.from(json["specifications"].map((x) => Specification.fromJson(x))), + associatedProductIds: List.from(json["associated_product_ids"].map((x) => x)), + tags: List.from(json["tags"].map((x) => x)), + vendorId: json["vendor_id"], + seName: json["se_name"], + ); + + Map toJson() => { + "id": id, + "visible_individually": visibleIndividually, + "name": name, + "namen": namen, + "localized_names": List.from(localizedNames.map((x) => x.toJson())), + "short_description": shortDescription == null ? null : shortDescription, + "short_descriptionn": shortDescriptionn == null ? null : shortDescriptionn, + "full_description": fullDescription, + "full_descriptionn": fullDescriptionn, + "markas_new": markasNew, + "show_on_home_page": showOnHomePage, + "meta_keywords": metaKeywords == null ? null : metaKeywords, + "meta_description": metaDescription == null ? null : metaDescription, + "meta_title": metaTitle == null ? null : metaTitle, + "allow_customer_reviews": allowCustomerReviews, + "approved_rating_sum": approvedRatingSum, + "not_approved_rating_sum": notApprovedRatingSum, + "approved_total_reviews": approvedTotalReviews, + "not_approved_total_reviews": notApprovedTotalReviews, + "sku": sku, + "is_rx": isRx, + "prescription_required": prescriptionRequired, + "rx_message": rxMessage == null ? null : rxMessage, + "rx_messagen": rxMessagen == null ? null : rxMessagen, + "manufacturer_part_number": manufacturerPartNumber, + "gtin": gtin, + "is_gift_card": isGiftCard, + "require_other_products": requireOtherProducts, + "automatically_add_required_products": automaticallyAddRequiredProducts, + "is_download": isDownload, + "unlimited_downloads": unlimitedDownloads, + "max_number_of_downloads": maxNumberOfDownloads, + "download_expiration_days": downloadExpirationDays, + "has_sample_download": hasSampleDownload, + "has_user_agreement": hasUserAgreement, + "is_recurring": isRecurring, + "recurring_cycle_length": recurringCycleLength, + "recurring_total_cycles": recurringTotalCycles, + "is_rental": isRental, + "rental_price_length": rentalPriceLength, + "is_ship_enabled": isShipEnabled, + "is_free_shipping": isFreeShipping, + "ship_separately": shipSeparately, + "additional_shipping_charge": additionalShippingCharge, + "is_tax_exempt": isTaxExempt, + "is_telecommunications_or_broadcasting_or_electronic_services": isTelecommunicationsOrBroadcastingOrElectronicServices, + "use_multiple_warehouses": useMultipleWarehouses, + "manage_inventory_method_id": manageInventoryMethodId, + "stock_quantity": stockQuantity, + "stock_availability": stockAvailability, + "stock_availabilityn": stockAvailabilityn, + "display_stock_availability": displayStockAvailability, + "display_stock_quantity": displayStockQuantity, + "min_stock_quantity": minStockQuantity, + "notify_admin_for_quantity_below": notifyAdminForQuantityBelow, + "allow_back_in_stock_subscriptions": allowBackInStockSubscriptions, + "order_minimum_quantity": orderMinimumQuantity, + "order_maximum_quantity": orderMaximumQuantity, + "allowed_quantities": allowedQuantities, + "allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations, + "disable_buy_button": disableBuyButton, + "disable_wishlist_button": disableWishlistButton, + "available_for_pre_order": availableForPreOrder, + "pre_order_availability_start_date_time_utc": preOrderAvailabilityStartDateTimeUtc, + "call_for_price": callForPrice, + "price": price, + "old_price": oldPrice, + "product_cost": productCost, + "special_price": specialPrice, + "special_price_start_date_time_utc": specialPriceStartDateTimeUtc, + "special_price_end_date_time_utc": specialPriceEndDateTimeUtc, + "customer_enters_price": customerEntersPrice, + "minimum_customer_entered_price": minimumCustomerEnteredPrice, + "maximum_customer_entered_price": maximumCustomerEnteredPrice, + "baseprice_enabled": basepriceEnabled, + "baseprice_amount": basepriceAmount, + "baseprice_base_amount": basepriceBaseAmount, + "has_tier_prices": hasTierPrices, + "has_discounts_applied": hasDiscountsApplied, + "discount_name": discountName == null ? null : discountName, + "discount_namen": discountNamen == null ? null : discountNamen, + "discount_description": discountDescription == null ? null : discountDescription, + "discount_Descriptionn": discountDescriptionn == null ? null : discountDescriptionn, + "discount_percentage": discountPercentage == null ? null : discountPercentage, + "currency": currency, + "currencyn": currencyn, + "weight": weight, + "length": length, + "width": width, + "height": height, + "available_start_date_time_utc": availableStartDateTimeUtc, + "available_end_date_time_utc": availableEndDateTimeUtc, + "display_order": displayOrder, + "published": published, + "deleted": deleted, + "created_on_utc": createdOnUtc.toIso8601String(), + "updated_on_utc": updatedOnUtc.toIso8601String(), + "product_type": productType, + "parent_grouped_product_id": parentGroupedProductId, + "role_ids": List.from(roleIds.map((x) => x)), + "discount_ids": List.from(discountIds.map((x) => x)), + "store_ids": List.from(storeIds.map((x) => x)), + "manufacturer_ids": List.from(manufacturerIds.map((x) => x)), + "reviews": List.from(reviews.map((x) => x.toJson())), + "images": List.from(images.map((x) => x.toJson())), + "attributes": List.from(attributes.map((x) => x)), + "specifications": List.from(specifications.map((x) => x.toJson())), + "associated_product_ids": List.from(associatedProductIds.map((x) => x)), + "tags": List.from(tags.map((x) => x)), + "vendor_id": vendorId, + "se_name": seName, + }; +} + +class Image { + Image({ + this.id, + this.position, + this.src, + this.thumb, + this.attachment, + }); + + int id; + int position; + String src; + String thumb; + String attachment; + + factory Image.fromJson(Map json) => Image( + id: json["id"], + position: json["position"], + src: json["src"], + thumb: json["thumb"], + attachment: json["attachment"], + ); + + Map toJson() => { + "id": id, + "position": position, + "src": src, + "thumb": thumb, + "attachment": attachment, + }; +} + +class LocalizedName { + LocalizedName({ + this.languageId, + this.localizedName, + }); + + int languageId; + String localizedName; + + factory LocalizedName.fromJson(Map json) => LocalizedName( + languageId: json["language_id"], + localizedName: json["localized_name"], + ); + + Map toJson() => { + "language_id": languageId, + "localized_name": localizedName, + }; +} + +class Review { + Review({ + this.id, + this.position, + this.reviewId, + this.customerId, + this.productId, + this.storeId, + this.isApproved, + this.title, + this.reviewText, + this.replyText, + this.rating, + this.helpfulYesTotal, + this.helpfulNoTotal, + this.createdOnUtc, + this.customer, + this.product, + }); + + int id; + int position; + int reviewId; + int customerId; + int productId; + int storeId; + bool isApproved; + String title; + String reviewText; + dynamic replyText; + int rating; + int helpfulYesTotal; + int helpfulNoTotal; + DateTime createdOnUtc; + Customer customer; + dynamic product; + + factory Review.fromJson(Map json) => Review( + id: json["id"], + position: json["position"], + reviewId: json["review_id"], + customerId: json["customer_id"], + productId: json["product_id"], + storeId: json["store_id"], + isApproved: json["is_approved"], + title: json["title"], + reviewText: json["review_text"], + replyText: json["reply_text"], + rating: json["rating"], + helpfulYesTotal: json["helpful_yes_total"], + helpfulNoTotal: json["helpful_no_total"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + customer: Customer.fromJson(json["customer"]), + product: json["product"], + ); + + Map toJson() => { + "id": id, + "position": position, + "review_id": reviewId, + "customer_id": customerId, + "product_id": productId, + "store_id": storeId, + "is_approved": isApproved, + "title": title, + "review_text": reviewText, + "reply_text": replyText, + "rating": rating, + "helpful_yes_total": helpfulYesTotal, + "helpful_no_total": helpfulNoTotal, + "created_on_utc": createdOnUtc.toIso8601String(), + "customer": customer.toJson(), + "product": product, + }; +} + +class Customer { + Customer({ + this.fileNumber, + this.iqamaNumber, + this.isOutSa, + this.patientType, + this.gender, + this.birthDate, + this.phone, + this.countryCode, + this.yahalaAccountno, + this.billingAddress, + this.shippingAddress, + this.addresses, + this.id, + this.username, + this.email, + this.firstName, + this.lastName, + this.languageId, + this.adminComment, + this.isTaxExempt, + this.hasShoppingCartItems, + this.active, + this.deleted, + this.isSystemAccount, + this.systemName, + this.lastIpAddress, + this.createdOnUtc, + this.lastLoginDateUtc, + this.lastActivityDateUtc, + this.registeredInStoreId, + this.roleIds, + }); + + dynamic fileNumber; + dynamic iqamaNumber; + int isOutSa; + int patientType; + dynamic gender; + DateTime birthDate; + dynamic phone; + dynamic countryCode; + dynamic yahalaAccountno; + dynamic billingAddress; + dynamic shippingAddress; + List addresses; + String id; + Username username; + Email email; + dynamic firstName; + dynamic lastName; + dynamic languageId; + dynamic adminComment; + dynamic isTaxExempt; + dynamic hasShoppingCartItems; + dynamic active; + dynamic deleted; + dynamic isSystemAccount; + dynamic systemName; + dynamic lastIpAddress; + dynamic createdOnUtc; + dynamic lastLoginDateUtc; + dynamic lastActivityDateUtc; + dynamic registeredInStoreId; + List roleIds; + + factory Customer.fromJson(Map json) => Customer( + fileNumber: json["file_number"], + iqamaNumber: json["iqama_number"], + isOutSa: json["is_out_sa"], + patientType: json["patient_type"], + gender: json["gender"], + birthDate: DateTime.parse(json["birth_date"]), + phone: json["phone"], + countryCode: json["country_code"], + yahalaAccountno: json["yahala_accountno"], + billingAddress: json["billing_address"], + shippingAddress: json["shipping_address"], + addresses: List.from(json["addresses"].map((x) => x)), + id: json["id"], + username: usernameValues.map[json["username"]], + email: emailValues.map[json["email"]], + firstName: json["first_name"], + lastName: json["last_name"], + languageId: json["language_id"], + adminComment: json["admin_comment"], + isTaxExempt: json["is_tax_exempt"], + hasShoppingCartItems: json["has_shopping_cart_items"], + active: json["active"], + deleted: json["deleted"], + isSystemAccount: json["is_system_account"], + systemName: json["system_name"], + lastIpAddress: json["last_ip_address"], + createdOnUtc: json["created_on_utc"], + lastLoginDateUtc: json["last_login_date_utc"], + lastActivityDateUtc: json["last_activity_date_utc"], + registeredInStoreId: json["registered_in_store_id"], + roleIds: List.from(json["role_ids"].map((x) => x)), + ); + + Map toJson() => { + "file_number": fileNumber, + "iqama_number": iqamaNumber, + "is_out_sa": isOutSa, + "patient_type": patientType, + "gender": gender, + "birth_date": birthDate.toIso8601String(), + "phone": phone, + "country_code": countryCode, + "yahala_accountno": yahalaAccountno, + "billing_address": billingAddress, + "shipping_address": shippingAddress, + "addresses": List.from(addresses.map((x) => x)), + "id": id, + "username": usernameValues.reverse[username], + "email": emailValues.reverse[email], + "first_name": firstName, + "last_name": lastName, + "language_id": languageId, + "admin_comment": adminComment, + "is_tax_exempt": isTaxExempt, + "has_shopping_cart_items": hasShoppingCartItems, + "active": active, + "deleted": deleted, + "is_system_account": isSystemAccount, + "system_name": systemName, + "last_ip_address": lastIpAddress, + "created_on_utc": createdOnUtc, + "last_login_date_utc": lastLoginDateUtc, + "last_activity_date_utc": lastActivityDateUtc, + "registered_in_store_id": registeredInStoreId, + "role_ids": List.from(roleIds.map((x) => x)), + }; +} + +enum Email { MEMO17299_GMAIL_COM, STEVE_GATES_NOP_COMMERCE_COM } + +final emailValues = EnumValues({ + "Memo17299@gmail.com": Email.MEMO17299_GMAIL_COM, + "steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM +}); + +enum Username { AMAL_26, STEVE_GATES_NOP_COMMERCE_COM } + +final usernameValues = EnumValues({ + "amal_26": Username.AMAL_26, + "steve_gates@nopCommerce.com": Username.STEVE_GATES_NOP_COMMERCE_COM +}); + +class Specification { + Specification({ + this.id, + this.displayOrder, + this.defaultValue, + this.defaultValuen, + this.name, + this.nameN, + }); + + int id; + int displayOrder; + String defaultValue; + String defaultValuen; + Name name; + NameN nameN; + + factory Specification.fromJson(Map json) => Specification( + id: json["id"], + displayOrder: json["display_order"], + defaultValue: json["default_value"], + defaultValuen: json["default_valuen"], + name: nameValues.map[json["name"]], + nameN: nameNValues.map[json["nameN"]], + ); + + Map toJson() => { + "id": id, + "display_order": displayOrder, + "default_value": defaultValue, + "default_valuen": defaultValuen, + "name": nameValues.reverse[name], + "nameN": nameNValues.reverse[nameN], + }; +} + +enum Name { PRIMARY_UNIT_OF_MEASURE, BRAND, MANUFACTURER_COUNTRY_NAME, STORAGE, COMPOSITION, SPF } + +final nameValues = EnumValues({ + "BRAND": Name.BRAND, + "COMPOSITION": Name.COMPOSITION, + "MANUFACTURER COUNTRY NAME": Name.MANUFACTURER_COUNTRY_NAME, + "Primary Unit Of Measure": Name.PRIMARY_UNIT_OF_MEASURE, + "SPF": Name.SPF, + "STORAGE": Name.STORAGE +}); + +enum NameN { EMPTY, NAME_N, PURPLE, FLUFFY, TENTACLED, SPF } + +final nameNValues = EnumValues({ + "وحدة القياس الأولية": NameN.EMPTY, + "تخزين": NameN.FLUFFY, + "علامة تجارية": NameN.NAME_N, + "اسم البلد المصنع": NameN.PURPLE, + "SPF": NameN.SPF, + "المكونات": NameN.TENTACLED +}); + +class EnumValues { + Map map; + Map reverseMap; + + EnumValues(this.map); + + Map get reverse { + if (reverseMap == null) { + reverseMap = map.map((k, v) => new MapEntry(v, k)); + } + return reverseMap; + } +} diff --git a/lib/models/pharmacy/reviewModel.dart b/lib/models/pharmacy/reviewModel.dart new file mode 100644 index 00000000..da30212c --- /dev/null +++ b/lib/models/pharmacy/reviewModel.dart @@ -0,0 +1,803 @@ +// To parse this JSON data, do +// +// final review = reviewFromJson(jsonString); + +import 'dart:convert'; + +List reviewFromJson(String str) => List.from(json.decode(str).map((x) => Review.fromJson(x))); + +String reviewToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class Product { + Product({ + this.id, + this.visibleIndividually, + this.name, + this.namen, + this.localizedNames, + this.shortDescription, + this.shortDescriptionn, + this.fullDescription, + this.fullDescriptionn, + this.markasNew, + this.showOnHomePage, + this.metaKeywords, + this.metaDescription, + this.metaTitle, + this.allowCustomerReviews, + this.approvedRatingSum, + this.notApprovedRatingSum, + this.approvedTotalReviews, + this.notApprovedTotalReviews, + this.sku, + this.isRx, + this.prescriptionRequired, + this.rxMessage, + this.rxMessagen, + this.manufacturerPartNumber, + this.gtin, + this.isGiftCard, + this.requireOtherProducts, + this.automaticallyAddRequiredProducts, + this.isDownload, + this.unlimitedDownloads, + this.maxNumberOfDownloads, + this.downloadExpirationDays, + this.hasSampleDownload, + this.hasUserAgreement, + this.isRecurring, + this.recurringCycleLength, + this.recurringTotalCycles, + this.isRental, + this.rentalPriceLength, + this.isShipEnabled, + this.isFreeShipping, + this.shipSeparately, + this.additionalShippingCharge, + this.isTaxExempt, + this.isTelecommunicationsOrBroadcastingOrElectronicServices, + this.useMultipleWarehouses, + this.manageInventoryMethodId, + this.stockQuantity, + this.stockAvailability, + this.stockAvailabilityn, + this.displayStockAvailability, + this.displayStockQuantity, + this.minStockQuantity, + this.notifyAdminForQuantityBelow, + this.allowBackInStockSubscriptions, + this.orderMinimumQuantity, + this.orderMaximumQuantity, + this.allowedQuantities, + this.allowAddingOnlyExistingAttributeCombinations, + this.disableBuyButton, + this.disableWishlistButton, + this.availableForPreOrder, + this.preOrderAvailabilityStartDateTimeUtc, + this.callForPrice, + this.price, + this.oldPrice, + this.productCost, + this.specialPrice, + this.specialPriceStartDateTimeUtc, + this.specialPriceEndDateTimeUtc, + this.customerEntersPrice, + this.minimumCustomerEnteredPrice, + this.maximumCustomerEnteredPrice, + this.basepriceEnabled, + this.basepriceAmount, + this.basepriceBaseAmount, + this.hasTierPrices, + this.hasDiscountsApplied, + this.discountName, + this.discountNamen, + this.discountDescription, + this.discountDescriptionn, + this.discountPercentage, + this.currency, + this.currencyn, + this.weight, + this.length, + this.width, + this.height, + this.availableStartDateTimeUtc, + this.availableEndDateTimeUtc, + this.displayOrder, + this.published, + this.deleted, + this.createdOnUtc, + this.updatedOnUtc, + this.productType, + this.parentGroupedProductId, + this.roleIds, + this.discountIds, + this.storeIds, + this.manufacturerIds, + this.reviews, + this.images, + this.attributes, + this.specifications, + this.associatedProductIds, + this.tags, + this.vendorId, + this.seName, + }); + + String id; + bool visibleIndividually; + String name; + String namen; + List localizedNames; + String shortDescription; + String shortDescriptionn; + String fullDescription; + String fullDescriptionn; + bool markasNew; + bool showOnHomePage; + String metaKeywords; + String metaDescription; + String metaTitle; + bool allowCustomerReviews; + dynamic approvedRatingSum; + dynamic notApprovedRatingSum; + dynamic approvedTotalReviews; + dynamic notApprovedTotalReviews; + String sku; + bool isRx; + bool prescriptionRequired; + dynamic rxMessage; + dynamic rxMessagen; + dynamic manufacturerPartNumber; + dynamic gtin; + bool isGiftCard; + bool requireOtherProducts; + bool automaticallyAddRequiredProducts; + bool isDownload; + bool unlimitedDownloads; + dynamic maxNumberOfDownloads; + dynamic downloadExpirationDays; + bool hasSampleDownload; + bool hasUserAgreement; + bool isRecurring; + dynamic recurringCycleLength; + dynamic recurringTotalCycles; + bool isRental; + dynamic rentalPriceLength; + bool isShipEnabled; + bool isFreeShipping; + bool shipSeparately; + dynamic additionalShippingCharge; + bool isTaxExempt; + bool isTelecommunicationsOrBroadcastingOrElectronicServices; + bool useMultipleWarehouses; + dynamic manageInventoryMethodId; + dynamic stockQuantity; + String stockAvailability; + String stockAvailabilityn; + bool displayStockAvailability; + bool displayStockQuantity; + dynamic minStockQuantity; + dynamic notifyAdminForQuantityBelow; + bool allowBackInStockSubscriptions; + dynamic orderMinimumQuantity; + dynamic orderMaximumQuantity; + dynamic allowedQuantities; + bool allowAddingOnlyExistingAttributeCombinations; + bool disableBuyButton; + bool disableWishlistButton; + bool availableForPreOrder; + dynamic preOrderAvailabilityStartDateTimeUtc; + bool callForPrice; + dynamic price; + dynamic oldPrice; + dynamic productCost; + dynamic specialPrice; + dynamic specialPriceStartDateTimeUtc; + dynamic specialPriceEndDateTimeUtc; + bool customerEntersPrice; + dynamic minimumCustomerEnteredPrice; + dynamic maximumCustomerEnteredPrice; + bool basepriceEnabled; + dynamic basepriceAmount; + dynamic basepriceBaseAmount; + bool hasTierPrices; + bool hasDiscountsApplied; + dynamic discountName; + dynamic discountNamen; + dynamic discountDescription; + dynamic discountDescriptionn; + dynamic discountPercentage; + String currency; + String currencyn; + double weight; + dynamic length; + dynamic width; + dynamic height; + dynamic availableStartDateTimeUtc; + dynamic availableEndDateTimeUtc; + dynamic displayOrder; + bool published; + bool deleted; + DateTime createdOnUtc; + DateTime updatedOnUtc; + String productType; + dynamic parentGroupedProductId; + List roleIds; + List discountIds; + List storeIds; + List manufacturerIds; + List reviews; + List images; + List attributes; + List specifications; + List associatedProductIds; + List tags; + dynamic vendorId; + String seName; + + factory Product.fromJson(Map json) => Product( + id: json["id"], + visibleIndividually: json["visible_individually"], + name: json["name"], + namen: json["namen"], + localizedNames: List.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))), + shortDescription: json["short_description"], + shortDescriptionn: json["short_descriptionn"], + fullDescription: json["full_description"], + fullDescriptionn: json["full_descriptionn"], + markasNew: json["markas_new"], + showOnHomePage: json["show_on_home_page"], + metaKeywords: json["meta_keywords"], + metaDescription: json["meta_description"], + metaTitle: json["meta_title"], + allowCustomerReviews: json["allow_customer_reviews"], + approvedRatingSum: json["approved_rating_sum"], + notApprovedRatingSum: json["not_approved_rating_sum"], + approvedTotalReviews: json["approved_total_reviews"], + notApprovedTotalReviews: json["not_approved_total_reviews"], + sku: json["sku"], + isRx: json["is_rx"], + prescriptionRequired: json["prescription_required"], + rxMessage: json["rx_message"], + rxMessagen: json["rx_messagen"], + manufacturerPartNumber: json["manufacturer_part_number"], + gtin: json["gtin"], + isGiftCard: json["is_gift_card"], + requireOtherProducts: json["require_other_products"], + automaticallyAddRequiredProducts: json["automatically_add_required_products"], + isDownload: json["is_download"], + unlimitedDownloads: json["unlimited_downloads"], + maxNumberOfDownloads: json["max_number_of_downloads"], + downloadExpirationDays: json["download_expiration_days"], + hasSampleDownload: json["has_sample_download"], + hasUserAgreement: json["has_user_agreement"], + isRecurring: json["is_recurring"], + recurringCycleLength: json["recurring_cycle_length"], + recurringTotalCycles: json["recurring_total_cycles"], + isRental: json["is_rental"], + rentalPriceLength: json["rental_price_length"], + isShipEnabled: json["is_ship_enabled"], + isFreeShipping: json["is_free_shipping"], + shipSeparately: json["ship_separately"], + additionalShippingCharge: json["additional_shipping_charge"], + isTaxExempt: json["is_tax_exempt"], + isTelecommunicationsOrBroadcastingOrElectronicServices: json["is_telecommunications_or_broadcasting_or_electronic_services"], + useMultipleWarehouses: json["use_multiple_warehouses"], + manageInventoryMethodId: json["manage_inventory_method_id"], + stockQuantity: json["stock_quantity"], + stockAvailability: json["stock_availability"], + stockAvailabilityn: json["stock_availabilityn"], + displayStockAvailability: json["display_stock_availability"], + displayStockQuantity: json["display_stock_quantity"], + minStockQuantity: json["min_stock_quantity"], + notifyAdminForQuantityBelow: json["notify_admin_for_quantity_below"], + allowBackInStockSubscriptions: json["allow_back_in_stock_subscriptions"], + orderMinimumQuantity: json["order_minimum_quantity"], + orderMaximumQuantity: json["order_maximum_quantity"], + allowedQuantities: json["allowed_quantities"], + allowAddingOnlyExistingAttributeCombinations: json["allow_adding_only_existing_attribute_combinations"], + disableBuyButton: json["disable_buy_button"], + disableWishlistButton: json["disable_wishlist_button"], + availableForPreOrder: json["available_for_pre_order"], + preOrderAvailabilityStartDateTimeUtc: json["pre_order_availability_start_date_time_utc"], + callForPrice: json["call_for_price"], + price: json["price"], + oldPrice: json["old_price"], + productCost: json["product_cost"], + specialPrice: json["special_price"], + specialPriceStartDateTimeUtc: json["special_price_start_date_time_utc"], + specialPriceEndDateTimeUtc: json["special_price_end_date_time_utc"], + customerEntersPrice: json["customer_enters_price"], + minimumCustomerEnteredPrice: json["minimum_customer_entered_price"], + maximumCustomerEnteredPrice: json["maximum_customer_entered_price"], + basepriceEnabled: json["baseprice_enabled"], + basepriceAmount: json["baseprice_amount"], + basepriceBaseAmount: json["baseprice_base_amount"], + hasTierPrices: json["has_tier_prices"], + hasDiscountsApplied: json["has_discounts_applied"], + discountName: json["discount_name"], + discountNamen: json["discount_namen"], + discountDescription: json["discount_description"], + discountDescriptionn: json["discount_Descriptionn"], + discountPercentage: json["discount_percentage"], + currency: json["currency"], + currencyn: json["currencyn"], + weight: json["weight"].toDouble(), + length: json["length"], + width: json["width"], + height: json["height"], + availableStartDateTimeUtc: json["available_start_date_time_utc"], + availableEndDateTimeUtc: json["available_end_date_time_utc"], + displayOrder: json["display_order"], + published: json["published"], + deleted: json["deleted"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + updatedOnUtc: DateTime.parse(json["updated_on_utc"]), + productType: json["product_type"], + parentGroupedProductId: json["parent_grouped_product_id"], + roleIds: List.from(json["role_ids"].map((x) => x)), + discountIds: List.from(json["discount_ids"].map((x) => x)), + storeIds: List.from(json["store_ids"].map((x) => x)), + manufacturerIds: List.from(json["manufacturer_ids"].map((x) => x)), + reviews: List.from(json["reviews"].map((x) => Review.fromJson(x))), + images: List.from(json["images"].map((x) => Image.fromJson(x))), + attributes: List.from(json["attributes"].map((x) => x)), + specifications: List.from(json["specifications"].map((x) => Specification.fromJson(x))), + associatedProductIds: List.from(json["associated_product_ids"].map((x) => x)), + tags: List.from(json["tags"].map((x) => x)), + vendorId: json["vendor_id"], + seName: json["se_name"], + ); + + Map toJson() => { + "id": id, + "visible_individually": visibleIndividually, + "name": name, + "namen": namen, + "localized_names": List.from(localizedNames.map((x) => x.toJson())), + "short_description": shortDescription, + "short_descriptionn": shortDescriptionn, + "full_description": fullDescription, + "full_descriptionn": fullDescriptionn, + "markas_new": markasNew, + "show_on_home_page": showOnHomePage, + "meta_keywords": metaKeywords, + "meta_description": metaDescription, + "meta_title": metaTitle, + "allow_customer_reviews": allowCustomerReviews, + "approved_rating_sum": approvedRatingSum, + "not_approved_rating_sum": notApprovedRatingSum, + "approved_total_reviews": approvedTotalReviews, + "not_approved_total_reviews": notApprovedTotalReviews, + "sku": sku, + "is_rx": isRx, + "prescription_required": prescriptionRequired, + "rx_message": rxMessage, + "rx_messagen": rxMessagen, + "manufacturer_part_number": manufacturerPartNumber, + "gtin": gtin, + "is_gift_card": isGiftCard, + "require_other_products": requireOtherProducts, + "automatically_add_required_products": automaticallyAddRequiredProducts, + "is_download": isDownload, + "unlimited_downloads": unlimitedDownloads, + "max_number_of_downloads": maxNumberOfDownloads, + "download_expiration_days": downloadExpirationDays, + "has_sample_download": hasSampleDownload, + "has_user_agreement": hasUserAgreement, + "is_recurring": isRecurring, + "recurring_cycle_length": recurringCycleLength, + "recurring_total_cycles": recurringTotalCycles, + "is_rental": isRental, + "rental_price_length": rentalPriceLength, + "is_ship_enabled": isShipEnabled, + "is_free_shipping": isFreeShipping, + "ship_separately": shipSeparately, + "additional_shipping_charge": additionalShippingCharge, + "is_tax_exempt": isTaxExempt, + "is_telecommunications_or_broadcasting_or_electronic_services": isTelecommunicationsOrBroadcastingOrElectronicServices, + "use_multiple_warehouses": useMultipleWarehouses, + "manage_inventory_method_id": manageInventoryMethodId, + "stock_quantity": stockQuantity, + "stock_availability": stockAvailability, + "stock_availabilityn": stockAvailabilityn, + "display_stock_availability": displayStockAvailability, + "display_stock_quantity": displayStockQuantity, + "min_stock_quantity": minStockQuantity, + "notify_admin_for_quantity_below": notifyAdminForQuantityBelow, + "allow_back_in_stock_subscriptions": allowBackInStockSubscriptions, + "order_minimum_quantity": orderMinimumQuantity, + "order_maximum_quantity": orderMaximumQuantity, + "allowed_quantities": allowedQuantities, + "allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations, + "disable_buy_button": disableBuyButton, + "disable_wishlist_button": disableWishlistButton, + "available_for_pre_order": availableForPreOrder, + "pre_order_availability_start_date_time_utc": preOrderAvailabilityStartDateTimeUtc, + "call_for_price": callForPrice, + "price": price, + "old_price": oldPrice, + "product_cost": productCost, + "special_price": specialPrice, + "special_price_start_date_time_utc": specialPriceStartDateTimeUtc, + "special_price_end_date_time_utc": specialPriceEndDateTimeUtc, + "customer_enters_price": customerEntersPrice, + "minimum_customer_entered_price": minimumCustomerEnteredPrice, + "maximum_customer_entered_price": maximumCustomerEnteredPrice, + "baseprice_enabled": basepriceEnabled, + "baseprice_amount": basepriceAmount, + "baseprice_base_amount": basepriceBaseAmount, + "has_tier_prices": hasTierPrices, + "has_discounts_applied": hasDiscountsApplied, + "discount_name": discountName, + "discount_namen": discountNamen, + "discount_description": discountDescription, + "discount_Descriptionn": discountDescriptionn, + "discount_percentage": discountPercentage, + "currency": currency, + "currencyn": currencyn, + "weight": weight, + "length": length, + "width": width, + "height": height, + "available_start_date_time_utc": availableStartDateTimeUtc, + "available_end_date_time_utc": availableEndDateTimeUtc, + "display_order": displayOrder, + "published": published, + "deleted": deleted, + "created_on_utc": createdOnUtc.toIso8601String(), + "updated_on_utc": updatedOnUtc.toIso8601String(), + "product_type": productType, + "parent_grouped_product_id": parentGroupedProductId, + "role_ids": List.from(roleIds.map((x) => x)), + "discount_ids": List.from(discountIds.map((x) => x)), + "store_ids": List.from(storeIds.map((x) => x)), + "manufacturer_ids": List.from(manufacturerIds.map((x) => x)), + "reviews": List.from(reviews.map((x) => x.toJson())), + "images": List.from(images.map((x) => x.toJson())), + "attributes": List.from(attributes.map((x) => x)), + "specifications": List.from(specifications.map((x) => x.toJson())), + "associated_product_ids": List.from(associatedProductIds.map((x) => x)), + "tags": List.from(tags.map((x) => x)), + "vendor_id": vendorId, + "se_name": seName, + }; +} + +class Review { + Review({ + this.id, + this.position, + this.reviewId, + this.customerId, + this.productId, + this.storeId, + this.isApproved, + this.title, + this.reviewText, + this.replyText, + this.rating, + this.helpfulYesTotal, + this.helpfulNoTotal, + this.createdOnUtc, + this.customer, + this.product, + }); + + dynamic id; + dynamic position; + dynamic reviewId; + dynamic customerId; + dynamic productId; + dynamic storeId; + bool isApproved; + String title; + ReviewText reviewText; + dynamic replyText; + dynamic rating; + dynamic helpfulYesTotal; + dynamic helpfulNoTotal; + DateTime createdOnUtc; + Customer customer; + Product product; + + factory Review.fromJson(Map json) => Review( + id: json["id"], + position: json["position"], + reviewId: json["review_id"], + customerId: json["customer_id"], + productId: json["product_id"], + storeId: json["store_id"], + isApproved: json["is_approved"], + title: json["title"], + reviewText: reviewTextValues.map[json["review_text"]], + replyText: json["reply_text"], + rating: json["rating"], + helpfulYesTotal: json["helpful_yes_total"], + helpfulNoTotal: json["helpful_no_total"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + customer: Customer.fromJson(json["customer"]), + product: json["product"] == null ? null : Product.fromJson(json["product"]), + ); + + Map toJson() => { + "id": id, + "position": position, + "review_id": reviewId, + "customer_id": customerId, + "product_id": productId, + "store_id": storeId, + "is_approved": isApproved, + "title": title, + "review_text": reviewText, + "reply_text": replyText, + "rating": rating, + "helpful_yes_total": helpfulYesTotal, + "helpful_no_total": helpfulNoTotal, + "created_on_utc": createdOnUtc.toIso8601String(), + "customer": customer.toJson(), + "product": product == null ? null : product.toJson(), + }; +} + +class Image { + Image({ + this.id, + this.position, + this.src, + this.thumb, + this.attachment, + }); + + dynamic id; + dynamic position; + String src; + String thumb; + String attachment; + + factory Image.fromJson(Map json) => Image( + id: json["id"], + position: json["position"], + src: json["src"], + thumb: json["thumb"], + attachment: json["attachment"], + ); + + Map toJson() => { + "id": id, + "position": position, + "src": src, + "thumb": thumb, + "attachment": attachment, + }; +} + +class LocalizedName { + LocalizedName({ + this.languageId, + this.localizedName, + }); + + dynamic languageId; + String localizedName; + + factory LocalizedName.fromJson(Map json) => LocalizedName( + languageId: json["language_id"], + localizedName: json["localized_name"], + ); + + Map toJson() => { + "language_id": languageId, + "localized_name": localizedName, + }; +} + +class Specification { + Specification({ + this.id, + this.displayOrder, + this.defaultValue, + this.defaultValuen, + this.name, + this.nameN, + }); + + dynamic id; + dynamic displayOrder; + String defaultValue; + String defaultValuen; + String name; + String nameN; + + factory Specification.fromJson(Map json) => Specification( + id: json["id"], + displayOrder: json["display_order"], + defaultValue: json["default_value"], + defaultValuen: json["default_valuen"], + name: json["name"], + nameN: json["nameN"], + ); + + Map toJson() => { + "id": id, + "display_order": displayOrder, + "default_value": defaultValue, + "default_valuen": defaultValuen, + "name": name, + "nameN": nameN, + }; +} + +class Customer { + Customer({ + this.fileNumber, + this.iqamaNumber, + this.isOutSa, + this.patientType, + this.gender, + this.birthDate, + this.phone, + this.countryCode, + this.yahalaAccountno, + this.billingAddress, + this.shippingAddress, + this.addresses, + this.id, + this.username, + this.email, + this.firstName, + this.lastName, + this.languageId, + this.adminComment, + this.isTaxExempt, + this.hasShoppingCartItems, + this.active, + this.deleted, + this.isSystemAccount, + this.systemName, + this.lastIpAddress, + this.createdOnUtc, + this.lastLoginDateUtc, + this.lastActivityDateUtc, + this.registeredInStoreId, + this.roleIds, + }); + + dynamic fileNumber; + dynamic iqamaNumber; + dynamic isOutSa; + dynamic patientType; + dynamic gender; + DateTime birthDate; + dynamic phone; + dynamic countryCode; + dynamic yahalaAccountno; + dynamic billingAddress; + dynamic shippingAddress; + List addresses; + String id; + Username username; + Email email; + dynamic firstName; + dynamic lastName; + dynamic languageId; + dynamic adminComment; + dynamic isTaxExempt; + dynamic hasShoppingCartItems; + dynamic active; + dynamic deleted; + dynamic isSystemAccount; + dynamic systemName; + dynamic lastIpAddress; + dynamic createdOnUtc; + dynamic lastLoginDateUtc; + dynamic lastActivityDateUtc; + dynamic registeredInStoreId; + List roleIds; + + factory Customer.fromJson(Map json) => Customer( + fileNumber: json["file_number"], + iqamaNumber: json["iqama_number"], + isOutSa: json["is_out_sa"], + patientType: json["patient_type"], + gender: json["gender"], + birthDate: DateTime.parse(json["birth_date"]), + phone: json["phone"], + countryCode: json["country_code"], + yahalaAccountno: json["yahala_accountno"], + billingAddress: json["billing_address"], + shippingAddress: json["shipping_address"], + addresses: List.from(json["addresses"].map((x) => x)), + id: json["id"], + username: usernameValues.map[json["username"]], + email: emailValues.map[json["email"]], + firstName: json["first_name"], + lastName: json["last_name"], + languageId: json["language_id"], + adminComment: json["admin_comment"], + isTaxExempt: json["is_tax_exempt"], + hasShoppingCartItems: json["has_shopping_cart_items"], + active: json["active"], + deleted: json["deleted"], + isSystemAccount: json["is_system_account"], + systemName: json["system_name"], + lastIpAddress: json["last_ip_address"], + createdOnUtc: json["created_on_utc"], + lastLoginDateUtc: json["last_login_date_utc"], + lastActivityDateUtc: json["last_activity_date_utc"], + registeredInStoreId: json["registered_in_store_id"], + roleIds: List.from(json["role_ids"].map((x) => x)), + ); + + Map toJson() => { + "file_number": fileNumber, + "iqama_number": iqamaNumber, + "is_out_sa": isOutSa, + "patient_type": patientType, + "gender": gender, + "birth_date": birthDate.toIso8601String(), + "phone": phone, + "country_code": countryCode, + "yahala_accountno": yahalaAccountno, + "billing_address": billingAddress, + "shipping_address": shippingAddress, + "addresses": List.from(addresses.map((x) => x)), + "id": id, + "username": usernameValues.reverse[username], + "email": emailValues.reverse[email], + "first_name": firstName, + "last_name": lastName, + "language_id": languageId, + "admin_comment": adminComment, + "is_tax_exempt": isTaxExempt, + "has_shopping_cart_items": hasShoppingCartItems, + "active": active, + "deleted": deleted, + "is_system_account": isSystemAccount, + "system_name": systemName, + "last_ip_address": lastIpAddress, + "created_on_utc": createdOnUtc, + "last_login_date_utc": lastLoginDateUtc, + "last_activity_date_utc": lastActivityDateUtc, + "registered_in_store_id": registeredInStoreId, + "role_ids": List.from(roleIds.map((x) => x)), + }; +} + +enum Email { TAMER_FANASHEH_DRSULAIMANALHABIB_COM, STEVE_GATES_NOP_COMMERCE_COM } + +final emailValues = EnumValues({ + "steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM, + "tamer.fanasheh@drsulaimanalhabib.com": Email.TAMER_FANASHEH_DRSULAIMANALHABIB_COM +}); + +enum Username { TAMERF, STEVE_GATES_NOP_COMMERCE_COM } + +final usernameValues = EnumValues({ + "steve_gates@nopCommerce.com": Username.STEVE_GATES_NOP_COMMERCE_COM, + "tamerf": Username.TAMERF +}); + +enum ReviewText { ENADDD, ENAD_TEST_0001, GOOD, ENAD_TEST_REVIEW_001, ENAD } + +final reviewTextValues = EnumValues({ + "ENAD ": ReviewText.ENAD, + "enaddd": ReviewText.ENADDD, + "ENAD TEST 0001": ReviewText.ENAD_TEST_0001, + "Enad Test Review 001": ReviewText.ENAD_TEST_REVIEW_001, + "good": ReviewText.GOOD +}); + +class EnumValues { + Map map; + Map reverseMap; + + EnumValues(this.map); + + Map get reverse { + if (reverseMap == null) { + reverseMap = map.map((k, v) => new MapEntry(v, k)); + } + return reverseMap; + } +} diff --git a/lib/models/pharmacy/topBrandsModel.dart b/lib/models/pharmacy/topBrandsModel.dart new file mode 100644 index 00000000..e27ee270 --- /dev/null +++ b/lib/models/pharmacy/topBrandsModel.dart @@ -0,0 +1,137 @@ +// To parse this JSON data, do +// +// final topBrand = topBrandFromJson(jsonString); + +import 'dart:convert'; + +List topBrandFromJson(String str) => List.from(json.decode(str).map((x) => TopBrand.fromJson(x))); + +String topBrandToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class TopBrand { + TopBrand({ + this.id, + this.name, + this.namen, + this.localizedNames, + this.description, + this.manufacturerTemplateId, + this.metaKeywords, + this.metaDescription, + this.metaTitle, + this.pageSize, + this.pageSizeOptions, + this.priceRanges, + this.published, + this.deleted, + this.displayOrder, + this.createdOnUtc, + this.updatedOnUtc, + this.image, + }); + + String id; + String name; + String namen; + List localizedNames; + dynamic description; + int manufacturerTemplateId; + String metaKeywords; + dynamic metaDescription; + dynamic metaTitle; + int pageSize; + String pageSizeOptions; + dynamic priceRanges; + bool published; + bool deleted; + int displayOrder; + DateTime createdOnUtc; + DateTime updatedOnUtc; + Image image; + + factory TopBrand.fromJson(Map json) => TopBrand( + id: json["id"], + name: json["name"], + namen: json["namen"], + localizedNames: List.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))), + description: json["description"], + manufacturerTemplateId: json["manufacturer_template_id"], + metaKeywords: json["meta_keywords"], + metaDescription: json["meta_description"], + metaTitle: json["meta_title"], + pageSize: json["page_size"], + pageSizeOptions: json["page_size_options"], + priceRanges: json["price_ranges"], + published: json["published"], + deleted: json["deleted"], + displayOrder: json["display_order"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + updatedOnUtc: DateTime.parse(json["updated_on_utc"]), + image: Image.fromJson(json["image"]), + ); + + Map toJson() => { + "id": id, + "name": name, + "namen": namen, + "localized_names": List.from(localizedNames.map((x) => x.toJson())), + "description": description, + "manufacturer_template_id": manufacturerTemplateId, + "meta_keywords": metaKeywords, + "meta_description": metaDescription, + "meta_title": metaTitle, + "page_size": pageSize, + "page_size_options": pageSizeOptions, + "price_ranges": priceRanges, + "published": published, + "deleted": deleted, + "display_order": displayOrder, + "created_on_utc": createdOnUtc.toIso8601String(), + "updated_on_utc": updatedOnUtc.toIso8601String(), + "image": image.toJson(), + }; +} + +class Image { + Image({ + this.src, + this.thumb, + this.attachment, + }); + + String src; + dynamic thumb; + dynamic attachment; + + factory Image.fromJson(Map json) => Image( + src: json["src"], + thumb: json["thumb"], + attachment: json["attachment"], + ); + + Map toJson() => { + "src": src, + "thumb": thumb, + "attachment": attachment, + }; +} + +class LocalizedName { + LocalizedName({ + this.languageId, + this.localizedName, + }); + + int languageId; + String localizedName; + + factory LocalizedName.fromJson(Map json) => LocalizedName( + languageId: json["language_id"], + localizedName: json["localized_name"], + ); + + Map toJson() => { + "language_id": languageId, + "localized_name": localizedName, + }; +} diff --git a/lib/pages/base/base_view.dart b/lib/pages/base/base_view.dart index f5311aae..5713da91 100644 --- a/lib/pages/base/base_view.dart +++ b/lib/pages/base/base_view.dart @@ -24,9 +24,10 @@ class _BaseViewState extends State> { @override void initState() { - if (widget.onModelReady != null && authenticatedUserObject.isLogin) { - widget.onModelReady(model); - } +// if (widget.onModelReady != null && authenticatedUserObject.isLogin) { +// widget.onModelReady(model); +// } + widget.onModelReady(model); super.initState(); } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 20184c9f..14640945 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -10,6 +10,9 @@ import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/my_reviews.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import 'package:diplomaticquarterapp/pages/pharmacyModule/pharmacy_module_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -480,7 +483,7 @@ class _HomePageState extends State { opacity: 0.5, ), DashboardItem( - // onTap: () => Navigator.push(context, FadePage(page: PharmacyPage())), +// onTap: () => Navigator.push(context, FadePage(page: PharmacyPage())), child: Center( child: Padding( @@ -509,7 +512,7 @@ class _HomePageState extends State { height: MediaQuery.of(context).size.width * 0.4, imageName: 'al-habib_onlne_pharmacy_bg.png', onTap: (){ - Navigator.push(context, FadePage(page: WishlistPage())); + Navigator.push(context, FadePage(page: ProductDetailPage())); }, ), DashboardItem( diff --git a/lib/pages/pharmacies/ProductCheckTypeWidget.dart b/lib/pages/pharmacies/ProductCheckTypeWidget.dart new file mode 100644 index 00000000..f2d87529 --- /dev/null +++ b/lib/pages/pharmacies/ProductCheckTypeWidget.dart @@ -0,0 +1,55 @@ +import 'package:diplomaticquarterapp/widgets/pharmacy/product_tile.dart'; +import 'package:flutter/material.dart'; + +class ProductCheckTypeWidget extends StatelessWidget { + final List wishlist; + final bool isTrue; + + ProductCheckTypeWidget(this.isTrue, this.wishlist); + + @override + Widget build(BuildContext context) { + return isTrue + ? ListView.builder( + itemCount: wishlist.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + Container( + child: isTrue + ? productTile( + productName: wishlist[index].product.name, + productPrice: wishlist[index].subtotal, + productRate: + double.parse(wishlist[index].subtotalVatRate), + productImage: wishlist[index].product.images[0].src, + showLine: isTrue, + ) + : productTile( + productName: wishlist[index].product.name, + productPrice: wishlist[index].subtotal, + productRate: + double.parse(wishlist[index].subtotalVatRate), + productImage: wishlist[index].product.images[0].src, + showLine: isTrue, + ), + ), + Divider(height: 1, color: Colors.grey) + ], + ); + }) + : GridView.count( + crossAxisCount: 2, + children: List.generate( + wishlist.length, + (index) => productTile( + productName: wishlist[index].product.name, + productPrice: wishlist[index].subtotal, + productRate: + double.parse(wishlist[index].subtotalVatRate), + productImage: wishlist[index].product.images[0].src, + showLine: isTrue, + )), + ); + } +} diff --git a/lib/pages/pharmacies/compare.dart b/lib/pages/pharmacies/compare.dart new file mode 100644 index 00000000..ffb3dd06 --- /dev/null +++ b/lib/pages/pharmacies/compare.dart @@ -0,0 +1,597 @@ +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +void main() => runApp(ComparePage()); + +class ComparePage extends StatefulWidget { + @override + _ComparePageState createState() => _ComparePageState(); +} + +class _ComparePageState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: 'Reviews page', + isShowAppBar: true, + isPharmacy: true, + body: Container( + child: compareList(), + ), + ); + } +} + +compareList() { + return CarouselSlider( + options: CarouselOptions( + height: 800.0, viewportFraction: 0.95, enableInfiniteScroll: false), + items: [1, 2].map((i) { + return Builder( + builder: (BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 8), + child: Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.symmetric(horizontal: 10.0), + child: slideDetail(), + ), + ); + }, + ); + }).toList(), + ); +} + +slideDetail() { + return ListView( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 800, + width: 150, + margin: EdgeInsets.symmetric(horizontal: 10.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + border: Border( + top: BorderSide(width: 0.5, color: Colors.grey), + left: BorderSide(width: 0.5, color: Colors.grey), + right: BorderSide(width: 0.5, color: Colors.grey), + bottom: BorderSide(width: 0.5, color: Colors.grey), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Container( + child: Align( + alignment: Alignment.topRight, + child: Icon(FontAwesomeIcons.trashAlt, size: 15)), + ), + SizedBox(height: 20,), + Image( + image: AssetImage( + 'assets/images/al-habib_onlne_pharmacy_bg.png'), + fit: BoxFit.cover, + width: 100, + height: 60, + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'SAR 999.99', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + 'ENAD test', + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'Primary Unit Of Measure', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + 'Each', + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'Primary Unit Of Measure', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + 'Each', + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'Primary Unit Of Measure', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + 'Each', + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'Primary Unit Of Measure', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + 'Each', + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'Primary Unit Of Measure', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + 'Each', + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + ], + ), + ), + ), + Container( + height: 800, + width: 150, + margin: EdgeInsets.symmetric(horizontal: 10.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + border: Border( + top: BorderSide(width: 0.5, color: Colors.grey), + left: BorderSide(width: 0.5, color: Colors.grey), + right: BorderSide(width: 0.5, color: Colors.grey), + bottom: BorderSide(width: 0.5, color: Colors.grey), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Container( + child: Align( + alignment: Alignment.topRight, + child: Icon(FontAwesomeIcons.trashAlt, size: 15)), + ), + SizedBox(height: 20,), + Image( + image: AssetImage( + 'assets/images/al-habib_onlne_pharmacy_bg.png'), + fit: BoxFit.cover, + width: 100, + height: 60, + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'SAR 999.99', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + 'ENAD test', + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'Primary Unit Of Measure', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + 'Each', + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'Primary Unit Of Measure', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + 'Each', + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'Primary Unit Of Measure', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + 'Each', + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'Primary Unit Of Measure', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + 'Each', + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'Primary Unit Of Measure', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + 'Each', + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color:Colors.grey,), + ), + ], + ), + ), + ), + ], + ), + ], + ); +} diff --git a/lib/pages/pharmacies/my_reviews.dart b/lib/pages/pharmacies/my_reviews.dart new file mode 100644 index 00000000..725743c3 --- /dev/null +++ b/lib/pages/pharmacies/my_reviews.dart @@ -0,0 +1,194 @@ +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/review_view_model.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:rating_bar/rating_bar.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; + +void main() => runApp(MyReviewsPage()); + +class MyReviewsPage extends StatefulWidget { + @override + _MyReviewsPageState createState() => _MyReviewsPageState(); +} + +class _MyReviewsPageState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getReviewData(), + builder: (_, model, wi) => AppScaffold( + appBarTitle: 'Wishlist page', + isShowAppBar: true, + isPharmacy: true, + body: Container( + child: ListView.builder( + itemCount: model.reviewListList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + Container( + child: reviewDetails( + model.reviewListList[index], + double.parse(model.reviewListList[index].product + .approvedTotalReviews.toString()), + double.parse(model.reviewListList[index].rating.toString()), + ), + ), + Divider(height: 1, color: Colors.grey) + ], + ); + }), + ), + ), + ); + } +} + +reviewDetails(data, rate, myRate) { + return Container( + child: Padding( + padding: const EdgeInsets.only(bottom: 10.0), + child: Container( + height: 200, + width: double.infinity, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + children: [ + Container( + margin: EdgeInsets.only(top: 10, left: 10), + child: Image.network( + data.product.images[0].src.trim(), + fit: BoxFit.cover, + width: 80, + height: 80, + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: data.product.name, + style: TextStyle( + color: Colors.black54, + fontSize: 13, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Column( + children: [ + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: data.product.price.toString() + + " " + + data.product.currency, + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + ], + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RatingBar.readOnly( + initialRating: rate, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ), + ], + ), + ], + ), + SizedBox( + height: 20, + ), + Container( + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(left: 10), + child: Text(data.createdOnUtc.toString())), + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.only(left: 60), + child: RatingBar.readOnly( + initialRating: myRate, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ], + ), + ), + ], + ), + ), + SizedBox( + height: 15, + ), + Expanded( + child: Container( + padding: EdgeInsets.only(left: 10), + child: Text(fixingString(data.reviewText.toString())), + ), + ), + ], + ), + ), + ), + ); +} + +fixingString(txt){ + String stringTxt; + String newTxt; + stringTxt = txt.toString(); + newTxt = stringTxt.split('.')[1]; + + return newTxt; +} diff --git a/lib/pages/pharmacies/product-brands.dart b/lib/pages/pharmacies/product-brands.dart new file mode 100644 index 00000000..86013a9c --- /dev/null +++ b/lib/pages/pharmacies/product-brands.dart @@ -0,0 +1,284 @@ +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart'; + +void main() => runApp(ProductBrandsPage()); + +class ProductBrandsPage extends StatefulWidget { + @override + _ProductBrandsPageState createState() => _ProductBrandsPageState(); +} + +class _ProductBrandsPageState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getTopBrandsData(), + builder: (_, model, wi) => AppScaffold( + appBarTitle: 'Brands page', + isShowAppBar: true, + isPharmacy: true, + body: Container( + child: Column( + children: [ + Container( + color: Colors.white, + alignment: Alignment.topLeft, + padding: EdgeInsets.only(left: 10.0, top: 10.0), + child: Text( + 'Top Brands', + style: TextStyle( + fontWeight: FontWeight.bold + ), + ), + ), + Container( + height: 220, + width: double.infinity, + color: Colors.white, + child: topBrand(), + ), + SizedBox( + height: 10, + ), + Container( + height: 100, + width: double.infinity, + color: Colors.white, + child: IconButton( + icon: Icon(Icons.search), + onPressed: () { + showSearch(context: context, delegate: SearchBar()); + }, + ), + ), + SizedBox( + height: 10, + ), + Container( + height: 280, + width: double.infinity, + color: Colors.white, + child: ListView.builder( + itemCount: model.brandsListList.length, + itemBuilder: (BuildContext ctxt, int index) { + return Container( + margin: EdgeInsets.only(top: 50, left: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text(model.brandsListList[index].name), + SizedBox( + height: 3, + ), + Divider(height: 1, color: Colors.grey) + ], + ), + ); + }), + ), + ], + ), + ), + ), + ); + } +} + +//topBrand() { +// return BaseView( +// onModelReady: (model) => model.getBrandsData(), +// builder: (_, model, wi) => Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Container( +// padding: EdgeInsets.all(10), +// child: Text( +// 'Top Brands', +// ), +// ), +// Row( +// children: [ +// Container( +// margin: EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 0.0), +// child: Container( +// margin: EdgeInsets.only(bottom: 10.0), +// child: Container( +// margin: EdgeInsets.only(bottom: 10.0), +// child: Container( +// child: Container( +// padding: EdgeInsets.symmetric( +// horizontal: 10.0, vertical: 10.0), +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(10), +// border: Border( +// top: BorderSide(width: 1.0, color: Colors.grey), +// left: BorderSide(width: 1.0, color: Colors.grey), +// right: BorderSide(width: 1.0, color: Colors.grey), +// bottom: BorderSide(width: 1.0, color: Colors.grey), +// ), +// color: Colors.white, +// ), +// child: Image( +// image: AssetImage( +// 'assets/images/al-habib_onlne_pharmacy_bg.png'), +// fit: BoxFit.cover, +// width: 60, +// height: 40, +// ), +// ), +// ), +// ), +// ), +// ), +// ], +// ), +// Row( +// children: [ +// Container( +// margin: EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 0.0), +// child: Container( +// margin: EdgeInsets.only(bottom: 10.0), +// child: Container( +// margin: EdgeInsets.only(bottom: 10.0), +// child: Container( +// padding: EdgeInsets.only(left: 5), +// child: Container( +// padding: EdgeInsets.symmetric( +// horizontal: 10.0, vertical: 10.0), +// decoration: BoxDecoration( +// borderRadius: BorderRadius.circular(10), +// border: Border( +// top: BorderSide(width: 1.0, color: Colors.grey), +// left: BorderSide(width: 1.0, color: Colors.grey), +// right: BorderSide(width: 1.0, color: Colors.grey), +// bottom: BorderSide(width: 1.0, color: Colors.grey), +// ), +// color: Colors.white, +// ), +// child: Image( +// image: AssetImage( +// 'assets/images/al-habib_onlne_pharmacy_bg.png'), +// fit: BoxFit.cover, +// width: 60, +// height: 40, +// ), +// ), +// ), +// ), +// ), +// ), +// ], +// ), +// ], +// ), +// ); +//} + +topBrand() { + return BaseView( + onModelReady: (model) => model.getTopBrandsData(), + builder: (_, model, wi) => GridView.count( + crossAxisCount: 4, + children: List.generate( + model.topBrandsListList.length, + (index) => Column( + children: [ + Container( + margin: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 0.0), + child: Container( + child: Container( + child: Container( +// padding: EdgeInsets.only(left: 5), + child: Container( + padding: EdgeInsets.symmetric( + horizontal: 10.0, vertical: 10.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + border: Border( + top: BorderSide(width: 1.0, color: Colors.grey), + left: BorderSide(width: 1.0, color: Colors.grey), + right: BorderSide(width: 1.0, color: Colors.grey), + bottom: BorderSide(width: 1.0, color: Colors.grey), + ), + color: Colors.white, + ), + child: Image.network( + model.topBrandsListList[index].image.src.trim(), + fit: BoxFit.cover, + width: 60, + height: 40, + ), + ), + ), + ), + ), + ), + ], + ), + ), + ), + ); +} + +brandSearch() { + return Text('ENAD'); +} + +class SearchBar extends SearchDelegate { + @override + List buildActions(BuildContext context) { + return [ + IconButton( + icon: Icon(Icons.clear), + onPressed: () { + query = ""; + }, + ) + ]; + } + + @override + Widget buildLeading(BuildContext context) { + return IconButton( + icon: AnimatedIcon( + icon: AnimatedIcons.menu_arrow, + progress: transitionAnimation, + ), + onPressed: () { + close(context, null); + }, + ); + } + + @override + Widget buildResults(BuildContext context) { + return Container( + height: 100, + width: 100, + child: Card( + color: Colors.red, + child: Center( + child: Text(query), + ), + ), + ); + } + + @override + Widget buildSuggestions(BuildContext context) { + return ListView.builder( + itemCount: 5, + itemBuilder: (context, index) => ListTile( + leading: Icon(Icons.location_city), + title: Text("Enad"), + onTap: () { + showResults(context); + }, + ), + ); + } +} diff --git a/lib/pages/pharmacies/product_detail.dart b/lib/pages/pharmacies/product_detail.dart new file mode 100644 index 00000000..aa91f072 --- /dev/null +++ b/lib/pages/pharmacies/product_detail.dart @@ -0,0 +1,888 @@ +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:rating_bar/rating_bar.dart'; +import 'package:provider/provider.dart'; + +int price = 0; +void main() => runApp(ProductDetailPage()); + +class ProductDetailPage extends StatefulWidget { + @override + __ProductDetailPageState createState() => __ProductDetailPageState(); +} + +class __ProductDetailPageState extends State { + bool isTrue = true; + bool isDetails = true; + bool isReviews = false; + bool isAvailabilty = false; + + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: 'product detail page', + isShowAppBar: true, + isPharmacy: true, + body: SingleChildScrollView( + child: Column( + children: [ + Container( + width: double.infinity, + color: Colors.white, + child: Column( + children: [ + Image( + image: AssetImage('assets/images/timeline_bg.png'), + ), + Container( + width: double.infinity, + height: 50, + color: Colors.yellowAccent, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Container( + alignment: Alignment.centerRight, + child: Text( + "Discount on Second item", + style: TextStyle( + fontWeight: FontWeight.bold, fontSize: 17), + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + flex: 0, + child: Container( + child: Image( + image: AssetImage('assets/images/offer.png'), + ), + ), + ), + ], + ), + ), + ], + ), + ), + SizedBox( + height: 4, + ), + Container( + width: 500, + height: 150, + color: Colors.white, + child: productNameAndPrice(), + ), + SizedBox( + height: 6, + ), + Container( + width: 500, + height: 120, + color: Colors.white, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Text( + "Specificaion", + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + ), + Divider(color: Colors.grey) + ], + ), + ), + SizedBox( + height: 6, + ), + Container( + width: 500, + margin: EdgeInsets.only(bottom: 100), +// height: 350, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Column( + children: [ + FlatButton( + onPressed: () { + setState(() { + isDetails = true; + isReviews = false; + isAvailabilty = false; + }); + }, + child: Text( + 'DETAILS', + style: TextStyle( + fontSize: 16, fontWeight: FontWeight.bold), + ), + color: Colors.white, + ), + isDetails + ? Container( + width: 100, + height: 5, + color: Colors.green, + ) + : Container() + ], + ), + SizedBox( + width: 20, + ), + Column( + children: [ + FlatButton( + onPressed: () { + setState(() { + isDetails = false; + isReviews = true; + isAvailabilty = false; + }); + }, + child: Text( + 'REVIEWS', + style: TextStyle( + fontSize: 16, fontWeight: FontWeight.bold), + ), + color: Colors.white, + ), + isReviews + ? Container( + width: 100, + height: 5, + color: Colors.green, + ) + : Container(), + ], + ), + SizedBox( + width: 20, + ), + Column( + children: [ + FlatButton( + onPressed: () { + setState(() { + isDetails = false; + isReviews = false; + isAvailabilty = true; + }); + }, + child: Text( + 'AVAILABILTY', + style: TextStyle( + fontSize: 16, fontWeight: FontWeight.bold), + ), + color: Colors.white, + ), + isAvailabilty + ? Container( + width: 100, + height: 5, + color: Colors.green, + ) + : Container(), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + isDetails + ? Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Text( + 'Description', + style: TextStyle( + fontSize: 17, + color: Colors.grey, + fontWeight: FontWeight.w600), + ), + ), + SizedBox( + height: 10, + ), + Container( + child: Text( + 'Body Mosturizing and nourishing lotion', + style: TextStyle(fontSize: 20), + ), + ), + ], + ), + ) + : isReviews + ? BaseView( + onModelReady: (model) => + model.getProductReviewsData(), + builder: (_, model, wi) => ListView.builder( + physics: const ScrollPhysics(), + itemCount: model.productDetailService[0].reviews.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemBuilder: (BuildContext context, int index){ + return Padding( + padding: EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Row( + children: [ + Container( + child: Text( + model.productDetailService[0] + .reviews[index].id + .toString(), + style: TextStyle( + fontSize: 17, + color: Colors.grey, + fontWeight: FontWeight.w600), + ), + ), + Container( + margin: EdgeInsets.only(left: 232), + child: RatingBar.readOnly( + initialRating: model + .productDetailService[0] + .reviews[index] + .rating + .toDouble(), + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ], + ), + ), + SizedBox( + height: 10, + ), + Container( + child: Text( + model.productDetailService[0].reviews[index] + .reviewText, + style: TextStyle(fontSize: 20), + ), + ), + SizedBox( + height: 50, + ), + Divider(height: 1, color: Colors.grey), + ], + ), + ); + }, + ), + ) + : isAvailabilty + ? BaseView( + onModelReady: (model) => + model.getProductLocationData(), + builder: (_, model, wi) => ListView.builder( + physics: const ScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.productLocationService.length, + itemBuilder: (BuildContext context, int index){ + return Padding( + padding: const EdgeInsets.all(8.0), + child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( +// crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Image.network(model + .productLocationService[index] + .projectImageUrl), + ), + SizedBox( + width: 10, + ), + Expanded( + flex: 4, + child: Text( + model.productLocationService[index] + .locationDescription + + "\n" + + fixingString(model + .productLocationService[ + 0] + .cityName + .toString()), + style: TextStyle(fontSize: 12), + ), + ), + Expanded( + flex: 1, + child: IconButton( + icon: Icon(Icons.location_on), + color: Colors.red, + onPressed: () {}, + ), + ), + Expanded( + flex: 1, + child: IconButton( + icon: Icon(Icons.phone), + color: Colors.red, + onPressed: () {}, + ), + ), + ], + ), + Divider(height: 1.2, color: Colors.grey) + ], + ), + ); + }, + + ), + ) + : Container(), + ], + ), + ), +// ListView(scrollDirection: Axis.vertical, shrinkWrap: true, children: [Text('ENAD')]), + ], + ), + ), + bottomSheet: footerWidget(), + ); + } +} + +class footerWidget extends StatefulWidget { + @override + _footerWidgetState createState() => _footerWidgetState(); +} + +class _footerWidgetState extends State { + double quantityUI = 70; + bool showUI = false; + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height: quantityUI, + color: Colors.white, + child: Column( + children: [ + showUI + ? Container( + width: double.infinity, + height: 90, + color: Colors.white, + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + 'Quantity', + style: TextStyle( + fontSize: 15, fontWeight: FontWeight.bold), + ), + ), +// ListView( +// scrollDirection: Axis.horizontal, +// children: [ +// itemQuantity(), +// ], +// ), + Container( +// margin: EdgeInsets.symmetric(vertical: 20.0), + height: 50.0, + child: ListView( + scrollDirection: Axis.horizontal, + children: [ + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '1', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 1; + return price; + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '2', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 2; + // return price; + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '3', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 3; + return price; + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '4', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 4; + return price; + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '5', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 5; + return price; + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '6', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 6; + return price; + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '7', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 7; + return price; + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '8', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 8; + return price; + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '9', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 9; + return price; + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '10', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 10; + return price; + }); + }, + ), + SizedBox( + width: 5, + ), + Container( + width: 50.0, + child: TextField( + decoration: + InputDecoration(labelText: 'quantity #'), + onChanged: (text) { + if (int.tryParse(text) == null) { + text = ''; + } else { + setState(() { + price = int.parse(text); + }); + } + }, + ), + ), + ], + ), + ) + ], + ), + ), + ) + : Container( + height: 20, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 70, + height: 50, + child: FlatButton( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 4, + child: Text( + price.toString(), + style: TextStyle(fontSize: 20), + ), + ), + Expanded( + flex: 5, + child: Text( + "QTY", + style: TextStyle(fontSize: 16), + ), + ), + ], + ), + onPressed: () { + setState(() { + if (showUI) { + quantityUI = 70; + showUI = false; + } else { + quantityUI = 150; + showUI = true; + } + }); + }, + ), + ), + InkWell( + onTap: () {}, + child: Container( + alignment: Alignment.center, + width: 190, + height: 46, + color: Colors.green, + child: Text( + 'Add to Cart', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15), + ), + ), + ), + SizedBox( + width: 5, + ), + InkWell( + onTap: () {}, + child: Container( + alignment: Alignment.center, + width: 120, + height: 46, + color: Colors.blue, + child: Text( + 'Buy Now', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15), + ), + ), + ), + ], + ), + ], + ), + ); + } +} + +productNameAndPrice() { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Text( + "22 SR", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), + ), + SizedBox( + width: 100, + ), + Text( + "Out Of Stock", + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.red), + ), + SizedBox(width: 30), + Text( + "notify me ", + style: TextStyle( + color: Colors.blue, + decoration: TextDecoration.underline, + ), + ), + Icon( + FontAwesomeIcons.bell, + color: Colors.blue, + size: 15.0, + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + margin: EdgeInsets.only(left: 5), + child: Text( + "Johnson And Jonson Vita-Rich Smoothing Body Cream - With Papaya Extract 200 ML", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15), + ), + ), + ), + Row( + children: [ + Expanded( + flex: 2, + child: Container( + margin: EdgeInsets.only(right: 150), + child: Align( + alignment: Alignment.bottomLeft, + child: RatingBar.readOnly( + initialRating: 3, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ), + ), + Expanded( + flex: 1, + child: Container( + child: Text( + 'Prescription attachment required', + style: TextStyle(color: Colors.red, fontSize: 10), + ), + ), + ), + Icon( + FontAwesomeIcons.questionCircle, + color: Colors.red, + size: 15.0, + ), + ], + ), + ], + ); +} + +slideDetail() { + return Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 14.0, vertical: 15.0), + decoration: const BoxDecoration( + border: Border( + top: BorderSide(width: 0.5, color: Colors.grey), + left: BorderSide(width: 0.5, color: Colors.grey), + right: BorderSide(width: 0.5, color: Colors.grey), + bottom: BorderSide(width: 0.5, color: Colors.grey), + ), + color: Colors.white, + ), + child: const Text('1', + textAlign: TextAlign.center, + style: TextStyle(color: Color(0xFF000000))), + ), + ) + ], + ); +} + +fixingString(txt) { + String stringTxt; + String newTxt; + stringTxt = txt.toString(); + newTxt = stringTxt.split('.')[1]; + + return newTxt; +} diff --git a/lib/pages/pharmacies/wishlist.dart b/lib/pages/pharmacies/wishlist.dart index 8fa7352d..3a09031b 100644 --- a/lib/pages/pharmacies/wishlist.dart +++ b/lib/pages/pharmacies/wishlist.dart @@ -1,8 +1,8 @@ -import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/wishlist_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/ProductCheckTypeWidget.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/wishList_service.dart'; -import 'package:diplomaticquarterapp/widgets/pharmacy/product_tile.dart'; void main() => runApp(WishlistPage()); @@ -14,42 +14,60 @@ class WishlistPage extends StatefulWidget { } class _WishlistPageState extends State { - - @override - void initState(){ - WidgetsBinding.instance.addPostFrameCallback((_) => getWishListItems()); - } + bool isTrue = true; Widget build(BuildContext context) { - return AppScaffold( - appBarTitle: 'Wishlist page', - isShowAppBar: true, - isPharmacy: true, - body: Container( -// child: productTile(), - child: ListView.builder( - itemCount: 3, - itemBuilder: (BuildContext context, int index) { - return Column( - children: [ - Container( - child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00,), - ), - Divider(height: 1, color: Colors.grey) - ], - ); - }), + return BaseView( + onModelReady: (model) => model.getWishlistData(), + builder: (_, model, wi) => AppScaffold( + appBarTitle: 'Wishlist page', + isShowAppBar: true, + isPharmacy: true, + body: Container( +// child: ListView.builder( +// itemCount: 3, +// itemBuilder: (BuildContext context, int index) { +// return Column( +// children: [ +// Container( +// child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00,), +// ), +// Divider(height: 1, color: Colors.grey) +// ], +// ); +// }), + child: Column( + children: [ +// Expanded( +// flex: 1, +// child: Container( +// color: Colors.white, +// width: double.infinity, +// height: 30, +// child: IconButton( +// alignment: Alignment.topRight, +// icon: Icon(Icons.art_track), +// color: Colors.blueAccent, +// onPressed: () { +// setState(() { +// isTrue = !isTrue; +// }); +// }, +// ), +// ), +// ), + Expanded( + flex: 20, + child: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.85, //250, + child: ProductCheckTypeWidget(isTrue, model.wishListList), + ), + ), + ], + ), + ), ), ); } } - -getWishListItems() { - - print("getWishListItems"); - WishListService service = new WishListService(); - service.getWishlist(AppGlobal.context).then((res) { - print(res); - }); - -} diff --git a/lib/services/pharmacy_services/brands_service.dart b/lib/services/pharmacy_services/brands_service.dart new file mode 100644 index 00000000..e4a40d6c --- /dev/null +++ b/lib/services/pharmacy_services/brands_service.dart @@ -0,0 +1,44 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; + +class BrandsService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + bool isLogin = false; + + List _brandsList = List(); + List get brandsList => _brandsList; + + List _topBrandsList = List(); + List get topBrandsList => _topBrandsList; + + Future getBrands() async { + hasError = false; + await baseAppClient.getPharmacy(GET_BRANDS, + onSuccess: (dynamic response, int statusCode) { + _brandsList.clear(); + response['manufacturer'].forEach((item) { + _brandsList.add(Brand.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } + + Future getTopBrands() async { + hasError = false; + await baseAppClient.getPharmacy(GET_TOP_BRANDS, + onSuccess: (dynamic response, int statusCode) { + _topBrandsList.clear(); + response['manufacturer'].forEach((item) { + _topBrandsList.add(TopBrand.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } +} diff --git a/lib/services/pharmacy_services/product_detail_service.dart b/lib/services/pharmacy_services/product_detail_service.dart new file mode 100644 index 00000000..f9bbb7e3 --- /dev/null +++ b/lib/services/pharmacy_services/product_detail_service.dart @@ -0,0 +1,61 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; + +class ProductDetailService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + bool isLogin = false; + + List _productDetailList = List(); + List get productDetailList => _productDetailList; + + List _productLocationList = List(); + List get productLocationList => _productLocationList; + + + Future getProductReviews() async { + hasError = false; + await baseAppClient.getPharmacy(GET_PRODUCT_DETAIL+"1480?fields=reviews", + onSuccess: (dynamic response, int statusCode) { + _productDetailList.clear(); + response['products'].forEach((item) { + _productDetailList.add(ProductDetail.fromJson(item)); + print(response); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } + + Future getProductAvailabiltyDetail() async { + hasError = false; + Map request; + + request = { + "Channel": 3, + "DeviceTypeID": 2, + "IPAdress": "10.20.10.20", + "LanguageID": 2, + "PatientOutSA": 0, + "SKU": "6720020025", + "SessionID": null, + "VersionID": 5.6, + "generalid": "Cs2020@2016\$2958", + "isDentalAllowedBackend": false + }; + await baseAppClient.post(GET_LOCATION, + onSuccess: (dynamic response, int statusCode) { + _productLocationList.clear(); + response['PharmList'].forEach((item) { + _productLocationList.add(LocationModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: request); + } + +} diff --git a/lib/services/pharmacy_services/review_service.dart b/lib/services/pharmacy_services/review_service.dart new file mode 100644 index 00000000..67434643 --- /dev/null +++ b/lib/services/pharmacy_services/review_service.dart @@ -0,0 +1,28 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/reviewModel.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; + + +class ReviewService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + bool isLogin = false; + List _reviewList = List(); + List get reviewList => _reviewList; + + + Future getReview() async { + hasError = false; + await baseAppClient.getPharmacy(GET_REVIEW+"1367368", + onSuccess: (dynamic response, int statusCode) { + _reviewList.clear(); + response['reviews'].forEach((item) { + _reviewList.add(Review.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } + +} diff --git a/lib/services/pharmacy_services/wishList_service.dart b/lib/services/pharmacy_services/wishList_service.dart index 0f9687e8..d4a00230 100644 --- a/lib/services/pharmacy_services/wishList_service.dart +++ b/lib/services/pharmacy_services/wishList_service.dart @@ -1,8 +1,9 @@ - import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/products.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/material.dart'; @@ -10,30 +11,61 @@ import 'package:flutter/material.dart'; class WishListService extends BaseService { AppSharedPreferences sharedPref = AppSharedPreferences(); - AppGlobal appGlobal = new AppGlobal(); - - AuthenticatedUser authUser = new AuthenticatedUser(); - AuthProvider authProvider = new AuthProvider(); - - - Future getWishlist(BuildContext context) async { + bool isLogin = false; + List _wishListProducts = List(); + List get wishListProducts => _wishListProducts; - if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); - authUser = data; - } +// Future getWishlist() async { +// var isLogin = await sharedPref.getString(LOGIN_TOKEN_ID); +// this.isLogin = isLogin != null; +//// if (!isLogin) { +//// // if not login +//// } else { +//// try { +//// await baseAppClient.get( +//// GET_WISHLIST +'/productsbyids/5308,3608,2316,963,5045,2714,1480,',//+ "272843" + "?shopping_cart_type=2", +//// onSuccess: (dynamic response, int statusCode) { +//// wishListProducts.clear(); +//// response['shopping_carts'].forEach((item) { +//// wishListProducts.add(Product.fromJson(item)); +//// }); +//// }, onFailure: (String error, int statusCode) { +//// hasError = true; +//// super.error = error; +//// }); +//// } catch (error) { +//// throw error; +//// } +//// } +// hasError = false; +// try { +// await baseAppClient.getPharmacy(GET_WISHLIST+"1367368?shopping_cart_type=2", +// onSuccess: (dynamic response, int statusCode) { +// wishListProducts.clear(); +// response.forEach((item) { +// wishListProducts.add(Wishlist.fromJson(response)); +// }); +// }, onFailure: (String error, int statusCode) { +// hasError = true; +// super.error = error; +// }); +// } catch (error) { +// throw error; +// } +// } - dynamic localRes; - String URL; - URL = GET_WISHLIST+"272843"+"?shopping_cart_type=2"; - await baseAppClient.get(URL, - onSuccess: (response, statusCode) async { - localRes = response; + Future getWishlist() async { + hasError = false; + await baseAppClient.getPharmacy(GET_WISHLIST+"1367368?shopping_cart_type=2", + onSuccess: (dynamic response, int statusCode) { + _wishListProducts.clear(); + response['shopping_carts'].forEach((item) { + _wishListProducts.add(Wishlist.fromJson(item)); + }); }, onFailure: (String error, int statusCode) { - throw error; + hasError = true; + super.error = error; }); - return Future.value(localRes); } } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 53a945aa..c203d0a6 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -33,6 +33,7 @@ class AppScaffold extends StatelessWidget { final bool isBottomBar; final Widget floatingActionButton; final bool isPharmacy; + final bool showCart; final String title; final String description; final bool isShowDecPage; @@ -51,9 +52,12 @@ class AppScaffold extends StatelessWidget { this.baseViewModel, this.floatingActionButton, this.isPharmacy = false, + this.showCart = false, this.title, this.description, - this.isShowDecPage = true, this.isBottomBar,this.backgroundColor}); + this.isShowDecPage = true, + this.isBottomBar, + this.backgroundColor}); @override Widget build(BuildContext context) { @@ -80,7 +84,7 @@ class AppScaffold extends StatelessWidget { ), centerTitle: true, actions: [ - isPharmacy + isPharmacy && showCart ? IconButton( icon: Icon(Icons.shopping_cart), color: Colors.white, @@ -89,7 +93,7 @@ class AppScaffold extends StatelessWidget { .popUntil(ModalRoute.withName('/')); }, ) - : IconButton( + : isPharmacy && !showCart ? Container() :IconButton( icon: Icon(FontAwesomeIcons.home), color: Colors.white, onPressed: () { diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart index 3fa93363..6e484ae2 100644 --- a/lib/widgets/pharmacy/product_tile.dart +++ b/lib/widgets/pharmacy/product_tile.dart @@ -9,12 +9,14 @@ class productTile extends StatelessWidget { final String productName; final String productPrice; final double productRate; + final String productImage; + final bool showLine; - productTile({this.productName, this.productPrice, this.productRate}); + productTile({this.productName, this.productPrice, this.productRate,this.productImage ,this.showLine = true}); @override Widget build(BuildContext context) { - return Container( + return showLine? Container( height: 120, width: double.infinity, color: Colors.white, @@ -26,13 +28,19 @@ class productTile extends StatelessWidget { children: [ Container( margin: EdgeInsets.only(left: 10), - child: Image( - image: - AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'), + child: Image.network( + productImage.trim(), fit: BoxFit.cover, width: 80, height: 80, ), +// child: Image( +// image: +// AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'), +// fit: BoxFit.cover, +// width: 80, +// height: 80, +// ), ), Expanded( flex: 5, @@ -102,6 +110,102 @@ class productTile extends StatelessWidget { ), ], ), + ): + Container( + child: Padding( + padding: EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: EdgeInsets.only(left:15), + child: Container( + width: 160, + height: 200, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + border: Border( + top: BorderSide(width: 0.5, color: Colors.grey), + left: BorderSide(width: 0.5, color: Colors.grey), + right: BorderSide(width: 0.5, color: Colors.grey), + bottom: BorderSide(width: 0.5, color: Colors.grey), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox(height: 2,), + Container( + child: Image.network( + productImage.trim(), + fit: BoxFit.cover, + width: 80, + height: 70, + ), + ), + SizedBox(height: 10,), +// Container(width: 150,height: 20,color: Colors.green,), + Container( + alignment: Alignment.centerLeft, + child:Column( + children: [ + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + productName, + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'SAR $productPrice', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + alignment: Alignment.topLeft, + margin: EdgeInsets.all(5), + child: Align( + child: RatingBar.readOnly( + initialRating: productRate, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), ); } } From 378562b78110ab73331a8bdec5dde4507724aacc Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 7 Dec 2020 15:44:26 +0200 Subject: [PATCH 004/103] adding some changes in order pages like translate texts --- lib/config/localized_values.dart | 14 ++- .../pharmacies/screens/cart-order-page.dart | 108 +++++++++--------- .../screens/cart-order-preview.dart | 64 +++++++---- lib/uitl/translations_delegate_base.dart | 8 ++ 4 files changed, 114 insertions(+), 80 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 15ae4181..c98fbb14 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -669,9 +669,16 @@ const Map localizedValues = { "shippedMethod": {"en": "SHIP BY:", "ar": " الشحن بواسطة:"}, "orderDetail": {"en": "Order Detail", "ar": " تفاصيل الطلب"}, "orderSummary": {"en": "Order Summary", "ar": " تفاصيل المنتج"}, - "subtotal": {"en": "Subtotal", "ar": " المجموع"}, + "subtotal": {"en": "Subtotal", "ar": " المجموع الفرعي"}, "shipping": {"en": "Shipping", "ar": " الشحن"}, + "shipBy": {"en": "SHIP BY:", "ar": "الشحن عن طريق:"}, + "lakumPoints": {"en": "Lakum Points", "ar": "نقاط لكم"}, + "use": {"en": "USE", "ar": "استخدم"}, + "proceedPay": {"en": "PROCEED TO PAY", "ar": "المتابعة للدفع"}, "vat": {"en": "VAT (15%)", "ar": "(15%) القيمة المضافة"}, + "inclusiveVat": {"en": "(inclusive VAT)", "ar": "(شامل الضريبة)"}, + "items": {"en": "item(s)", "ar": "عنصر"}, + "checkOut": {"en": "CHECK OUT", "ar": "الدفع"}, "sar": {"en": "SAR", "ar": " ر.س "}, "payOnline": {"en": "PAY ONLINE", "ar": "اتمام عملية الدفع "}, "cancelOrder": {"en": "CANCEL ORDER", "ar": "الغاء الطلب "}, @@ -1144,4 +1151,9 @@ const Map localizedValues = { "en": "Select Home Health Care Services", "ar": " حدد خدمات الرعاية الصحية المنزلية" }, + "pharmacyServiceTermsCondition": { + "en": "I agree with the terms of service and I adhere to them unconditionally", + "ar": " أوافق على شروط الخدمة وألتزم بها دون قيد أو شرط" + }, + }; diff --git a/lib/pages/pharmacies/screens/cart-order-page.dart b/lib/pages/pharmacies/screens/cart-order-page.dart index d8a274d7..c5576900 100644 --- a/lib/pages/pharmacies/screens/cart-order-page.dart +++ b/lib/pages/pharmacies/screens/cart-order-page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-preview.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart'; @@ -95,13 +96,13 @@ class CartOrderPage extends StatelessWidget { MainAxisAlignment.spaceBetween, children: [ Texts( - "Subtotal", + TranslationBase.of(context).subtotal, fontSize: 14, color: Colors.black, fontWeight: FontWeight.w500, ), Texts( - "SAR ${(cart.subtotal).toStringAsFixed(2)}", + "${TranslationBase.of(context).sar} ${(cart.subtotal).toStringAsFixed(2)}", fontSize: 14, color: Colors.black, fontWeight: FontWeight.w500, @@ -120,13 +121,13 @@ class CartOrderPage extends StatelessWidget { MainAxisAlignment.spaceBetween, children: [ Texts( - "VAT (15%)", + "${TranslationBase.of(context).vat}", fontSize: 14, color: Colors.black, fontWeight: FontWeight.w500, ), Texts( - "SAR ${(cart.subtotalVatAmount).toStringAsFixed(2)}", + "${TranslationBase.of(context).sar} ${(cart.subtotalVatAmount).toStringAsFixed(2)}", fontSize: 14, color: Colors.black, fontWeight: FontWeight.w500, @@ -151,7 +152,7 @@ class CartOrderPage extends StatelessWidget { fontWeight: FontWeight.bold, ), Texts( - "SAR ${(cart.subtotal).toStringAsFixed(2)}", + "${TranslationBase.of(context).sar} ${(cart.subtotal).toStringAsFixed(2)}", fontSize: 14, color: Colors.black, fontWeight: FontWeight.bold, @@ -181,7 +182,9 @@ class CartOrderPage extends StatelessWidget { : Container(), bottomSheet: Container( height: !(model.cartResponse.shoppingCarts == null || - model.cartResponse.shoppingCarts.length == 0) ? height * 0.15 : 0, + model.cartResponse.shoppingCarts.length == 0) + ? height * 0.15 + : 0, color: Colors.white, child: OrderBottomWidget(model.addresses, height), ), @@ -206,6 +209,8 @@ class _OrderBottomWidgetState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectProvider = Provider.of(context); + return Container( margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0), child: Consumer( @@ -238,7 +243,9 @@ class _OrderBottomWidgetState extends State { width: 25.0, height: widget.height * 0.070, decoration: new BoxDecoration( - color: !isAgree ? Color(0xffeeeeee) : Colors.green, + color: !isAgree + ? Color(0xffeeeeee) + : Colors.green, shape: BoxShape.circle, ), child: !isAgree @@ -258,7 +265,8 @@ class _OrderBottomWidgetState extends State { padding: EdgeInsets.symmetric(horizontal: 4), margin: const EdgeInsets.symmetric(vertical: 4), child: Texts( - "I agree with the terms of service and I adhere to them unconditionally", + TranslationBase.of(context) + .pharmacyServiceTermsCondition, fontSize: 13, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -267,10 +275,8 @@ class _OrderBottomWidgetState extends State { ), InkWell( onTap: () => { - Navigator.push( - context, - FadePage( - page: PharmacyTermsConditions())) + Navigator.push(context, + FadePage(page: PharmacyTermsConditions())) }, child: Container( child: Icon( @@ -290,39 +296,43 @@ class _OrderBottomWidgetState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.symmetric( - horizontal: 0, vertical: 4), - child: Row( - children: [ - Texts( - "SAR ${(cart.subtotal).toStringAsFixed(2)}", - fontSize: 14, - fontWeight: FontWeight.bold, - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 4), - child: Texts( - "(inclusive VAT)", - fontSize: 8, - color: Colors.grey, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.symmetric( + horizontal: 0, vertical: 0), + child: Row( + children: [ + Texts( + "${TranslationBase.of(context).sar} ${(cart.subtotal).toStringAsFixed(2)}", + fontSize: + projectProvider.isArabic ? 12 : 14, fontWeight: FontWeight.bold, ), - ), - ], + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 4), + child: Texts( + "${TranslationBase.of(context).inclusiveVat}", + fontSize: 8, + color: Colors.grey, + fontWeight: FontWeight.bold, + ), + ), + ], + ), ), - ), - Texts( - "${cart.quantityCount} item(s)", - fontSize: 10, - color: Colors.grey, - fontWeight: FontWeight.bold, - ), - ], + Texts( + "${cart.quantityCount} ${TranslationBase.of(context).items}", + fontSize: 10, + color: Colors.grey, + fontWeight: FontWeight.bold, + ), + ], + ), ), RaisedButton( onPressed: isAgree @@ -335,7 +345,7 @@ class _OrderBottomWidgetState extends State { } : null, child: new Text( - "CHECK OUT", + "${TranslationBase.of(context).checkOut}", style: new TextStyle( color: isAgree ? Colors.white @@ -345,19 +355,9 @@ class _OrderBottomWidgetState extends State { color: Color(0xff005aff), disabledColor: Color(0xff005aff), ), - /* SecondaryButton( - label: "CHECK OUT", - color: Colors.blueAccent, - textColor: Colors.white, - onTap: (() { - Navigator.push( - context, FadePage(page: OrderPreviewPage(widget.addresses))); - }), - disabled: isAgree ? false : true, - )*/ ], ), - ) + ), ], ) : Container(), diff --git a/lib/pages/pharmacies/screens/cart-order-preview.dart b/lib/pages/pharmacies/screens/cart-order-preview.dart index aed2dbc5..39d06ea8 100644 --- a/lib/pages/pharmacies/screens/cart-order-preview.dart +++ b/lib/pages/pharmacies/screens/cart-order-preview.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/address-select-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart'; @@ -22,7 +23,8 @@ class OrderPreviewPage extends StatelessWidget { @override Widget build(BuildContext context) { - PreferredSizeWidget appBarWidget = AppBarWidget("Check out", null, true); + PreferredSizeWidget appBarWidget = + AppBarWidget("${TranslationBase.of(context).checkOut}", null, true); final mediaQuery = MediaQuery.of(context); final height = mediaQuery.size.height - appBarWidget.preferredSize.height - @@ -33,7 +35,7 @@ class OrderPreviewPage extends StatelessWidget { builder: (_, model, wi) => ChangeNotifierProvider.value( value: model.paymentCheckoutData, child: AppScaffold( - title: "Check out", + title: "${TranslationBase.of(context).checkOut}", isShowAppBar: true, isShowDecPage: false, appBarWidget: appBarWidget, @@ -114,13 +116,13 @@ class OrderPreviewPage extends StatelessWidget { MainAxisAlignment.spaceBetween, children: [ Texts( - "Subtotal", + "${TranslationBase.of(context).subtotal}", fontSize: 14, color: Colors.black, fontWeight: FontWeight.w500, ), Texts( - "SAR ${(model.cartResponse.subtotal).toStringAsFixed(2)}", + "${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}", fontSize: 14, color: Colors.black, fontWeight: FontWeight.w500, @@ -139,13 +141,13 @@ class OrderPreviewPage extends StatelessWidget { MainAxisAlignment.spaceBetween, children: [ Texts( - "Shipping", + "${TranslationBase.of(context).shipping}", fontSize: 14, color: Colors.black, fontWeight: FontWeight.w500, ), Texts( - "SAR ${(model.totalAdditionalShippingCharge).toStringAsFixed(2)}", + "${TranslationBase.of(context).sar} ${(model.totalAdditionalShippingCharge).toStringAsFixed(2)}", fontSize: 14, color: Colors.black, fontWeight: FontWeight.w500, @@ -164,13 +166,13 @@ class OrderPreviewPage extends StatelessWidget { MainAxisAlignment.spaceBetween, children: [ Texts( - "VAT (15%)", + "${TranslationBase.of(context).vat}", fontSize: 14, color: Colors.black, fontWeight: FontWeight.w500, ), Texts( - "SAR ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}", + "${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}", fontSize: 14, color: Colors.black, fontWeight: FontWeight.w500, @@ -195,7 +197,7 @@ class OrderPreviewPage extends StatelessWidget { fontWeight: FontWeight.bold, ), Texts( - "SAR ${(model.cartResponse.subtotal).toStringAsFixed(2)}", + "${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}", fontSize: 14, color: Colors.black, fontWeight: FontWeight.bold, @@ -215,7 +217,9 @@ class OrderPreviewPage extends StatelessWidget { ), ), bottomSheet: Container( - height: model.cartResponse.shoppingCarts != null ? height * 0.10 : 0, + height: model.cartResponse.shoppingCarts != null + ? height * 0.10 + : 0, color: Colors.white, child: PaymentBottomWidget(model), ), @@ -396,7 +400,7 @@ class _SelectAddressWidgetState extends State { padding: EdgeInsets.symmetric( vertical: 0, horizontal: 6), child: Texts( - "SHIP BY:", + "${TranslationBase.of(context).shipBy}", fontSize: 12, fontWeight: FontWeight.bold, color: Colors.black, @@ -562,6 +566,8 @@ class _LakumWidgetState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectProvider = Provider.of(context); + return Container( color: Colors.white, padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), @@ -579,7 +585,7 @@ class _LakumWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - "Lakum Points", + "${TranslationBase.of(context).lakumPoints}", fontSize: 12, fontWeight: FontWeight.bold, ), @@ -599,23 +605,27 @@ class _LakumWidgetState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ Texts( - "Riyal", + "${TranslationBase.of(context).riyal}", fontSize: 12, fontWeight: FontWeight.bold, ), Container( - margin: EdgeInsets.only(left: 4), + margin: projectProvider.isArabic ? EdgeInsets.only(right: 4) : EdgeInsets.only(left: 4), width: 60, - height: 40, + height: 50, child: TextField( decoration: InputDecoration( border: OutlineInputBorder( borderSide: BorderSide(color: Colors.black, width: 0.2), gapPadding: 0, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8)), + borderRadius: projectProvider.isArabic + ? BorderRadius.only( + topRight: Radius.circular(8), + bottomRight: Radius.circular(8)) + : BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8)), ), disabledBorder: OutlineInputBorder( borderSide: @@ -670,12 +680,16 @@ class _LakumWidgetState extends State { ), ), Container( - height: 40, + height: 50, padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12), decoration: new BoxDecoration( color: Color(0xff3666E0), shape: BoxShape.rectangle, - borderRadius: BorderRadius.only( + borderRadius: projectProvider.isArabic + ? BorderRadius.only( + topLeft: Radius.circular(6), + bottomLeft: Radius.circular(6)) + : BorderRadius.only( topRight: Radius.circular(6), bottomRight: Radius.circular(6)), border: Border.fromBorderSide(BorderSide( @@ -684,7 +698,7 @@ class _LakumWidgetState extends State { )), ), child: Texts( - "USE", + "${TranslationBase.of(context).use}", fontSize: 12, color: Colors.white, fontWeight: FontWeight.bold, @@ -727,7 +741,7 @@ class PaymentBottomWidget extends StatelessWidget { child: Row( children: [ Texts( - "SAR ${(model.cartResponse.subtotal).toStringAsFixed(2)}", + "${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}", fontSize: 14, fontWeight: FontWeight.bold, color: Color(0xff929295), @@ -736,7 +750,7 @@ class PaymentBottomWidget extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 4), child: Texts( - "(inclusive VAT)", + "${TranslationBase.of(context).inclusiveVat}", fontSize: 8, color: Color(0xff929295), fontWeight: FontWeight.w600, @@ -746,7 +760,7 @@ class PaymentBottomWidget extends StatelessWidget { ), ), Texts( - "${model.cartResponse.quantityCount} item(s)", + "${model.cartResponse.quantityCount} ${TranslationBase.of(context).items}", fontSize: 10, color: Colors.grey, fontWeight: FontWeight.bold, @@ -785,7 +799,7 @@ class PaymentBottomWidget extends StatelessWidget { child: Padding( padding: const EdgeInsets.symmetric(vertical: 16), child: new Text( - "PROCEED TO PAY", + "${TranslationBase.of(context).proceedPay}", style: new TextStyle( color: (paymentData.address != null && paymentData.paymentOption != null) diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 6721824d..0bd2ce60 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -735,7 +735,14 @@ class TranslationBase { String get orderDetail => localizedValues['orderDetail'][locale.languageCode]; String get subtotal => localizedValues['subtotal'][locale.languageCode]; String get shipping => localizedValues['shipping'][locale.languageCode]; + String get shipBy => localizedValues['shipBy'][locale.languageCode]; + String get lakumPoints => localizedValues['lakumPoints'][locale.languageCode]; + String get use => localizedValues['use'][locale.languageCode]; + String get proceedPay => localizedValues['proceedPay'][locale.languageCode]; String get vat => localizedValues['vat'][locale.languageCode]; + String get inclusiveVat => localizedValues['inclusiveVat'][locale.languageCode]; + String get items => localizedValues['items'][locale.languageCode]; + String get checkOut => localizedValues['checkOut'][locale.languageCode]; String get total => localizedValues['total'][locale.languageCode]; String get sar => localizedValues['sar'][locale.languageCode]; String get payOnline => localizedValues['payOnline'][locale.languageCode]; @@ -1023,6 +1030,7 @@ class TranslationBase { String get riyal => localizedValues['riyal'][locale.languageCode]; String get termOfService => localizedValues['termOfService'][locale.languageCode]; String get shoppingCart => localizedValues['shoppingCart'][locale.languageCode]; + String get pharmacyServiceTermsCondition => localizedValues['pharmacyServiceTermsCondition'][locale.languageCode]; String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; From 727940c5c687360eb3b01e1a75a0225667310ca7 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Tue, 8 Dec 2020 10:18:48 +0300 Subject: [PATCH 005/103] fixed merging issues --- lib/widgets/others/app_scaffold_widget.dart | 229 ++++------ lib/widgets/pharmacy/product_tile.dart | 476 ++++++++++---------- 2 files changed, 346 insertions(+), 359 deletions(-) diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 7d0d60f8..4b588453 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -37,7 +37,6 @@ class AppScaffold extends StatelessWidget { final bool isBottomBar; final Widget floatingActionButton; final bool isPharmacy; - final bool showCart; final String title; final String description; final String image; @@ -49,29 +48,28 @@ class AppScaffold extends StatelessWidget { final PreferredSizeWidget appBarWidget; AuthenticatedUserObject authenticatedUserObject = - locator(); + locator(); AppScaffold( {@required this.body, - this.appBarTitle = '', - this.isLoading = false, - this.isShowAppBar = false, - this.hasAppBarParam, - this.bottomSheet, - this.baseViewModel, - this.floatingActionButton, - this.isPharmacy = false, - this.showCart = false, - this.title, - this.description, - this.isShowDecPage = true, - this.isBottomBar, - this.backgroundColor, - this.preferredSize = 0.0, - this.appBarIcons, - this.appBarWidget, - this.image, - this.infoList}); + this.appBarTitle = '', + this.isLoading = false, + this.isShowAppBar = false, + this.hasAppBarParam, + this.bottomSheet, + this.baseViewModel, + this.floatingActionButton, + this.isPharmacy = false, + this.title, + this.description, + this.isShowDecPage = true, + this.isBottomBar, + this.backgroundColor, + this.preferredSize = 0.0, + this.appBarIcons, + this.appBarWidget, + this.image, + this.infoList}); @override Widget build(BuildContext context) { @@ -90,58 +88,29 @@ class AppScaffold extends StatelessWidget { appBar = preferredSize == 0 ? appBarWidget : PreferredSize( - child: appBarWidget, - preferredSize: Size.fromHeight(preferredSize)); + child: appBarWidget, + preferredSize: Size.fromHeight(preferredSize)); } else { appBar = this.appBarWidget; } return Scaffold( - backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, - appBar: isShowAppBar - ? AppBar( - elevation: 0, - backgroundColor: isPharmacy - ? Colors.green - : Theme.of(context).appBarTheme.color, - textTheme: TextTheme( - headline6: - TextStyle(color: Colors.white, fontWeight: FontWeight.bold), - ), - title: Text(authenticatedUserObject.isLogin - ? appBarTitle.toUpperCase() - : TranslationBase.of(context).serviceInformationTitle),leading: Builder( - builder: (BuildContext context) { - return ArrowBack(); - }, - ), - centerTitle: true, - actions: [ - isPharmacy && showCart - ? IconButton( - icon: Icon(Icons.shopping_cart), - color: Colors.white, - onPressed: () { - Navigator.of(context) - .popUntil(ModalRoute.withName('/')); - }, - ) - : isPharmacy && !showCart ? Container() :IconButton( - icon: Icon(FontAwesomeIcons.home), - color: Colors.white, - onPressed: () { - Navigator.of(context) - .popUntil(ModalRoute.withName('/')); - }, - ), - ], - ) + backgroundColor: + backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, + appBar: appBar, + body: (!Provider.of(context, listen: false).isLogin && + isShowDecPage) + ? NotAutPage( + title: appBarTitle, + description: description, + infoList: infoList, + ) : baseViewModel != null - ? NetworkBaseView( - child: buildBodyWidget(), - baseViewModel: baseViewModel, - ) - : buildBodyWidget(), + ? NetworkBaseView( + child: buildBodyWidget(), + baseViewModel: baseViewModel, + ) + : buildBodyWidget(), bottomSheet: bottomSheet, //floatingActionButton: floatingActionButton ?? floatingActionButton, // bottomNavigationBar: @@ -164,7 +133,7 @@ class AppScaffold extends StatelessWidget { class AppBarWidget extends StatelessWidget with PreferredSizeWidget { final AuthenticatedUserObject authenticatedUserObject = - locator(); + locator(); final String appBarTitle; final List appBarIcons; @@ -184,72 +153,72 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget { Widget buildAppBar(BuildContext context) { return isShowAppBar ? AppBar( - elevation: 0, - backgroundColor: - isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, - textTheme: TextTheme( - headline6: - TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + elevation: 0, + backgroundColor: + isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, + textTheme: TextTheme( + headline6: + TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + ), + title: Texts( + authenticatedUserObject.isLogin || !isShowDecPage + ? appBarTitle.toUpperCase() + : TranslationBase.of(context).serviceInformationTitle, + color: Colors.white, + bold: true, + ), + leading: Builder( + builder: (BuildContext context) { + return ArrowBack(); + }, + ), + centerTitle: true, + actions: [ + isPharmacy + ? IconButton( + icon: Icon(Icons.shopping_cart), + color: Colors.white, + onPressed: () { + Navigator.of(context) + .popUntil(ModalRoute.withName('/')); + }) + : Container(), + image != null + ? InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: InsuranceUpdate(), ), - title: Texts( - authenticatedUserObject.isLogin || !isShowDecPage - ? appBarTitle.toUpperCase() - : TranslationBase.of(context).serviceInformationTitle, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + image, + height: SizeConfig.heightMultiplier * 5, + width: SizeConfig.heightMultiplier * 5, color: Colors.white, - bold: true, ), - leading: Builder( - builder: (BuildContext context) { - return ArrowBack(); - }, - ), - centerTitle: true, - actions: [ - isPharmacy - ? IconButton( - icon: Icon(Icons.shopping_cart), - color: Colors.white, - onPressed: () { - Navigator.of(context) - .popUntil(ModalRoute.withName('/')); - }) - : Container(), - image != null - ? InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: InsuranceUpdate(), - ), - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Image.asset( - image, - height: SizeConfig.heightMultiplier * 5, - width: SizeConfig.heightMultiplier * 5, - color: Colors.white, - ), - ), - ) - : IconButton( - icon: Icon(FontAwesomeIcons.home), - color: Colors.white, - onPressed: () { - Navigator.pushAndRemoveUntil( - context, - MaterialPageRoute( - builder: (context) => LandingPage()), - (Route r) => false); - }, - ), - if (appBarIcons != null) ...appBarIcons - ], - ) + ), + ) + : IconButton( + icon: Icon(FontAwesomeIcons.home), + color: Colors.white, + onPressed: () { + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute( + builder: (context) => LandingPage()), + (Route r) => false); + }, + ), + if (appBarIcons != null) ...appBarIcons + ], + ) : Container( - height: 0, - width: 0, - ); + height: 0, + width: 0, + ); } @override diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart index 78b89ef0..725966d5 100644 --- a/lib/widgets/pharmacy/product_tile.dart +++ b/lib/widgets/pharmacy/product_tile.dart @@ -6,9 +6,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:rating_bar/rating_bar.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; - - - class productTile extends StatelessWidget { final String productName; final String productPrice; @@ -16,14 +13,20 @@ class productTile extends StatelessWidget { final int productReviews; final String qyt; final String totalPrice; - final bool isOrderDetails; - final String productImage; - final bool showLine; - + final bool isOrderDetails; + final String productImage; + final bool showLine; - productTile({this.productName, this.productPrice, this.productRate, - this.qyt, this.totalPrice, this.productReviews, - this.isOrderDetails=true, this.productImage ,this.showLine = true}); + productTile( + {this.productName, + this.productPrice, + this.productRate, + this.qyt, + this.totalPrice, + this.productReviews, + this.isOrderDetails = true, + this.productImage, + this.showLine = true}); @override Widget build(BuildContext context) { @@ -63,8 +66,7 @@ class productTile extends StatelessWidget { alignment: Alignment.topLeft, child: RichText( text: TextSpan( - text: - productName, + text: productName, style: TextStyle( color: Colors.black54, fontSize: 15, @@ -88,251 +90,267 @@ class productTile extends StatelessWidget { ), ), ), - this.isOrderDetails == false ? Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RatingBar.readOnly( - initialRating: productRate, - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ), - ): Container(), + this.isOrderDetails == false + ? Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RatingBar.readOnly( + initialRating: productRate, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ) + : Container(), ], ), ), - this.isOrderDetails == false ? Expanded( - flex: 1, - child: Column ( - children: [ - Icon(FontAwesomeIcons.trashAlt, size: 15), - SizedBox(height: 50,), - Icon(FontAwesomeIcons.shoppingCart, size: 15), - ], - ), - ) : Container(), + this.isOrderDetails == false + ? Expanded( + flex: 1, + child: Column( + children: [ + Icon(FontAwesomeIcons.trashAlt, size: 15), + SizedBox( + height: 50, + ), + Icon(FontAwesomeIcons.shoppingCart, size: 15), + ], + ), + ) + : Container(), ], ), - this.isOrderDetails == true ?Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - margin: EdgeInsets.only(bottom: 5.0), - child: RichText( - text: TextSpan( - text: 'QYT: $qyt', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.grey, - fontSize: 13), - ), - ), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - TranslationBase.of(context).total, - style: TextStyle( - color: Colors.grey, - fontSize: 13.0, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - RichText( + this.isOrderDetails == true + ? Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + margin: EdgeInsets.only(bottom: 5.0), + child: RichText( text: TextSpan( - text: ' $totalPrice SAR', + text: 'QYT: $qyt', style: TextStyle( fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 15), + color: Colors.grey, + fontSize: 13), ), ), - ], - ), - ], - ), - ], - ), - ): Container(), -// this.isOrderDetails == true && model.order[0].orderStatusId == 30? - this.isOrderDetails == true? - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( -// margin: EdgeInsets.all(5.0), - child: Align( - alignment: Alignment.topLeft, - child: RatingBar.readOnly( - initialRating: productRate, - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ), - ), - Container( -// margin: EdgeInsets.all(5), - child: Align( -// alignment: Alignment.topLeft, - child: RichText( - text: TextSpan( - text: '($productReviews reviews)', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.grey, - fontSize: 13), - ), - ), - ), - ), - InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => ProductReviewPage())); - }, - child: Container( - padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), - height: 30.0, - decoration: BoxDecoration( - border: Border.all( - color: Colors.orange, - style: BorderStyle.solid, - width: 1.0 ), - color: Colors.transparent, - borderRadius: BorderRadius.circular(5.0) - ), - child: Text( - TranslationBase.of(context).writeReview, - style: TextStyle( - fontSize:12, - color: Colors.orange, - ), - ), - ), - ), - ], - ), - ) : Container(), - ], - ), - ): - Container( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - Padding( - padding: EdgeInsets.only(left:15), - child: Container( - width: 160, - height: 200, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border( - top: BorderSide(width: 0.5, color: Colors.grey), - left: BorderSide(width: 0.5, color: Colors.grey), - right: BorderSide(width: 0.5, color: Colors.grey), - bottom: BorderSide(width: 0.5, color: Colors.grey), - ), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox(height: 2,), - Container( - child: Image.network( - productImage.trim(), - fit: BoxFit.cover, - width: 80, - height: 70, - ), - ), - SizedBox(height: 10,), -// Container(width: 150,height: 20,color: Colors.green,), - Container( - alignment: Alignment.centerLeft, - child:Column( + Column( + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: TextSpan( - text: - productName, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + TranslationBase.of(context).total, + style: TextStyle( + color: Colors.grey, + fontSize: 13.0, + fontWeight: FontWeight.bold, ), ), - ), + ], ), - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + RichText( text: TextSpan( - text: 'SAR $productPrice', + text: ' $totalPrice SAR', style: TextStyle( fontWeight: FontWeight.bold, color: Colors.black, - fontSize: 13), + fontSize: 15), ), ), + ], + ), + ], + ), + ], + ), + ) + : Container(), +// this.isOrderDetails == true && model.order[0].orderStatusId == 30? + this.isOrderDetails == true + ? Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( +// margin: EdgeInsets.all(5.0), + child: Align( + alignment: Alignment.topLeft, + child: RatingBar.readOnly( + initialRating: productRate, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ), + Container( +// margin: EdgeInsets.all(5), + child: Align( +// alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: '($productReviews reviews)', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.grey, + fontSize: 13), ), ), - Container( - alignment: Alignment.topLeft, - margin: EdgeInsets.all(5), - child: Align( - child: RatingBar.readOnly( - initialRating: productRate, - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), + ), + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ProductReviewPage())); + }, + child: Container( + padding: EdgeInsets.only( + left: 13.0, right: 13.0, top: 5.0), + height: 30.0, + decoration: BoxDecoration( + border: Border.all( + color: Colors.orange, + style: BorderStyle.solid, + width: 1.0), + color: Colors.transparent, + borderRadius: BorderRadius.circular(5.0)), + child: Text( + TranslationBase.of(context).writeReview, + style: TextStyle( + fontSize: 12, + color: Colors.orange, ), ), - ], + ), ), + ], + ), + ) + : Container( + child: Padding( + padding: EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: EdgeInsets.only(left: 15), + child: Container( + width: 160, + height: 200, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + border: Border( + top: BorderSide( + width: 0.5, color: Colors.grey), + left: BorderSide( + width: 0.5, color: Colors.grey), + right: BorderSide( + width: 0.5, color: Colors.grey), + bottom: BorderSide( + width: 0.5, color: Colors.grey), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Container( + child: Image.network( + productImage.trim(), + fit: BoxFit.cover, + width: 80, + height: 70, + ), + ), + SizedBox( + height: 10, + ), +// Container(width: 150,height: 20,color: Colors.green,), + Container( + alignment: Alignment.centerLeft, + child: Column( + children: [ + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: productName, + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'SAR $productPrice', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + alignment: Alignment.topLeft, + margin: EdgeInsets.all(5), + child: Align( + child: RatingBar.readOnly( + initialRating: productRate, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ], ), - ], + ), ), - ), - ), - ], - ), + ], ), ); } From 9fecf8e89f186320ed21510fe46357738d5b294b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 10:34:02 +0200 Subject: [PATCH 006/103] fix insurance update --- .../FamilyFiles/GetAllSharedRecordByStatusResponse.dart | 4 ++-- lib/pages/insurance/insurance_update_screen.dart | 6 ++++-- lib/splashPage.dart | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart index b21d940f..750cf0be 100644 --- a/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart +++ b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart @@ -25,7 +25,7 @@ class GetAllSharedRecordsByStatusResponse { dynamic successMsgN; dynamic doctorInformationList; List getAllPendingRecordsList; - List getAllSharedRecordsByStatusList; + List getAllSharedRecordsByStatusList = List(); List getResponseFileList; bool isHMGPatient; bool isLoginSuccessfully; @@ -92,7 +92,7 @@ class GetAllSharedRecordsByStatusResponse { this.successMsgN, this.doctorInformationList, this.getAllPendingRecordsList, - this.getAllSharedRecordsByStatusList, + this.getAllSharedRecordsByStatusList , this.getResponseFileList, this.isHMGPatient, this.isLoginSuccessfully, diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 1e616108..f2f66031 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -97,7 +97,9 @@ class _InsuranceUpdateState extends State controller: _tabController, children: [ Container( - child: ListView.builder( + child: + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList!=null? + ListView.builder( itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, itemBuilder: (BuildContext context, int index) { return Container( @@ -173,7 +175,7 @@ class _InsuranceUpdateState extends State ), ), ); - }), + }):Container(), ), Container( child: ListView.builder( diff --git a/lib/splashPage.dart b/lib/splashPage.dart index d367d3ec..2c12d6fd 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -42,9 +42,9 @@ class _SplashScreenState extends State { var data = await sharedPref.getObject(USER_PROFILE); if (data != null) { AuthenticatedUser userData = AuthenticatedUser.fromJson(data); - Provider.of(context, listen: false).isLogin = true; - authenticatedUserObject.isLogin = true; - authenticatedUserObject.user = userData; + // Provider.of(context, listen: false).isLogin = true; + //authenticatedUserObject.isLogin = true; + //authenticatedUserObject.user = userData; } } From 554ed1b50a4f4e020421d7807c427c4c0eba87ed Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 10:55:27 +0200 Subject: [PATCH 007/103] fix insurance update --- lib/config/localized_values.dart | 7 +- .../insurance/insurance_update_screen.dart | 236 +++++++++--------- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/others/app_scaffold_widget.dart | 28 ++- 4 files changed, 148 insertions(+), 124 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2498a679..2b596bfb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -483,7 +483,7 @@ const Map localizedValues = { "LabOrders": {"en": "Lab Orders", "ar": "تحاليل المختبر"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "Prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, - "History": {"en": "History", "ar": "السجل"}, + "History": {"en": "History", "ar": "السجلات"}, "OrderNo": {"en": "Order No", "ar": "رقم الطلب"}, "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, @@ -1164,5 +1164,8 @@ const Map localizedValues = { "en": "Request medical report", "ar": "طلب تقرير طبي" }, - + "insur-cards": { + "en": "Insurance Cards", + "ar": "بطاقات التأمين" + }, }; diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index f2f66031..b088d477 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; @@ -35,7 +36,7 @@ class _InsuranceUpdateState extends State onModelReady: (model) => model.getInsuranceUpdated(), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( - appBarTitle: 'Insurance Cards', + appBarTitle: TranslationBase.of(context).insurCards, isShowAppBar: true, baseViewModel: model, body: Scaffold( @@ -63,7 +64,7 @@ class _InsuranceUpdateState extends State controller: _tabController, isScrollable: true, indicatorWeight: 4.0, - indicatorColor: Colors.red, + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.symmetric( horizontal: 13.0, vertical: 2.0), @@ -72,13 +73,14 @@ class _InsuranceUpdateState extends State Container( width: MediaQuery.of(context).size.width * 0.35, child: Center( - child: Texts('Card'), + child: Texts(TranslationBase.of(context) + .updateInsuranceSubtitle), ), ), Container( width: MediaQuery.of(context).size.width * 0.35, child: Center( - child: Texts('History'), + child: Texts(TranslationBase.of(context).history), ), ), ], @@ -97,85 +99,99 @@ class _InsuranceUpdateState extends State controller: _tabController, children: [ Container( - child: - model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList!=null? - ListView.builder( - itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, - itemBuilder: (BuildContext context, int index) { - return Container( - margin: EdgeInsets.all(10.0), - child: Card( - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - child: Container( - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, left: 10.0, right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index].patientName, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: FontWeight.w500, - letterSpacing: 1.0)), - Text( - 'File No.' + - model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index].patientID.toString(), - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: FontWeight.w500, - letterSpacing: 1.0)), - ], - ), - ), - ), - Expanded( - flex: 2, - child: Container( - // height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: 'Update', - small: true, - textColor: Colors.white, - // color: Colors.grey, - ), - //height: 45, - // width:90 + child: model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList != + null + ? ListView.builder( + itemCount: model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList.length, + itemBuilder: (BuildContext context, int index) { + return Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: + EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientName, + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ) + ], ), - ], + ), ), - ), - ) - ], + Expanded( + flex: 2, + child: Container( + // height: MediaQuery.of(context).size.height * 0.12, + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase.of( + context) + .updateInsurance, + small: true, + textColor: Colors.white, + // color: Colors.grey, + ), + //height: 45, + // width:90 + ), + ], + ), + ), + ) + ], + ), + ), ), - ), - ), - ); - }):Container(), + ); + }) + : Container(), ), Container( child: ListView.builder( @@ -212,35 +228,34 @@ class _InsuranceUpdateState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("TAMER FANASHEH ", - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - 'File No.' + - model - .insuranceUpdate[ - index] - .patientID - .toString(), - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), Text( - model.insuranceUpdate[index] - .createdOn, + model.user.firstName + + " " + + model.user.lastName, style: TextStyle( fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w500, letterSpacing: 1.0)), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model + .insuranceUpdate[ + index] + .patientID + .toString(), + fontSize: 14, + color: Colors.black, + ), + Texts( + model.insuranceUpdate[index] + .createdOn, + fontSize: 14, + color: Colors.black, + ), ], ), ), @@ -248,7 +263,6 @@ class _InsuranceUpdateState extends State Expanded( flex: 1, child: Container( -// height: MediaQuery.of(context).size.height * 0.12, margin: EdgeInsets.only(top: 20.0), child: Column( children: [ @@ -259,15 +273,13 @@ class _InsuranceUpdateState extends State Container( margin: EdgeInsets.only( top: 13.5, left: 2.0), - child: Text( - model - .insuranceUpdate[ - index] - .statusDescription, - textAlign: - TextAlign.center, - style: TextStyle( - fontSize: 12.0)), + child: Texts( + model.insuranceUpdate[index] + .statusDescription, + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.black, + ), ), ], ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 39048bca..5a055973 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -942,6 +942,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get completed => localizedValues['completed'][locale.languageCode]; String get cancelled => localizedValues['cancelled'][locale.languageCode]; String get requestMedicalReport => localizedValues['request-medical-report'][locale.languageCode]; + String get insurCards => localizedValues['insur-cards'][locale.languageCode]; } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 99a7ee2d..cdc6025a 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -59,11 +59,13 @@ class AppScaffold extends StatelessWidget { this.isShowDecPage = true, this.isBottomBar, this.image, - this.infoList, this.imagesInfo}); + this.infoList, + this.imagesInfo}); @override Widget build(BuildContext context) { AppGlobal.context = context; + ProjectViewModel projectViewModel = Provider.of(context); return Scaffold( backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -75,13 +77,15 @@ class AppScaffold extends StatelessWidget { headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), - title: Texts( - authenticatedUserObject.isLogin || !isShowDecPage - ? appBarTitle.toUpperCase() - : TranslationBase.of(context).serviceInformationTitle, - color: Colors.white, - bold: true, - ), + title: Text( + authenticatedUserObject.isLogin || !isShowDecPage + ? appBarTitle.toUpperCase() + : TranslationBase.of(context).serviceInformationTitle, + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + fontFamily: + projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), leading: Builder( builder: (BuildContext context) { return ArrowBack(); @@ -129,13 +133,17 @@ class AppScaffold extends StatelessWidget { infoList: infoList, imagesInfo: imagesInfo, ) - : baseViewModel != null + : baseViewModel != null ? NetworkBaseView( child: buildBodyWidget(), baseViewModel: baseViewModel, ) : buildBodyWidget(), - bottomSheet: (Provider.of(context, listen: false).isLogin || !isShowDecPage)?bottomSheet:null, + bottomSheet: + (Provider.of(context, listen: false).isLogin || + !isShowDecPage) + ? bottomSheet + : null, //floatingActionButton: floatingActionButton ?? floatingActionButton, // bottomNavigationBar: // this.isBottomBar == true ? BottomBarSearch() : SizedBox() From 14f92f6c582bb7e7167f1959117117f2eb5782a3 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 11:02:33 +0200 Subject: [PATCH 008/103] remove updated button --- .../insurance/insurance_update_screen.dart | 77 ++++++++++--------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index b088d477..a7e7c32b 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,15 +1,11 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; import '../base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; -import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; -import 'package:rating_bar/rating_bar.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; class InsuranceUpdate extends StatefulWidget { @override @@ -31,6 +27,7 @@ class _InsuranceUpdateState extends State _tabController.dispose(); } + //TODO implement update card Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getInsuranceUpdated(), @@ -144,6 +141,9 @@ class _InsuranceUpdateState extends State color: Colors.black, fontWeight: FontWeight.w500, ), + SizedBox( + height: 8, + ), Texts( TranslationBase.of(context) .fileno + @@ -162,29 +162,30 @@ class _InsuranceUpdateState extends State ), ), ), - Expanded( - flex: 2, - child: Container( - // height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: TranslationBase.of( - context) - .updateInsurance, - small: true, - textColor: Colors.white, - // color: Colors.grey, + if (false) + Expanded( + flex: 2, + child: Container( + // height: MediaQuery.of(context).size.height * 0.12, + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase.of( + context) + .updateInsurance, + small: true, + textColor: Colors.white, + // color: Colors.grey, + ), + //height: 45, + // width:90 ), - //height: 45, - // width:90 - ), - ], + ], + ), ), - ), - ) + ) ], ), ), @@ -228,16 +229,17 @@ class _InsuranceUpdateState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - model.user.firstName + - " " + - model.user.lastName, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), + Texts( + model.user.firstName + + " " + + model.user.lastName, + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.black, + ), + SizedBox( + height: 8, + ), Texts( TranslationBase.of(context) .fileno + @@ -248,12 +250,17 @@ class _InsuranceUpdateState extends State .patientID .toString(), fontSize: 14, + fontWeight: FontWeight.w500, color: Colors.black, ), + SizedBox( + height: 8, + ), Texts( model.insuranceUpdate[index] .createdOn, fontSize: 14, + fontWeight: FontWeight.w500, color: Colors.black, ), ], From 468bb0356c15a803eb4f08e7130b66e1a3fc0f31 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 9 Dec 2020 12:38:56 +0300 Subject: [PATCH 009/103] updates & fixes --- lib/pages/ToDoList/ToDo.dart | 22 +++-- lib/pages/medical/medical_profile_page.dart | 93 +++++++++++++------ .../radiology/radiology_details_page.dart | 6 +- 3 files changed, 83 insertions(+), 38 deletions(-) diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index fb8990b2..95e10879 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -62,7 +62,7 @@ class _ToDoState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, imagesInfo: imagesInfo, - isShowAppBar: true, + isShowAppBar: false, description: TranslationBase.of(context).infoTodo, body: SingleChildScrollView( child: Column( @@ -212,17 +212,23 @@ class _ToDoState extends State { ), Container( child: CountdownTimer( - endTime: DateTime.now().millisecondsSinceEpoch + + endTime: DateTime.now() + .millisecondsSinceEpoch + (widget.appoList[index] - .remaniningHoursTocanPay * - 1000) * + .remaniningHoursTocanPay * + 1000) * 60, - widgetBuilder: (_, CurrentRemainingTime time) { + widgetBuilder: + (_, CurrentRemainingTime time) { return Text( - '${time.days}:${time.hours}:${time.min}:${time.sec} ' + TranslationBase.of(context).upcomingTimeLeft, + '${time.days}:${time.hours}:${time.min}:${time.sec} ' + + TranslationBase.of( + context) + .upcomingTimeLeft, style: TextStyle( fontSize: 12.0, - color: Color(0xff40ACC9))); + color: + Color(0xff40ACC9))); }, ), ), @@ -529,7 +535,7 @@ class _ToDoState extends State { }).catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); + err != null ?? AppToast.showErrorToast(message: err); }); } diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 41746f3c..37592733 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -81,11 +81,11 @@ class _MedicalProfilePageState extends State { padding: EdgeInsets.symmetric(vertical: 5.0), child: Column( children: [ - if(model.isLogin) - Container( - width: double.infinity, - height: 55, - ), + if (model.isLogin) + Container( + width: double.infinity, + height: 55, + ), Row( children: [ Expanded( @@ -112,29 +112,63 @@ class _MedicalProfilePageState extends State { .myAppointmentsList, hasBadge: true, ), - Positioned( - right: 0.0, - child: Badge( - toAnimate: false, - position: - BadgePosition.topEnd(), - shape: BadgeShape.circle, - badgeColor: Color(0xFF40ACC9) - .withOpacity(1.0), - borderRadius: - BorderRadius.circular(8), - badgeContent: Container( - padding: - EdgeInsets.all(2.0), - child: Text( - appoCountProvider.count - .toString(), - style: TextStyle( - color: Colors.white, - fontSize: 16.0)), - ), - ), - ), + projectViewModel.isArabic + ? Positioned( + left: 0.0, + child: Badge( + toAnimate: false, + shape: + BadgeShape.circle, + badgeColor: Color( + 0xFF40ACC9) + .withOpacity(1.0), + borderRadius: + BorderRadius + .circular(8), + badgeContent: Container( + padding: + EdgeInsets.all( + 2.0), + child: Text( + appoCountProvider + .count + .toString(), + style: TextStyle( + color: Colors + .white, + fontSize: + 16.0)), + ), + ), + ) + : Positioned( + right: 0.0, + child: Badge( + toAnimate: false, + shape: + BadgeShape.circle, + badgeColor: Color( + 0xFF40ACC9) + .withOpacity(1.0), + borderRadius: + BorderRadius + .circular(8), + badgeContent: Container( + padding: + EdgeInsets.all( + 2.0), + child: Text( + appoCountProvider + .count + .toString(), + style: TextStyle( + color: Colors + .white, + fontSize: + 16.0)), + ), + ), + ), ]) : MedicalProfileItem( title: TranslationBase.of(context) @@ -156,7 +190,8 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context).lab, imagePath: 'lab_result_icon.png', - subTitle: TranslationBase.of(context).labSubtitle, + subTitle: TranslationBase.of(context) + .labSubtitle, ), ), ), diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 9f8a0640..ce4a4e3a 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -27,17 +27,21 @@ class RadiologyDetailsPage extends StatelessWidget { baseViewModel: model, body: SingleChildScrollView( child: Column( + mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ Text('${finalRadiology.reportData}',textAlign: TextAlign.center,), + SizedBox( + height: 160.0, + ) ], ), ), bottomSheet: Container( width: double.infinity, - height: MediaQuery.of(context).size.height * 0.2, color: Colors.grey[100], child: Column( + mainAxisSize: MainAxisSize.min, children: [ Divider(), Container( From 4d203c8a5b2ef1740c80055b401812555c8a823c Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 13:43:07 +0200 Subject: [PATCH 010/103] fix LabResult --- lib/config/localized_values.dart | 8 ++ lib/core/model/labs/lab_result.dart | 8 +- lib/core/service/client/base_app_client.dart | 2 +- lib/core/service/medical/labs_service.dart | 23 ++++ .../viewModels/medical/labs_view_model.dart | 32 +++-- .../medical/labs/laboratory_result_page.dart | 2 +- lib/uitl/date_uitl.dart | 15 +++ lib/uitl/translations_delegate_base.dart | 2 + lib/widgets/charts/app_time_series_chart.dart | 7 ++ .../medical/LabResult/FlowChartPage.dart | 42 +++++++ .../{ => LabResult}/LabResultWidget.dart | 19 ++- .../LabResult/Lab_Result_details_wideget.dart | 112 ++++++++++++++++++ .../lab_result_chart_and_detials.dart | 74 ++++++++++++ .../laboratory_result_widget.dart | 3 +- .../others/app_expandable_notifier.dart | 3 +- 15 files changed, 330 insertions(+), 22 deletions(-) create mode 100644 lib/widgets/data_display/medical/LabResult/FlowChartPage.dart rename lib/widgets/data_display/medical/{ => LabResult}/LabResultWidget.dart (88%) create mode 100644 lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart create mode 100644 lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart rename lib/widgets/data_display/medical/{ => LabResult}/laboratory_result_widget.dart (99%) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2b596bfb..f7b5f234 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1168,4 +1168,12 @@ const Map localizedValues = { "en": "Insurance Cards", "ar": "بطاقات التأمين" }, + 'labResult': { + "en": "Lab results", + "ar": "نتائج التحاليل المخبرية" + }, + 'details':{ + 'en':'Details', + 'ar':'التفاصيل' + } }; diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index c9acd809..adc2e5ff 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -1,9 +1,9 @@ class LabResult { String description; - Null femaleInterpretativeData; + dynamic femaleInterpretativeData; int gender; int lineItemNo; - Null maleInterpretativeData; + dynamic maleInterpretativeData; String notes; String packageID; int patientID; @@ -13,11 +13,11 @@ class LabResult { String sampleCollectedOn; String sampleReceivedOn; String setupID; - Null superVerifiedOn; + dynamic superVerifiedOn; String testCode; String uOM; String verifiedOn; - Null verifiedOnDateTime; + dynamic verifiedOnDateTime; LabResult( {this.description, diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 0e940a53..408f8a6e 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -139,7 +139,7 @@ class BaseAppClient { parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); } else if (!parsed['IsAuthenticated']) { - // await logout(); + await logout(); //helpers.showErrorToast('Your session expired Please login agian'); } else { diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index b9b9a16c..737b7b1b 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -32,6 +32,7 @@ class LabsService extends BaseService { List patientLabSpecialResult = List(); List labResultList = List(); + List labOrdersResultsList = List(); Future getLaboratoryResult( {String projectID, @@ -77,6 +78,28 @@ class LabsService extends BaseService { }, body: body); } + Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder,String procedure}) async { + hasError = false; + Map body = Map(); + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['isDentalAllowedBackend'] = false; + body['SetupID'] = patientLabOrder.setupID; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID; + body['Procedure'] = procedure; + await baseAppClient.post(GET_Patient_LAB_RESULT, + onSuccess: (dynamic response, int statusCode) { + labOrdersResultsList.clear(); + response['ListPLR'].forEach((lab) { + labOrdersResultsList.add(LabResult.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 582ee745..95be11db 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -12,6 +12,9 @@ class LabsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; LabsService _labsService = locator(); + List get labOrdersResultsList => _labsService.labOrdersResultsList; + + List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); @@ -105,18 +108,15 @@ class LabsViewModel extends BaseViewModel { getPatientLabResult({PatientLabOrders patientLabOrder}) async { setState(ViewState.Busy); - await _labsService.getPatientLabResult( - patientLabOrder: patientLabOrder - ); + await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); } else { _labsService.labResultList.forEach((element) { - List patientLabOrdersClinic = - labResultLists - .where((elementClinic) => - elementClinic.filterName == element.testCode) + List patientLabOrdersClinic = labResultLists + .where( + (elementClinic) => elementClinic.filterName == element.testCode) .toList(); if (patientLabOrdersClinic.length != 0) { @@ -124,16 +124,26 @@ class LabsViewModel extends BaseViewModel { .patientLabResultList .add(element); } else { - labResultLists.add(LabResultList( - filterName: element.testCode, - lab: element)); + labResultLists + .add(LabResultList(filterName: element.testCode, lab: element)); } - }); setState(ViewState.Idle); } } + + getPatientLabOrdersResults({PatientLabOrders patientLabOrder,String procedure}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder,procedure: procedure); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + sendLabReportEmail({PatientLabOrders patientLabOrder}) async { setState(ViewState.Busy); await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 9b1f5a26..dc3d10cc 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/medical/laboratory_result_widget.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/laboratory_result_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index c5ef6b34..95086f10 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -19,6 +19,21 @@ class DateUtil { return DateTime.now(); } + static DateTime convertStringToDateTime(String date) { + if (date != null) { + try { + var dateT = date.split('/'); + var year = dateT[2].substring(0,4); + return DateTime(int.parse(year),int.parse(dateT[1]),int.parse(dateT[0])); + } catch (e) { + print(e); + } + + return DateTime.now(); + } else + return DateTime.now(); + } + static String convertDateToString(DateTime date) { const start = "/Date("; const end = "+0300)"; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 5a055973..86e98b07 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -943,6 +943,8 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get cancelled => localizedValues['cancelled'][locale.languageCode]; String get requestMedicalReport => localizedValues['request-medical-report'][locale.languageCode]; String get insurCards => localizedValues['insur-cards'][locale.languageCode]; + String get labResult => localizedValues['labResult'][locale.languageCode]; + String get details => localizedValues['details'][locale.languageCode]; } diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart index 857a7620..d34bc591 100644 --- a/lib/widgets/charts/app_time_series_chart.dart +++ b/lib/widgets/charts/app_time_series_chart.dart @@ -62,3 +62,10 @@ class TimeSeriesSales { TimeSeriesSales(this.time, this.sales); } + +class TimeSeriesSales2 { + final DateTime time; + final double sales; + + TimeSeriesSales2(this.time, this.sales); +} diff --git a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart new file mode 100644 index 00000000..fde78169 --- /dev/null +++ b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart @@ -0,0 +1,42 @@ +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +import 'lab_result_chart_and_detials.dart'; + +class FlowChartPage extends StatelessWidget { + final PatientLabOrders patientLabOrder; + final String filterName; + + FlowChartPage({this.patientLabOrder, this.filterName}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPatientLabOrdersResults( + patientLabOrder: patientLabOrder, procedure: filterName), + builder: (context, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: filterName, + baseViewModel: model, + body: SingleChildScrollView( + child: model.labOrdersResultsList.isNotEmpty + ? Container( + child: LabResultChartAndDetails( + name: filterName, + labResult: model.labOrdersResultsList, + ), + ) + : Container( + child: Center( + child: Texts('no Data'), + ), + ), + ), + ), + ); + } +} diff --git a/lib/widgets/data_display/medical/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart similarity index 88% rename from lib/widgets/data_display/medical/LabResultWidget.dart rename to lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index 6ad51c36..eb8771b7 100644 --- a/lib/widgets/data_display/medical/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -1,18 +1,23 @@ import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../text.dart'; +import '../../text.dart'; +import 'FlowChartPage.dart'; + class LabResultWidget extends StatelessWidget { final String filterName ; final List patientLabResultList; + final PatientLabOrders patientLabOrder; - LabResultWidget({Key key, this.filterName, this.patientLabResultList}) : super(key: key); + LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder}) : super(key: key); ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -30,7 +35,15 @@ class LabResultWidget extends StatelessWidget { Texts(filterName), InkWell( onTap: () { - //TODO model.getPatientLabResult(patientLabOrder: widget.patientLabOrder); + Navigator.push( + context, + FadePage( + page: FlowChartPage( + filterName: filterName, + patientLabOrder: patientLabOrder, + ), + ), + ); }, child: Texts( TranslationBase.of(context).showMoreBtn, diff --git a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart new file mode 100644 index 00000000..1f09dcf7 --- /dev/null +++ b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart @@ -0,0 +1,112 @@ +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class LabResultDetailsWidget extends StatefulWidget { + final List labResult; + + LabResultDetailsWidget({ + this.labResult, + }); + + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), + border: Border.all(color: Colors.grey, width: 1), + ), + margin: EdgeInsets.all(20), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add(TableRow(children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).date, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts(TranslationBase.of(context).labResult, color: Colors.white), + ), + height: 60), + ) + ])); + widget.labResult.forEach((vital) { + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + // '${DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + '${vital.sampleCollectedOn}', + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${vital.resultValue}', + textAlign: TextAlign.center, + ), + ), + ), + ), + ])); + }); + return tableRow; + } +} diff --git a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart new file mode 100644 index 00000000..19a95bac --- /dev/null +++ b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart @@ -0,0 +1,74 @@ +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:flutter/material.dart'; + +import 'package:charts_flutter/flutter.dart' as charts; + +import 'Lab_Result_details_wideget.dart'; + +class LabResultChartAndDetails extends StatelessWidget { + LabResultChartAndDetails({ + Key key, + @required this.labResult, + @required this.name, + }) : super(key: key); + + final List labResult; + final String name; + + List _timeSeriesData = []; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + AppExpandableNotifier( + headerWidget: AppTimeSeriesChart( + seriesList: generateData(), + chartName: name, + startDate: DateUtil.convertStringToDateTime(labResult[0].sampleCollectedOn), + endDate: DateTime.now(), + ), + bodyWidget: LabResultDetailsWidget( + labResult: labResult, + ), + ), + ], + ); + } + + generateData() { + if (labResult.length > 0) { + int x =0; + labResult.forEach( + (element) { + try { + var resultValueDouble =double.parse(element.resultValue); + var resultValueInt = resultValueDouble.toInt(); + _timeSeriesData.add( + TimeSeriesSales( + DateUtil.convertStringToDateTime(element.sampleCollectedOn), + resultValueInt, + ), + ); + + } catch (e) { + print(e); + } + + }, + ); + } + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (TimeSeriesSales sales, _) => sales.time, + measureFn: (TimeSeriesSales sales, _) => sales.sales, + data: _timeSeriesData, + ) + ]; + } +} diff --git a/lib/widgets/data_display/medical/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart similarity index 99% rename from lib/widgets/data_display/medical/laboratory_result_widget.dart rename to lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index d16019b6..79cf632b 100644 --- a/lib/widgets/data_display/medical/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -12,7 +12,7 @@ import 'package:flutter_html/flutter_html.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -import '../text.dart'; +import '../../text.dart'; import 'LabResultWidget.dart'; class LaboratoryResultWidget extends StatefulWidget { @@ -232,6 +232,7 @@ class _LaboratoryResultWidgetState extends State { ...List.generate( model.labResultLists.length, (index) => LabResultWidget( + patientLabOrder: widget.patientLabOrder, filterName: model .labResultLists[index].filterName, patientLabResultList: model diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index b68ae1da..23a3a59f 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; @@ -59,7 +60,7 @@ class _AppExpandableNotifier extends State { Padding( padding: EdgeInsets.all(10), child: Text( - widget.title ?? 'Details', + widget.title ?? TranslationBase.of(context).details, style: TextStyle( fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2, From c4bb75eab4492cb47748657784c80fbb4e42131b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 9 Dec 2020 18:40:32 +0300 Subject: [PATCH 011/103] Doctor rating fixed --- lib/pages/BookAppointment/DoctorProfile.dart | 15 +- .../MyAppointments/AppointmentDetails.dart | 355 ++++++++++++++++-- .../widgets/AppointmentActions.dart | 2 +- .../widgets/AppointmentCardView.dart | 12 +- 4 files changed, 331 insertions(+), 53 deletions(-) diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 20e4ae09..392eb24c 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -53,17 +53,6 @@ class _DoctorProfileState extends State length: 2, vsync: this, initialIndex: widget.isOpenAppt == true ? 1 : 0); - - // event.controller.stream.listen((p) { - // if (p['clinic_id'] != null && - // p['doctor_id'] != null && - // p['project_id'] != null) { - // setState(() { - // // need to take the data from here - // // dropdownValue = p['clinic_id']; - // }); - // } - // }); _tabController = new TabController(length: 2, vsync: this); widget.authUser = new AuthenticatedUser(); widget.doctor.speciality = widget.docProfileList.specialty; @@ -164,7 +153,7 @@ class _DoctorProfileState extends State alignment: Alignment.center, child: Text( "(" + - widget.doctor.noOfPatientsRate.toString() + + widget.docProfileList.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews + ")", @@ -496,7 +485,7 @@ class _DoctorProfileState extends State } double getRatingWidth(int patientNumber) { - var width = (patientNumber / this.widget.doctor.noOfPatientsRate) * 100; + var width = (patientNumber / this.widget.docProfileList.noOfPatientsRate) * 100; return width; } diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 109af9d1..4143d090 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -1,8 +1,11 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -26,6 +29,8 @@ class _AppointmentDetailsState extends State with SingleTickerProviderStateMixin { static TabController _tabController; + List doctorDetailsList = List(); + @override void initState() { _tabController = new TabController(length: 2, vsync: this); @@ -46,26 +51,26 @@ class _AppointmentDetailsState extends State isShowAppBar: true, bottomSheet: AppointmentDetails.showFooterButton ? Container( - width: MediaQuery.of(context).size.width, - height: 50.0, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: goToBookConfirm, - child: Text(TranslationBase.of(context).bookNow, - style: TextStyle(fontSize: 18.0)), - ), - ), - ) + width: MediaQuery.of(context).size.width, + height: 50.0, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: goToBookConfirm, + child: Text(TranslationBase.of(context).bookNow, + style: TextStyle(fontSize: 18.0)), + ), + ), + ) : null, body: Container( color: new Color(0xFFf6f6f6), @@ -88,7 +93,8 @@ class _AppointmentDetailsState extends State ), ), Container( - margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), + margin: + EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), alignment: Alignment.center, child: Text( widget.appo.doctorTitle + @@ -123,19 +129,24 @@ class _AppointmentDetailsState extends State emptyIcon: Icons.star, ), ), - Container( - margin: EdgeInsets.only(top: 5.0), - alignment: Alignment.center, - child: Text( - "(" + - widget.appo.noOfPatientsRate.toString() + - " Reviews)", - style: TextStyle( - fontSize: 14.0, - color: Colors.blue[800], - letterSpacing: 1.0, - decoration: TextDecoration.underline, - )), + InkWell( + onTap: () { + getDoctorRatingsDetails(); + }, + child: Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: Text( + "(" + + widget.appo.noOfPatientsRate.toString() + + " Reviews)", + style: TextStyle( + fontSize: 14.0, + color: Colors.blue[800], + letterSpacing: 1.0, + decoration: TextDecoration.underline, + )), + ), ), Container( margin: EdgeInsets.only(top: 10.0), @@ -171,8 +182,14 @@ class _AppointmentDetailsState extends State child: TabBarView( physics: NeverScrollableScrollPhysics(), children: [ - AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton), - DocAvailableAppointments(doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment) + AppointmentActions( + appo: widget.appo, + tabController: _tabController, + enableFooterButton: enableFooterButton), + DocAvailableAppointments( + doctor: getDoctorObject(), + isLiveCareAppointment: + widget.appo.isLiveCareAppointment) ], controller: _tabController, ), @@ -208,7 +225,273 @@ class _AppointmentDetailsState extends State selectedTime: DocAvailableAppointments.selectedTime))); } + getDoctorRatingsDetails() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.getDoctorsRatingDetails(widget.appo.doctorID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + doctorDetailsList.clear(); + res['DoctorRatingDetailsList'].forEach((v) { + doctorDetailsList.add(new DoctorRateDetails.fromJson(v)); + }); + showRatingDialog(doctorDetailsList); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + void showRatingDialog(List doctorDetailsList) { + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: Dialog( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + // height: 400.0, + width: MediaQuery.of(context).size.width * 0.8, + color: Colors.white, + child: Column( + children: [ + Container( + alignment: Alignment.center, + width: MediaQuery.of(context).size.width, + color: Theme.of(context).primaryColor, + margin: EdgeInsets.only(bottom: 5.0), + padding: EdgeInsets.all(10.0), + child: Text( + TranslationBase.of(context).doctorRating, + style: TextStyle( + fontSize: 22.0, color: Colors.white))), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Text( + this + .widget + .appo + .actualDoctorRate + .ceilToDouble() + .toString(), + style: TextStyle( + fontSize: 32.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: + this.widget.appo.actualDoctorRate.toDouble(), + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text( + this.widget.appo.noOfPatientsRate.toString() + + " " + + TranslationBase.of(context).reviews, + style: TextStyle( + fontSize: 14.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).excellent, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[0].patientNumber), + height: 6.0, + child: Container( + color: Colors.green[700], + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).v_good, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[1].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffB7B723), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).good, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[2].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEBA727), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).average, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[3].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEB7227), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context) + .below_average, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[4].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffE20C0C), + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 40.0), + child: Divider()), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Align( + alignment: FractionalOffset.bottomCenter, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 40.0, + child: RaisedButton( + elevation: 0.0, + color: Colors.white, + textColor: Colors.red, + hoverColor: Colors.transparent, + focusColor: Colors.transparent, + highlightColor: Colors.transparent, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text( + TranslationBase.of(context).cancel, + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}); + } + + double getRatingWidth(int patientNumber) { + var width = (patientNumber / this.widget.appo.noOfPatientsRate) * 100; + return width; + } DoctorList getDoctorObject() { DoctorList docObj = new DoctorList(); diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index c0399b8a..76c0633c 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -88,7 +88,7 @@ class _AppointmentActionsState extends State { Container( // height: 100.0, margin: EdgeInsets.all(7.0), - padding: EdgeInsets.only(bottom: 15.0), + padding: EdgeInsets.only(bottom: 4.0), decoration: BoxDecoration( boxShadow: [ BoxShadow( diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index 1bbe471a..25d5e931 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -5,6 +6,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; import '../AppointmentDetails.dart'; @@ -23,6 +25,7 @@ class AppointmentCard extends StatefulWidget { class _ApointmentCardState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return InkWell( onTap: () { navigateToAppointmentDetails(context, widget.appo); @@ -46,7 +49,7 @@ class _ApointmentCardState extends State { fit: BoxFit.fill, height: 60.0, width: 60.0), ), Container( - width: MediaQuery.of(context).size.width * 0.57, + width: MediaQuery.of(context).size.width * 0.61, margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -101,8 +104,11 @@ class _ApointmentCardState extends State { Container( transform: Matrix4.translationValues(15.0, -40.0, 0.0), - child: Image.asset( - "assets/images/new-design/arrow.png", + child: projectViewModel.isArabic ? Image.asset( + "assets/images/new-design/arrow_menu_black-ar.png", + width: 25.0, + height: 25.0) : Image.asset( + "assets/images/new-design/arrow_menu_black-en.png", width: 25.0, height: 25.0), ), From e85b21c08fa5eed40fba319fa71eb2c31b416976 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 9 Dec 2020 19:15:56 +0200 Subject: [PATCH 012/103] parent_categorise_page update --- lib/pages/parent_categorise_page.dart | 1734 +++++++++++++------------ 1 file changed, 888 insertions(+), 846 deletions(-) diff --git a/lib/pages/parent_categorise_page.dart b/lib/pages/parent_categorise_page.dart index 4acb3b68..414106b1 100644 --- a/lib/pages/parent_categorise_page.dart +++ b/lib/pages/parent_categorise_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/sub_categorise_page.dart'; @@ -52,766 +53,970 @@ class _ParentCategorisePageState extends State { backgroundColor: Colors.white, isShowDecPage: false, baseViewModel: model, - body: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 5.90, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: Image.network( - id == '1' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089188_personal-care_2.png' - : id == '2' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089189_skin-care_2.png' - : id == '3' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089190_health-care_2.png' - : id == '4' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089191_sexual-health_2.png' - : id == '5' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089192_beauty_2.png' - : id == '6' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089193_baby-child_2.png' - : id == '7' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089194_vitamins-supplements_2.png' - : id == '8' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png' - : id == '9' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png' - : id == '10' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png' - : '', - fit: BoxFit.fill, - height: 160.0, - width: double.infinity), - ), - if (model.categoriseParent.length > 8) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + body: Container( + child: ListView( + scrollDirection: Axis.vertical, + children: [ + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Image.network( + id == '1' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089188_personal-care_2.png' + : id == '2' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089189_skin-care_2.png' + : id == '3' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089190_health-care_2.png' + : id == '4' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089191_sexual-health_2.png' + : id == '5' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089192_beauty_2.png' + : id == '6' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089193_baby-child_2.png' + : id == '7' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089194_vitamins-supplements_2.png' + : id == '8' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png' + : id == '9' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png' + : id == '10' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png' + : '', + fit: BoxFit.fill, + height: 160.0, + width: double.infinity), + ), + if (model.categoriseParent.length > 8) + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.all(10.0), - child: InkWell( - child: Container( - child: Texts( - 'View All Categories', - fontWeight: FontWeight.w300, - ), - ), - onTap: () { - showModalBottomSheet( - isScrollControlled: true, - context: context, - builder: (BuildContext context) { - return Container( - height: MediaQuery.of(context) - .size - .height * - 0.89, - color: Colors.white, - child: Center( - child: ListView.builder( - scrollDirection: - Axis.vertical, - itemCount: model - .categoriseParent.length, - itemBuilder: - (BuildContext context, - int index) { - return Container( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: InkWell( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Texts(model - .categoriseParent[ - index] - .name), - Divider( - thickness: 0.6, - color: Colors - .black12, - ) - ], + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: EdgeInsets.all(10.0), + child: InkWell( + child: Container( + child: Texts( + 'View All Categories', + fontWeight: FontWeight.w300, + ), + ), + onTap: () { + showModalBottomSheet( + isScrollControlled: true, + context: context, + builder: (BuildContext context) { + return Container( + height: MediaQuery.of(context) + .size + .height * + 0.89, + color: Colors.white, + child: Center( + child: ListView.builder( + scrollDirection: + Axis.vertical, + itemCount: model + .categoriseParent + .length, + itemBuilder: + (BuildContext context, + int index) { + return Container( + child: Padding( + padding: + EdgeInsets.all( + 8.0), + child: InkWell( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Texts(model + .categoriseParent[ + index] + .name), + Divider( + thickness: + 0.6, + color: Colors + .black12, + ) + ], + ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: + (context) => + SubCategorisePage( + title: model.categoriseParent[index].name, + id: model.categoriseParent[index].id, + parentId: id, + )), + ); + }, + ), ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: - (context) => - SubCategorisePage( - title: - model.categoriseParent[index].name, - id: model.categoriseParent[index].id, - parentId: - id, - )), - ); - }, - ), - ), - ); - }), - ), + ); + }), + ), + ); + }, ); }, - ); - }, - ), + ), + ), + Icon(Icons.arrow_forward) + ], + ), + Divider( + thickness: 1.0, + color: Colors.grey.shade400, ), - Icon(Icons.arrow_forward) ], ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - ], - ), //Expanded widget heree if nassery - Padding( - padding: EdgeInsets.only(top: 35.0), - child: Container( - height: MediaQuery.of(context).size.height * 0.2, - child: Center( - child: ListView.builder( - scrollDirection: Axis.horizontal, - itemCount: model.categoriseParent.length > 8 - ? 8 - : model.categoriseParent.length, - itemBuilder: (BuildContext context, int index) { - return Padding( - padding: - EdgeInsets.symmetric(horizontal: 8.0), - child: InkWell( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.symmetric( - horizontal: 13.0), - child: Container( - height: 60.0, - width: 65.0, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.orange.shade200 - .withOpacity(0.45), - ), - child: Center( - child: Icon( - Icons.apps_sharp, - size: 32.0, + Padding( + padding: EdgeInsets.only(top: 35.0), + child: Container( + height: MediaQuery.of(context).size.height * 0.2, + child: Center( + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: model.categoriseParent.length > 8 + ? 8 + : model.categoriseParent.length, + itemBuilder: + (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.0), + child: InkWell( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 13.0), + child: Container( + height: 60.0, + width: 65.0, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors + .orange.shade200 + .withOpacity(0.45), + ), + child: Center( + child: Icon( + Icons.apps_sharp, + size: 32.0, + ), + ), ), ), - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.197, - height: MediaQuery.of(context) - .size - .height * - 0.08, - child: Center( - child: Texts( - projectViewModel.isArabic - ? model - .categoriseParent[index] - .namen - : model - .categoriseParent[index] - .name, - fontSize: 13.4, - fontWeight: FontWeight.w600, - maxLines: 3, + Container( + width: MediaQuery.of(context) + .size + .width * + 0.197, + height: MediaQuery.of(context) + .size + .height * + 0.08, + child: Center( + child: Texts( + projectViewModel.isArabic + ? model + .categoriseParent[ + index] + .namen + : model + .categoriseParent[ + index] + .name, + fontSize: 13.4, + fontWeight: FontWeight.w600, + maxLines: 3, + ), + ), ), - ), + ], ), - ], - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - SubCategorisePage( - title: model - .categoriseParent[index] - .name, - id: model - .categoriseParent[index] - .id, - parentId: id, - )), - ); - print(id); - }, - ), - ); - }), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + SubCategorisePage( + title: model + .categoriseParent[ + index] + .name, + id: model + .categoriseParent[ + index] + .id, + parentId: id, + )), + ); + print(id); + }, + ), + ); + }), + ), + ), ), - ), - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - InkWell( - child: Row( - children: [ - Icon( - Icons.wrap_text, - ), - SizedBox( - width: 10.0, - ), - Texts( - 'Refine', - fontWeight: FontWeight.w600, + Divider( + thickness: 1.0, + color: Colors.grey.shade400, + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + child: Row( + children: [ + Icon( + Icons.wrap_text, + ), + SizedBox( + width: 10.0, + ), + Texts( + 'Refine', + fontWeight: FontWeight.w600, + ), + ], ), - ], - ), - onTap: () { - showModalBottomSheet( - isScrollControlled: true, - context: context, - builder: (BuildContext context) { - return DraggableScrollableSheet( - initialChildSize: 0.95, - maxChildSize: 0.95, - minChildSize: 0.9, - builder: (BuildContext context, - ScrollController scrollController) { - return SingleChildScrollView( - controller: scrollController, - child: Container( - height: MediaQuery.of(context) - .size - .height * - 1.95, - child: Column( - children: [ - Padding( - padding: - EdgeInsets.all(8.0), - child: Row( - children: [ - Icon( - Icons.wrap_text, - ), - SizedBox( - width: 10.0, - ), - Texts( - 'Refine', - fontWeight: - FontWeight.w600, - ), - SizedBox( - width: 250.0, - ), - InkWell( - child: Texts( - 'Close', - color: Colors.red, - fontWeight: - FontWeight.w600, - fontSize: 15.0, - ), - onTap: () { - Navigator.pop( - context); - }, - ), - ], - ), - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - Column( + onTap: () { + showModalBottomSheet( + isScrollControlled: true, + context: context, + builder: (BuildContext context) { + return DraggableScrollableSheet( + initialChildSize: 0.95, + maxChildSize: 0.95, + minChildSize: 0.9, + builder: (BuildContext context, + ScrollController + scrollController) { + return SingleChildScrollView( + controller: scrollController, + child: Container( + height: MediaQuery.of(context) + .size + .height * + 1.95, + child: Column( children: [ - ExpansionTile( - title: - Texts('Categorise'), - children: [ - Container( - height: 350, - child: ListView - .builder( - controller: - scrollController, - scrollDirection: - Axis - .vertical, - shrinkWrap: - true, - itemCount: model - .categoriseParent - .length, - itemBuilder: - (BuildContext - context, - int index) { - return CheckboxListTile( - tristate: - true, - title: Texts(model - .categoriseParent[index] - .name), - controlAffinity: - ListTileControlAffinity.leading, - value: - checkedCategorise, - onChanged: - (bool - value) { - setState( - () { - checkedCategorise = - value; - }); - }, - ); - }), - ) - ], + Padding( + padding: + EdgeInsets.all(8.0), + child: Row( + children: [ + Icon( + Icons.wrap_text, + ), + SizedBox( + width: 10.0, + ), + Texts( + 'Refine', + fontWeight: + FontWeight + .w600, + ), + SizedBox( + width: 250.0, + ), + InkWell( + child: Texts( + 'Close', + color: + Colors.red, + fontWeight: + FontWeight + .w600, + fontSize: 15.0, + ), + onTap: () { + Navigator.pop( + context); + }, + ), + ], + ), ), Divider( thickness: 1.0, color: Colors.black12, ), - ExpansionTile( - title: Texts('Brands'), + Column( children: [ - Container( - height: 350, - child: ListView - .builder( - scrollDirection: - Axis - .vertical, - shrinkWrap: - true, - itemCount: model - .brandsList - .length, - itemBuilder: - (BuildContext - context, - int index) { - return CheckboxListTile( - tristate: + ExpansionTile( + title: Texts( + 'Categorise'), + children: [ + Container( + height: 350, + child: ListView + .builder( + controller: + scrollController, + scrollDirection: + Axis + .vertical, + shrinkWrap: true, - title: Texts(model - .brandsList[index] - .name), - controlAffinity: - ListTileControlAffinity.leading, - value: - checkedBrands, - onChanged: - (bool - value) { - setState( - () { - checkedBrands = - value; - }); - }, - autofocus: + itemCount: model + .categoriseParent + .length, + itemBuilder: + (BuildContext context, + int index) { + return CheckboxListTile( + tristate: + true, + title: + Texts(model.categoriseParent[index].name), + controlAffinity: + ListTileControlAffinity.leading, + value: + checkedCategorise, + onChanged: + (bool value) { + setState(() { + checkedCategorise = value; + }); + }, + ); + }), + ) + ], + ), + Divider( + thickness: 1.0, + color: + Colors.black12, + ), + ExpansionTile( + title: + Texts('Brands'), + children: [ + Container( + height: 350, + child: ListView + .builder( + scrollDirection: + Axis + .vertical, + shrinkWrap: true, - ); - }), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - ExpansionTile( - title: Texts('Price'), - children: [ - Container( - color: Color( - 0xffEEEEEE), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceAround, - children: [ - Column( + itemCount: model + .brandsList + .length, + itemBuilder: + (BuildContext context, + int index) { + return CheckboxListTile( + tristate: + true, + title: + Texts(model.brandsList[index].name), + controlAffinity: + ListTileControlAffinity.leading, + value: + checkedBrands, + onChanged: + (bool value) { + setState(() { + checkedBrands = value; + }); + }, + autofocus: + true, + ); + }), + ) + ], + ), + Divider( + thickness: 1.0, + color: + Colors.black12, + ), + ExpansionTile( + title: + Texts('Price'), + children: [ + Container( + color: Color( + 0xffEEEEEE), + child: Row( mainAxisAlignment: MainAxisAlignment - .start, + .spaceAround, children: [ - Texts( - 'Min'), - Container( - color: Colors - .white, - width: - 200, - height: - 40, - child: - TextFormField( - decoration: - InputDecoration( - border: - OutlineInputBorder(), + Column( + mainAxisAlignment: + MainAxisAlignment + .start, + children: [ + Texts( + 'Min'), + Container( + color: + Colors.white, + width: + 200, + height: + 40, + child: + TextFormField( + decoration: + InputDecoration( + border: OutlineInputBorder(), + ), + ), ), - ), + ], ), - ], - ), - Column( - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - Texts( - 'Max'), - Container( - color: Colors - .white, - width: - 200, - height: - 40, - child: - TextFormField( - decoration: - InputDecoration( - border: - OutlineInputBorder(), + Column( + mainAxisAlignment: + MainAxisAlignment + .start, + children: [ + Texts( + 'Max'), + Container( + color: + Colors.white, + width: + 200, + height: + 40, + child: + TextFormField( + decoration: + InputDecoration( + border: OutlineInputBorder(), + ), + ), ), - ), + ], ), ], ), + ) + ], + ), + Divider( + thickness: 1.0, + color: + Colors.black12, + ), + SizedBox( + height: MediaQuery.of( + context) + .size + .height * + 0.4, + ), + Padding( + padding: + EdgeInsets.all( + 8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + children: [ + Container( + width: 100, + child: Button( + label: + 'Reset', + backgroundColor: + Colors + .red, + ), + ), + SizedBox( + width: 30, + ), + Container( + width: 200, + child: Button( + label: + 'Apply', + backgroundColor: + Colors + .green, + ), + ), ], ), - ) + ), ], ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - SizedBox( - height: MediaQuery.of( - context) - .size - .height * - 0.4, - ), - Padding( - padding: - EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - children: [ - Container( - width: 100, - child: Button( - label: 'Reset', - backgroundColor: + ], + ), + ), + ); + }); + }, + ); + }, + ), + Row( + children: [ + Container( + height: 44.0, + child: VerticalDivider( + color: Colors.black45, + thickness: 1.0, +//width: 0.3, +// indent: 0.0, + ), + ), + Padding( + padding: EdgeInsets.all(8.0), + child: InkWell( + child: styleIcon, + onTap: () { + setState(() { + if (styleOne == true) { + styleOne = false; + styleTwo = true; + styleIcon = Icon( + Icons.auto_awesome_mosaic, + color: Colors.blue, + size: 29.0, + ); + } else { + styleOne = true; + styleTwo = false; + styleIcon = Icon( + Icons.widgets_sharp, + color: Colors.blue, + size: 29.0, + ); + } + }); + }, + ), + ), + ], + ), + ], + ), + ), + Divider( + thickness: 1.0, + color: Colors.grey.shade400, + ), + styleOne == true + ? Container( + height: SizeConfig.screenHeight * 7.8, + child: GridView.builder( + physics: NeverScrollableScrollPhysics(), + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 0.5, + mainAxisSpacing: 2.0, + childAspectRatio: 0.9, + ), + itemCount: model.parentProducts.length, + itemBuilder: + (BuildContext context, int index) { + return NetworkBaseView( + baseViewModel: model, + child: Card( + color: model.parentProducts[index] + .discountName != + null + ? Color(0xffFFFF00) + : Colors.white, + elevation: 0, + shape: Border( + right: BorderSide( + color: Colors.grey.shade300, + width: 1, + ), + left: BorderSide( + color: Colors.grey.shade300, + width: 1, + ), + bottom: BorderSide( + color: Colors.grey.shade300, + width: 1, + ), + top: BorderSide( + color: Colors.grey.shade300, + width: 1, + ), + ), + margin: EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: + Radius.circular(110.0), + ), + color: Colors.white, + ), + padding: EdgeInsets.symmetric( + horizontal: 0), + width: MediaQuery.of(context) + .size + .width / + 3, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Stack( + children: [ + if (model + .parentProducts[ + index] + .discountName != + null) + RotatedBox( + quarterTurns: 4, + child: Container( + decoration: + BoxDecoration(), + child: Padding( + padding: + EdgeInsets + .only( + right: 5.0, + top: 20.0, + bottom: 5.0, + ), + child: Texts( + 'offer' + .toUpperCase(), + color: Colors.red, + fontSize: 13.0, + fontWeight: + FontWeight + .w900, ), ), - SizedBox( - width: 30, + transform: new Matrix4 + .rotationZ( + 5.837200), + ), + ), + Container( + margin: + EdgeInsets.fromLTRB( + 0, 16, 0, 0), + alignment: + Alignment.center, + child: Image.network( + model + .parentProducts[ + index] + .images + .isNotEmpty + ? model + .parentProducts[ + index] + .images[0] + .thumb + : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', + fit: BoxFit.cover, + height: 80, + ), + ), + Container( + width: model + .parentProducts[ + index] + .rxMessage != + null + ? MediaQuery.of( + context) + .size + .width / + 5 + : 0, + padding: + EdgeInsets.all(4), + decoration: + BoxDecoration( + color: + Color(0xffb23838), + borderRadius: + BorderRadius.only( + topLeft: Radius + .circular( + 6)), + ), + child: Texts( + model + .parentProducts[ + index] + .rxMessage != + null + ? model + .parentProducts[ + index] + .rxMessage + : "", + color: Colors.white, + regular: true, + fontSize: 10, + fontWeight: + FontWeight.w400, + ), + ), + ], + ), + Container( + margin: + EdgeInsets.symmetric( + horizontal: 6, + vertical: 0, + ), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + if (model + .parentProducts[ + index] + .discountName != + null) + Container( + width: + double.infinity, + height: 13.0, + decoration: + BoxDecoration( + color: Color( + 0xff5AB145), ), - Container( - width: 200, - child: Button( - label: 'Apply', - backgroundColor: - Colors - .green, + child: Center( + child: Texts( + model + .parentProducts[ + index] + .discountName, + regular: true, + color: Colors + .white, + fontSize: 10.4, ), ), + ), + Texts( + model + .parentProducts[ + index] + .name, + regular: true, + fontSize: 12, + fontWeight: + FontWeight.w700, + ), + Padding( + padding: + const EdgeInsets + .only( + top: 4, + bottom: 4), + child: Texts( + "SAR ${model.parentProducts[index].price}", + bold: true, + fontSize: 14, + ), + ), + Row( + children: [ + StarRating( + totalAverage: model + .parentProducts[ + index] + .approvedRatingSum > + 0 + ? (model.parentProducts[index].approvedRatingSum.toDouble() / + model.parentProducts[index].approvedRatingSum + .toDouble()) + .toDouble() + : 0, + forceStars: + true), + Texts( + "(${model.parentProducts[index].approvedTotalReviews})", + regular: true, + fontSize: 10, + fontWeight: + FontWeight + .w400, + ) ], ), - ), - ], + ], + ), ), ], ), ), - ); - }); - }, - ); - }, - ), - Row( - children: [ - Container( - height: 44.0, - child: VerticalDivider( - color: Colors.black45, - thickness: 1.0, -//width: 0.3, -// indent: 0.0, - ), - ), - Padding( - padding: EdgeInsets.all(8.0), - child: InkWell( - child: styleIcon, - onTap: () { - setState(() { - if (styleOne == true) { - styleOne = false; - styleTwo = true; - styleIcon = Icon( - Icons.auto_awesome_mosaic, - color: Colors.blue, - size: 29.0, - ); - } else { - styleOne = true; - styleTwo = false; - styleIcon = Icon( - Icons.widgets_sharp, - color: Colors.blue, - size: 29.0, - ); - } - }); + )); }, ), - ), - ], - ), - ], - ), - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - styleOne == true - ? Container( - height: MediaQuery.of(context).size.height * 4.89, - child: GridView.builder( - physics: NeverScrollableScrollPhysics(), - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 0.5, - mainAxisSpacing: 2.0, - childAspectRatio: 0.9, - ), - itemCount: model.parentProducts.length, - itemBuilder: (BuildContext context, int index) { - return NetworkBaseView( - baseViewModel: model, - child: Card( - color: model.parentProducts[index] - .discountName != - null - ? Color(0xffFFFF00) - : Colors.white, - elevation: 0, - shape: Border( - right: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - left: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - bottom: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - top: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - ), - margin: EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(110.0), - ), - color: Colors.white, - ), - padding: EdgeInsets.symmetric( - horizontal: 0), - width: MediaQuery.of(context) - .size - .width / - 3, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + ) + : Container( + height: + MediaQuery.of(context).size.height * 5.0, + child: ListView.builder( + physics: NeverScrollableScrollPhysics(), + itemCount: model.parentProducts.length, + itemBuilder: + (BuildContext context, int index) { + return Card( + child: Row( children: [ Stack( children: [ - if (model - .parentProducts[index] - .discountName != - null) - RotatedBox( - quarterTurns: 4, - child: Container( + Column( + children: [ + Container( decoration: BoxDecoration(), child: Padding( padding: EdgeInsets.only( - right: 5.0, - top: 20.0, - bottom: 5.0, - ), - child: Texts( - 'offer' - .toUpperCase(), - color: Colors.red, - fontSize: 13.0, - fontWeight: - FontWeight.w900, + left: 9.0, + top: 8.0, + right: 10.0, ), ), - transform: new Matrix4 - .rotationZ( - 5.837200), ), - ), - Container( - margin: EdgeInsets.fromLTRB( - 0, 16, 0, 0), - alignment: Alignment.center, - child: Image.network( - model - .parentProducts[ - index] - .images - .isNotEmpty - ? model - .parentProducts[ - index] - .images[0] - .thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.cover, - height: 80, - ), + Container( + margin: + EdgeInsets.fromLTRB( + 0, 0, 0, 0), + alignment: + Alignment.center, + child: Image.network( + model + .parentProducts[ + index] + .images + .isNotEmpty + ? model + .parentProducts[ + index] + .images[0] + .thumb + : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', + fit: BoxFit.contain, + height: 80, + ), + ), + ], ), - Container( - width: model - .parentProducts[ - index] - .rxMessage != - null - ? MediaQuery.of(context) - .size - .width / - 5 - : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: - BorderRadius.only( - topLeft: Radius - .circular(6)), - ), - child: Texts( - model + Column( + children: [ + Container( + width: model + .parentProducts[ + index] + .rxMessage != + null + ? MediaQuery.of( + context) + .size + .width / + 5 + : 0, + padding: + EdgeInsets.all(4), + decoration: + BoxDecoration( + color: + Color(0xffb23838), + borderRadius: + BorderRadius.only( + topLeft: Radius + .circular( + 6)), + ), + child: Texts( + model + .parentProducts[ + index] + .rxMessage != + null + ? model .parentProducts[ index] - .rxMessage != - null - ? model - .parentProducts[ - index] - .rxMessage - : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ), + .rxMessage + : "", + color: Colors.white, + regular: true, + fontSize: 10, + fontWeight: + FontWeight.w400, + ), + ), + ], ), ], ), Container( + height: 100.0, margin: EdgeInsets.symmetric( horizontal: 6, vertical: 0, ), child: Column( + mainAxisAlignment: + MainAxisAlignment + .spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (model - .parentProducts[ - index] - .discountName != - null) - Container( - width: double.infinity, - height: 13.0, - decoration: - BoxDecoration( - color: - Color(0xff5AB145), - ), - child: Center( - child: Texts( - model - .parentProducts[ - index] - .discountName, - regular: true, - color: Colors.white, - fontSize: 10.4, - ), - ), - ), + SizedBox( + height: 4.0, + ), Texts( model .parentProducts[index] .name, regular: true, - fontSize: 12, + fontSize: 13.2, fontWeight: - FontWeight.w700, + FontWeight.w500, + maxLines: 5, + ), + SizedBox( + height: 8.0, ), Padding( padding: @@ -855,176 +1060,13 @@ class _ParentCategorisePageState extends State { ), ], ), - ), - )); - }, - ), - ) - : Container( - height: MediaQuery.of(context).size.height * 5.0, - child: ListView.builder( - physics: NeverScrollableScrollPhysics(), - itemCount: model.parentProducts.length, - itemBuilder: - (BuildContext context, int index) { - return Card( - child: Row( - children: [ - Stack( - children: [ - Column( - children: [ - Container( - decoration: BoxDecoration(), - child: Padding( - padding: EdgeInsets.only( - left: 9.0, - top: 8.0, - right: 10.0, - ), - ), - ), - Container( - margin: EdgeInsets.fromLTRB( - 0, 0, 0, 0), - alignment: Alignment.center, - child: Image.network( - model - .parentProducts[ - index] - .images - .isNotEmpty - ? model - .parentProducts[ - index] - .images[0] - .thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.contain, - height: 80, - ), - ), - ], - ), - Column( - children: [ - Container( - width: model - .parentProducts[ - index] - .rxMessage != - null - ? MediaQuery.of(context) - .size - .width / - 5 - : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: - BorderRadius.only( - topLeft: Radius - .circular(6)), - ), - child: Texts( - model - .parentProducts[ - index] - .rxMessage != - null - ? model - .parentProducts[ - index] - .rxMessage - : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ), - ), - ], - ), - ], - ), - Container( - height: 100.0, - margin: EdgeInsets.symmetric( - horizontal: 6, - vertical: 0, - ), - child: Column( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SizedBox( - height: 4.0, - ), - Texts( - model.parentProducts[index] - .name, - regular: true, - fontSize: 13.2, - fontWeight: FontWeight.w500, - maxLines: 5, - ), - SizedBox( - height: 8.0, - ), - Padding( - padding: - const EdgeInsets.only( - top: 4, bottom: 4), - child: Texts( - "SAR ${model.parentProducts[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ - StarRating( - totalAverage: model - .parentProducts[ - index] - .approvedRatingSum > - 0 - ? (model - .parentProducts[ - index] - .approvedRatingSum - .toDouble() / - model - .parentProducts[ - index] - .approvedRatingSum - .toDouble()) - .toDouble() - : 0, - forceStars: true), - Texts( - "(${model.parentProducts[index].approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ) - ], - ), - ], - ), - ), - ], - ), - ); - }), - ) - ], - ), + ); + }), + ) + ], + ), + ), + ], ), ), )); From 21ccf1ef86b54f8ce0c8433b7d260f1f101f5fb8 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 9 Dec 2020 21:48:21 +0300 Subject: [PATCH 013/103] bug fixes --- lib/core/service/client/base_app_client.dart | 10 +- lib/pages/landing/home_page.dart | 185 ++++++----- lib/pages/login/login-type.dart | 295 +++++++++--------- lib/pages/login/login.dart | 57 ++-- .../authentication/auth_provider.dart | 20 +- .../others/floating_button_search.dart | 4 +- 6 files changed, 312 insertions(+), 259 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 0e940a53..1caea0fe 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -157,9 +157,13 @@ class BaseAppClient { onFailure('Please Check The Internet Connection', -1); } } catch (e) { - print(e); - onFailure('Failed to connect to the server', -1); - // onFailure(e.toString(), -1); + //print(e); + // + if (e is String) { + onFailure(e.toString(), -1); + } else { + onFailure('Failed to connect to the server', -1); + } } } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index fbdaf906..41f9f309 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -27,7 +27,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; - +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import '../../locator.dart'; class HomePage extends StatefulWidget { @@ -49,8 +49,8 @@ class _HomePageState extends State { // }); // super.initState(); // } - AuthenticatedUserObject authenticatedUserObject = locator(); - + AuthenticatedUserObject authenticatedUserObject = + locator(); @override Widget build(BuildContext context) { @@ -93,9 +93,10 @@ class _HomePageState extends State { ) ], ), - ), - Container(width: double.infinity, height:projectViewModel.isArabic ? 120:110), + Container( + width: double.infinity, + height: projectViewModel.isArabic ? 120 : 110), ], ), Positioned( @@ -110,7 +111,7 @@ class _HomePageState extends State { Orientation.landscape ? 0.02 : 0.03), - child: (!model.isLogin ) + child: (!model.isLogin) ? Container( width: double.infinity, height: 160, @@ -179,7 +180,6 @@ class _HomePageState extends State { color: Theme.of(context) .primaryColor, fontSize: 14, - ), ), ), @@ -307,7 +307,9 @@ class _HomePageState extends State { bold: true, ), Texts( - TranslationBase.of(context).height, + TranslationBase.of( + context) + .height, color: Colors.white, fontSize: 10, ), @@ -339,7 +341,9 @@ class _HomePageState extends State { bold: true, ), Texts( - TranslationBase.of(context).weight, + TranslationBase.of( + context) + .weight, color: Colors.white, fontSize: 10, ) @@ -353,8 +357,10 @@ class _HomePageState extends State { ), Expanded( child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Image.asset( 'assets/images/blood-drop.png', @@ -368,7 +374,9 @@ class _HomePageState extends State { color: Colors.white, ), Texts( - TranslationBase.of(context).bloodType, + TranslationBase.of( + context) + .bloodType, color: Colors.white, fontSize: 10, ) @@ -407,28 +415,35 @@ class _HomePageState extends State { padding: const EdgeInsets.all(15.0), child: Column( children: [ - SizedBox(height: 15,), - + SizedBox( + height: 15, + ), Container( width: 60, decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(12) - ), - child: Center(child: Image.asset('assets/images/vital_sign_icon.png', + borderRadius: + BorderRadius.circular(12)), + child: Center( + child: Image.asset( + 'assets/images/vital_sign_icon.png', width: 80, height: 50, - fit: BoxFit.contain,)), + fit: BoxFit.contain, + )), + ), + SizedBox( + height: 20, ), - SizedBox(height: 20,), Texts( - TranslationBase.of(context) - .vitalSigns, + TranslationBase.of(context).vitalSigns, textAlign: TextAlign.center, color: Colors.white, bold: true, - fontSize: projectViewModel.isArabic? SizeConfig.textMultiplier * 1.5 :SizeConfig.textMultiplier * 1.7, + fontSize: projectViewModel.isArabic + ? SizeConfig.textMultiplier * 1.5 + : SizeConfig.textMultiplier * 1.7, ) ], ), @@ -456,26 +471,35 @@ class _HomePageState extends State { padding: const EdgeInsets.all(15.0), child: Column( children: [ - SizedBox(height: 15,), + SizedBox( + height: 15, + ), Container( width: 50, decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(12) - ), - child: Center(child: Image.asset('assets/images/search_medicine_icon.png', + borderRadius: + BorderRadius.circular(12)), + child: Center( + child: Image.asset( + 'assets/images/search_medicine_icon.png', width: 50, height: 50, - fit: BoxFit.contain,)), + fit: BoxFit.contain, + )), + ), + SizedBox( + height: 20, ), - SizedBox(height: 20,), Texts( TranslationBase.of(context).searchMedicine, textAlign: TextAlign.center, color: Colors.white, bold: true, - fontSize: projectViewModel.isArabic? SizeConfig.textMultiplier * 1.5 :SizeConfig.textMultiplier * 1.7, + fontSize: projectViewModel.isArabic + ? SizeConfig.textMultiplier * 1.5 + : SizeConfig.textMultiplier * 1.7, ) ], ), @@ -487,8 +511,9 @@ class _HomePageState extends State { ), ), Expanded( - child: DashboardItem(opacity: 1.0, - onTap: (){ + child: DashboardItem( + opacity: 1.0, + onTap: () { Navigator.push( context, FadePage( @@ -501,25 +526,35 @@ class _HomePageState extends State { padding: const EdgeInsets.all(15.0), child: Column( children: [ - SizedBox(height: 15,), + SizedBox( + height: 15, + ), Container( decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(12) - ), - child: Center(child: Image.asset('assets/images/online_payment_icon.png', + borderRadius: + BorderRadius.circular(12)), + child: Center( + child: Image.asset( + 'assets/images/online_payment_icon.png', width: 80, height: 50, - fit: BoxFit.contain,)), + fit: BoxFit.contain, + )), + ), + SizedBox( + height: 15, ), - SizedBox(height: 15,), Texts( - TranslationBase.of(context).onlinePaymentService, + TranslationBase.of(context) + .onlinePaymentService, textAlign: TextAlign.center, color: Colors.white, bold: true, - fontSize: projectViewModel.isArabic? SizeConfig.textMultiplier * 1.5 :SizeConfig.textMultiplier * 1.7, + fontSize: projectViewModel.isArabic + ? SizeConfig.textMultiplier * 1.5 + : SizeConfig.textMultiplier * 1.7, ) ], ), @@ -555,34 +590,33 @@ class _HomePageState extends State { ); }, child: MedicalProfileItem( - title: TranslationBase.of(context) - .myAppointments, + title: + TranslationBase.of(context).myAppointments, imagePath: 'my_appointment_icon.png', - subTitle: TranslationBase.of(context).myAppointmentsList, + subTitle: TranslationBase.of(context) + .myAppointmentsList, ), ), ), Expanded( flex: 1, child: InkWell( - onTap: () => Navigator.push(context, - FadePage(page: LabsHomePage())), + onTap: () => Navigator.push( + context, FadePage(page: LabsHomePage())), child: MedicalProfileItem( title: TranslationBase.of(context).lab, imagePath: 'lab_result_icon.png', - subTitle: - TranslationBase.of(context).lab, + subTitle: TranslationBase.of(context).lab, ), ), ), Expanded( flex: 1, child: InkWell( - onTap: () => Navigator.push(context, - FadePage(page: RadiologyHomePage())), + onTap: () => Navigator.push( + context, FadePage(page: RadiologyHomePage())), child: MedicalProfileItem( - title: TranslationBase.of(context) - .radiology, + title: TranslationBase.of(context).radiology, imagePath: 'radiology_icon.png', subTitle: TranslationBase.of(context) .radiologySubtitle, @@ -605,8 +639,7 @@ class _HomePageState extends State { ); }, child: MedicalProfileItem( - title: TranslationBase.of(context) - .medicines, + title: TranslationBase.of(context).medicines, imagePath: 'prescription_icon.png', subTitle: TranslationBase.of(context) .medicinesSubtitle, @@ -625,8 +658,7 @@ class _HomePageState extends State { ); }, child: MedicalProfileItem( - title: TranslationBase.of(context) - .myDoctor, + title: TranslationBase.of(context).myDoctor, imagePath: 'doctor_icon.png', subTitle: TranslationBase.of(context) .myDoctorSubtitle, @@ -637,12 +669,11 @@ class _HomePageState extends State { flex: 1, child: InkWell( onTap: () { - Navigator.push(context, - FadePage(page: InsuranceCard())); + Navigator.push( + context, FadePage(page: InsuranceCard())); }, child: MedicalProfileItem( - title: TranslationBase.of(context) - .insurance, + title: TranslationBase.of(context).insurance, imagePath: 'insurance_card_icon.png', subTitle: TranslationBase.of(context) .insuranceSubtitle, @@ -651,7 +682,6 @@ class _HomePageState extends State { ), ], ), - ], ), ), @@ -664,7 +694,7 @@ class _HomePageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ DashboardItem( - opacity:1.0, + opacity: 1.0, child: Container( width: double.infinity, padding: EdgeInsets.all(10), @@ -677,31 +707,38 @@ class _HomePageState extends State { bold: true, ), Texts( - TranslationBase.of(context).viewAllHabibMedicalService, + TranslationBase.of(context) + .viewAllHabibMedicalService, color: Colors.white, fontWeight: FontWeight.normal, fontSize: 10, ), - Expanded( - child: Container(), - ), - Texts( + // Expanded( + // child: Container(), + // ), + Text( TranslationBase.of(context).viewAll, - color: Colors.white, - bold: true, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold), + overflow: TextOverflow.ellipsis, ) ], ), ), - height: 100, + height: 106, imageName: 'ask_doctor_bg.png', - //color: Colors.grey[700], + //color: Colors.grey[700], width: MediaQuery.of(context).size.width * 0.45, onTap: () => Navigator.push( - context, FadePage(page: AllHabibMedicalService(goToMyProfile: widget.goToMyProfile,))), + context, + FadePage( + page: AllHabibMedicalService( + goToMyProfile: widget.goToMyProfile, + ))), ), DashboardItem( - opacity:1.0, + opacity: 1.0, onTap: () { Navigator.push( context, FadePage(page: ContactUsPage())); @@ -721,7 +758,7 @@ class _HomePageState extends State { TranslationBase.of(context).viewAllWaysReachUs, color: Colors.white, fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 1.0 , + fontSize: SizeConfig.textMultiplier * 1.0, ), Expanded( child: Container(), @@ -786,7 +823,9 @@ class DashboardItem extends StatelessWidget { this.width, this.height, this.color, - this.opacity = 1.0,this.icon,this.margin=0}) + this.opacity = 1.0, + this.icon, + this.margin = 0}) : super(key: key); final bool hasBorder; final String imageName; diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index dcd58b9d..6113fb71 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -14,159 +14,168 @@ class LoginType extends StatelessWidget { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).login, + appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, isShowDecPage: false, - body: Padding( - padding: EdgeInsets.all(20), - child: Column( - children: [ - Expanded( - flex: 4, - child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset( - 'assets/images/DQ/dq_logo_icon.png', - height: 90, - width: 90, - ), - AppText( - TranslationBase.of(context).logintypeRadio, - fontSize: SizeConfig.textMultiplier * 3.5, - textAlign: TextAlign.start, - marginBottom: 20.0, - marginTop: 20.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, + body: SingleChildScrollView( + child: Container( + padding: + EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), + height: SizeConfig.realScreenHeight * .9, + width: SizeConfig.realScreenWidth, + child: Column( + children: [ + Expanded( + flex: 4, + child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: InkWell( - onTap: () => { - LoginType.loginType = 1, - Navigator.of(context) - .pushNamed(LOGIN_PAGE) - }, - child: RoundedContainer( - borderColor: Colors.grey, - showBorder: true, - child: Padding( - padding: EdgeInsets.fromLTRB( - 20, 10, 20, 10), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/id_card_icon.png', - height: SizeConfig - .imageSizeMultiplier * - 12, - width: SizeConfig - .imageSizeMultiplier * - 15, - ), - SizedBox( - height: 20, + Image.asset( + 'assets/images/DQ/dq_logo_icon.png', + height: 90, + width: 90, + ), + AppText( + TranslationBase.of(context).logintypeRadio, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.start, + marginBottom: 20.0, + marginTop: 20.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () => { + LoginType.loginType = 1, + Navigator.of(context) + .pushNamed(LOGIN_PAGE) + }, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB( + 20, 10, 20, 10), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/id_card_icon.png', + height: SizeConfig + .imageSizeMultiplier * + 12, + width: SizeConfig + .imageSizeMultiplier * + 15, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .idNo, + fontSize: SizeConfig + .textMultiplier * + 2, + fontWeight: FontWeight.bold, + ) + ], ), - AppText( - TranslationBase.of(context) - .idNo, - fontSize: - SizeConfig.textMultiplier * + )))), + Expanded( + child: InkWell( + onTap: () => { + LoginType.loginType = 2, + Navigator.of(context) + .pushNamed(LOGIN_PAGE) + }, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB( + 25, 10, 25, 10), + child: Column( + children: [ + Image.asset( + 'assets/images/my_file_white_icon.png', + height: SizeConfig + .imageSizeMultiplier * + 12, + width: SizeConfig + .imageSizeMultiplier * + 15, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .fileNo, + fontSize: SizeConfig + .textMultiplier * 2, - fontWeight: FontWeight.bold, - ) - ], - ), - )))), - Expanded( + fontWeight: FontWeight.bold, + ) + ], + ), + )))) + ], + ), + SizedBox( + height: 25, + ), + Divider( + color: Colors.grey, + height: 2, + ), + Center( child: InkWell( onTap: () => { - LoginType.loginType = 2, Navigator.of(context) - .pushNamed(LOGIN_PAGE) + .pushNamed(FORGOT_PASSWORD) }, - child: RoundedContainer( - borderColor: Colors.grey, - showBorder: true, - child: Padding( - padding: EdgeInsets.fromLTRB( - 25, 10, 25, 10), - child: Column( - children: [ - Image.asset( - 'assets/images/my_file_white_icon.png', - height: SizeConfig - .imageSizeMultiplier * - 12, - width: SizeConfig - .imageSizeMultiplier * - 15, - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context) - .fileNo, - fontSize: - SizeConfig.textMultiplier * - 2, - fontWeight: FontWeight.bold, - ) - ], - ), - )))) - ], - ), - SizedBox(height: 25,), - Divider( - color: Colors.grey, - height: 2, - ), - Center( - child: InkWell( - onTap: () => { - Navigator.of(context) - .pushNamed(FORGOT_PASSWORD) - }, - child: AppText( - TranslationBase.of(context).forgotPassword, - fontSize: SizeConfig.textMultiplier * 2.5, - marginTop: 20.0, - underline: true))) - ]), - ), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Divider( - color: Colors.grey, - height: 2, - ), - SizedBox(height: 10,), - Row( + child: AppText( + TranslationBase.of(context) + .forgotPassword, + fontSize: + SizeConfig.textMultiplier * 2.5, + marginTop: 20.0, + underline: true))) + ]), + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, children: [ - - Expanded( - child: DefaultButton( - TranslationBase.of(context).registerNow, - () => { - Navigator.of(context).pushNamed( - REGISTER, - ) - }, - )), + Divider( + color: Colors.grey, + height: 2, + ), + SizedBox( + height: 10, + ), + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).registerNow, + () => { + Navigator.of(context).pushNamed( + REGISTER, + ) + }, + )), + ], + ), ], - ), - ], - )) - ], - ))); + )) + ], + )))); } } diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index a1540ef7..cb3ae1a4 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -93,23 +93,24 @@ class _Login extends State { onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), - Directionality( - textDirection:TextDirection.ltr,child:Container( - child: TextFields( - fontWeight: FontWeight.normal, - controller: nationalIDorFile, - onChanged: (value) => {validateForm()}, - prefixIcon: Icon( - loginType == 1 - ? Icons.chrome_reader_mode - : Icons.receipt, - color: Color(0xFF40ACC9)), - padding: EdgeInsets.only( - top: 20, bottom: 20, left: 10, right: 10), - hintText: loginType == 1 - ? TranslationBase.of(context).nationalID - : TranslationBase.of(context).fileNo, - ))) + Directionality( + textDirection: TextDirection.ltr, + child: Container( + child: TextFields( + fontWeight: FontWeight.normal, + controller: nationalIDorFile, + onChanged: (value) => {validateForm()}, + prefixIcon: Icon( + loginType == 1 + ? Icons.chrome_reader_mode + : Icons.receipt, + color: Color(0xFF40ACC9)), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + hintText: loginType == 1 + ? TranslationBase.of(context).nationalID + : TranslationBase.of(context).fileNo, + ))) ], ), ), @@ -122,7 +123,9 @@ class _Login extends State { color: Colors.grey, height: 2, ), - SizedBox(height: 10,), + SizedBox( + height: 10, + ), Row( children: [ Expanded( @@ -152,18 +155,14 @@ class _Login extends State { } void validateForm() { - //TODO fix login - if (util.validateIDBox(nationalIDorFile.text, loginType) == - true /*&& - mobileNo.length >= 9 */ - && + if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { setState(() { isButtonDisabled = false; }); } else { setState(() { - isButtonDisabled = false; + isButtonDisabled = true; }); } } @@ -209,15 +208,13 @@ class _Login extends State { okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => { - ConfirmDialog.closeAlertDialog(context), + ConfirmDialog.closeAlertDialog(context), Navigator.of(context).pushNamed( REGISTER, ), - }, cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); dialog.showAlertDialog(context); - }); // SMSOTP.showLoadingDialog(context, false), } @@ -244,9 +241,9 @@ class _Login extends State { this.authService.checkActivationCode(request, code).then((result) => { sharedPref.remove(FAMILY_FILE), result = CheckActivationCode.fromJson(result), - result.list.isFamily =false, - this.sharedPref.setObject(USER_PROFILE, result.list), - this.sharedPref.setObject(MAIN_USER, result.list), + result.list.isFamily = false, + this.sharedPref.setObject(USER_PROFILE, result.list), + this.sharedPref.setObject(MAIN_USER, result.list), this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), this.sharedPref.setString(TOKEN, result.authenticationTokenID), authenticatedUserObject.getUser(), diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 59f51bfc..07e1e301 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -173,15 +173,19 @@ class AuthProvider with ChangeNotifier { request.generalid = GENERAL_ID; request.languageID = LANGUAGE_ID; request.patientOutSA = request.zipCode == '966' ? 0 : 1; - - dynamic localRes; - await new BaseAppClient().post(CHECK_PATIENT_AUTH, - onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { + try { + dynamic localRes; + await new BaseAppClient().post(CHECK_PATIENT_AUTH, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request.toJson()); + return Future.value(localRes); + } catch (error) { throw error; - }, body: request.toJson()); - return Future.value(localRes); + //throw error; + } } Future getLoginInfo(request) async { diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 2bfacaea..babbf052 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -823,13 +823,13 @@ class _FloatingSearchButton extends State speak() async { if (_currentLocaleId == 'en' && results['ReturnMessage'] != null) { - await flutterTts.setVoice("en-us-x-sfg#male_2-local"); + //await flutterTts.setVoice("en-us-x-sfg#male_2-local"); await flutterTts.setLanguage("en-US"); await flutterTts.speak(results['ReturnMessage']); } else if (results['ReturnMessage_Ar'] != null) { await flutterTts.setLanguage("ar-SA"); - await flutterTts.setVoice("ar-sa-x-sfg#male_1-local"); + //await flutterTts.setVoice("ar-sa-x-sfg#male_1-local"); await flutterTts.speak(results['ReturnMessage_Ar']); } // Future.delayed(const Duration(seconds: 10), () { From eca2266f7b03d67e28d22f9d4a81dc3d92aa312a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 23:23:14 +0200 Subject: [PATCH 014/103] hot fixing --- lib/config/localized_values.dart | 18 +++- .../insurance/insurance_card_screen.dart | 87 +++++++++++-------- lib/pages/insurance/insurance_details.dart | 26 +++--- .../prescription_details_page.dart | 20 +++-- .../prescriptions_home_page.dart | 2 +- .../prescriptions/prescriptions_page.dart | 4 +- .../radiology/radiology_details_page.dart | 7 +- lib/uitl/translations_delegate_base.dart | 4 + .../LabResult/Lab_Result_details_wideget.dart | 3 +- .../data_display/medical/doctor_card.dart | 4 +- 10 files changed, 107 insertions(+), 68 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f7b5f234..313cbbb2 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1175,5 +1175,21 @@ const Map localizedValues = { 'details':{ 'en':'Details', 'ar':'التفاصيل' - } + }, + "active-insurence": { + "en": "Active", + "ar": "نشطة" + }, + "not-active": { + "en": "Not Active", + "ar": "غير نشط" + }, + "card-detail": { + "en": "Insurance Details", + "ar": "منافعك التامينية" + }, + "Dr": { + "en": "Dr. ", + "ar": "الدكتور." + }, }; diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index 5f8c6777..42357eea 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -20,18 +20,23 @@ import '../base/base_view.dart'; class InsuranceCard extends StatefulWidget { int appointmentNo; - InsuranceCard({this.appointmentNo}); @override _InsuranceCardState createState() => _InsuranceCardState(); } + class _InsuranceCardState extends State { InsuranceCardService _insuranceCardService = locator(); List imagesInfo = List(); + @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); return BaseView( onModelReady: (model) => model.getInsurance(), @@ -79,16 +84,16 @@ class _InsuranceCardState extends State { padding: EdgeInsets.all(14), width: double.infinity, decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.grey,width: 0.2), - borderRadius: BorderRadius.all(Radius.circular(2)), - boxShadow: [ - BoxShadow( - color: Colors.white70, - ), - - ] - ), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.grey, width: 0.2), + borderRadius: + BorderRadius.all(Radius.circular(2)), + boxShadow: [ + BoxShadow( + color: Colors.white70, + ), + ]), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -103,28 +108,34 @@ class _InsuranceCardState extends State { thickness: 0.5, ), Column( - crossAxisAlignment: CrossAxisAlignment.stretch, + crossAxisAlignment: + CrossAxisAlignment.stretch, children: [ Text( TranslationBase.of(context).category + - model.insurance[index].subCategoryDesc, + model.insurance[index] + .subCategoryDesc, style: TextStyle(fontSize: 18.5), ), Text( - TranslationBase.of(context).expirationDate + - convertDateFormat( - model.insurance[index].cardValidTo), + TranslationBase.of(context) + .expirationDate + + convertDateFormat(model + .insurance[index].cardValidTo), style: TextStyle(fontSize: 18.5), ), Text( - TranslationBase.of(context).patientCard + - model.insurance[index].patientCardID, + TranslationBase.of(context) + .patientCard + + model + .insurance[index].patientCardID, style: TextStyle(fontSize: 18.5), ), Text( - TranslationBase.of(context).policyNumber + - model - .insurance[index].insurancePolicyNumber, + TranslationBase.of(context) + .policyNumber + + model.insurance[index] + .insurancePolicyNumber, style: TextStyle(fontSize: 18.5), ), ], @@ -132,16 +143,18 @@ class _InsuranceCardState extends State { Column( children: [ model.insurance[index].isActive == true - ? Text('Active', - style: TextStyle( + ? Texts( + TranslationBase.of(context) + .activeInsurence, color: Colors.green, fontWeight: FontWeight.w900, - fontSize: 17.9)) - : Text('Not Active', - style: TextStyle( + fontSize: 17.9) + : Texts( + TranslationBase.of(context) + .notActive, color: Colors.red, fontWeight: FontWeight.w900, - fontSize: 17.9)) + fontSize: 17.9) ], ), SizedBox( @@ -151,7 +164,9 @@ class _InsuranceCardState extends State { Container( color: Colors.transparent, child: SecondaryButton( - onTap:()=>{ getDetails(model.insurance[index])}, + onTap: () => { + getDetails(model.insurance[index]) + }, label: TranslationBase.of(context).seeDetails, textColor: Colors.white, ), @@ -160,8 +175,6 @@ class _InsuranceCardState extends State { ], ), ), - - ], ), ], @@ -191,13 +204,13 @@ class _InsuranceCardState extends State { return newDate.toString(); } - getDetails(data){ + + getDetails(data) { GifLoaderDialogUtils.showMyDialog(context); _insuranceCardService.getInsuranceDetails(data).then((value) => { - GifLoaderDialogUtils.hideDialog(context), - Navigator.push(context, - FadePage(page: InsuranceCardDetails(data:value[0]['CheckList']))) - - }); + GifLoaderDialogUtils.hideDialog(context), + Navigator.push(context, + FadePage(page: InsuranceCardDetails(data: value[0]['CheckList']))) + }); } } diff --git a/lib/pages/insurance/insurance_details.dart b/lib/pages/insurance/insurance_details.dart index d0a829be..16745e9e 100644 --- a/lib/pages/insurance/insurance_details.dart +++ b/lib/pages/insurance/insurance_details.dart @@ -1,35 +1,29 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:html/dom.dart' as dom; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class InsuranceCardDetails extends StatefulWidget { +class InsuranceCardDetails extends StatelessWidget { final String data; InsuranceCardDetails({this.data}); - @override - _InsuranceCardInsuranceCardDetailsState createState() => _InsuranceCardInsuranceCardDetailsState(); -} -//TODO fix it -class _InsuranceCardInsuranceCardDetailsState extends State { @override Widget build(BuildContext context) { - return - AppScaffold( - isShowAppBar: true, - - body: Center( - child: SingleChildScrollView( + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).cardDetail, + body: Center( + child: SingleChildScrollView( child: Html( - data:widget.data, - ) - ) + data: data, + ), + ), ), ); } - } diff --git a/lib/pages/medical/prescriptions/prescription_details_page.dart b/lib/pages/medical/prescriptions/prescription_details_page.dart index 024de17c..d59bc06d 100644 --- a/lib/pages/medical/prescriptions/prescription_details_page.dart +++ b/lib/pages/medical/prescriptions/prescription_details_page.dart @@ -105,22 +105,29 @@ class PrescriptionDetailsPage extends StatelessWidget { color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts(TranslationBase.of(context).way))), + child: Center( + child: Texts(TranslationBase.of(context).way))), Container( color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts(TranslationBase.of(context).average))), + child: Center( + child: + Texts(TranslationBase.of(context).average))), Container( color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts(TranslationBase.of(context).dailyDoses))), + child: Center( + child: Texts( + TranslationBase.of(context).dailyDoses))), Container( color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts(TranslationBase.of(context).period))), + child: Center( + child: + Texts(TranslationBase.of(context).period))), ], ), TableRow( @@ -136,7 +143,8 @@ class PrescriptionDetailsPage extends StatelessWidget { height: 50, width: double.infinity, child: Center( - child: Text(prescriptionReport.frequencyN?? ''))), + child: + Text(prescriptionReport.frequencyN ?? ''))), Container( color: Colors.white, height: 50, @@ -174,7 +182,7 @@ class PrescriptionDetailsPage extends StatelessWidget { SizedBox( height: 5, ), - Texts(prescriptionReport.remarks), + Texts(prescriptionReport.remarks ?? ''), ], ), ), diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index 94484340..b13933c6 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -83,7 +83,7 @@ class _HomePrescriptionsPageState extends State controller: _tabController, indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Colors.red[800], + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), diff --git a/lib/pages/medical/prescriptions/prescriptions_page.dart b/lib/pages/medical/prescriptions/prescriptions_page.dart index 6b852db9..dc842bdc 100644 --- a/lib/pages/medical/prescriptions/prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_page.dart @@ -37,7 +37,7 @@ class PrescriptionsPage extends StatelessWidget { leading: Radio( value: FilterType.Clinic, groupValue: prescriptionsViewModel.filterType, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (FilterType value) { prescriptionsViewModel.setFilterType(value); }, @@ -55,7 +55,7 @@ class PrescriptionsPage extends StatelessWidget { leading: Radio( value: FilterType.Hospital, groupValue: prescriptionsViewModel.filterType, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (FilterType value) { prescriptionsViewModel.setFilterType(value); }, diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 9f8a0640..53057953 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_mode import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -29,7 +30,11 @@ class RadiologyDetailsPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text('${finalRadiology.reportData}',textAlign: TextAlign.center,), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('${finalRadiology.reportData}',textAlign: TextAlign.start,fontSize: 17,), + ), + SizedBox(height: MediaQuery.of(context).size.height * 0.2,) ], ), ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 86e98b07..53ae86d4 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -945,6 +945,10 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get insurCards => localizedValues['insur-cards'][locale.languageCode]; String get labResult => localizedValues['labResult'][locale.languageCode]; String get details => localizedValues['details'][locale.languageCode]; + String get activeInsurence => localizedValues['active-insurence'][locale.languageCode]; + String get notActive => localizedValues['not-active'][locale.languageCode]; + String get cardDetail => localizedValues['card-detail'][locale.languageCode]; + String get dr => localizedValues['Dr'][locale.languageCode]; } diff --git a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart index 1f09dcf7..753f3deb 100644 --- a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart +++ b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart @@ -86,8 +86,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: Texts( - // '${DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', - '${vital.sampleCollectedOn}', + '${vital.verifiedOn}', textAlign: TextAlign.center, ), ), diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 732a8934..2e70f2ab 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -96,7 +96,7 @@ class DoctorCard extends StatelessWidget { Expanded( flex: 1, child: LargeAvatar( - name: name, + name:name, url: profileUrl, ), ), @@ -108,7 +108,7 @@ class DoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - name, + TranslationBase.of(context).dr+" "+ name, bold: true, ), Texts( From 9d3c64200e835f20237aef1b4e5aa8392677e6ac Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Thu, 10 Dec 2020 01:24:51 +0300 Subject: [PATCH 015/103] fixes --- lib/config/localized_values.dart | 4 ++ lib/pages/BookAppointment/BookConfirm.dart | 4 +- .../components/DocAvailableAppointments.dart | 1 + .../BookAppointment/components/DocInfo.dart | 7 ++- .../MyAppointments/AppointmentDetails.dart | 41 ++++++++++++- lib/pages/MyAppointments/MyAppointments.dart | 2 + .../MyAppointments/models/ArrivedButtons.dart | 4 +- .../widgets/AppointmentActions.dart | 5 +- .../widgets/AppointmentCardView.dart | 60 +++++++++++-------- lib/uitl/translations_delegate_base.dart | 3 +- 10 files changed, 91 insertions(+), 40 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f7b5f234..1466f977 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1175,5 +1175,9 @@ const Map localizedValues = { 'details':{ 'en':'Details', 'ar':'التفاصيل' + }, + "age": { + "en": "Age", + "ar": "العمر" } }; diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 7a247b78..73975c58 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -325,7 +325,7 @@ class _BookConfirmState extends State { Container( margin: EdgeInsets.only(top: 5.0), child: Text( - "Gender: " + + TranslationBase.of(context).gender + ": " + widget.authUser.genderDescription, style: TextStyle( fontSize: 12.0, @@ -335,7 +335,7 @@ class _BookConfirmState extends State { Container( margin: EdgeInsets.only(top: 5.0, bottom: 3.0), child: Text( - "Age: " + widget.authUser.age.toString(), + TranslationBase.of(context).age + ": " + widget.authUser.age.toString(), style: TextStyle( fontSize: 12.0, color: Colors.grey[600], diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 70b6aaa0..8ac1d197 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -380,6 +380,7 @@ class _DocAvailableAppointmentsState extends State AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); }); } diff --git a/lib/pages/BookAppointment/components/DocInfo.dart b/lib/pages/BookAppointment/components/DocInfo.dart index aa6e3b9f..02c1eb90 100644 --- a/lib/pages/BookAppointment/components/DocInfo.dart +++ b/lib/pages/BookAppointment/components/DocInfo.dart @@ -13,6 +13,7 @@ class DoctorInformation extends StatelessWidget { return Container( margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), child: Column( + mainAxisSize: MainAxisSize.min, children: [ Card( shape: RoundedRectangleBorder( @@ -106,6 +107,7 @@ class DoctorInformation extends StatelessWidget { Container( margin: EdgeInsets.fromLTRB(20.0, 0.0, 10.0, 5.0), child: Column( + mainAxisSize: MainAxisSize.min, children: [ _getNormalText(docProfileList.doctorProfileInfo) ], @@ -123,7 +125,6 @@ class DoctorInformation extends StatelessWidget { return Text(text, style: TextStyle( fontSize: 13, - fontFamily: 'Open-Sans', fontWeight: FontWeight.bold, letterSpacing: 0.5, color: Colors.grey[800])); @@ -133,9 +134,9 @@ class DoctorInformation extends StatelessWidget { return Container( margin: EdgeInsets.only(top: 5.0), child: Text(text, + maxLines: 16, style: TextStyle( fontSize: 13, - fontFamily: 'Open-Sans', letterSpacing: 0.5, color: Colors.grey[700])), ); @@ -151,7 +152,7 @@ class DoctorInformation extends StatelessWidget { Text(text.trim(), style: TextStyle( fontSize: 13, - fontFamily: 'Open-Sans', + letterSpacing: 0.5, color: Colors.grey[700])), Container( diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 4143d090..4fc038a6 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; @@ -5,10 +6,12 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; import 'widgets/AppointmentActions.dart'; @@ -39,13 +42,13 @@ class _AppointmentDetailsState extends State @override void dispose() { - // TODO: implement dispose super.dispose(); _tabController.dispose(); } @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: widget.appo.doctorNameObj, isShowAppBar: true, @@ -109,7 +112,7 @@ class _AppointmentDetailsState extends State Container( margin: EdgeInsets.only(top: 10.0), alignment: Alignment.center, - child: Text(widget.appo.clinicName, + child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), style: TextStyle( fontSize: 12.0, color: Colors.grey[900], @@ -139,7 +142,9 @@ class _AppointmentDetailsState extends State child: Text( "(" + widget.appo.noOfPatientsRate.toString() + - " Reviews)", + " " + + TranslationBase.of(context).reviews + + ")", style: TextStyle( fontSize: 14.0, color: Colors.blue[800], @@ -148,6 +153,17 @@ class _AppointmentDetailsState extends State )), ), ), + Container( + alignment: Alignment.center, + child: Text(DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + widget.appo.appointmentDate), + projectViewModel.isArabic ? "ar" : "en")), + ), + Container( + alignment: Alignment.center, + child: Text(widget.appo.startTime), + ), Container( margin: EdgeInsets.only(top: 10.0), child: Divider( @@ -493,6 +509,25 @@ class _AppointmentDetailsState extends State return width; } + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString(); + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + " "; + }); + return docSpeciality; + } + DoctorList getDoctorObject() { DoctorList docObj = new DoctorList(); docObj.doctorID = widget.appo.doctorID; diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index aa3b72ae..47e539a0 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -419,4 +419,6 @@ class _MyAppointmentsState extends State ), ); } + + } diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index a30349ba..a5132883 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -40,7 +40,7 @@ class ArrivedButtons { "caller": "insertComplaint" }, { - "title": TranslationBase.of(AppGlobal.context).insurance, + "title": TranslationBase.of(AppGlobal.context).insuranceApproval, "subtitle": TranslationBase.of(AppGlobal.context).insuranceSubtitle, "icon": "assets/images/new-design/insurance_approvals_icon.png", "caller": "Insurance" @@ -58,4 +58,4 @@ class ArrivedButtons { "caller": "Survey" } ]; -} +} \ No newline at end of file diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 76c0633c..d8c5fd47 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -437,12 +437,11 @@ class _AppointmentActionsState extends State { navigateToMedicinePrescriptionReport( prescriptionReportEnhList, res['ListPRM']); } else { - AppToast.showErrorToast(message: "Sorry there is no data"); + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); - print(err); - AppToast.showErrorToast(message: err); + // AppToast.showErrorToast(message: err); }); } diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index 25d5e931..a1e5c0e7 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -80,7 +80,12 @@ class _ApointmentCardState extends State { ), Container( margin: EdgeInsets.only(top: 3.0, bottom: 3.0), - child: Text(getDate(widget.appo.appointmentDate).trim(), + child: Text( + DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + widget.appo.appointmentDate), + projectViewModel.isArabic ? "ar" : "en") + .trim(), style: TextStyle( fontSize: 12.0, color: Colors.grey[600], @@ -104,33 +109,38 @@ class _ApointmentCardState extends State { Container( transform: Matrix4.translationValues(15.0, -40.0, 0.0), - child: projectViewModel.isArabic ? Image.asset( - "assets/images/new-design/arrow_menu_black-ar.png", - width: 25.0, - height: 25.0) : Image.asset( - "assets/images/new-design/arrow_menu_black-en.png", - width: 25.0, - height: 25.0), + child: projectViewModel.isArabic + ? Image.asset( + "assets/images/new-design/arrow_menu_black-ar.png", + width: 25.0, + height: 25.0) + : Image.asset( + "assets/images/new-design/arrow_menu_black-en.png", + width: 25.0, + height: 25.0), ), ], ), - widget.appo.patientStatusType == AppointmentType.BOOKED ? - Container( - child: CountdownTimer( - endTime: DateTime.now().millisecondsSinceEpoch + - (widget.appo.remaniningHoursTocanPay * 1000) * - 60, - widgetBuilder: (_, CurrentRemainingTime time) { - return Text( - '${time.days}:${time.hours}:${time.min}:${time.sec} ' + - TranslationBase.of(context) - .upcomingTimeLeft, - style: TextStyle( - fontSize: 12.0, - color: Color(0xff40ACC9))); - }, - ), - ) : Container(), + (widget.appo.patientStatusType == AppointmentType.BOOKED || + widget.appo.patientStatusType == + AppointmentType.CONFIRMED) + ? Container( + child: CountdownTimer( + endTime: DateTime.now().millisecondsSinceEpoch + + (widget.appo.remaniningHoursTocanPay * 1000) * + 60, + widgetBuilder: (_, CurrentRemainingTime time) { + return Text( + '${time.days}:${time.hours}:${time.min}:${time.sec} ' + + TranslationBase.of(context) + .upcomingTimeLeft, + style: TextStyle( + fontSize: 12.0, + color: Color(0xff40ACC9))); + }, + ), + ) + : Container(), ], ), ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 86e98b07..61107e30 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -945,8 +945,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get insurCards => localizedValues['insur-cards'][locale.languageCode]; String get labResult => localizedValues['labResult'][locale.languageCode]; String get details => localizedValues['details'][locale.languageCode]; - - + String get age => localizedValues['age'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From e28209d4e8808941b0262b4f1e8ddae8e448d04b Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 10 Dec 2020 08:23:19 +0300 Subject: [PATCH 016/103] bug fixes --- lib/config/localized_values.dart | 4 + lib/pages/landing/landing_page.dart | 335 +++++------ lib/pages/settings/profile_setting.dart | 42 +- lib/uitl/translations_delegate_base.dart | 116 ++-- lib/widgets/drawer/app_drawer_widget.dart | 645 ++++++++++------------ 5 files changed, 576 insertions(+), 566 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e6be280b..68927062 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1044,5 +1044,9 @@ const Map localizedValues = { "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", "ar": "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." + }, + "update-succ": { + "en": "Successfully updated profile", + "ar": "تم تحديث البيانات بنجاح" } }; diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 8de82ed1..27797c30 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -52,6 +52,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { ProjectViewModel projectViewModel; var notificationCount = ''; var themeNotifier; + ///inject the user data AuthenticatedUserObject authenticatedUserObject = locator(); @@ -140,18 +141,17 @@ class _LandingPageState extends State with WidgetsBindingObserver { _firebaseMessaging.setAutoInitEnabled(true); locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); + new LocationUtils(isShowConfirmDialog: true, context: context); WidgetsBinding.instance .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); - if (Platform.isIOS) { _firebaseMessaging.requestNotificationPermissions(); } _firebaseMessaging.getToken().then((String token) async { sharedPref.setString(PUSH_TOKEN, token); - if (token != null && await sharedPref.getObject(USER_PROFILE) ==null) { + if (token != null && await sharedPref.getObject(USER_PROFILE) == null) { DEVICE_TOKEN = token; checkUserStatus(token); } @@ -159,122 +159,124 @@ class _LandingPageState extends State with WidgetsBindingObserver { }).catchError((err) { print(err); }); + // + // //_firebase Background message handler Future.delayed(Duration.zero, () => setTheme()); //_firebase Background message handler // _firebaseMessaging.configure( - // onMessage: (Map message) async { - // showDialog("onMessage: $message"); - // print("onMessage: $message"); - // print(message); - // print(message['name']); - // print(message['appointmentdate']); - // - // if (Platform.isIOS) { - // if (message['is_call'] == "true") { - // var route = ModalRoute.of(context); - // - // if (route != null) { - // print(route.settings.name); - // } - // - // Map myMap = new Map.from(message); - // print(myMap); - // LandingPage.isOpenCallPage = true; - // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - // if (!isPageNavigated) { - // isPageNavigated = true; - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => IncomingCall( - // incomingCallData: LandingPage.incomingCallData))) - // .then((value) { - // isPageNavigated = false; - // }); - // } - // } else { - // print("Is Call Not Found iOS"); - // } - // } else { - // print("Is Call Not Found iOS"); - // } - // - // if (Platform.isAndroid) { - // if (message['data'].containsKey("is_call")) { - // var route = ModalRoute.of(context); - // - // if (route != null) { - // print(route.settings.name); - // } - // - // Map myMap = - // new Map.from(message['data']); - // print(myMap); - // LandingPage.isOpenCallPage = true; - // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - // if (!isPageNavigated) { - // isPageNavigated = true; - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => IncomingCall( - // incomingCallData: LandingPage.incomingCallData))) - // .then((value) { - // isPageNavigated = false; - // }); - // } - // } else { - // print("Is Call Not Found Android"); - // } - // } else { - // print("Is Call Not Found Android"); - // } - // }, - // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, - // onLaunch: (Map message) async { - // print("onLaunch: $message"); - // showDialog("onLaunch: $message"); - // }, - // onResume: (Map message) async { - // print("onResume: $message"); - // print(message); - // print(message['name']); - // print(message['appointmentdate']); - // - // showDialog("onResume: $message"); - // - // if (Platform.isIOS) { - // if (message['is_call'] == "true") { - // var route = ModalRoute.of(context); - // - // if (route != null) { - // print(route.settings.name); - // } - // - // Map myMap = - // new Map.from(message); - // print(myMap); - // LandingPage.isOpenCallPage = true; - // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - // if (!isPageNavigated) { - // isPageNavigated = true; - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => IncomingCall( - // incomingCallData: LandingPage.incomingCallData))) - // .then((value) { - // isPageNavigated = false; - // }); - // } - // } else { - // print("Is Call Not Found iOS"); - // } - // } else { - // print("Is Call Not Found iOS"); - // } - // }, - // ); + // // onMessage: (Map message) async { + // // showDialog("onMessage: $message"); + // // print("onMessage: $message"); + // // print(message); + // // print(message['name']); + // // print(message['appointmentdate']); + // // + // // if (Platform.isIOS) { + // // if (message['is_call'] == "true") { + // // var route = ModalRoute.of(context); + // // + // // if (route != null) { + // // print(route.settings.name); + // // } + // // + // // Map myMap = new Map.from(message); + // // print(myMap); + // // LandingPage.isOpenCallPage = true; + // // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // // if (!isPageNavigated) { + // // isPageNavigated = true; + // // Navigator.push( + // // context, + // // MaterialPageRoute( + // // builder: (context) => IncomingCall( + // // incomingCallData: LandingPage.incomingCallData))) + // // .then((value) { + // // isPageNavigated = false; + // // }); + // // } + // // } else { + // // print("Is Call Not Found iOS"); + // // } + // // } else { + // // print("Is Call Not Found iOS"); + // // } + // // + // // if (Platform.isAndroid) { + // // if (message['data'].containsKey("is_call")) { + // // var route = ModalRoute.of(context); + // // + // // if (route != null) { + // // print(route.settings.name); + // // } + // // + // // Map myMap = + // // new Map.from(message['data']); + // // print(myMap); + // // LandingPage.isOpenCallPage = true; + // // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // // if (!isPageNavigated) { + // // isPageNavigated = true; + // // Navigator.push( + // // context, + // // MaterialPageRoute( + // // builder: (context) => IncomingCall( + // // incomingCallData: LandingPage.incomingCallData))) + // // .then((value) { + // // isPageNavigated = false; + // // }); + // // } + // // } else { + // // print("Is Call Not Found Android"); + // // } + // // } else { + // // print("Is Call Not Found Android"); + // // } + // // }, + // // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, + // // onLaunch: (Map message) async { + // // print("onLaunch: $message"); + // // showDialog("onLaunch: $message"); + // // }, + // // onResume: (Map message) async { + // // print("onResume: $message"); + // // print(message); + // // print(message['name']); + // // print(message['appointmentdate']); + // // + // // showDialog("onResume: $message"); + // // + // // if (Platform.isIOS) { + // // if (message['is_call'] == "true") { + // // var route = ModalRoute.of(context); + // // + // // if (route != null) { + // // print(route.settings.name); + // // } + // // + // // Map myMap = + // // new Map.from(message); + // // print(myMap); + // // LandingPage.isOpenCallPage = true; + // // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // // if (!isPageNavigated) { + // // isPageNavigated = true; + // // Navigator.push( + // // context, + // // MaterialPageRoute( + // // builder: (context) => IncomingCall( + // // incomingCallData: LandingPage.incomingCallData))) + // // .then((value) { + // // isPageNavigated = false; + // // }); + // // } + // // } else { + // // print("Is Call Not Found iOS"); + // // } + // // } else { + // // print("Is Call Not Found iOS"); + // // } + // // }, + // ); } showDialogs(String message) { @@ -390,7 +392,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { notificationCount, style: new TextStyle( color: Colors.white, - fontSize: projectViewModel.isArabic ? 8 : 9, + fontSize: projectViewModel.isArabic ? 8 : 9, ), textAlign: TextAlign.center, ), @@ -405,16 +407,18 @@ class _LandingPageState extends State with WidgetsBindingObserver { IconButton( //iconSize: 70, icon: Icon( - projectViewModel.isLogin ? Icons.settings : Icons.login, + projectViewModel.isLogin && projectViewModel.user != null + ? Icons.settings + : Icons.login, color: Colors.white, ), onPressed: () { - if (projectViewModel.isLogin) + if (projectViewModel.isLogin && projectViewModel.user != null) Navigator.of(context).pushNamed( SETTINGS, ); else - login(); + login(); }, //do something, ) ], @@ -428,7 +432,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { children: [ HomePage( goToMyProfile: () { - _changeCurrentTab(1); + // _changeCurrentTab(1); }, ), MedicalProfilePage(), @@ -464,50 +468,51 @@ class _LandingPageState extends State with WidgetsBindingObserver { case 2: return TranslationBase.of(context).bookAppo; case 3: - return TranslationBase.of(context).myFamily; - case 4: return TranslationBase.of(context).services; + case 4: + return TranslationBase.of(context).bookAppo; } } - setTheme() async{ - // - // defaultTheme = - // ThemeData( - // fontFamily:projectViewModel.isArabic ? 'Cairo' : 'WorkSans', - // primarySwatch: Colors.blue, - // visualDensity: VisualDensity.adaptivePlatformDensity, - // brightness: Brightness.light, - // pageTransitionsTheme: const PageTransitionsTheme( - // builders: { - // TargetPlatform.android: ZoomPageTransitionsBuilder(), - // TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), - // }, - // ), - // hintColor: Colors.grey[400], - // disabledColor: Colors.grey[300], - // errorColor: Color.fromRGBO(235, 80, 60, 1.0), - // scaffoldBackgroundColor: Color(0xffEEEEEE), - // textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), - // textSelectionHandleColor: Colors.grey, - // canvasColor: Colors.white, - // backgroundColor: Colors.white, - // highlightColor: Colors.grey[100].withOpacity(0.4), - // splashColor: Colors.transparent, - // primaryColor: Color(0xff40ACC9), - // bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), - // cursorColor: Colors.grey, - // cardColor: Colors.white, - // iconTheme: IconThemeData(), - // appBarTheme: AppBarTheme( - // color: Color(0xff40ACC9), - // brightness: Brightness.dark, - // elevation: 10.0, - // actionsIconTheme: IconThemeData( - // color: Color(0xff40ACC9), - // ), - // ), - // ); - // themeNotifier.setTheme(defaultTheme); + + setTheme() async { + // + // defaultTheme = + // ThemeData( + // fontFamily:projectViewModel.isArabic ? 'Cairo' : 'WorkSans', + // primarySwatch: Colors.blue, + // visualDensity: VisualDensity.adaptivePlatformDensity, + // brightness: Brightness.light, + // pageTransitionsTheme: const PageTransitionsTheme( + // builders: { + // TargetPlatform.android: ZoomPageTransitionsBuilder(), + // TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + // }, + // ), + // hintColor: Colors.grey[400], + // disabledColor: Colors.grey[300], + // errorColor: Color.fromRGBO(235, 80, 60, 1.0), + // scaffoldBackgroundColor: Color(0xffEEEEEE), + // textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), + // textSelectionHandleColor: Colors.grey, + // canvasColor: Colors.white, + // backgroundColor: Colors.white, + // highlightColor: Colors.grey[100].withOpacity(0.4), + // splashColor: Colors.transparent, + // primaryColor: Color(0xff40ACC9), + // bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + // cursorColor: Colors.grey, + // cardColor: Colors.white, + // iconTheme: IconThemeData(), + // appBarTheme: AppBarTheme( + // color: Color(0xff40ACC9), + // brightness: Brightness.dark, + // elevation: 10.0, + // actionsIconTheme: IconThemeData( + // color: Color(0xff40ACC9), + // ), + // ), + // ); + // themeNotifier.setTheme(defaultTheme); } void checkUserStatus(token) async { authService @@ -522,8 +527,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { .then((res) => {print(res)}); authService.getDashboard().then((value) => { setState(() { - notificationCount = value['List_PatientDashboard'] - [0]['UnreadPatientNotificationCount'].toString(); + notificationCount = value['List_PatientDashboard'][0] + ['UnreadPatientNotificationCount'] + .toString(); }) }); } @@ -555,6 +561,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { _changeCurrentTab(2); } } + login() async { var data = await sharedPref.getObject(IMEI_USER_DATA); sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); diff --git a/lib/pages/settings/profile_setting.dart b/lib/pages/settings/profile_setting.dart index c9089351..13ca5da6 100644 --- a/lib/pages/settings/profile_setting.dart +++ b/lib/pages/settings/profile_setting.dart @@ -9,9 +9,9 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class ProfileSettings extends StatefulWidget { - @override _ProfileSettings createState() => _ProfileSettings(); } @@ -32,10 +32,10 @@ class _ProfileSettings extends State }); super.initState(); } - Widget build(BuildContext context) { + Widget build(BuildContext context) { return BaseView( - onModelReady: (model) =>{}, + onModelReady: (model) => {}, builder: (_, model, wi) => Container( child: ListView(scrollDirection: Axis.vertical, children: [ @@ -82,7 +82,6 @@ class _ProfileSettings extends State setState(() { language = value; }); - }, ) ], @@ -102,7 +101,6 @@ class _ProfileSettings extends State setState(() { language = value; }); - }, ) ], @@ -164,7 +162,7 @@ class _ProfileSettings extends State children: [ AppText(TranslationBase.of(context).email), TextField( - controller: emailController, + controller: emailController, decoration: InputDecoration( suffixIcon: Icon(Icons.edit), )) @@ -179,7 +177,7 @@ class _ProfileSettings extends State children: [ AppText(TranslationBase.of(context).emergencyName), TextField( - controller: emergencyContactName, + controller: emergencyContactName, decoration: InputDecoration( suffixIcon: Icon(Icons.edit), )) @@ -209,7 +207,7 @@ class _ProfileSettings extends State child: DefaultButton( TranslationBase.of(context).submit, () { - saveSettings(); + saveSettings(); }, )), ], @@ -217,14 +215,15 @@ class _ProfileSettings extends State ]))); } - getSettings(context){ + getSettings(context) { GifLoaderDialogUtils.showMyDialog(context); - authService.getSettings().then((result)=>{ - GifLoaderDialogUtils.hideDialog(context), - setValue(result["PateintInfoForUpdateList"][0]) - }); + authService.getSettings().then((result) => { + GifLoaderDialogUtils.hideDialog(context), + setValue(result["PateintInfoForUpdateList"][0]) + }); } - setValue(value){ + + setValue(value) { setState(() { this.language = int.parse(value["PreferredLanguage"]); this.emailAlert = value["IsEmailAlertRequired"]; @@ -233,20 +232,21 @@ class _ProfileSettings extends State this.emergencyContact.text = value["EmergencyContactNo"]; this.emergencyContactName.text = value["EmergencyContactName"]; }); - } - saveSettings(){ + + saveSettings() { GifLoaderDialogUtils.showMyDialog(context); Map request = {}; - request["EmailAddress"] =this.emailController.text; + request["EmailAddress"] = this.emailController.text; request["EmergencyContactName"] = this.emergencyContactName.text; request["EmergencyContactNo"] = this.emergencyContact.text; request["IsEmailAlertRequired"] = this.emailAlert; request["IsSMSAlertRequired"] = this.smsAlert; request["PreferredLanguage"] = this.language.toString(); - authService.saveSettings(request).then((result)=>{ - print(result), - GifLoaderDialogUtils.hideDialog(context) - }); + authService.saveSettings(request).then((result) => { + AppToast.showSuccessToast( + message: TranslationBase.of(context).profileUpdate), + GifLoaderDialogUtils.hideDialog(context) + }); } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 2cb521d9..46347d4b 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -148,7 +148,7 @@ class TranslationBase { String get idNo => localizedValues['national-id'][locale.languageCode]; String get fileNo => localizedValues['fileNo'][locale.languageCode]; -String get fileno => localizedValues['fileno'][locale.languageCode]; + String get fileno => localizedValues['fileno'][locale.languageCode]; String get forgotPassword => localizedValues['forgotFileNo'][locale.languageCode]; @@ -791,7 +791,8 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get modes => localizedValues['modes'][locale.languageCode]; String get vibration => localizedValues['vibration'][locale.languageCode]; String get blindMode => localizedValues['blind-modes'][locale.languageCode]; - String get invertTheme => localizedValues['invert-theme'][locale.languageCode]; + String get invertTheme => + localizedValues['invert-theme'][locale.languageCode]; String get offTheme => localizedValues['off-theme'][locale.languageCode]; String get dimTheme => localizedValues['dim-theme'][locale.languageCode]; String get bwTheme => localizedValues['bw-theme'][locale.languageCode]; @@ -805,8 +806,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; localizedValues['accessibility'][locale.languageCode]; String get selectClinic => localizedValues['selectClinic'][locale.languageCode]; - String get reviews => - localizedValues['reviews'][locale.languageCode]; + String get reviews => localizedValues['reviews'][locale.languageCode]; String get orderStatus => localizedValues['orderStatus'][locale.languageCode]; String get cancelOrder => localizedValues['CancelOrder'][locale.languageCode]; @@ -814,9 +814,12 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get feedback => localizedValues['Feedback'][locale.languageCode]; String get liveChat => localizedValues['LiveChat'][locale.languageCode]; String get service => localizedValues['Service'][locale.languageCode]; - String get hMGServiceLabel => localizedValues['HMGServiceLabel'][locale.languageCode]; - String get healthWeatherIndicators => localizedValues['HealthWeatherIndicators'][locale.languageCode]; - String get healthTipsBasedOnCurrentWeather => localizedValues['HealthTipsBasedOnCurrentWeather'][locale.languageCode]; + String get hMGServiceLabel => + localizedValues['HMGServiceLabel'][locale.languageCode]; + String get healthWeatherIndicators => + localizedValues['HealthWeatherIndicators'][locale.languageCode]; + String get healthTipsBasedOnCurrentWeather => + localizedValues['HealthTipsBasedOnCurrentWeather'][locale.languageCode]; String get moreDetails => localizedValues['MoreDetails'][locale.languageCode]; String get sendCopy => localizedValues['SendCopy'][locale.languageCode]; String get resendOrder => localizedValues['ResendOrder'][locale.languageCode]; @@ -830,7 +833,8 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get mass => localizedValues['mass'][locale.languageCode]; String get tempC => localizedValues['temp-c'][locale.languageCode]; String get bpm => localizedValues['bpm'][locale.languageCode]; - String get respirationSigns => localizedValues['respiration-signs'][locale.languageCode]; + String get respirationSigns => + localizedValues['respiration-signs'][locale.languageCode]; String get sysDias => localizedValues['sys-dias'][locale.languageCode]; String get body => localizedValues['body'][locale.languageCode]; String get feedbackTitle => localizedValues['feedback'][locale.languageCode]; @@ -839,26 +843,39 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get likeToHear => localizedValues['like-to-hear'][locale.languageCode]; String get subject => localizedValues['subject'][locale.languageCode]; String get message => localizedValues['message'][locale.languageCode]; - String get emptySubject => localizedValues['empty-subject'][locale.languageCode]; - String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; - String get selectAttachment => localizedValues['select-attachment'][locale.languageCode]; - String get complainAppo => localizedValues['complain-appo'][locale.languageCode]; - String get complainWithoutAppo => localizedValues['complain-without-appo'][locale.languageCode]; + String get emptySubject => + localizedValues['empty-subject'][locale.languageCode]; + String get emptyMessage => + localizedValues['empty-message'][locale.languageCode]; + String get selectAttachment => + localizedValues['select-attachment'][locale.languageCode]; + String get complainAppo => + localizedValues['complain-appo'][locale.languageCode]; + String get complainWithoutAppo => + localizedValues['complain-without-appo'][locale.languageCode]; String get question => localizedValues['question'][locale.languageCode]; - String get messageType => localizedValues['message-type'][locale.languageCode]; + String get messageType => + localizedValues['message-type'][locale.languageCode]; String get compliment => localizedValues['compliment'][locale.languageCode]; String get suggestion => localizedValues['suggestion'][locale.languageCode]; - String get yourFeedback => localizedValues['your-feedback'][locale.languageCode]; + String get yourFeedback => + localizedValues['your-feedback'][locale.languageCode]; String get selectPart => localizedValues['select-part'][locale.languageCode]; String get number => localizedValues['number'][locale.languageCode]; - String get notClassified => localizedValues['not-classified'][locale.languageCode]; - String get searchItemError => localizedValues['searchItemError'][locale.languageCode]; + String get notClassified => + localizedValues['not-classified'][locale.languageCode]; + String get searchItemError => + localizedValues['searchItemError'][locale.languageCode]; String get youCanFind => localizedValues['YouCanFind'][locale.languageCode]; - String get itemInSearch => localizedValues['ItemInSearch'][locale.languageCode]; + String get itemInSearch => + localizedValues['ItemInSearch'][locale.languageCode]; String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode]; - String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; - String get generalResult => localizedValues['GeneralResult'][locale.languageCode]; - String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get specialResult => + localizedValues['SpecialResult'][locale.languageCode]; + String get generalResult => + localizedValues['GeneralResult'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; String get value => localizedValues['value'][locale.languageCode]; String get range => localizedValues['range'][locale.languageCode]; String get outpatient => localizedValues['out-patient'][locale.languageCode]; @@ -868,50 +885,69 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get sendCopyRad => localizedValues['send-copy'][locale.languageCode]; String get appoSurvey => localizedValues['appoSurvey'][locale.languageCode]; String get labResults => localizedValues['labResults'][locale.languageCode]; - String get doctorRating => localizedValues['doctorRating'][locale.languageCode]; + String get doctorRating => + localizedValues['doctorRating'][locale.languageCode]; String get good => localizedValues['good'][locale.languageCode]; String get v_good => localizedValues['v-good'][locale.languageCode]; String get excellent => localizedValues['excellent'][locale.languageCode]; - String get below_average => localizedValues['below-average'][locale.languageCode]; + String get below_average => + localizedValues['below-average'][locale.languageCode]; String get infoSigns => localizedValues['info-signs'][locale.languageCode]; - String get infoAdvancePayment => localizedValues['info-advance-payment'][locale.languageCode]; - String get infoMyBalance => localizedValues['info-my-balance'][locale.languageCode]; + String get infoAdvancePayment => + localizedValues['info-advance-payment'][locale.languageCode]; + String get infoMyBalance => + localizedValues['info-my-balance'][locale.languageCode]; String get erContant => localizedValues['er-contant'][locale.languageCode]; String get er => localizedValues['er'][locale.languageCode]; - String get transportationService => localizedValues['transportation-Service'][locale.languageCode]; - String get infoAmbulance => localizedValues['info-ambulance'][locale.languageCode]; - String get transportHeading => localizedValues['RRT-transport-heading'][locale.languageCode]; + String get transportationService => + localizedValues['transportation-Service'][locale.languageCode]; + String get infoAmbulance => + localizedValues['info-ambulance'][locale.languageCode]; + String get transportHeading => + localizedValues['RRT-transport-heading'][locale.languageCode]; String get sar => localizedValues['sar'][locale.languageCode]; - String get directionHeading => localizedValues['RRT-direction-heading'][locale.languageCode]; + String get directionHeading => + localizedValues['RRT-direction-heading'][locale.languageCode]; String get toHospital => localizedValues['to-hospital'][locale.languageCode]; - String get fromHospital => localizedValues['from-hospital'][locale.languageCode]; + String get fromHospital => + localizedValues['from-hospital'][locale.languageCode]; String get oneDirec => localizedValues['one-direc'][locale.languageCode]; String get twoDirec => localizedValues['two-direc'][locale.languageCode]; - String get pickupLocation => localizedValues['pickup-location'][locale.languageCode]; + String get pickupLocation => + localizedValues['pickup-location'][locale.languageCode]; String get pickupSpot => localizedValues['pickup-spot'][locale.languageCode]; String get insideHome => localizedValues['inside-home'][locale.languageCode]; String get haveAppo => localizedValues['have-appo'][locale.languageCode]; - String get dropoffLocation => localizedValues['dropoff-location'][locale.languageCode]; + String get dropoffLocation => + localizedValues['dropoff-location'][locale.languageCode]; String get selectAll => localizedValues['select-all'][locale.languageCode]; String get selectMap => localizedValues['select-map'][locale.languageCode]; - String get noAppointment => localizedValues['no-appointment'][locale.languageCode]; - String get patientShareB => localizedValues['patient-share'][locale.languageCode]; - String get patientShareTax => localizedValues['patient-share-tax'][locale.languageCode]; - String get patientShareTotal => localizedValues['patient-share-total'][locale.languageCode]; - String get selectAmbulate => localizedValues['select-ambulate'][locale.languageCode]; + String get noAppointment => + localizedValues['no-appointment'][locale.languageCode]; + String get patientShareB => + localizedValues['patient-share'][locale.languageCode]; + String get patientShareTax => + localizedValues['patient-share-tax'][locale.languageCode]; + String get patientShareTotal => + localizedValues['patient-share-total'][locale.languageCode]; + String get selectAmbulate => + localizedValues['select-ambulate'][locale.languageCode]; String get wheelchair => localizedValues['wheelchair'][locale.languageCode]; String get walker => localizedValues['walker"'][locale.languageCode]; String get stretcher => localizedValues['stretcher'][locale.languageCode]; String get none => localizedValues['none'][locale.languageCode]; String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; String get billAmount => localizedValues['bill-amount'][locale.languageCode]; - String get transportMethod => localizedValues['transport-method'][locale.languageCode]; + String get transportMethod => + localizedValues['transport-method'][locale.languageCode]; String get directions => localizedValues['directions'][locale.languageCode]; - String get infoMyAppointments => localizedValues['info-my-appointments'][locale.languageCode]; + String get infoMyAppointments => + localizedValues['info-my-appointments'][locale.languageCode]; String get infoTodo => localizedValues['info-todo'][locale.languageCode]; String get familyInfo => localizedValues['family-info'][locale.languageCode]; - + String get profileUpdate => + localizedValues['update-succ'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index a45cba96..71cc3d2b 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -41,19 +41,15 @@ class _AppDrawerState extends State { var familyFileProvider = FamilyFilesProvider(); AuthenticatedUser user; AuthenticatedUser mainUser; - AuthenticatedUserObject authenticatedUserObject = locator< - AuthenticatedUserObject>(); + AuthenticatedUserObject authenticatedUserObject = + locator(); VitalSignService _vitalSignService = locator(); - @override Widget build(BuildContext context) { projectProvider = Provider.of(context); return SizedBox( - width: MediaQuery - .of(context) - .size - .width * 0.75, + width: MediaQuery.of(context).size.width * 0.75, child: Container( color: Colors.white, child: Drawer( @@ -65,359 +61,329 @@ class _AppDrawerState extends State { padding: EdgeInsets.zero, children: [ Container( - height: SizeConfig.screenHeight * .30, + height: SizeConfig.screenHeight * .25, + padding: EdgeInsets.all(15), child: InkWell( - child: DrawerHeader( - child: Column( - children: [ - Container( - child: - Image.asset('assets/images/DQ/DQ_logo.png'), - margin: EdgeInsets.all( - SizeConfig.imageSizeMultiplier * 4), - ), - (user != null && projectProvider.isLogin) - ? Padding( - padding: EdgeInsets.all(15), - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Row( - children: [ + child: Column( + children: [ + Container( + child: + Image.asset('assets/images/DQ/DQ_logo.png'), + margin: EdgeInsets.all( + SizeConfig.imageSizeMultiplier * 4), + ), + (user != null && projectProvider.isLogin) + ? Padding( + padding: EdgeInsets.all(10), + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Row( + children: [ + Padding( + padding: + EdgeInsets.only(right: 5), + child: Icon( + Icons.account_circle, + color: Color(0xFF40ACC9), + )), + AppText( + user.firstName + + ' ' + + user.lastName, + color: Color(0xFF40ACC9), + ) + ], + ), + Row(children: [ Padding( - padding: EdgeInsets.only( - right: 5), - child: Icon( - Icons.account_circle, - color: Color(0xFF40ACC9), - )), - AppText( - user.firstName + - ' ' + - user.lastName, - color: Color(0xFF40ACC9), - ) - ], - ), - Row(children: [ - Padding( - padding: EdgeInsets.only( - left: 30, top: 5), - child: Column( - children: [ - AppText( - TranslationBase - .of( - context) - .fileno + - ": " + - user.patientID - .toString(), - color: - Color(0xFF40ACC9), - fontSize: SizeConfig - .textMultiplier * - 1.5, - ), - AppText( - user.bloodGroup != null - ? 'Blood Group: ' + - user.bloodGroup - : '', - fontSize: SizeConfig - .textMultiplier * - 1.5, - ), - ], - )) - ]) - ])) - : SizedBox(), - ], - ), + padding: + EdgeInsets.only(left: 30), + child: Column( + children: [ + AppText( + TranslationBase.of( + context) + .fileno + + ": " + + user.patientID + .toString(), + color: Color(0xFF40ACC9), + fontSize: SizeConfig + .textMultiplier * + 1.5, + ), + AppText( + user.bloodGroup != null + ? 'Blood Group: ' + + user.bloodGroup + : '', + fontSize: SizeConfig + .textMultiplier * + 1.5, + ), + ], + )) + ]) + ])) + : SizedBox(), + ], ), ), ), Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - InkWell( - child: DrawerItem( - TranslationBase - .of(context) - .arabicChange, - Icons.translate), - onTap: () { - // Navigator.of(context).pushNamed( - // WELCOME_LOGIN, - // ); - if (projectProvider.isArabic) { - projectProvider.changeLanguage('en'); - } else { - projectProvider.changeLanguage('ar'); - } - }, - ), (user != null && projectProvider.isLogin) ? Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - user.isFamily == null || user.isFamily == false - ? InkWell( - child: DrawerItem( - TranslationBase - .of(context) - .family, - Icons.group, - textColor: Color(0xFF40ACC9), - iconColor: Color(0xFF40ACC9), - bottomLine: false, - sideArrow: true, - ), - onTap: () { - Navigator.of(context).pushNamed( - MY_FAMILIY, - ); - }, - ) - : SizedBox(), - FutureBuilder( - future: getFamilyFiles(), // async work - builder: (BuildContext context, - AsyncSnapshot< - GetAllSharedRecordsByStatusResponse> - snapshot) { - switch (snapshot.connectionState) { - case ConnectionState.waiting: - return Padding( - padding: EdgeInsets.all(10), - child: Text('Loading....')); - default: - if (snapshot.hasError) - return Padding( - padding: EdgeInsets.all(10), - child: Text(snapshot.error)); - else - return Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - // <--- left side - color: Colors.grey[200], - width: 1.0, - ), - )), - child: Column( - children: [ - user.isFamily == true - ? Container( - padding: - EdgeInsets.only( - bottom: 5), - child: InkWell( - onTap: () { - switchUser( - mainUser, - context); - }, - child: Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: < - Widget>[ - Expanded( - child: Icon( - Icons - .person), - ), - Expanded( - flex: 7, - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: < - Widget>[ - AppText( - mainUser - .firstName + - ' ' + - mainUser - .lastName), - AppText( - TranslationBase - .of( - context) - .fileno + - ": " + - mainUser - .patientID - .toString()), - ])), - ], - ))) - : SizedBox(), - Column( - mainAxisAlignment: - MainAxisAlignment - .start, - mainAxisSize: - MainAxisSize.min, - children: snapshot.data - .getAllSharedRecordsByStatusList - .map( - (result) { - return result - .status == - 3 - ? Container( - padding: EdgeInsets - .only( - bottom: - 5), + mainAxisAlignment: MainAxisAlignment.start, + children: [ + user.isFamily == null || + user.isFamily == false + ? InkWell( + child: DrawerItem( + TranslationBase.of(context).family, + Icons.group, + textColor: Color(0xFF40ACC9), + iconColor: Color(0xFF40ACC9), + bottomLine: false, + sideArrow: true, + ), + onTap: () { + Navigator.of(context).pushNamed( + MY_FAMILIY, + ); + }, + ) + : SizedBox(), + FutureBuilder( + future: getFamilyFiles(), // async work + builder: (BuildContext context, + AsyncSnapshot< + GetAllSharedRecordsByStatusResponse> + snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.all(10), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text(snapshot.error)); + else + return Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + // <--- left side + color: Colors.grey[200], + width: 1.0, + ), + )), + child: Column( + children: [ + user.isFamily == true + ? Container( + padding: + EdgeInsets.only( + bottom: 5), child: InkWell( onTap: () { switchUser( - result, + mainUser, context); }, child: Row( crossAxisAlignment: - CrossAxisAlignment - .start, + CrossAxisAlignment + .start, children: < Widget>[ Expanded( - child: - Icon(Icons - .person, - color: result - .responseID == - user - .patientID - ? Color( - 0xFF40ACC9) - : Colors - .black), + child: Icon( + Icons + .person), ), Expanded( flex: 7, - child: Padding( - padding: EdgeInsets - .only( - left: 5, - right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: < - Widget>[ - AppText( - result - .patientName, - color: result - .responseID == - user - .patientID - ? Color( - 0xFF40ACC9) - : Colors - .black), - AppText( - TranslationBase - .of( - context) - .fileno + - ": " + - result - .iD - .toString(), - color: result - .responseID == - user - .patientID - ? Color( - 0xFF40ACC9) - : Colors - .black), - ]))), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText(mainUser.firstName + ' ' + mainUser.lastName), + AppText(TranslationBase.of(context).fileno + ": " + mainUser.patientID.toString()), + ])), ], ))) - : SizedBox(); - }).toList()) - ], - )); - } - }, - ), - InkWell( - child: DrawerItem( - TranslationBase - .of(context) - .notification, - Icons.notifications), - onTap: () { - //NotificationsPage - Navigator.of(context).pop(); - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - NotificationsPage())); - }, - ), - InkWell( - child: DrawerItem( - TranslationBase - .of(context) - .appsetting, - Icons.settings_input_composite), - onTap: () { - Navigator.of(context).pushNamed( - SETTINGS, - ); - }, - ), - InkWell( - child: DrawerItem( - TranslationBase - .of(context) - .rateApp, - Icons.star), - onTap: () { - if (Platform.isIOS) { - launch( - "https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978"); - } else { - launch( - "https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en"); - } - }, - ), - InkWell( - child: DrawerItem( - TranslationBase - .of(context) - .logout, - Icons.lock_open), - onTap: () { - logout(); - }, - ) - ], - ) - : InkWell( - child: DrawerItem( - TranslationBase - .of(context) - .loginregister, - Icons.lock_open), - onTap: () { - login(); - }, - ), + : SizedBox(), + Column( + mainAxisAlignment: + MainAxisAlignment + .start, + mainAxisSize: + MainAxisSize.min, + children: snapshot.data + .getAllSharedRecordsByStatusList + .map( + (result) { + return result + .status == + 3 + ? Container( + padding: EdgeInsets + .only( + bottom: + 5), + child: InkWell( + onTap: () { + switchUser( + result, + context); + }, + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: < + Widget>[ + Expanded( + child: + Icon(Icons.person, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), + ), + Expanded( + flex: 7, + child: Padding( + padding: EdgeInsets.only(left: 5, right: 5), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), + AppText(TranslationBase.of(context).fileno + ": " + result.iD.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), + ]))), + ], + ))) + : SizedBox(); + }).toList()) + ], + )); + } + }, + ), + InkWell( + child: DrawerItem( + TranslationBase.of(context) + .arabicChange, + Icons.translate), + onTap: () { + if (projectProvider.isArabic) { + projectProvider.changeLanguage('en'); + } else { + projectProvider.changeLanguage('ar'); + } + }, + ), + InkWell( + child: DrawerItem( + TranslationBase.of(context) + .notification, + Icons.notifications), + onTap: () { + //NotificationsPage + Navigator.of(context).pop(); + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + NotificationsPage())); + }, + ), + InkWell( + child: DrawerItem( + TranslationBase.of(context).appsetting, + Icons.settings_input_composite), + onTap: () { + Navigator.of(context).pushNamed( + SETTINGS, + ); + }, + ), + InkWell( + child: DrawerItem( + TranslationBase.of(context).rateApp, + Icons.star), + onTap: () { + if (Platform.isIOS) { + launch( + "https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978"); + } else { + launch( + "https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en"); + } + }, + ), + InkWell( + child: DrawerItem( + TranslationBase.of(context).logout, + Icons.lock_open), + onTap: () { + logout(); + }, + ) + ], + ) + : Column( + children: [ + InkWell( + child: DrawerItem( + TranslationBase.of(context) + .loginregister, + Icons.lock_open), + onTap: () { + login(); + }, + ), + SizedBox( + height: 120, + ), + InkWell( + child: DrawerItem( + TranslationBase.of(context) + .arabicChange, + Icons.translate), + onTap: () { + if (projectProvider.isArabic) { + projectProvider.changeLanguage('en'); + } else { + projectProvider.changeLanguage('ar'); + } + }, + ), + InkWell( + child: DrawerItem( + TranslationBase.of(context).appsetting, + Icons.settings_input_composite), + onTap: () { + Navigator.of(context).pushNamed( + SETTINGS, + ); + }, + ), + InkWell( + child: DrawerItem( + TranslationBase.of(context).rateApp, + Icons.star), + onTap: () { + if (Platform.isIOS) { + launch( + "https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978"); + } else { + launch( + "https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en"); + } + }, + ) + ], + ) ], ) ], @@ -436,9 +402,7 @@ class _AppDrawerState extends State { children: [ Column( children: [ - Text(TranslationBase - .of(context) - .poweredBy), + Text(TranslationBase.of(context).poweredBy), Image.asset( 'assets/images/cs_logo_container.png', width: SizeConfig.imageSizeMultiplier * 30, @@ -527,12 +491,11 @@ class _AppDrawerState extends State { this .familyFileProvider .silentLoggin(user is AuthenticatedUser ? null : user, - mainUser: user is AuthenticatedUser) + mainUser: user is AuthenticatedUser) .then((value) { GifLoaderDialogUtils.hideDialog(context); loginAfter(value, context); - }) - .catchError((err) { + }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); AppToast.showErrorToast(message: err); From 9d9d77ee3ac666d3c7c646b332a74a5d524d6054 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 10 Dec 2020 11:35:54 +0300 Subject: [PATCH 017/103] bug fixes --- lib/pages/landing/landing_page.dart | 6 ++---- lib/widgets/drawer/app_drawer_widget.dart | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 27797c30..d348060a 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -407,13 +407,11 @@ class _LandingPageState extends State with WidgetsBindingObserver { IconButton( //iconSize: 70, icon: Icon( - projectViewModel.isLogin && projectViewModel.user != null - ? Icons.settings - : Icons.login, + projectViewModel.isLogin ? Icons.settings : Icons.login, color: Colors.white, ), onPressed: () { - if (projectViewModel.isLogin && projectViewModel.user != null) + if (projectViewModel.isLogin) Navigator.of(context).pushNamed( SETTINGS, ); diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 48a09fb4..41686aab 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -60,7 +60,7 @@ class _AppDrawerState extends State { padding: EdgeInsets.zero, children: [ Container( - height: SizeConfig.screenHeight * .25, + height: SizeConfig.screenHeight * .27, padding: EdgeInsets.all(15), child: InkWell( child: Column( From 9ecaaa1b126f6f6d038f7d5c7cf5a958cc2d6c89 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 10 Dec 2020 11:46:57 +0300 Subject: [PATCH 018/103] radiology fix in appointment details --- .../MyAppointments/widgets/AppointmentActions.dart | 14 +++++++++----- lib/pages/landing/landing_page.dart | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index d8c5fd47..510ccf2d 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -412,14 +412,18 @@ class _AppointmentActionsState extends State { .then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['FinalRadiologyList']); - finalRadiology = - new FinalRadiology.fromJson(res['FinalRadiologyList'][0]); - print(finalRadiology.reportData); - navigateToRadiologyDetails(finalRadiology); + if (res['FinalRadiologyList'] != null) { + finalRadiology = + new FinalRadiology.fromJson(res['FinalRadiologyList'][0]); + print(finalRadiology.reportData); + navigateToRadiologyDetails(finalRadiology); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); - AppToast.showErrorToast(message: err); + // AppToast.showErrorToast(message: err); }); } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 27797c30..3eb3e32d 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -470,7 +470,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { case 3: return TranslationBase.of(context).services; case 4: - return TranslationBase.of(context).bookAppo; + return TranslationBase.of(context).todoList; } } From 5083080ba3ba6b047cd5ee6a48ab660c1e6804eb Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 10 Dec 2020 14:46:58 +0200 Subject: [PATCH 019/103] fix vital sign details --- assets/images/appointment_booking.png | Bin 0 -> 6175 bytes assets/images/book_appointment_arabic.png | Bin 0 -> 5709 bytes assets/images/booking_ar.png | Bin 0 -> 7264 bytes assets/images/booking_en.png | Bin 0 -> 7851 bytes assets/images/check-in.png | Bin 0 -> 2050 bytes assets/images/device_icon.png | Bin 0 -> 21635 bytes assets/images/new-design/check-in.png | Bin 1326 -> 2050 bytes assets/images/online_payment_icon.png | Bin 3166 -> 10046 bytes lib/pages/landing/home_page.dart | 8 +-- .../vital_sign_details_wideget.dart | 62 ++++++++++-------- .../vital_sign_item_details_screen.dart | 47 +++++++++++-- .../vital_sing_chart_and_detials.dart | 3 +- lib/pages/paymentService/payment_service.dart | 24 ++++--- lib/widgets/buttons/floatingActionButton.dart | 40 ++++------- 14 files changed, 107 insertions(+), 77 deletions(-) create mode 100644 assets/images/appointment_booking.png create mode 100644 assets/images/book_appointment_arabic.png create mode 100644 assets/images/booking_ar.png create mode 100644 assets/images/booking_en.png create mode 100644 assets/images/check-in.png create mode 100644 assets/images/device_icon.png diff --git a/assets/images/appointment_booking.png b/assets/images/appointment_booking.png new file mode 100644 index 0000000000000000000000000000000000000000..14db8d895d749640278bdaea77858403230fafc9 GIT binary patch literal 6175 zcmV+)7~toLP)005u}1^@s6i_d2*000-}Nkl z378bc*~kAgEU?R-z`C5mvdbkR3ZeoEiV@VPARcHu;t`GUNQ_27MFasQ;t{`m8sh=t z8PRxwCQrm88V(PFfPex5iy|!du?y}lyE}Q_+PBx zI^KHgE#JakM?up_O8}(+iuuzGKsx|!`BMm>0DvDr27p}tVFiF%0QCU&0N7>vYy+?n zKpB751E|(T-av*5nMe}(0EPe<0H7a#dH`q^Lw0gaeotb{sG_(7H3M5iUOoD+{FMc0+1>X_Z5IS0AArSWXg~#0?Y((K7eZh45Q~#AWv=( z0PqQbrvbbUpvvnHl1+0ii=|vP{k)WUuLzLrbFTvU62Pbw z9^=J>kIQBmmsKw>WLk9r(yGHl09FFHPz%ozJ}#>jTy_O2XI51KQXyW)D+Yf6&_aPc zd5soacI&t-m3(m`?Kj;uDWD$9gRy=4ih0jvcNyUAH9^OJ_)Taw*^QK z@K_?>D2-!`%#*$rw{YD$iqitT6u|vXXEIp?>gx~)1RT42 z0GyVCX(pKaxsDyfNdXSx0juXtE%k>Ei9Z8}Y7wZdbu8UL%^@K^C(}$YRJSt$oZ!@L zo$?Fo0${Gnp3DBsOl0@&g;w25;mgQCpuS#u9f>2af5Qf|mYq7H{Y4iFLHe4-7gT}L z%{i(s;PWA?v;^%gI8U^$=5&32zqsz;`VBbv%^KAG_+wo6bO{RJG!MYBPHYEtVqY+2 zXaRtME3xl@r`g|LJjhvSO$ zpq6g4|`z}H;9qcc!bgUoKlC>nDvDwckUUGv{Z zv+V4+^AR|72(5Z_N82+`$DWTr!Tu#n(X3UgkZUNvGz)Kk>BYz>$j8R%52`A{fn4|3 z#FI$80=!&xbIW0)&O*_sv$1#KBCNk>3aWqD67@GZ{raM4^f{>bav8Qh|B_>QY1OMI zS`R-3`xbwO@|P*pi=37nI-q3I1QeciCMs8b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Ot-w}K~yyTEMw zlX?15@E{SxC4x;bUTAznkpk#VAMoy5O$^bLHxbBuT)?kdedne zBrU~>NKw2LNBc!&OL2BE59pnOL_-3MHtRQ#O+pN4Xc0+(Zseba-mDEkZut8iiO7E1a(K7EVpVAuYtTW*4gfX>;*q0AgC5)}#~_tc94)9E|6< zR$6MfNoy(Xxrwz96Y-uG{5*hJ>0SeA%q-SG%s6pi^^IN#aH(+|s`DG-P1Fei(s8fk z|FpyTXVfUl4zBa+c(do!k^SWHItDI3+-E(7~(qruLL3z;*1H z3C>9Yf_J{(<#3uBb+}6w-5?&E79iLl8UMMX8r66-R%3G{+z=pftKL_fQq1H!bsV<@ zNMnUx1DKtDb(M0==DKucZ10u;!Dm6xfb|I%@1b#*zi=J8c7}|b0tCM`WT>9u@_jVU zGlQ4eT(xSrEkN)Cj0bS1Hqm&30N2&{MATOz1ZeO_4)al!zEi4-6) z2fzs4xS~;uom@9_5}B(+3lO|-;8^XzpcG5EP7)p&HyHv1uOklCwn8PC$#vn#+OA!a zB|z|a;~D^00N9_ze55P;x$Lh==D0kW0yH3p#{PPbNkUn~WgeF^sS~ImK(I^qFy2`e zw~v`7EY)1bC&%MP?9(n+HSbJK>L=Bf+4=zh3SD{oDpaBKBxs6Zpd`&OqSt7t?)sM^0 za-g7Opt=AJ)&UsHGq-tKh*APvHvPG*lG4-yB2@%vh7Jq4h{r+hg<(xBEBVBsIkF>9y-X?!&F6~&dPJS9 zMTDY{eGcFs+|t<#X6+$TU4UlVu)iCfwl{>usmd6*o<&A$v>yVP&ttrlC!GWsOluZm zf3}&?r+WfgNow7`1we({{tw#5KX?r$b|p^002ovPDHLkV1nY5u;%~( literal 0 HcmV?d00001 diff --git a/assets/images/book_appointment_arabic.png b/assets/images/book_appointment_arabic.png new file mode 100644 index 0000000000000000000000000000000000000000..f0bc5aff59a36356b346c5e8f2698f2c08765009 GIT binary patch literal 5709 zcmV-T7P9GyP)005u}1^@s6i_d2*000&gNkl z34B!5y~lqu31qU6g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QPVLS?Vl_ZPL#e*lL2s(L}m|D6B;002ov JPDHLkV1kbCJ9hv8 literal 0 HcmV?d00001 diff --git a/assets/images/check-in.png b/assets/images/check-in.png new file mode 100644 index 0000000000000000000000000000000000000000..f6effbeb6b8a17f264f78658d198744e3e213a81 GIT binary patch literal 2050 zcmV+d2>thoP)Px+yh%hsRCodHoN1_4RTRfH%?2|qEr-$+wK*)aG^C7zqNMr~krV}mNLf(!p&}wP zhz2MOBKr_YMK%y+l!DM`4j&Q=D=WW@--g`^!0Ty59TVS?8T~&wlUi1;2OC z-FFXbueH}6&VA>0>lUTMTi_ph5XonQr>x#S#9AQc_q9NDh_8LkwMU1TP3Bu5I>gt$ z=Gvn}%qH_K5FO%cUvurzA!d{L7Kjeh(ILL}HP;>;Vm6s?f#?ul`-M7r;d516@*z{7;sm;8i%w$zmE<*Ml5fL_e=G=KsqoVjrvWYiMLlk%kJC=}wtx zplQ#lr$_$a9HPh=0nL`XY0$&K);i4&@!n;r1Kw@abN23fi5(%$+gPf95qPZ~^=v$q z#M$*e=&WhhuvPxO@DgY@qEt;C3I+$0q+c^Scd`%@fGt{=Zm9(|+1N;b$4u*aC zY-EPRxX#KB-YkH}U|@31OQrHOt!vP@igm=zL7U!*M#u4b3%m$Am1`GftuM{5sQ3&X zhs&WCNHhSHp609aHMj_ofh3xy?uXYv>q#m{bD^n69F-)>usVqkfy0wDO+#B?6MPS! z!z$PZsr2XK_5_s=L4u5s>-Lat1#qPw+s zf)?*GN3YhQl`spA1&Jc2%r=VFWsZ;o+8h5^mD8Qv>5$!BX^y`T?uCW02DDDJRkxz& zOPCL{;a1Q_Ar(c_JZP()W_=!{L((PFKyUjB8| zBZn7>c#7qcbIA2N)N8*{T98wgdb=4OhPkjCQc;9z>#D8na5xksilX7L4_ZJYUC|@M zuYr@`O^`eaGhq)jL$0C`wVh`zG*4MYI?!k|G7_@{EjT=2?klbf#&BoI)eZA#eZ85mKZRd6j8)zGZagHc%9nDZQ!eT6hbzrdj&c zZMY9Eg6zPR(`%!qQT^r!$##Txa)}xbO_rk2 z6QEOi?JlhkY1(3^BVTKRqG2$khTh4wrawiTc758O*UBgo9s(Ue^NOa;8F@1o&DUr& zgpj_SPU$o~4P?OfikzlfKl7nTq?scm9U<*iJe2bK8u+>d>9h^jW@t&$lrFN-t_5A^ z8f^mP%rT%dPgA9{Ii%Kj{YV&>Q2SYs?=>o-1Z08ekbs;aRiZ`2#F2}%mRU_6C)%rhj@G+qOU^r zOOh>#9t0B2=u zpH*qIx#*BKP1LRoy7O%kk10z}Bk5_TP-HTSly*)qc4~_;|9_8kSq1E{#BK}i-z@Gdt5`R@<2_y&lYip>WC3iW62WU?x2ogphvLH;<1L9mFQ#z z?w~(~oKe&cA^c)Ps5Q!2mjIZtMR@e;h gz$>7ib#jw`0VqW(eEQLBr2qf`07*qoM6N<$f{>Kj9smFU literal 0 HcmV?d00001 diff --git a/assets/images/device_icon.png b/assets/images/device_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..8ad55c09420faa5b2b03b7ce260fce9b76cc0c8f GIT binary patch literal 21635 zcmX6_WmuH&(*+ln?r>?A?(S|WX?~&I}h-W^WObdKYWQEsd`~j{Buf@g^?D#FmvpaL8)y`Er=d`L|sQ{BfRA zwg89aOkPoE!0}?0Nh_I&N6(?R@5{r!^GV$>7^OtLROxEXW8Li5IBFgJa(y6uQTr`c9V?e&8`nyk3) zY8J%kaISdnyB4e0)8+7A@$G^?Ui;aD(Q<7YUIvm_R@4*`Uq_%6^>GeTV=;CuYyUN` z`}?fex1ScN7Rm@bS;vdVTSE0J3cNdrj9I zm=@OhJ_j+5@%dT;@uoVmgPP);vG_llUCER{>96>QSxYndl7CrG8h^>TrHaRj8X?R+qAWpKvb!8*}m-ua?#)w-oQ^ze@{83*Wcvj@1#TVE2Pv z`daDx(;e;4H}uo)+9uN3CHHwymq&8_AFX~ZHE@!%dkI|*;0Wj(3@>sxZir<=6cc7G z57L;sS*&Iqx*qn9?ziK#FobX7GlhNJ7YTz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/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 008887ca..ad26b29b 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -42,13 +42,7 @@ class HomePage extends StatefulWidget { class _HomePageState extends State { ToDoCountProviderModel toDoProvider; - @override - // void initState() { - // WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - // getToDoCount(); - // }); - // super.initState(); - // } + AuthenticatedUserObject authenticatedUserObject = locator(); diff --git a/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart b/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart index 589284a1..113e29a6 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart @@ -1,9 +1,12 @@ import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class VitalSignDetailsWidget extends StatefulWidget { final List vitalList; @@ -21,6 +24,7 @@ class VitalSignDetailsWidget extends StatefulWidget { class _VitalSignDetailsWidgetState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return Container( decoration: BoxDecoration( color: Colors.transparent, @@ -38,7 +42,7 @@ class _VitalSignDetailsWidgetState extends State { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(projectViewModel), ), ], ), @@ -46,20 +50,21 @@ class _VitalSignDetailsWidgetState extends State { ); } - List fullData() { + List fullData(ProjectViewModel projectViewModel) { List tableRow = []; tableRow.add(TableRow(children: [ Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) ), ), child: Center( child: Texts( - widget.title1, + TranslationBase.of(context).date, color: Colors.white, ), ), @@ -69,9 +74,10 @@ class _VitalSignDetailsWidgetState extends State { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) ), ), child: Center( @@ -81,32 +87,34 @@ class _VitalSignDetailsWidgetState extends State { ) ])); widget.vitalList.forEach((vital) { - tableRow.add(TableRow(children: [ - Container( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', - textAlign: TextAlign.center, + var data = vital.toJson()[widget.viewKey]; + if (data != 0) + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${projectViewModel.isArabic ? DateUtil.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtil.getMonthArabic(vital.vitalSignDate.month) : DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + textAlign: TextAlign.center, + ), ), ), ), - ), - Container( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${vital.toJson()[widget.viewKey]}', - textAlign: TextAlign.center, + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${vital.toJson()[widget.viewKey]}', + textAlign: TextAlign.center, + ), ), ), ), - ), - ])); + ])); }); return tableRow; } diff --git a/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart index 802aae38..55f91d02 100644 --- a/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart @@ -1,8 +1,10 @@ import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart'; import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class VitalSignItemDetailsScreen extends StatelessWidget { final VitalSignDetails pageKey; @@ -15,43 +17,56 @@ class VitalSignItemDetailsScreen extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); switch (pageKey) { case VitalSignDetails.BodyMeasurements: VSchart = [ { 'name': 'Height', + 'nameAr': 'الطول', 'title1': 'Date', 'title2': 'Cm', + 'title2Ar': 'سم', 'viewKey': 'HeightCm', }, { 'name': 'Weight Kg', + 'nameAr': 'الوزن كجم', 'title1': 'Date', 'title2': 'Kg', + 'title2Ar': 'كجم', 'viewKey': 'WeightKg', }, { - 'name': 'BodyMassIndex', + 'name': 'Body Mass Index', + 'nameAr': 'مؤشر كتلة الجسم', 'title1': 'Date', 'title2': 'BodyMass', + 'title2Ar': 'كتلة الجسم', 'viewKey': 'BodyMassIndex', }, { - 'name': 'HeadCircumCm', + 'name': 'Head Circum Cm', + 'nameAr': 'محيط رأس سم', 'title1': 'Date', 'title2': 'Cm', + 'title2Ar': 'سم', 'viewKey': 'HeadCircumCm', }, { 'name': 'Ideal Body Weight (Lbs)', + 'nameAr': 'وزن الجسم المثالي (رطل)', 'title1': 'Date', 'title2': 'Ideal Weight', + 'title2Ar': 'الوزن المثالي', 'viewKey': 'IdealBodyWeightLbs', }, { - 'name': 'LeanBodyWeightLbs (Lbs)', + 'name': 'Lean Body WeightLbs (Lbs)', + 'nameAr': 'رطل وزن الجسم النحيل (رطل)', 'title1': 'Date', 'title2': 'Lean Weight', + 'title2Ar': 'وزن خفيف', 'viewKey': 'LeanBodyWeightLbs', } ]; @@ -61,9 +76,11 @@ class VitalSignItemDetailsScreen extends StatelessWidget { case VitalSignDetails.Temperature: VSchart = [ { - 'name': 'Temperature In Celcius', + 'name': 'Temperature In Celsius', + 'nameAr': 'درجة الحرارة بالدرجة المئوية', 'title1': 'Date', 'title2': 'C', + 'title2Ar': 'ْس', 'viewKey': 'TemperatureCelcius', }, ]; @@ -73,8 +90,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Pulse Beat Per Minute', + 'nameAr': 'نبضة نبضة في الدقيقة', 'title1': 'Date', 'title2': 'Minute', + 'title2Ar': 'دقيقة', 'viewKey': 'PulseBeatPerMinute', }, ]; @@ -84,8 +103,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Respiration Beat Per Minute', + 'nameAr': 'ضربات التنفس في الدقيقة', 'title1': 'Date', 'title2': 'Beat Per Minute', + 'title2Ar': 'نفس في الدقيقة', 'viewKey': 'RespirationBeatPerMinute', }, ]; @@ -95,14 +116,18 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Blood Pressure Higher', + 'nameAr': 'ضغط الدم الإنقباض', 'title1': 'Date', 'title2': 'Minute', + 'title2Ar': 'الإنقباض', 'viewKey': 'BloodPressureHigher', }, { 'name': 'Blood Pressure Lower', + 'nameAr': 'ضغط الدم الإنبساط', 'title1': 'Date', 'title2': 'Minute', + 'title2Ar': 'الإنبساط', 'viewKey': 'BloodPressureLower', } ]; @@ -112,8 +137,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Respiration Rate', + 'nameAr': 'معدل التنفس', 'title1': 'Date', 'title2': 'bpm', + 'title2Ar': 'نفس', 'viewKey': 'RespirationBeatPerMinute', }, ]; @@ -123,8 +150,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'FIO2', + 'nameAr': 'معدل النبض بالدقيقة', 'title1': 'Date', 'title2': 'bpm', + 'title2Ar': 'نبضة', 'viewKey': 'PulseBeatPerMinute', }, ]; @@ -134,8 +163,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'PainScore', + 'nameAr': 'نقاط الألم', 'title1': 'Date', 'title2': 'Cm', + 'title2Ar': 'سم', 'viewKey': 'PainScore', }, ]; @@ -145,8 +176,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Weight Kg', + 'nameAr': 'الوزن كجم', 'title1': 'Date', 'title2': 'Kg', + 'title2Ar': 'كجم', 'viewKey': 'WeightKg', }, ]; @@ -157,8 +190,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Height Cm', + 'nameAr': 'الطول سم', 'title1': 'Date', 'title2': 'Cm', + 'title2Ar': 'سم', 'viewKey': 'HeightCm', }, ]; @@ -177,9 +212,9 @@ class VitalSignItemDetailsScreen extends StatelessWidget { return vitalListTemp.length != 0 ? VitalSingChartAndDetials( vitalList: vitalList, - name: chartInfo['name'], + name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'], title1: chartInfo['title1'], - title2: chartInfo['title2'], + title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'], viewKey: chartInfo['viewKey']) : Container(); }).toList(), diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart index 299605ef..a56ee0ba 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart @@ -45,7 +45,7 @@ class VitalSingChartAndDetials extends StatelessWidget { endDate: vitalList[0].vitalSignDate, ), bodyWidget: VitalSignDetailsWidget( - vitalList: vitalList.reversed.toList(), + vitalList: vitalList, title1: title1, title2: title2, viewKey: viewKey, @@ -59,6 +59,7 @@ class VitalSingChartAndDetials extends StatelessWidget { if (vitalList.length > 0) { vitalList.forEach( (element) { + if( element.toJson()[viewKey]?.toInt()!=0) timeSeriesData.add( TimeSeriesSales( new DateTime(element.vitalSignDate.year, diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index cc2fd7ca..b79bfe71 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -50,11 +50,15 @@ class PaymentService extends StatelessWidget { fontSize: 14, fontWeight: FontWeight.normal, ), - Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', - fit: BoxFit.fill, - height: 55, - width: double.infinity, + SizedBox(height: 12,), + Container( + margin: EdgeInsets.only(left: 10,right: 10), + child: Image.asset( + 'assets/images/online_payment_icon.png', + fit: BoxFit.fill, + height: 55, + width: double.infinity, + ), ), ], ), @@ -82,12 +86,13 @@ class PaymentService extends StatelessWidget { fontSize: 14, fontWeight: FontWeight.normal, ), + SizedBox(height: 12,), Align( - alignment: projectViewModel.isArabic + alignment: !projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, child: Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', + 'assets/images/device_icon.png', height: 55, ), ), @@ -124,12 +129,13 @@ class PaymentService extends StatelessWidget { fontSize: 14, fontWeight: FontWeight.normal, ), + SizedBox(height: 12,), Align( - alignment: projectViewModel.isArabic + alignment: !projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, child: Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', + 'assets/images/new-design/check-in.png', height: 55, ), ), diff --git a/lib/widgets/buttons/floatingActionButton.dart b/lib/widgets/buttons/floatingActionButton.dart index d2715346..4afd72b3 100644 --- a/lib/widgets/buttons/floatingActionButton.dart +++ b/lib/widgets/buttons/floatingActionButton.dart @@ -25,6 +25,7 @@ class _FloatingButtonState extends State AnimationController _animationController; Animation _animation; PermissionService permission = new PermissionService(); + @override void initState() { _animationController = AnimationController( @@ -63,16 +64,17 @@ class _FloatingButtonState extends State onTapCancel: () { _animationController.forward(); }, - onTap: (){permission.vibrate(widget.onTap, context);}, + onTap: () { + permission.vibrate(widget.onTap, context); + }, behavior: HitTestBehavior.opaque, child: Transform.scale( scale: _buttonSize, child: AnimatedContainer( duration: Duration(milliseconds: 150), margin: EdgeInsets.only(bottom: 4), - padding: EdgeInsets.symmetric(vertical: 24, horizontal: 24), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(54.0)), + borderRadius: BorderRadius.all(Radius.circular(70.0)), color: Theme.of(context).primaryColor, boxShadow: [ BoxShadow( @@ -81,31 +83,15 @@ class _FloatingButtonState extends State spreadRadius: _buttonSize < 1.0 ? -(1 - _buttonSize) * 50 : 0.0, offset: Offset(0, 7.0), - blurRadius: 55.0) + blurRadius: 70.0) ]), - child: Container( - child: Column( - children: [ - Icon(EvaIcons.calendar,color: Colors.white,size: 23,), - Texts( - TranslationBase.of(context).book, - bold: !projectViewModel.isArabic, - color: Colors.white, - fontSize: projectViewModel.isArabic ? 8 : 17, - ), - Texts( - TranslationBase.of(context).appointmentLabel, - bold: projectViewModel.isArabic, - color: Colors.white, - fontSize:projectViewModel.isArabic ? 8.8 : 8, - ), - ], - ), - width: 54, - height: 54, - decoration: BoxDecoration( - shape: BoxShape.circle, - ), + child: Image.asset( + projectViewModel.isArabic + ? 'assets/images/booking_ar.png' + : 'assets/images/booking_en.png', + // fit: BoxFit.cover, + width: 90, + height: 90, ), )), )); From 62b923b25ecefd3316b0bf3d0073db0d48846965 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 10 Dec 2020 14:53:09 +0200 Subject: [PATCH 020/103] fix send rad report email --- lib/core/service/medical/radiology_service.dart | 2 +- lib/pages/medical/radiology/radiology_details_page.dart | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index b3cb737b..965fa752 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -67,7 +67,7 @@ class RadiologyService extends BaseService { _requestSendRadReportEmail.patientName = user.firstName + " " + user.lastName; _requestSendRadReportEmail.patientIditificationNum = user.patientIdentificationNo; _requestSendRadReportEmail.projectName = finalRadiology.projectName; - _requestSendRadReportEmail.radResult = 'asd'; //finalRadiology.reportData; + _requestSendRadReportEmail.radResult = finalRadiology.reportData; _requestSendRadReportEmail.to = user.emailAddress; _requestSendRadReportEmail.dateofBirth = user.dateofBirth; diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 53057953..b0f97534 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -40,11 +40,12 @@ class RadiologyDetailsPage extends StatelessWidget { ), bottomSheet: Container( width: double.infinity, - height: MediaQuery.of(context).size.height * 0.2, + height: model.radImageURL.isNotEmpty ? MediaQuery.of(context).size.height * 0.2:MediaQuery.of(context).size.height * 0.15, color: Colors.grey[100], child: Column( children: [ Divider(), + if(model.radImageURL.isNotEmpty) Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( From 740a2948674a12a2018a26115ccb4d3cb381c95e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 10 Dec 2020 16:36:18 +0300 Subject: [PATCH 021/103] Translation & bug fixes --- lib/config/localized_values.dart | 20 ++ lib/pages/BookAppointment/BookConfirm.dart | 2 +- lib/pages/BookAppointment/BookSuccess.dart | 335 ++++++++++-------- .../widgets/AppointmentActions.dart | 20 +- lib/pages/ToDoList/ToDo.dart | 1 + lib/pages/paymentService/payment_service.dart | 64 ++-- .../rate_appointment_doctor.dart | 11 +- lib/uitl/translations_delegate_base.dart | 7 + 8 files changed, 276 insertions(+), 184 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7e523457..bfa9d5cb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -74,6 +74,10 @@ const Map localizedValues = { 'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء' }, + "book-success-confirm-more-24-1-2": { + "en": "The online payment process will be available 24 hours before the appointment.", + "ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة." + }, 'upcoming-payment-pending': { 'en': 'Online Payment will be Activated before 24 Hours of Appointment Time', @@ -1110,4 +1114,20 @@ const Map localizedValues = { "not-active": {"en": "Not Active", "ar": "غير نشط"}, "card-detail": {"en": "Insurance Details", "ar": "منافعك التامينية"}, "Dr": {"en": "Dr. ", "ar": "الدكتور."}, + "empty": { + "en": "You do not have any records.", + "ar": "ليس لديك أي سجلات" + }, + "last-visit": { + "en": "How was your last visit with doctor?", + "ar": "كيف تقيم زيارتك الأخيرة للطبيب؟" + }, + "tap-title": { + "en": "Please rate the doctor", + "ar": "يرجى تقييم الطبيب" + }, + "later": { + "en": "Later", + "ar": "لاحقاً" + }, }; diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 73975c58..f7cbd4f3 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -241,7 +241,7 @@ class _BookConfirmState extends State { ), ), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0), + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: Text( TranslationBase.of(context).date + ": " + diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 70a5b1fb..f513c434 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -165,6 +165,173 @@ class _BookSuccessState extends State { ], ), ), + bottomNavigationBar: getBottomContainer(), + ); + } + + Widget getBottomContainer() { + switch (widget.patientShareResponse.nextAction) { + case 0: + return Container(); + break; + case 10: + return _getConfirmAppoButtons(); + break; + case 15: + return _getPaymentPendingAppo(); + break; + case 20: + return _getPayNowButtons(); + break; + case 30: + return _getQRButtons(); + break; + case 50: + return _getConfirmAppoButtons(); + break; + } + } + + Widget _getQRButtons() { + return Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.18, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { +// navigateToQR(context); + getAppoQR(context); + }, + child: Text(TranslationBase.of(context).viewQR.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ); + } + + Widget _getPayNowButtons() { + return Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.2, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + startPaymentProcess(); + }, + child: Text(TranslationBase.of(context).payNow.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF40ACC9), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text(TranslationBase.of(context).payLater.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ); + } + + Widget _getConfirmAppoButtons() { + return Container( + alignment: Alignment.bottomCenter, + margin: EdgeInsets.only(bottom: 5.0), + height: MediaQuery.of(context).size.height * 0.15, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + AppoitmentAllHistoryResultList appo = + new AppoitmentAllHistoryResultList(); + appo.clinicID = widget.docObject.clinicID; + appo.projectID = widget.docObject.projectID; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; + appo.serviceID = widget.patientShareResponse.serviceID; + appo.isLiveCareAppointment = + widget.patientShareResponse.isLiveCareAppointment; + appo.doctorID = widget.patientShareResponse.doctorID; + confirmAppointment(appo); + }, + child: Text( + widget.patientShareResponse.isLiveCareAppointment + ? TranslationBase.of(context) + .confirmLiveCare + .toUpperCase() + : TranslationBase.of(context).confirm.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF40ACC9), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text( + TranslationBase.of(context).confirmLater.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), ); } @@ -238,8 +405,7 @@ class _BookSuccessState extends State { _getBulletPoint("1"), Container( width: MediaQuery.of(context).size.width * 0.8, - child: Text( - "Please confirm the appointment to avoid the cancellation", + child: Text(TranslationBase.of(context).upcomingConfirm, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)), ), @@ -263,7 +429,7 @@ class _BookSuccessState extends State { Container( width: MediaQuery.of(context).size.width * 0.8, child: Text( - "The online payment process will be available 24 hours before the appointment.", + TranslationBase.of(context).upcomingConfirmMore, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)), ), @@ -277,67 +443,6 @@ class _BookSuccessState extends State { margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), child: Image.asset("assets/images/new-design/payment-method.png"), ), - Container( - alignment: Alignment.bottomCenter, - height: MediaQuery.of(context).size.height * 0.32, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - AppoitmentAllHistoryResultList appo = - new AppoitmentAllHistoryResultList(); - appo.clinicID = widget.docObject.clinicID; - appo.projectID = widget.docObject.projectID; - appo.appointmentNo = - widget.patientShareResponse.appointmentNo; - appo.serviceID = widget.patientShareResponse.serviceID; - appo.isLiveCareAppointment = - widget.patientShareResponse.isLiveCareAppointment; - appo.doctorID = widget.patientShareResponse.doctorID; - confirmAppointment(appo); - }, - child: Text( - widget.patientShareResponse.isLiveCareAppointment - ? TranslationBase.of(context) - .confirmLiveCare - .toUpperCase() - : TranslationBase.of(context).confirm.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF40ACC9), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - navigateToHome(context); - }, - child: Text( - TranslationBase.of(context).confirmLater.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ], - ), - ), ], ); } @@ -463,52 +568,6 @@ class _BookSuccessState extends State { ), ], ), - Container( - alignment: Alignment.bottomCenter, - height: MediaQuery.of(context).size.height * 0.2, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - startPaymentProcess(); - }, - child: Text(TranslationBase.of(context).payNow.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF40ACC9), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - navigateToHome(context); - }, - child: Text( - TranslationBase.of(context).payLater.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ], - ), - ), ], ); } @@ -770,34 +829,34 @@ class _BookSuccessState extends State { ), ], ), - Container( - alignment: Alignment.bottomCenter, - height: MediaQuery.of(context).size.height * 0.18, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { -// navigateToQR(context); - getAppoQR(context); - }, - child: Text(TranslationBase.of(context).viewQR.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ], - ), - ), +// Container( +// alignment: Alignment.bottomCenter, +// height: MediaQuery.of(context).size.height * 0.18, +// child: Column( +// mainAxisAlignment: MainAxisAlignment.end, +// children: [ +// ButtonTheme( +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(10.0), +// ), +// minWidth: MediaQuery.of(context).size.width * 0.7, +// height: 45.0, +// child: RaisedButton( +// color: new Color(0xFF60686b), +// textColor: Colors.white, +// disabledTextColor: Colors.white, +// disabledColor: new Color(0xFFbcc2c4), +// onPressed: () { +// // navigateToQR(context); +// getAppoQR(context); +// }, +// child: Text(TranslationBase.of(context).viewQR.toUpperCase(), +// style: TextStyle(fontSize: 18.0)), +// ), +// ), +// ], +// ), +// ), ], ); } diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 510ccf2d..9ce6692c 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -411,8 +411,8 @@ class _AppointmentActionsState extends State { .getPatientRadOrders(widget.appo.appointmentNo.toString(), context) .then((res) { GifLoaderDialogUtils.hideDialog(context); - print(res['FinalRadiologyList']); if (res['FinalRadiologyList'] != null) { + print(res['FinalRadiologyList']); finalRadiology = new FinalRadiology.fromJson(res['FinalRadiologyList'][0]); print(finalRadiology.reportData); @@ -423,7 +423,7 @@ class _AppointmentActionsState extends State { }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); - // AppToast.showErrorToast(message: err); + AppToast.showErrorToast(message: err); }); } @@ -433,19 +433,17 @@ class _AppointmentActionsState extends State { DoctorsListService service = new DoctorsListService(); service.getPatientPrescriptionReports(widget.appo, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - res['ListPRM'].forEach((report) { - prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report)); - }); - print(prescriptionReportEnhList.length); - if (prescriptionReportEnhList.length != 0) { - navigateToMedicinePrescriptionReport( - prescriptionReportEnhList, res['ListPRM']); + if (res['ListPRM'].length != 0) { + res['ListPRM'].forEach((report) { + prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report)); + }); + print(prescriptionReportEnhList.length); } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + AppToast.showErrorToast(message: TranslationBase.of(context).noRecords); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); - // AppToast.showErrorToast(message: err); + AppToast.showErrorToast(message: err); }); } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 95e10879..25f2e0a7 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -63,6 +63,7 @@ class _ToDoState extends State { appBarTitle: TranslationBase.of(context).todoList, imagesInfo: imagesInfo, isShowAppBar: false, + isShowDecPage: true, description: TranslationBase.of(context).infoTodo, body: SingleChildScrollView( child: Column( diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index cc2fd7ca..56f842f1 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -62,36 +63,41 @@ class PaymentService extends StatelessWidget { ), ), Expanded( - child: Container( - margin: EdgeInsets.all(5.0), - padding: EdgeInsets.all(9), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8.0), - shape: BoxShape.rectangle), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).onlineCheckIn, - color: HexColor('#B61422'), - bold: true, - ), - Texts( - TranslationBase.of(context).appointment, - fontSize: 14, - fontWeight: FontWeight.normal, - ), - Align( - alignment: projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', - height: 55, + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: ToDo())); + }, + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).onlineCheckIn, + color: HexColor('#B61422'), + bold: true, ), - ), - ], + Texts( + TranslationBase.of(context).appointment, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + Align( + alignment: projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Image.asset( + 'assets/images/al-habib_online_payment_service_icon.png', + height: 55, + ), + ), + ], + ), ), ), ) diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 7a128b10..1cd560d4 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_clinic.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -60,10 +61,10 @@ class _RateAppointmentDoctorState extends State { child: Column( children: [ SizedBox( - height: 25, + height: 25, //5598 ), Texts( - 'How would you rate your last visit to the doctor', + TranslationBase.of(context).lastVisit, bold: true, color: Colors.black, ), @@ -114,7 +115,7 @@ class _RateAppointmentDoctorState extends State { ), Center( child: Texts( - 'Please rate the doctor', + TranslationBase.of(context).tapTitle, textAlign: TextAlign.center, )), SizedBox( @@ -204,7 +205,7 @@ class _RateAppointmentDoctorState extends State { ); } }, - label: "Next", + label: TranslationBase.of(context).next, disabled: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal, textColor: Theme.of(context).backgroundColor), @@ -222,7 +223,7 @@ class _RateAppointmentDoctorState extends State { ); }, child: Texts( - 'Later', + TranslationBase.of(context).later, decoration: TextDecoration.underline, color: HexColor('#151DFE'), fontSize: 18, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 5be01ab1..406156d0 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -220,6 +220,9 @@ class TranslationBase { String get upcomingConfirm => localizedValues['upcoming-confirm'][locale.languageCode]; + String get upcomingConfirmMore => + localizedValues['book-success-confirm-more-24-1-2'][locale.languageCode]; + String get upcomingPaymentPending => localizedValues['upcoming-payment-pending'][locale.languageCode]; @@ -1000,6 +1003,10 @@ class TranslationBase { String get notActive => localizedValues['not-active'][locale.languageCode]; String get cardDetail => localizedValues['card-detail'][locale.languageCode]; String get dr => localizedValues['Dr'][locale.languageCode]; + String get noRecords => localizedValues['empty'][locale.languageCode]; + String get lastVisit => localizedValues['last-visit'][locale.languageCode]; + String get tapTitle => localizedValues['tap-title'][locale.languageCode]; + String get later => localizedValues['later'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 2f77592bac3f869bb74e226342a5cfabeb71c04a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 10 Dec 2020 15:40:21 +0200 Subject: [PATCH 022/103] fix Prescriptions Service and design issues --- lib/config/localized_values.dart | 4 ++++ .../model/prescriptions/request_prescription_report.dart | 2 +- lib/core/service/medical/prescriptions_service.dart | 1 + lib/core/viewModels/medical/prescriptions_view_model.dart | 3 ++- lib/core/viewModels/medical/radiology_view_model.dart | 4 ++-- .../medical/prescriptions/prescription_items_page.dart | 8 ++++++++ lib/pages/medical/radiology/radiology_details_page.dart | 1 + lib/pages/pharmacies/pharmacies_list_screen.dart | 4 ++-- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/pharmacy/drug_item.dart | 1 + 10 files changed, 23 insertions(+), 6 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 313cbbb2..1cdecf5b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1192,4 +1192,8 @@ const Map localizedValues = { "en": "Dr. ", "ar": "الدكتور." }, + "sendSuc":{ + "en":"A copy has been sent to the email", + "ar":"تم إرسال نسخة إلى البريد الإلكتروني" + }, }; diff --git a/lib/core/model/prescriptions/request_prescription_report.dart b/lib/core/model/prescriptions/request_prescription_report.dart index df901a99..c8323740 100644 --- a/lib/core/model/prescriptions/request_prescription_report.dart +++ b/lib/core/model/prescriptions/request_prescription_report.dart @@ -82,7 +82,7 @@ class RequestPrescriptionReport { data['EpisodeID'] = this.episodeID; data['ClinicID'] = this.clinicID; data['ProjectID'] = this.projectID; - // data['DischargeNo'] = this.dischargeNo; + data['DischargeNo'] = this.dischargeNo; return data; } } diff --git a/lib/core/service/medical/prescriptions_service.dart b/lib/core/service/medical/prescriptions_service.dart index d6ad3732..e9741a7f 100644 --- a/lib/core/service/medical/prescriptions_service.dart +++ b/lib/core/service/medical/prescriptions_service.dart @@ -72,6 +72,7 @@ class PrescriptionsService extends BaseService { prescriptionReportEnhList.clear(); if(prescriptions.isInOutPatient){ response['ListPRM'].forEach((prescriptions) { + prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); }); }else{ diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart index 1cd934e2..2c32a081 100644 --- a/lib/core/viewModels/medical/prescriptions_view_model.dart +++ b/lib/core/viewModels/medical/prescriptions_view_model.dart @@ -119,6 +119,7 @@ class PrescriptionsViewModel extends BaseViewModel { int patientID, String clinicName, String doctorName, + String mes, int projectID}) async { setState(ViewState.BusyLocal); await _prescriptionsService.sendPrescriptionEmail( @@ -128,7 +129,7 @@ class PrescriptionsViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); AppToast.showErrorToast(message: error); } else { - AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail'); + AppToast.showSuccessToast(message: mes); setState(ViewState.Idle); } } diff --git a/lib/core/viewModels/medical/radiology_view_model.dart b/lib/core/viewModels/medical/radiology_view_model.dart index 26d40361..076707dc 100644 --- a/lib/core/viewModels/medical/radiology_view_model.dart +++ b/lib/core/viewModels/medical/radiology_view_model.dart @@ -80,7 +80,7 @@ class RadiologyViewModel extends BaseViewModel { } sendRadReportEmail( - {FinalRadiology finalRadiology}) async { + {FinalRadiology finalRadiology,String mes}) async { setState(ViewState.BusyLocal); await _radiologyService.sendRadReportEmail( finalRadiology: finalRadiology @@ -89,7 +89,7 @@ class RadiologyViewModel extends BaseViewModel { error = _radiologyService.error; AppToast.showErrorToast(message: error); } else { - AppToast.showSuccessToast(message: 'A copy has been sent to the email'); + AppToast.showSuccessToast(message: mes); } setState(ViewState.Idle); } diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index 696ea2db..5037a195 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -63,6 +63,7 @@ class PrescriptionItemsPage extends StatelessWidget { height: 70, ), ), + SizedBox(width: 10,), Expanded( child: Padding( padding: const EdgeInsets.all(8.0), @@ -121,6 +122,7 @@ class PrescriptionItemsPage extends StatelessWidget { height: 70, ), ), + SizedBox(width: 10,), Expanded( child: Padding( padding: const EdgeInsets.all(8.0), @@ -133,6 +135,11 @@ class PrescriptionItemsPage extends StatelessWidget { ), ), ), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) ], ), ), @@ -157,6 +164,7 @@ class PrescriptionItemsPage extends StatelessWidget { patientID: prescriptions.patientID, clinicName: prescriptions.companyName, doctorName: prescriptions.doctorName, + mes: TranslationBase.of(context).sendSuc, projectID: prescriptions.projectID), loading: model.state == ViewState.BusyLocal, ), diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index b0f97534..f4e9f0e5 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -60,6 +60,7 @@ class RadiologyDetailsPage extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.8, child: Button( onTap: () => model.sendRadReportEmail( + mes: TranslationBase.of(context).sendSuc, finalRadiology: finalRadiology), label: TranslationBase.of(context).sendCopyRad, loading: model.state == ViewState.BusyLocal, diff --git a/lib/pages/pharmacies/pharmacies_list_screen.dart b/lib/pages/pharmacies/pharmacies_list_screen.dart index dc69a3e2..ce042462 100644 --- a/lib/pages/pharmacies/pharmacies_list_screen.dart +++ b/lib/pages/pharmacies/pharmacies_list_screen.dart @@ -146,7 +146,7 @@ class PharmaciesList extends StatelessWidget { child: InkWell( child: Icon( Icons.phone, - color: Colors.red, + color: Theme.of(context).primaryColor, ), onTap: () => launch("tel://" + model.pharmacyList[index].phoneNumber), @@ -157,7 +157,7 @@ class PharmaciesList extends StatelessWidget { child: InkWell( child: Icon( Icons.local_pharmacy, - color: Colors.red, + color: Theme.of(context).primaryColor, ), onTap: () { MapsLauncher.launchCoordinates( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 53ae86d4..31523ec5 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -949,6 +949,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get notActive => localizedValues['not-active'][locale.languageCode]; String get cardDetail => localizedValues['card-detail'][locale.languageCode]; String get dr => localizedValues['Dr'][locale.languageCode]; + String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; } diff --git a/lib/widgets/pharmacy/drug_item.dart b/lib/widgets/pharmacy/drug_item.dart index 05f6ef4c..7736e089 100644 --- a/lib/widgets/pharmacy/drug_item.dart +++ b/lib/widgets/pharmacy/drug_item.dart @@ -50,6 +50,7 @@ class _MedicineItemWidgetState extends State { ), ), ), + SizedBox(width: 10,), Expanded( child: Center( child: Padding( From 08aa2de69b3a5e7d95a5cd6ad91e7d893e0e6391 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 10 Dec 2020 17:00:49 +0200 Subject: [PATCH 023/103] fix Prescriptions Service and design issues --- assets/images/booking_ar.png | Bin 7264 -> 7967 bytes assets/images/booking_en.png | Bin 7851 -> 8589 bytes lib/uitl/date_uitl.dart | 3 ++- 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/images/booking_ar.png b/assets/images/booking_ar.png index fb37b2d7e63d63f81d7a9ed81916bd0955b1f91f..b562f288612cfe087597824df0edb4246310136c 100644 GIT binary patch delta 7919 zcmVkJ`trz5euiZ8Z>z6|KcbmhcJzK@`UR zyXXGD-AtIBo!On)o!On)o$p7O*E!$$&UgNMp5OTnXC6gqV1Ih$+QI@Uf3Of@C}a4O z!~iB(cP>PC#&|czSvPvdH{A2S;mAT9!nb;SJC1Ml_*O4CKOTM#@lWt=FXw!3pnUR< zsKmSns3=FtU%j_|=;)zhF0mO*@DWhNP)4AWL1mL(1Y-xldM_7jFF^W%5TP|vuf8>b zlA%pDCFy9kIe!Ddxs}3qkZqhK@!%IZ<6lHAbt%Bs-VvoE1i;7F2qxZOlJt6?;FL{^ zD|pZmve_&|Rs*nj>A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KZgTRsj87#-e?(0}QJGJ=nC9#Pv~K*P&_9uXZ0Xeb&NSI1 zF4Ho-7i;~h|6?M7j~@aDAb-nx@xUIU3?3LW7OwL=|KwwxBbU`WOp81K-7u-kg*>)CByPSR%ufGh~j_s7m0CT>UQdOuc7oK!BVY3SCqv*EC)#{L>c zVYl-w%y#+dsm&!rF0*Az0v`ja72zc4^!aOC4~Erz;`p7d3s(|ojekZ>x?!us6X5Xc zt61ehmow`CWQA%EH5%RVa_m*m621n;!=vRcOfqNUR^_!8p#YGDr9nbpwf}{y`ahT6 zy;eit=S2fFHl|@C)U@G!LtDKH4S-T%%dk>F<7AJ={k$?CeRQV*QjXk%kx7@hyWLv7U9D_?03joUMlahlzhTQe9{TifJnvOIo&gk3Ki0_ik zrL^Qyxc?R_0LtoZ#u_TSN!ux<-%-FPDV@yw3xN^;!MOL<#&X z<1RS?K=VtW!SW6WEeS?Hc%#jEhxM6^3XD{6E`XOQqd{18uzPOK0nl7g0+8MFI~Xh0 z`rzzo&O7MO1R4QH;5lK;3c5T&<)704luDz;Tnz%F&wq9wKoIN$IMx}?pz?YYj+`(i zRq#k`SmLq5Cmxw7)GbvR@&bTX3ZUCM!MLjSfYDVGp!87AhLBvS9D8`#vJEXQ7NY<- zb3Br4lp!k5$Xfu~y#R7x6O5bo9}*jJWH<(H?qQe;;}4FE@^eEoP#TQqJQw_>)kD@#6{|9@hZwZUvVL7xBs002ovPDHLkV1l7w@r?ig diff --git a/assets/images/booking_en.png b/assets/images/booking_en.png index e493ef44f1641374b864f97d6fc171d22490dd11..a3ffa8be445183ac914dc89e6fb1527c4ae2be67 100644 GIT binary patch delta 8546 zcmV-oA)VfI;c{l7bV1(V7*Byu?ZmkM5)lSKw*!? z!IA;BDXP-bY=3hGfYaxwyzOGusDNxZTMBtLtkjtRTN_V29i;$1xl9T5rU(Sy=-x2q zow;SQ!4tBjScn!4z@qtY50VXmbEHrJoGgaD@0enJy2DbVDfN{XU22Z z*m3_X#*LWJJOS%Cb8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?Pa_woWj zI{d+k4eFMU7FdJPgS?@*uG~04oC>BELM8G+c>^FfLu!nFlO4)a#rWpqrsFp39AIyi zJI4-6+I`(#I+&w*1t4AiLegbi{r+6#wH0bGw-witDF@i4lkG6NSz@&_tt*rAc?Te! zTfei`nSYL_Nt{JYh3CM5;?Z)A7@2c%tIGB+3IaenOLW=ObCx?Xx3Rl?wvR8j>rgh% zlB5G{q*JIB)Pey}vyR|vl#>m+_HDJrIO$h1s; zy>i!>nO={V?HW#(T;4q-1zoXGQ36minS9Uq8@?<_8O@CJ`g|#Wk|U7RcR!LnfTO0_ zX2SQP2B5xC_V*?6IZ4pT<5$WwTvjf~QGa+;_x7q~3FPJ}2>_aaLt!EFDqv)fkW!#N zk`j-M`s}mP(MRU_V!G#&1E9%#0Lb+GhRBNK2rMQ7XaEl20l-qFk_MoDXlTrfB|r5{ z+4p0H{LNgq#o4|~pO3;P2IKuDxARch&Vo-iu!+iYS(yAO3jo>}$Ubg>akhAAGjmb` zQ1+C|2a!O$r)(F&$i{{}!vt`xBH$R1k9&8wQMLedGeZ9+2R2|_w0WmmD4%OZreqbS zR{x13qyDb9fM9b(GQ&H6qMhpR#8(TWv|!w7q!oS0EYXjdO^wmod5s; M07*qoM6N<$g4-@i+5i9m diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 95086f10..3e6123c2 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -24,7 +24,8 @@ class DateUtil { try { var dateT = date.split('/'); var year = dateT[2].substring(0,4); - return DateTime(int.parse(year),int.parse(dateT[1]),int.parse(dateT[0])); + var dateP = DateTime(int.parse(year),int.parse(dateT[1]),int.parse(dateT[0])); + return dateP; } catch (e) { print(e); } From 6ac8d67b830d19b250270ebcef1c412ad5b63d77 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sat, 12 Dec 2020 17:27:55 +0200 Subject: [PATCH 024/103] finish address add/edit/delete/select --- lib/config/config.dart | 4 + lib/config/shared_pref_kay.dart | 1 + lib/core/model/pharmacies/Country.dart | 32 + .../LakumInquiryInformationObjVersion.dart | 6 +- .../PharmacyAddressesViewModel.dart | 109 ++- .../screens/cart-order-preview.dart | 25 +- .../screens/pharmacy_module_page.dart | 5 +- .../pharmacyAddresses/AddAddress.dart | 165 ++--- .../pharmacyAddresses/PharmacyAddresses.dart | 622 ++++++++---------- .../pharmacyAddress_service.dart | 116 +++- lib/widgets/buttons/borderedButton.dart | 32 +- lib/widgets/dialogs/confirm_dialog.dart | 4 +- .../pickupLocation/PickupLocationFromMap.dart | 60 +- 13 files changed, 660 insertions(+), 521 deletions(-) create mode 100644 lib/core/model/pharmacies/Country.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 7fe198b1..7334dbf7 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -357,6 +357,7 @@ const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; // pharmacy const PHARMACY_VERIFY_CUSTOMER = "epharmacy/api/VerifyCustomer"; +const PHARMACY_GET_COUNTRY = "epharmacy/api/countries"; const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer"; const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners"; const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer"; @@ -366,6 +367,9 @@ const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/"; const GET_WISHLIST = "epharmacy/api/shopping_cart_items/"; const GET_ORDER = "orders?"; const GET_ORDER_DETAILS = "epharmacy/api/orders/"; +const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress"; +const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress"; +const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress"; const GET_ADDRESS = "epharmacy/api/Customers/272843?fields=addresses"; const GET_SHOPPING_CART = "epharmacy/api/shopping_cart_items/"; const GET_SHIPPING_OPTIONS = "epharmacy/api/get_shipping_option/"; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 9e57990c..6a65ac26 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -21,3 +21,4 @@ const THEME_VALUE = 'is_vibration'; const MAIN_USER = 'main-user'; const PHARMACY_LAST_VISITED_PRODUCTS = 'last-visited'; const PHARMACY_CUSTOMER_ID = 'costumer-id'; +const PHARMACY_SELECTED_ADDRESS = 'selected-address'; diff --git a/lib/core/model/pharmacies/Country.dart b/lib/core/model/pharmacies/Country.dart new file mode 100644 index 00000000..77f519d3 --- /dev/null +++ b/lib/core/model/pharmacies/Country.dart @@ -0,0 +1,32 @@ +class CountryData { + int id; + String name; + String namen; + String twoLetterIsoCode; + String threeLetterIsoCode; + + CountryData( + {this.id, + this.name, + this.namen, + this.twoLetterIsoCode, + this.threeLetterIsoCode}); + + CountryData.fromJson(Map json) { + id = json['id']; + name = json['name']; + namen = json['namen']; + twoLetterIsoCode = json['two_letter_iso_code']; + threeLetterIsoCode = json['three_letter_iso_code']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['namen'] = this.namen; + data['two_letter_iso_code'] = this.twoLetterIsoCode; + data['three_letter_iso_code'] = this.threeLetterIsoCode; + return data; + } +} diff --git a/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart b/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart index 809277e1..c609fa0b 100644 --- a/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart +++ b/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart @@ -27,9 +27,9 @@ class LakumInquiryInformationObjVersion { int transferPoints; List transferPointsAmountPerYear; List transferPointsDetails; - int waitingPoints; - int loyalityAmount; - int loyalityPoints; + dynamic waitingPoints; + dynamic loyalityAmount; + dynamic loyalityPoints; int purchaseRate; LakumInquiryInformationObjVersion( diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart index 75a178fa..485c92fb 100644 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -1,24 +1,117 @@ - +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Country.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyAddressesModel.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; class PharmacyAddressesViewModel extends BaseViewModel { - PharmacyAddressService _PharmacyAddressService = locator(); + PharmacyAddressService _pharmacyAddressService = + locator(); + + List get addresses => _pharmacyAddressService.addresses; - List get address => _PharmacyAddressService.address; + int get selectedAddressIndex => _pharmacyAddressService.selectedAddressIndex; + CountryData get country => _pharmacyAddressService.country; + + setSelectedAddressIndex(int index) { + _pharmacyAddressService.selectedAddressIndex = index; + } - Future getAddress() async { + Future getAddressesList() async { setState(ViewState.Busy); - await _PharmacyAddressService.getAddress(); - if (_PharmacyAddressService.hasError) { - error = _PharmacyAddressService.error; + await _pharmacyAddressService.getAddresses(); + if (_pharmacyAddressService.hasError) { + error = _pharmacyAddressService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + +/* Future getCountries(String countryName) async { + setState(ViewState.Busy); + await _pharmacyAddressService.getCountries(countryName); + if (_pharmacyAddressService.hasError) { + error = _pharmacyAddressService.error; + // setState(ViewState.Error); + } else { + // setState(ViewState.Idle); + } + }*/ + + Future addEditAddress(PickResult value, Addresses editedAddress) async { + setState(ViewState.Busy); + + Addresses sendingAddress; + + if (editedAddress == null) { + sendingAddress = Addresses(); + sendingAddress.id = "0"; + sendingAddress.firstName = user.firstName; + sendingAddress.lastName = user.lastName; + sendingAddress.email = user.emailAddress; + sendingAddress.company = null; + } else { + sendingAddress = editedAddress; + } + value.addressComponents.forEach((element) { + if (element.types.contains("country")) { + sendingAddress.country = element.longName; + } + if (element.types.contains("administrative_area_level_1")) { + sendingAddress.city = element.longName; + } + if (element.types.contains("postal_code")) { + sendingAddress.zipPostalCode = element.longName; + } + if (element.types.contains("administrative_area_level_2")) { + sendingAddress.province = element.longName; + } + }); + sendingAddress.latLong = value.geometry.location.toString(); + + await _pharmacyAddressService.getCountries(sendingAddress.country); + sendingAddress.countryId = country.id; + sendingAddress.stateProvinceId = null; + sendingAddress.address1 = value.formattedAddress; + sendingAddress.address2 = ""; + sendingAddress.phoneNumber = user.mobileNumber; + sendingAddress.faxNumber = user.faxNumber; + sendingAddress.customerAttributes = ""; + sendingAddress.createdOnUtc = DateTime.now().toString(); + + if (editedAddress == null) { + await _pharmacyAddressService.addCustomerAddress(sendingAddress); + } else { + await _pharmacyAddressService.editCustomerAddress(sendingAddress); + } + + if (_pharmacyAddressService.hasError) { + error = _pharmacyAddressService.error; setState(ViewState.Error); } else { + setState(ViewState.Idle); + } + } + Future deleteAddresses(Addresses sendingAddress) async { + setState(ViewState.Busy); + await _pharmacyAddressService.deleteCustomerAddress(sendingAddress); + if (_pharmacyAddressService.hasError) { + error = _pharmacyAddressService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); } } -} \ No newline at end of file + + Future saveSelectedAddressLocally(Addresses selectedAddress) async { + await sharedPref.setObject(PHARMACY_SELECTED_ADDRESS, selectedAddress); + } +} diff --git a/lib/pages/pharmacies/screens/cart-order-preview.dart b/lib/pages/pharmacies/screens/cart-order-preview.dart index 39d06ea8..f052c54e 100644 --- a/lib/pages/pharmacies/screens/cart-order-preview.dart +++ b/lib/pages/pharmacies/screens/cart-order-preview.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/address-select-pag import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -242,12 +243,14 @@ class _SelectAddressWidgetState extends State { Addresses address; _navigateToAddressPage() { - Navigator.push( - context, FadePage(page: AddressSelectPageTest(widget.addresses))) + Navigator.push(context, FadePage(page: PharmacyAddressesPage())) .then((result) { - address = result; - widget.model.paymentCheckoutData.address = address; - widget.model.getInformationsByAddress(); + if (result != null) { + address = result; + widget.model.paymentCheckoutData.address = address; + widget.model.getInformationsByAddress(); + } + /* setState(() { if (result != null) { address = result; @@ -610,7 +613,9 @@ class _LakumWidgetState extends State { fontWeight: FontWeight.bold, ), Container( - margin: projectProvider.isArabic ? EdgeInsets.only(right: 4) : EdgeInsets.only(left: 4), + margin: projectProvider.isArabic + ? EdgeInsets.only(right: 4) + : EdgeInsets.only(left: 4), width: 60, height: 50, child: TextField( @@ -687,11 +692,11 @@ class _LakumWidgetState extends State { shape: BoxShape.rectangle, borderRadius: projectProvider.isArabic ? BorderRadius.only( - topLeft: Radius.circular(6), - bottomLeft: Radius.circular(6)) + topLeft: Radius.circular(6), + bottomLeft: Radius.circular(6)) : BorderRadius.only( - topRight: Radius.circular(6), - bottomRight: Radius.circular(6)), + topRight: Radius.circular(6), + bottomRight: Radius.circular(6)), border: Border.fromBorderSide(BorderSide( color: Color(0xff3666E0), width: 0.8, diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index 9155516c..1e94ae81 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.da import 'package:diplomaticquarterapp/pages/pharmacies/widgets/BannerPager.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/manufacturerItem.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -188,7 +189,9 @@ class GridViewButtons extends StatelessWidget { opacity: 0, hasColorFilter: false, child: GridViewCard(TranslationBase.of(context).myPrescriptions, - 'assets/images/pharmacy_module/prescription_icon.png', () {}), + 'assets/images/pharmacy_module/prescription_icon.png', () { + Navigator.push(context, FadePage(page: PharmacyAddressesPage())); + }), ), DashboardItem( imageName: 'pharmacy_module/bg_4.png', diff --git a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart index 30fd4cd6..7e8763e1 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart @@ -1,127 +1,82 @@ -import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_html/style.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; class AddAddressPage extends StatefulWidget { + final Addresses editedAddress; + final Function(PickResult) onPick; + + AddAddressPage(this.editedAddress, this.onPick); + @override - _AddAddressState createState() => _AddAddressState(); + _AddAddressPageState createState() => _AddAddressPageState(); } -class _AddAddressState extends State { +class _AddAddressPageState extends State { + double _latitude; + double _longitude; - void onMapCreated(controller){ - setState(() { - mapController= controller; - }); - } - void _getAddressFromLatLng() {} - _onMapTypeButtonPressed(){} - _onAddMarkerButtonPressed(){} - - LatLng _initialPosition; - GoogleMapController mapController; @override void initState() { - // TODO: implement initState - _initialPosition = LatLng(24.662617030, 46.7334844); super.initState(); + if (widget.editedAddress != null && + widget.editedAddress.latLong != null && + widget.editedAddress.latLong != "") { + List latLng = widget.editedAddress.latLong.split(","); + _latitude = double.parse(latLng[0]); + _longitude = double.parse(latLng[1]); + } else { + _getCurrentLocation(); + } } - void _onMapCreated(GoogleMapController controller) { - mapController = controller; + _getCurrentLocation() async { + await Geolocator.getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); } - @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - centerTitle: true, - title: Text(TranslationBase.of(context).addNewAddress, style: TextStyle(color:Colors.white)), - backgroundColor: Colors.green, - ), - body: Stack( - children: [ - GoogleMap( - zoomControlsEnabled: true, - myLocationButtonEnabled: true, - myLocationEnabled: true, - onMapCreated: _onMapCreated, - onCameraMove: (object) { -// widget.currentLat = object.target.latitude; -// widget.currentLong = object.target.longitude; - }, - onCameraIdle: _getAddressFromLatLng, - padding: EdgeInsets.only(bottom: 90.0), - initialCameraPosition: CameraPosition( - target: _initialPosition, - zoom: 13.0, - ), - ), -// Align( -// alignment: Alignment.topRight, -// child: Column( -// children: [ -// button(_onMapTypeButtonPressed,Icons.map), -// SizedBox( -// height:16.0, -// ), -// button(_onAddMarkerButtonPressed, Icons.add_location) -// ], -// ), -// ), - ] - ), - bottomSheet: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) { - return AddAddressPage(); - }), - ); - }, - child: Container( - height: 50.0, - color: Colors.green, - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 1.0 - ), - color: Colors.green, - borderRadius: BorderRadius.circular(10.0) - ), - child: Center( - child: Text(TranslationBase.of(context).confirmLocation, - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ), - ), + PreferredSizeWidget appBarWidget = AppBarWidget( + "${TranslationBase.of(context).changeAddress}", null, true); + final mediaQuery = MediaQuery.of(context); + final height = mediaQuery.size.height - + appBarWidget.preferredSize.height - + mediaQuery.padding.top; + + return BaseView( + builder: (_, model, wi) => AppScaffold( + appBarTitle: TranslationBase.of(context).changeAddress, + isShowAppBar: true, + isPharmacy: true, + backgroundColor: Colors.white, + appBarWidget: appBarWidget, + body: Container( + height: height * 1, + child: PickupLocationFromMap( + latitude: _latitude, + longitude: _longitude, + isWithAppBar: false, + buttonColor: Color(0xFF5AB145), + buttonLabel: TranslationBase.of(context).save, + onPick: (value) { + widget.onPick(value); + }, ), ), ), - ); + ); } - - -// Widget button(Function function, IconData icon){ -// return FloatingActionButton( -// onPressed: function, -// materialTapTargetSize: MaterialTapTargetSize.padded, -// backgroundColor: Colors.red, -// child: Icon( -// icon, -// size: 18.0, -// ),); -// } - } - diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart index 44df964d..3ec7c831 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart @@ -1,380 +1,320 @@ - +import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; -class PharmacyAddressesPage extends StatefulWidget{ +class PharmacyAddressesPage extends StatefulWidget { @override _PharmacyAddressesState createState() => _PharmacyAddressesState(); - } - -class _PharmacyAddressesState extends State{ - - int selectedRadio; - bool _value = false; - - AppSharedPreferences sharedPref = AppSharedPreferences(); - +} - @override - void initState(){ -// WidgetsBinding.instance.addPostFrameCallback((_) => getAllAddress()); +class _PharmacyAddressesState extends State { - super.initState(); - selectedRadio=0; - } - setSelectedRadio(int val){ - setState(() { - selectedRadio = val; - }); + void navigateToAddressPage( + BuildContext ctx, PharmacyAddressesViewModel model, Addresses address) { + Navigator.push( + ctx, + FadePage( + page: AddAddressPage(address, (pickResult) { + model.addEditAddress(pickResult, address); + }))); } - Widget build (BuildContext context){ + Widget build(BuildContext context) { + PreferredSizeWidget appBarWidget = AppBarWidget( + "${TranslationBase.of(context).changeAddress}", null, true); + final mediaQuery = MediaQuery.of(context); + final height = mediaQuery.size.height - + appBarWidget.preferredSize.height - + mediaQuery.padding.top; + return BaseView( - onModelReady: (model) => model.getAddress(), - builder: (_,model, wi )=> AppScaffold( - appBarTitle: "", -// centerTitle: true, -// title: Text(TranslationBase.of(context).changeAddress, style: TextStyle(color:Colors.white)), -// backgroundColor: Colors.green, + onModelReady: (model) => model.getAddressesList(), + builder: (_, model, wi) => AppScaffold( + appBarTitle: TranslationBase.of(context).changeAddress, isShowAppBar: true, - isPharmacy:true , + isPharmacy: true, + backgroundColor: Colors.white, + appBarWidget: appBarWidget, body: Container( - child:SingleChildScrollView( + height: height * 0.90, + child: SingleChildScrollView( child: Column( - children:[ - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: 5 , - itemBuilder: (context, index){ - return Container( - child: Padding( - padding:EdgeInsets.only(top:10.0, left:5.0, right:5.0, bottom:5.0,), - child: Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - setState(() { - _value = !_value; - }); - }, - child: Container( - margin: EdgeInsets.only(right: 20), - - child: Padding( - padding: const EdgeInsets.all(5.0), - child: _value - ? Container( - child: SvgPicture.asset( - 'assets/images/pharmacy/check_icon.svg', - height: 25, - width: 25,), - ) - : Container( - child: SvgPicture.asset( - 'assets/images/pharmacy/check_icon.svg', - height: 23, - width: 23, - color: Colors.transparent, - ), - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey, - style: BorderStyle.solid, - width: 1.0 - ), - color: Colors.transparent, - borderRadius: BorderRadius.circular(50.0) - ), - ), - ), - ), - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('NAME', - style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, - ), - ), - SizedBox( - height: 5,), - Text('Address', - style: TextStyle(fontSize: 15.0, color: Colors.grey, - ), - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - margin: EdgeInsets.only(bottom: 8), - child: SvgPicture.asset( - 'assets/images/pharmacy/mobile_number_icon.svg', - height: 13,), - ), - Container( - margin: EdgeInsets.only(left: 10, bottom: 8), - child: Text('588888778', - style: TextStyle(fontSize: 15.0, - ), - ), - ), - ], - ), - SizedBox( - height: 15,), - Row( - children: [ - Column( - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) { - return AddAddressPage(); - }), - ); - }, - child: Row( - children: [ - Container( - margin: EdgeInsets.only(right:10, bottom: 15), - child: SvgPicture.asset( - 'assets/images/pharmacy/edit_icon.svg', - height: 15,), - ), - Container( - margin: EdgeInsets.only(right:5, bottom: 15), - padding: EdgeInsets.only(right: 10.0), - child: Text(TranslationBase.of(context).edit, - style: TextStyle(fontSize: 15.0, - color: Colors.blue, - ), - ), - decoration: BoxDecoration( - border: Border( - right: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - ), - ), - ], - ), - ), - ], - ), - Column( - children: [ - InkWell( - onTap: () { -// confirmDelete(snapshot.data[index]["id"]); - confirmDelete("address"); - }, - child: Row( - children: [ - Container( - margin: EdgeInsets.only(left: 15, right: 10, bottom: 15), - child: SvgPicture.asset( - 'assets/images/pharmacy/delete_red_icon.svg', - height: 15,), - ), - Container( - margin: EdgeInsets.only(bottom: 15), - child: Text(TranslationBase.of(context).delete, - style: TextStyle(fontSize: 15.0, - color: Colors.redAccent, - ), - ), - ), - ], - ), - ), - ], - ) - ], - ), - ], - ), - SizedBox( - height: 10, - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 6, - indent: 0, - endIndent: 0, - ), - ], - ), - ), - ); - } - ), - SizedBox( - height: 10, - ), - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) { - return AddAddressPage(); + children: [ + ...List.generate( + model.addresses != null ? model.addresses.length : 0, + (index) => AddressItemWidget( + model, + model.addresses[index], + () { + setState(() { + model.setSelectedAddressIndex(index); + }); + }, + model.selectedAddressIndex == index, + (address) { + navigateToAddressPage(context, model, address); }), - ); - }, - child: Container( - margin: EdgeInsets.only(bottom: 100.0), - height: 50.0, - color: Colors.transparent, - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 1.0 - ), - color: Colors.transparent, - borderRadius: BorderRadius.circular(5.0) - ), - child: Center( - child: Text( - TranslationBase.of(context).addAddress, - style: TextStyle( - color: Colors.green, - fontWeight: FontWeight.bold, - ), - ), - ), - ), + ), + Container( + color: Colors.white, + margin: EdgeInsets.all(8), + child: BorderedButton( + TranslationBase.of(context).addAddress, + hasBorder: true, + borderColor: Color(0xFF0fca6d), + textColor: Color(0xFF0fca6d), + fontWeight: FontWeight.bold, + backgroundColor: Colors.white, + fontSize: 14, + vPadding: 12, + hasShadow: true, + handler: () { + navigateToAddressPage(context, model, null); + }, ), ), ], ), ), ), - bottomSheet: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) { - return AddAddressPage(); - }), - ); - }, - child: Container( - height: 50.0, - color: Colors.green, - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 1.0 - ), - color: Colors.green, - borderRadius: BorderRadius.circular(5.0) + bottomSheet: Container( + height: height * 0.10, + color: Colors.white, + child: Column( + children: [ + Divider( + color: Colors.grey.shade300, + height: 1, + thickness: 1, + indent: 0, + endIndent: 0, ), - child: Center( - child: Text(TranslationBase.of(context).confirmAddress, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - ), + Container( + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 8), + child: BorderedButton( + TranslationBase.of(context).confirmAddress, + hasBorder: true, + borderColor: Color(0xFF5AB145), + textColor: Colors.white, + fontWeight: FontWeight.bold, + backgroundColor: Color(0xFF5AB145), + fontSize: 14, + vPadding: 12, + handler: () { + model.saveSelectedAddressLocally( + model.addresses[model.selectedAddressIndex]); + Navigator.pop(context, + model.addresses[model.selectedAddressIndex]); + }, ), ), - ), + ], ), ), ), ); } - confirmDelete(address){ - showDialog( - context: context, - builder: (BuildContext context)=> AlertDialog( - title: Text(TranslationBase.of(context).confirmDeleteMsg, - style: TextStyle( - fontWeight: FontWeight.bold, - ),), - content: Text("address"), - actions:[ - FlatButton( - child: Text(TranslationBase.of(context).cancel, - style: TextStyle( - color: Colors.red, - fontWeight: FontWeight.bold, - fontSize: 16, - ),), - onPressed: (){ - Navigator.pop(context); - }, - ), - FlatButton( - child: Text(TranslationBase.of(context).confirmDelete, - style: TextStyle( - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 16, - ),), - onPressed: (){ -// http.delete("https://uat.hmgwebservices.com/epharmacy/api/Customers/272843?fields=addresses/$id"); - Navigator.push(context, - MaterialPageRoute(builder: (context)=> PharmacyAddressesPage() )); - }, - ), - ], - ) - ); - } -} - -getAllAddress() { -// print("ADDRESSES"); -// PharmacyAddressService service = new PharmacyAddressService(); -// service.getAddress(AppGlobal.context).then((res) { -// print(res); -// }); - } +class AddressItemWidget extends StatelessWidget { + final PharmacyAddressesViewModel model; + final Addresses address; + final Function selectAddress; + final bool isSelected; + final Function(Addresses) onTabEditAddress; + AddressItemWidget(this.model, this.address, this.selectAddress, + this.isSelected, this.onTabEditAddress); - getConfirmAddress(){ - - } - getEditAddress(){ - - } - getDeleteAddress(){ - + @override + Widget build(BuildContext context) { + return Container( + color: Colors.white, + child: Padding( + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 0), + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + InkWell( + onTap: selectAddress, + child: Container( + margin: EdgeInsets.only(left: 16, right: 16), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Container( + decoration: new BoxDecoration( + color: !isSelected ? Colors.white : Colors.green, + shape: BoxShape.circle, + border: Border.all( + color: Colors.grey, + style: BorderStyle.solid, + width: 1.0), + ), + child: Padding( + padding: const EdgeInsets.all(0.0), + child: Icon( + Icons.check, + color: isSelected + ? Colors.white + : Colors.transparent, + size: 25, + ), + ), + ), + ), + ), + ), + ], + ), + Expanded( + child: Container( + child: Container( + margin: + EdgeInsets.symmetric(vertical: 12, horizontal: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 0), + child: Texts( + "${address.firstName} ${address.lastName}", + fontSize: 14, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 4), + child: Texts( + "${address.address1} ${address.address2} ${address.address2},, ${address.city}, ${address.country} ${address.zipPostalCode}", + fontSize: 12, + fontWeight: FontWeight.normal, + color: Colors.grey.shade500, + ), + ), + Row( + children: [ + Container( + margin: const EdgeInsets.only(right: 8), + child: Icon( + Icons.phone, + size: 20, + color: Colors.black, + ), + ), + Texts( + "${address.phoneNumber}", + fontSize: 14, + fontWeight: FontWeight.bold, + color: Colors.grey, + ), + ], + ), + SizedBox( + height: 10, + ), + Container( + height: 25, + child: Row( + children: [ + BorderedButton( + TranslationBase.of(context).edit, + backgroundColor: Colors.transparent, + hasBorder: true, + borderColor: Colors.transparent, + textColor: Color(0x990000FF), + handler: () { + onTabEditAddress(address); + }, + icon: Icon( + Icons.edit, + size: 15, + color: Color(0x990000FF), + ), + ), + Padding( + padding: + const EdgeInsets.symmetric(horizontal: 8), + child: SizedBox( + child: Container( + width: 1, + color: Colors.grey.shade400, + ), + ), + ), + BorderedButton( + TranslationBase.of(context).delete, + backgroundColor: Colors.transparent, + hasBorder: true, + borderColor: Colors.transparent, + textColor: Color(0x99FF0000), + handler: () { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + title: "Are you sure want to delete", + confirmMessage: + "${address.address1} ${address.address2}", + okText: + TranslationBase.of(context).delete, + cancelText: TranslationBase.of(context) + .cancel_nocaps, + okFunction: () => { + model + .deleteAddresses(address) + .then((_) { + ConfirmDialog.closeAlertDialog( + context); + AppToast.showErrorToast( + message: + "Address has been deleted"); + }) + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + }, + icon: Icon( + Icons.delete, + size: 15, + color: Color(0x99FF0000), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ), + ], + ), + Divider( + color: Colors.grey.shade200, + height: 10, + thickness: 10, + indent: 0, + endIndent: 0, + ), + ], + ), + ), + ); + } } - - - - - diff --git a/lib/services/pharmacy_services/pharmacyAddress_service.dart b/lib/services/pharmacy_services/pharmacyAddress_service.dart index eae5ac8c..1bb6571c 100644 --- a/lib/services/pharmacy_services/pharmacyAddress_service.dart +++ b/lib/services/pharmacy_services/pharmacyAddress_service.dart @@ -1,36 +1,102 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Country.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; -import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyAddressesModel.dart'; +class PharmacyAddressService extends BaseService { + List addresses = List(); + CountryData country; + int selectedAddressIndex = 0; -class PharmacyAddressService extends BaseService{ - List get address => address; + Future getAddresses() async { + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + Map queryParams = {'fields': 'addresses'}; + hasError = false; + Addresses selectedAddress; + try { + await baseAppClient.get("$GET_CUSTOMERS_ADDRESSES$customerId", + onSuccess: (dynamic response, int statusCode) async { + addresses.clear(); + var savedAddress = + await sharedPref.getObject(PHARMACY_SELECTED_ADDRESS); + if (savedAddress != null) { + selectedAddress = Addresses.fromJson(savedAddress); + } + int index = 0; + response['customers'][0]['addresses'].forEach((item) { + Addresses address = Addresses.fromJson(item); + if (selectedAddress != null && selectedAddress.id == item["id"]) { + selectedAddressIndex = index; + } + addresses.add(address); + index++; + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, queryParams: queryParams); + } catch (error) { + throw error; + } + } + + Future getCountries(String countryName) async { + hasError = false; + try { + await baseAppClient.get("$PHARMACY_GET_COUNTRY", + onSuccess: (dynamic response, int statusCode) { + // countries.clear(); + response['countries'].forEach((item) { + if (CountryData.fromJson(item).name == countryName || + CountryData.fromJson(item).namen == countryName) { + country = CountryData.fromJson(item); + } + // countries.add(CountryData.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } catch (error) { + throw error; + } + } - AppSharedPreferences sharedPref = AppSharedPreferences(); - AppGlobal appGlobal = new AppGlobal(); - AuthenticatedUser authUser = new AuthenticatedUser(); - AuthProvider authProvider = new AuthProvider(); + Future addCustomerAddress(Addresses address) async { + makeCustomerAddress(address, ADD_CUSTOMER_ADDRESS); + } - List _addressList = List(); - List get reviewList => _addressList; + Future editCustomerAddress(Addresses address) async { + makeCustomerAddress(address, EDIT_CUSTOMER_ADDRESS); + } + Future deleteCustomerAddress(Addresses address) async { + makeCustomerAddress(address, DELETE_CUSTOMER_ADDRESS); + } - Future getAddress() async { - print("step 1"); + Future makeCustomerAddress(Addresses address, String url) async { + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); hasError = false; - await baseAppClient.getPharmacy(GET_ORDER, - onSuccess: (dynamic response, int statusCode) { - _addressList.clear(); - response['customers'].forEach((item) { - _addressList.add(PharmacyAddressesModel.fromJson(item)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }); - }} \ No newline at end of file + super.error = ""; + + Map customerObject = Map(); + customerObject["addresses"] = [address]; + customerObject["id"] = customerId; + customerObject["email"] = address.email; + customerObject["role_ids"] = [3]; + Map body = Map(); + body["customer"] = customerObject; + + await baseAppClient.post("$url", onSuccess: (response, statusCode) async { + addresses.clear(); + response['customers'][0]['addresses'].forEach((item) { + addresses.add(Addresses.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/widgets/buttons/borderedButton.dart b/lib/widgets/buttons/borderedButton.dart index e297a10e..b0bbdaf0 100644 --- a/lib/widgets/buttons/borderedButton.dart +++ b/lib/widgets/buttons/borderedButton.dart @@ -18,6 +18,7 @@ class BorderedButton extends StatelessWidget { final double fontSize; final Widget icon; final FontWeight fontWeight; + final bool hasShadow; BorderedButton( this.text, { @@ -36,6 +37,7 @@ class BorderedButton extends StatelessWidget { this.fontSize = 0, this.icon, this.fontWeight, + this.hasShadow = false, }); @override @@ -46,14 +48,21 @@ class BorderedButton extends StatelessWidget { }, child: Container( decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: backgroundColor ?? Colors.white, - borderRadius: BorderRadius.circular(radius), - border: Border.fromBorderSide(BorderSide( - color: hasBorder ? borderColor : Colors.white, - width: 0.8, - )), - ), + shape: BoxShape.rectangle, + color: backgroundColor ?? Colors.white, + borderRadius: BorderRadius.circular(radius), + border: Border.fromBorderSide(BorderSide( + color: hasBorder ? borderColor : Colors.white, + width: 0.8, + )), + boxShadow: [ + BoxShadow( + color: !hasShadow ? Colors.transparent : Colors.grey.withOpacity(0.5), + // spreadRadius: 5, + blurRadius: 15.0, + offset: Offset(0.0, 0.75) // changes position of shadow + ), + ]), child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -69,8 +78,11 @@ class BorderedButton extends StatelessWidget { text, textAlign: TextAlign.center, style: TextStyle( - fontSize: fontSize == 0 ? SizeConfig.textMultiplier * 1.6 : fontSize, - fontWeight: fontWeight != null ? fontWeight : FontWeight.normal, + fontSize: fontSize == 0 + ? SizeConfig.textMultiplier * 1.6 + : fontSize, + fontWeight: + fontWeight != null ? fontWeight : FontWeight.normal, color: textColor ?? Color(0xffc4aa54)), ), ), diff --git a/lib/widgets/dialogs/confirm_dialog.dart b/lib/widgets/dialogs/confirm_dialog.dart index 8f1192a5..02b208ad 100644 --- a/lib/widgets/dialogs/confirm_dialog.dart +++ b/lib/widgets/dialogs/confirm_dialog.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; class ConfirmDialog { final BuildContext context; + final title; final confirmMessage; final okText; final cancelText; @@ -14,6 +15,7 @@ class ConfirmDialog { ConfirmDialog( {@required this.context, + this.title, @required this.confirmMessage, @required this.okText, @required this.cancelText, @@ -31,7 +33,7 @@ class ConfirmDialog { // set up the AlertDialog AlertDialog alert = AlertDialog( - title: Text(TranslationBase.of(context).confirm), + title: title != null ? Text(title) : Text(TranslationBase.of(context).confirm), content: Text(this.confirmMessage), actions: [ cancelButton, diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart index d8c93441..563de5d7 100644 --- a/lib/widgets/pickupLocation/PickupLocationFromMap.dart +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/others/close_back.dart'; import 'package:flutter/cupertino.dart'; @@ -13,24 +14,36 @@ class PickupLocationFromMap extends StatelessWidget { final Function(PickResult) onPick; final double latitude; final double longitude; + final bool isWithAppBar; + final String buttonLabel; + final Color buttonColor; - const PickupLocationFromMap({Key key, this.onPick, this.latitude, this.longitude}) + const PickupLocationFromMap( + {Key key, + this.onPick, + this.latitude, + this.longitude, + this.isWithAppBar = true, + this.buttonLabel, + this.buttonColor}) : super(key: key); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Scaffold( - appBar: AppBar( - elevation: 0, - textTheme: TextTheme( - headline6: - TextStyle(color: Colors.white, fontWeight: FontWeight.bold), - ), - title: Text('Location'), - leading: CloseBack(), - centerTitle: true, - ), + appBar: isWithAppBar + ? AppBar( + elevation: 0, + textTheme: TextTheme( + headline6: + TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + ), + title: Text('Location'), + leading: CloseBack(), + centerTitle: true, + ) + : null, body: PlacePicker( apiKey: GOOGLE_API_KEY, enableMyLocationButton: true, @@ -57,17 +70,30 @@ class PickupLocationFromMap extends StatelessWidget { child: state == SearchingState.Searching ? Center(child: CircularProgressIndicator()) : Container( - margin: EdgeInsets.all(12), - child: SecondaryButton( - color: Colors.grey[800], + margin: EdgeInsets.all(12), + child: BorderedButton( + buttonLabel != null ? buttonLabel : TranslationBase.of(context).next, textColor: Colors.white, - onTap: () { + fontWeight: FontWeight.bold, + backgroundColor: buttonColor != null ? buttonColor : Colors.grey[800], + fontSize: 14, + vPadding: 12, + radius: 10, + handler: () { onPick(selectedPlace); Navigator.of(context).pop(); }, - label: TranslationBase.of(context).next, ), - ), + /* SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + onPick(selectedPlace); + Navigator.of(context).pop(); + }, + label: TranslationBase.of(context).next, + ),*/ + ), ); }, initialPosition: LatLng(latitude, longitude), From c058cf0e93709fe48b4d7cf22e0082c26c9803da Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 13 Dec 2020 12:05:33 +0200 Subject: [PATCH 025/103] finish address add/edit/delete/select --- lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart index 3ec7c831..d542606d 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart @@ -45,6 +45,7 @@ class _PharmacyAddressesState extends State { appBarTitle: TranslationBase.of(context).changeAddress, isShowAppBar: true, isPharmacy: true, + baseViewModel: model, backgroundColor: Colors.white, appBarWidget: appBarWidget, body: Container( From b25bdbb6fa9d5f3bb4d12266962e51469459bb3f Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 13 Dec 2020 13:14:03 +0200 Subject: [PATCH 026/103] fix LiveChatPage Service LabOrderResult MedicineSearch issues --- ios/Flutter/.last_build_id | 2 +- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 20 +++++ lib/core/model/labs/LabOrderResult.dart | 88 +++++++++++++++++++ lib/core/service/client/base_app_client.dart | 11 +-- .../service/contactus/livechat_service.dart | 1 + lib/core/service/hospital_service.dart | 3 +- lib/core/service/medical/labs_service.dart | 7 +- lib/core/service/pharmacies_service.dart | 45 +++++++--- .../viewModels/medical/labs_view_model.dart | 3 +- .../viewModels/pharmacies_view_model.dart | 4 +- lib/core/viewModels/project_view_model.dart | 3 +- .../LiveChat/hospitalsLivechat_page.dart | 57 ++++++++---- .../ContactUs/LiveChat/livechat_page.dart | 24 +++-- .../LiveChat/pharmaciesLivechat_page.dart | 21 ++--- .../medical/balance/my_balance_page.dart | 9 +- .../prescription_items_page.dart | 3 +- .../pharmacies/medicine_search_screen.dart | 2 + .../pharmacies/pharmacies_list_screen.dart | 2 + lib/splashPage.dart | 10 +-- lib/uitl/translations_delegate_base.dart | 5 ++ lib/widgets/buttons/secondary_button.dart | 2 +- .../LabResult/Lab_Result_details_wideget.dart | 20 +++-- .../lab_result_chart_and_detials.dart | 9 +- lib/widgets/pharmacy/drug_item.dart | 7 +- 25 files changed, 267 insertions(+), 95 deletions(-) create mode 100644 lib/core/model/labs/LabOrderResult.dart diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index 6bca0336..4a225219 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -f4a819c27119d0f472892c1088ad1ca3 \ No newline at end of file +d69545ca05f0ca200eba92121a1458fb \ No newline at end of file diff --git a/lib/config/config.dart b/lib/config/config.dart index 4e2791b1..c9f3186a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -38,8 +38,8 @@ const GET_PRESCRIPTION_REPORT_ENH = const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const GET_Patient_LAB_RESULT = - 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f94a41cf..a1fb48bc 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1114,4 +1114,24 @@ const Map localizedValues = { "en":"A copy has been sent to the email", "ar":"تم إرسال نسخة إلى البريد الإلكتروني" }, + "instructions": { + "en": "You can now talk directly to the appointments department by chat or request a call back", + "ar": "يمكنك الان التحدث مباشرة مع قسم المواعيد عن طريق خدمة المحادثة النصية أو طلب معاودة الاتصال" + }, + "instructions-pharmacies": { + "en": "You can now talk directly to the pharmacist by chat or request a call back", + "ar": "يمكنك الآن التحدث مباشرة إلى الصيدلي عن طريق الدردشة أو طلب معاودة الاتصال" + }, + "select-hospital": { + "en": "Choose Hospital", + "ar": "اختر المستشفى" + }, + "start": { + "en": "Start", + "ar": "ابدأ" + }, + "info-chat": { + "en": "This service allows you to chat with customer service directly without the need to call.", + "ar": "المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً." + }, }; diff --git a/lib/core/model/labs/LabOrderResult.dart b/lib/core/model/labs/LabOrderResult.dart new file mode 100644 index 00000000..ecb4ae65 --- /dev/null +++ b/lib/core/model/labs/LabOrderResult.dart @@ -0,0 +1,88 @@ +class LabOrderResult { + String description; + dynamic femaleInterpretativeData; + int gender; + int lineItemNo; + dynamic maleInterpretativeData; + dynamic notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + dynamic superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + String verifiedOnDateTime; + + LabOrderResult( + {this.description, + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); + + LabOrderResult.fromJson(Map json) { + description = json['Description']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + gender = json['Gender']; + lineItemNo = json['LineItemNo']; + maleInterpretativeData = json['MaleInterpretativeData']; + notes = json['Notes']; + packageID = json['PackageID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + referanceRange = json['ReferanceRange']; + resultValue = json['ResultValue']; + sampleCollectedOn = json['SampleCollectedOn']; + sampleReceivedOn = json['SampleReceivedOn']; + setupID = json['SetupID']; + superVerifiedOn = json['SuperVerifiedOn']; + testCode = json['TestCode']; + uOM = json['UOM']; + verifiedOn = json['VerifiedOn']; + verifiedOnDateTime = json['VerifiedOnDateTime']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Gender'] = this.gender; + data['LineItemNo'] = this.lineItemNo; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['Notes'] = this.notes; + data['PackageID'] = this.packageID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ReferanceRange'] = this.referanceRange; + data['ResultValue'] = this.resultValue; + data['SampleCollectedOn'] = this.sampleCollectedOn; + data['SampleReceivedOn'] = this.sampleReceivedOn; + data['SetupID'] = this.setupID; + data['SuperVerifiedOn'] = this.superVerifiedOn; + data['TestCode'] = this.testCode; + data['UOM'] = this.uOM; + data['VerifiedOn'] = this.verifiedOn; + data['VerifiedOnDateTime'] = this.verifiedOnDateTime; + return data; + } +} diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 9154b9d3..d58054c4 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -47,15 +47,8 @@ class BaseAppClient { } body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; - body['LanguageID'] = body.containsKey('LanguageID') - ? body['LanguageID'] != null - ? body['LanguageID'] - : languageID == 'ar' - ? 1 - : 2 - : languageID == 'en' - ? 2 - : 1; + body['LanguageID'] = languageID == 'ar' ? 1 : 2; + body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; diff --git a/lib/core/service/contactus/livechat_service.dart b/lib/core/service/contactus/livechat_service.dart index b806d56b..025073ca 100644 --- a/lib/core/service/contactus/livechat_service.dart +++ b/lib/core/service/contactus/livechat_service.dart @@ -8,6 +8,7 @@ class LiveChatService extends BaseService { List LivechatModelList = List(); Map body = Map(); + // body['body'] Future getAllLiveChatOrders() async { hasError = false; diff --git a/lib/core/service/hospital_service.dart b/lib/core/service/hospital_service.dart index 194b8256..519fc8c0 100644 --- a/lib/core/service/hospital_service.dart +++ b/lib/core/service/hospital_service.dart @@ -13,14 +13,13 @@ class HospitalService extends BaseService { double _longitude; _getCurrentLocation() async { - await getLastKnownPosition().then((value) { + await Geolocator.getLastKnownPosition().then((value) { _latitude = value.latitude; _longitude = value.longitude; }).catchError((e) { _longitude = 0; _latitude = 0; }); - // currentLocation = LatLng(position.latitude, position.longitude); } Future getHospitals() async { diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 737b7b1b..8318025e 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; @@ -32,7 +33,7 @@ class LabsService extends BaseService { List patientLabSpecialResult = List(); List labResultList = List(); - List labOrdersResultsList = List(); + List labOrdersResultsList = List(); Future getLaboratoryResult( {String projectID, @@ -88,11 +89,11 @@ class LabsService extends BaseService { body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID; body['Procedure'] = procedure; - await baseAppClient.post(GET_Patient_LAB_RESULT, + await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { - labOrdersResultsList.add(LabResult.fromJson(lab)); + labOrdersResultsList.add(LabOrderResult.fromJson(lab)); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/pharmacies_service.dart b/lib/core/service/pharmacies_service.dart index f89fb425..e2bb225b 100644 --- a/lib/core/service/pharmacies_service.dart +++ b/lib/core/service/pharmacies_service.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_list_model.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; +import 'package:geolocator/geolocator.dart'; class PharmacyService extends BaseService { List _medicineItem = List(); @@ -59,10 +60,29 @@ class PharmacyService extends BaseService { projectID: 15, ); + double _latitude; + double _longitude; + + _getCurrentLocation() async { + await Geolocator.getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } + Future getMedicineList({String drugName}) async { hasError = false; - _requestGetPharmaciesModel.pHRItemName = drugName; - try { + // await _getCurrentLocation(); + Map body = Map(); + body['PHR_itemName'] = drugName; + body['isLoginForDoctorApp'] = true; + body['isDentalAllowedBackend'] = true; + // body['Latitude'] = _latitude; + // body['Longitude'] = _longitude; + await baseAppClient.post(GET_PHARMCY_ITEMS, onSuccess: (dynamic response, int statusCode) { _medicineItem.clear(); @@ -72,15 +92,18 @@ class PharmacyService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _requestGetPharmaciesModel.toJson()); - } catch (error) { - throw error; - } + }, body: body); + } Future getPharmaciesList({int itemID}) async { - _pharmaciesListModel.itemID = itemID; - try { + + await _getCurrentLocation(); + Map body = Map(); + body['ItemID'] = itemID; + body['Latitude'] = _latitude; + body['Longitude'] = _longitude; + await baseAppClient.post(GET_PHARMACY_LIST, onSuccess: (dynamic response, int statusCode) { _pharmaciesList.clear(); @@ -91,9 +114,7 @@ class PharmacyService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _pharmaciesListModel.toJson()); - } catch (error) { - throw error; - } + }, body:body); + } } diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 95be11db..c54084d6 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; @@ -12,7 +13,7 @@ class LabsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; LabsService _labsService = locator(); - List get labOrdersResultsList => _labsService.labOrdersResultsList; + List get labOrdersResultsList => _labsService.labOrdersResultsList; List _patientLabOrdersListClinic = List(); diff --git a/lib/core/viewModels/pharmacies_view_model.dart b/lib/core/viewModels/pharmacies_view_model.dart index 01ad4e72..b9e162fc 100644 --- a/lib/core/viewModels/pharmacies_view_model.dart +++ b/lib/core/viewModels/pharmacies_view_model.dart @@ -23,9 +23,11 @@ class PharmacyViewModel extends BaseViewModel { setState(ViewState.Error); } else setState(ViewState.Idle); - //_pharmacyService.clearPharmaciesList(); } + clearMedicineSearch(){ + _pharmacyService.clearMedicineList(); + } Future getMedicine({String name}) async { hasError = false; _pharmacyService.clearMedicineList(); diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index d2b7cf8b..0c00345e 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -30,7 +30,6 @@ class ProjectViewModel extends BaseViewModel { bool get isArabic => _isArabic; - // BaseViewModel baseViewModel = locator() StreamSubscription subscription; ProjectViewModel() { @@ -54,7 +53,7 @@ class ProjectViewModel extends BaseViewModel { }); } - void loadSharedPrefLanguage() async { + Future loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); _appLocale = Locale(currentLanguage); diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index 5bffe17c..d85971bb 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -1,11 +1,15 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -27,13 +31,14 @@ class _HospitalsLiveChatPageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getLiveChatRequestOrders(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, + isShowDecPage: false, body: SingleChildScrollView( child: Container( - margin: EdgeInsets.only(left: 15, right: 15), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -43,11 +48,11 @@ class _HospitalsLiveChatPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 20, + height: 70, ), Container( width: double.infinity, - height: 200, + height: 230, decoration: BoxDecoration( image: DecorationImage( image: ExactAssetImage( @@ -56,10 +61,29 @@ class _HospitalsLiveChatPageState extends State { ), child: Padding( padding: const EdgeInsets.all(8.0), - child: Texts( - 'You can now talk directly to the appointments department by chat or request a call back\n \nChoose Hospital :', - color: Colors.white, - textAlign: TextAlign.start, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: projectViewModel.isArabic? 10:20, + ), + Texts( + TranslationBase.of(context).instructions, + color: Colors.white, + textAlign: TextAlign.start, + ), + SizedBox( + height:projectViewModel.isArabic? 8:25, + ), + Texts( + TranslationBase.of(context) + .selectHospitalDec + + " :", + color: Colors.white, + fontWeight: FontWeight.w700, + textAlign: TextAlign.start, + ), + ], ), ), ), @@ -91,7 +115,7 @@ class _HospitalsLiveChatPageState extends State { borderRadius: BorderRadius.all( Radius.circular(5)), color: tappedIndex == index - ? Colors.red + ? Theme.of(context).primaryColor : Colors.white, ), child: Padding( @@ -104,8 +128,7 @@ class _HospitalsLiveChatPageState extends State { onTap: () { setState(() { tappedIndex = index; - chat = - "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=en&WorkGroup=${model.LiveChatModelList[index].value}"; + chat = "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.currentLanguage}&WorkGroup=${model.LiveChatModelList[index].value}"; }); }, child: Row( @@ -135,7 +158,8 @@ class _HospitalsLiveChatPageState extends State { .black, textAlign: TextAlign .center, - ))), //model.cOCItemList[index].cOCTitl + ))), + //model.cOCItemList[index].cOCTitl IconButton( icon: Icon( Icons.arrow_forward_ios, @@ -171,18 +195,19 @@ class _HospitalsLiveChatPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.13, + height: MediaQuery.of(context).size.height * 0.10, width: double.infinity, padding: EdgeInsets.all(8.0), child: Center( child: Container( - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery.of(context).size.height * 0.07, width: MediaQuery.of(context).size.width * 0.8, - child: Button( - label: 'ٍStart', + child: SecondaryButton( + label: TranslationBase.of(context).start, loading: model.state == ViewState.BusyLocal, + textColor: Colors.white, + disabled: chat.isEmpty, onTap: () { - print("chat=" + chat); launch(chat); }, ), diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart index b870234a..a747db3d 100644 --- a/lib/pages/ContactUs/LiveChat/livechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -1,6 +1,8 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -16,9 +18,15 @@ class LiveChatPage extends StatefulWidget { class _LiveChatPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; + List imagesInfo = List(); + @override void initState() { super.initState(); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/1.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/2.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/2.png')); + _tabController = TabController(length: 2, vsync: this); } @@ -33,7 +41,10 @@ class _LiveChatPageState extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: 'Locations', + imagesInfo: imagesInfo, + title: TranslationBase.of(context).liveChat, + description: TranslationBase.of(context).infoChat, + appBarTitle: TranslationBase.of(context).service, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -71,25 +82,22 @@ class _LiveChatPageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - //indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab, - - indicatorColor: Colors.red[800], + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts(' Hospitals '), + child: Texts(TranslationBase.of(context).hospitals), ), ), Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts(' Pharmacies '), + child: Texts(TranslationBase.of(context).pharmacies), ), ), ], diff --git a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart index cbda0828..c5300b5d 100644 --- a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart @@ -1,12 +1,15 @@ import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -28,10 +31,11 @@ class _PhamaciesLiveChatPageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getLiveChatRequestOrders(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, + isShowDecPage: false, body: SingleChildScrollView( child: Container( margin: EdgeInsets.only(left: 15, right: 15), @@ -43,12 +47,9 @@ class _PhamaciesLiveChatPageState extends State { Container( width: double.infinity, height: 200, - decoration: BoxDecoration( - image: DecorationImage( - image: ExactAssetImage(''), fit: BoxFit.cover), - ), + child: Texts( - 'You can now talk directly to the pharmacist by chat or request a call back', + TranslationBase.of(context).instructionsPharmacies, color: Colors.black, textAlign: TextAlign.center, ), @@ -63,20 +64,20 @@ class _PhamaciesLiveChatPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.13, + height: MediaQuery.of(context).size.height * 0.10, width: double.infinity, padding: EdgeInsets.all(8.0), child: Center( child: Container( - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery.of(context).size.height * 0.87, width: MediaQuery.of(context).size.width * 0.8, child: Button( - label: 'ٍStart', + label: TranslationBase.of(context).start, loading: model.state == ViewState.BusyLocal, onTap: () { print("chat=" + chat); chat = - "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=1"; + "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.isArabic? 1:2}"; launch(chat); }, ), diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index 2fb8c51c..50bb2dea 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -45,21 +45,22 @@ class MyBalancePage extends StatelessWidget { width: double.infinity, height: 65, decoration: BoxDecoration( - color: HexColor('#B61422'), + color: Theme.of(context).primaryColor, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(7), ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Texts( - TranslationBase.of(context).totalBalance, + '${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar, color: Colors.white, + bold: true, ), Texts( - '${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar, + TranslationBase.of(context).totalBalance, color: Colors.white, - bold: true, ), ], ), diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index 5037a195..d4a9e500 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -150,7 +150,7 @@ class PrescriptionItemsPage extends StatelessWidget { ), bottomSheet: Container( width: double.infinity, - height: MediaQuery.of(context).size.height * 0.23, + height: MediaQuery.of(context).size.height * 0.1, color: Colors.grey[100], child: Column( children: [ @@ -169,6 +169,7 @@ class PrescriptionItemsPage extends StatelessWidget { loading: model.state == ViewState.BusyLocal, ), ), + if(false) Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( diff --git a/lib/pages/pharmacies/medicine_search_screen.dart b/lib/pages/pharmacies/medicine_search_screen.dart index 62cacb7f..adf99ce1 100644 --- a/lib/pages/pharmacies/medicine_search_screen.dart +++ b/lib/pages/pharmacies/medicine_search_screen.dart @@ -21,6 +21,8 @@ class MedicineSearch extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( + allowAny: true, + onModelReady: (model) => model.clearMedicineSearch(), builder: (BuildContext context, PharmacyViewModel model, Widget child) => AppScaffold( baseViewModel: model, diff --git a/lib/pages/pharmacies/pharmacies_list_screen.dart b/lib/pages/pharmacies/pharmacies_list_screen.dart index ce042462..a35a77c9 100644 --- a/lib/pages/pharmacies/pharmacies_list_screen.dart +++ b/lib/pages/pharmacies/pharmacies_list_screen.dart @@ -24,12 +24,14 @@ class PharmaciesList extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( + allowAny: true, onModelReady: (model) => model.getPharmacies(id: medicineID), builder: (BuildContext context, PharmacyViewModel model, Widget child) => AppScaffold( appBarTitle: TranslationBase.of(context).pharmaciesList, baseViewModel: model, isShowAppBar: true, + isShowDecPage: false, body: Container( height: SizeConfig.screenHeight, child: ListView( diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 2c12d6fd..2d8c3ef9 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -27,7 +27,7 @@ class _SplashScreenState extends State { Timer( Duration(seconds: 1, milliseconds: 500), () { - getUserData().then((value) { + Provider.of(context, listen: false).loadSharedPrefLanguage().then((value) { Navigator.of(context).pushReplacement( MaterialPageRoute( builder: (BuildContext context) => LandingPage(), @@ -39,13 +39,7 @@ class _SplashScreenState extends State { } Future getUserData() async { - var data = await sharedPref.getObject(USER_PROFILE); - if (data != null) { - AuthenticatedUser userData = AuthenticatedUser.fromJson(data); - // Provider.of(context, listen: false).isLogin = true; - //authenticatedUserObject.isLogin = true; - //authenticatedUserObject.user = userData; - } + Provider.of(context, listen: false).loadSharedPrefLanguage(); } @override diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 44280337..73ad2794 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1001,6 +1001,11 @@ class TranslationBase { String get cardDetail => localizedValues['card-detail'][locale.languageCode]; String get dr => localizedValues['Dr'][locale.languageCode]; String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; + String get instructions => localizedValues['instructions'][locale.languageCode]; + String get instructionsPharmacies => localizedValues['instructions-pharmacies'][locale.languageCode]; + String get selectHospitalDec => localizedValues['select-hospital'][locale.languageCode]; + String get start => localizedValues['start'][locale.languageCode]; + String get infoChat => localizedValues['info-chat'][locale.languageCode]; } diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index d5687554..71a88554 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -177,7 +177,7 @@ class _SecondaryButtonState extends State width: MediaQuery.of(context).size.width, height: 100, decoration: BoxDecoration( - color: Theme.of(context).primaryColor, + color: widget.disabled? Colors.grey: widget.color ?? Theme.of(context).primaryColor, ), ), ), diff --git a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart index 753f3deb..68d01e4a 100644 --- a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart +++ b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart @@ -1,12 +1,16 @@ +import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class LabResultDetailsWidget extends StatefulWidget { - final List labResult; + final List labResult; LabResultDetailsWidget({ this.labResult, @@ -19,6 +23,7 @@ class LabResultDetailsWidget extends StatefulWidget { class _VitalSignDetailsWidgetState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return Container( decoration: BoxDecoration( color: Colors.transparent, @@ -36,7 +41,7 @@ class _VitalSignDetailsWidgetState extends State { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(projectViewModel), ), ], ), @@ -44,7 +49,7 @@ class _VitalSignDetailsWidgetState extends State { ); } - List fullData() { + List fullData(ProjectViewModel projectViewModel) { List tableRow = []; tableRow.add(TableRow(children: [ Container( @@ -52,7 +57,8 @@ class _VitalSignDetailsWidgetState extends State { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), ), ), child: Center( @@ -69,7 +75,8 @@ class _VitalSignDetailsWidgetState extends State { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), ), ), child: Center( @@ -79,6 +86,7 @@ class _VitalSignDetailsWidgetState extends State { ) ])); widget.labResult.forEach((vital) { + var date =DateUtil.convertStringToDate(vital.verifiedOnDateTime); tableRow.add(TableRow(children: [ Container( child: Container( @@ -86,7 +94,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: Texts( - '${vital.verifiedOn}', + '${projectViewModel.isArabic? DateUtil.getWeekDayArabic(date.weekday): DateUtil.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? DateUtil.getMonthArabic(date.month) : DateUtil.getMonth(date.month)} ${date.year}', textAlign: TextAlign.center, ), ), diff --git a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart index 19a95bac..dabad6af 100644 --- a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart +++ b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; @@ -15,7 +16,7 @@ class LabResultChartAndDetails extends StatelessWidget { @required this.name, }) : super(key: key); - final List labResult; + final List labResult; final String name; List _timeSeriesData = []; @@ -28,8 +29,8 @@ class LabResultChartAndDetails extends StatelessWidget { headerWidget: AppTimeSeriesChart( seriesList: generateData(), chartName: name, - startDate: DateUtil.convertStringToDateTime(labResult[0].sampleCollectedOn), - endDate: DateTime.now(), + startDate: DateUtil.convertStringToDate(labResult[0].verifiedOnDateTime), + endDate: DateUtil.convertStringToDate(labResult[labResult.length-1].verifiedOnDateTime), ), bodyWidget: LabResultDetailsWidget( labResult: labResult, @@ -49,7 +50,7 @@ class LabResultChartAndDetails extends StatelessWidget { var resultValueInt = resultValueDouble.toInt(); _timeSeriesData.add( TimeSeriesSales( - DateUtil.convertStringToDateTime(element.sampleCollectedOn), + DateUtil.convertStringToDate(element.verifiedOnDateTime), resultValueInt, ), ); diff --git a/lib/widgets/pharmacy/drug_item.dart b/lib/widgets/pharmacy/drug_item.dart index 7736e089..ae64349e 100644 --- a/lib/widgets/pharmacy/drug_item.dart +++ b/lib/widgets/pharmacy/drug_item.dart @@ -38,14 +38,13 @@ class _MedicineItemWidgetState extends State { children: [ if (widget.url != null) Container( - height: 39.0, - width: 39.0, + child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(7)), child: Image.memory( dataFromBase64String(widget.url), - height: SizeConfig.imageSizeMultiplier * 11, - width: SizeConfig.imageSizeMultiplier * 11, + height: SizeConfig.imageSizeMultiplier * 19, + width: SizeConfig.imageSizeMultiplier * 18, fit: BoxFit.cover, ), ), From 9d046fd9714af7b927d27093d13cb9a666c6a941 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 13 Dec 2020 15:02:58 +0300 Subject: [PATCH 027/103] updates & fixes --- .../all_habib_medical_service_page.dart | 60 +++++++++---------- .../MyAppointments/models/ArrivedButtons.dart | 12 ++-- .../widgets/AppointmentActions.dart | 55 +++++++++++++++-- .../appointment_services/GetDoctorsList.dart | 38 ++++++++++++ 4 files changed, 125 insertions(+), 40 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 316a2437..030e6c3e 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -179,20 +179,20 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).onlinePaymentService, ), - ServicesContainer( - onTap: () { - Navigator.push( - context, - FadePage( - page: ErOptions( - isAppbar: true, - ), - ), - ); - }, - imageLocation: 'assets/images/emergency_service_image.png', - title: TranslationBase.of(context).emergencyService, - ), + // ServicesContainer( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: ErOptions( + // isAppbar: true, + // ), + // ), + // ); + // }, + // imageLocation: 'assets/images/emergency_service_image.png', + // title: TranslationBase.of(context).emergencyService, + // ), ServicesContainer( onTap: () => Navigator.push( context, @@ -233,22 +233,22 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/new-design/virtual_tour_icon.png', title: TranslationBase.of(context).vTour, ), - ServicesContainer( - onTap: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyWebView( - title: TranslationBase.of(context).hmgNews, - selectedUrl: - "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", - ), - ), - ); - }, - imageLocation: - 'assets/images/new-design/twitter_dashboard_icon.png', - title: TranslationBase.of(context).latestNews, - ), + // ServicesContainer( + // onTap: () { + // Navigator.of(context).push( + // MaterialPageRoute( + // builder: (BuildContext context) => MyWebView( + // title: TranslationBase.of(context).hmgNews, + // selectedUrl: + // "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + // ), + // ), + // ); + // }, + // imageLocation: + // 'assets/images/new-design/twitter_dashboard_icon.png', + // title: TranslationBase.of(context).latestNews, + // ), ServicesContainer( onTap: () => Navigator.push( context, diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index a5132883..ab139203 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -3,12 +3,12 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class ArrivedButtons { static var buttons = [ - { - "title": TranslationBase.of(AppGlobal.context).arrived, - "subtitle": TranslationBase.of(AppGlobal.context).status, - "icon": "assets/images/new-design/waiting-room.png", - "caller": "openReschedule" - }, + // { + // "title": TranslationBase.of(AppGlobal.context).arrived, + // "subtitle": TranslationBase.of(AppGlobal.context).status, + // "icon": "assets/images/new-design/waiting-room.png", + // "caller": "openReschedule" + // }, { "title": TranslationBase.of(AppGlobal.context).medicines, "subtitle": TranslationBase.of(AppGlobal.context).medicinesSubtitle, diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 9ce6692c..3000def5 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -16,6 +17,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.d import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; +import 'package:diplomaticquarterapp/pages/medical/labs/laboratory_result_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; @@ -62,8 +64,8 @@ class _AppointmentActionsState extends State { toDoProvider = Provider.of(context); var size = MediaQuery.of(context).size; final double itemHeight = projectViewModel.isArabic - ? ((size.height - kToolbarHeight - 24) * 0.47) / 2 - : ((size.height - kToolbarHeight - 24) * 0.4) / 2; + ? ((size.height - kToolbarHeight - 24) * 0.5) / 2 + : ((size.height - kToolbarHeight - 24) * 0.45) / 2; final double itemWidth = size.width / 2; return Container( @@ -83,7 +85,7 @@ class _AppointmentActionsState extends State { _handleButtonClicks(e); }, child: Column( - mainAxisSize: MainAxisSize.min, + mainAxisSize: MainAxisSize.max, children: [ Container( // height: 100.0, @@ -100,7 +102,7 @@ class _AppointmentActionsState extends State { color: Colors.white), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, + mainAxisSize: MainAxisSize.max, children: [ Container( margin: @@ -196,6 +198,10 @@ class _AppointmentActionsState extends State { openAppointmentRadiology(); break; + case "labResult": + openAppointmentLabResults(); + break; + case "prescriptions": openPrescriptionReport(); break; @@ -403,6 +409,36 @@ class _AppointmentActionsState extends State { }); } + openAppointmentLabResults() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + PatientLabOrders patientLabOrders = new PatientLabOrders(); + service + .getPatientLabOrdersByAppoNo(widget.appo.appointmentNo, + widget.appo.projectID, widget.appo.clinicID, context) + .then((res) { + print(res['ListLabResultsByAppNo']); + GifLoaderDialogUtils.hideDialog(context); + if (res['ListLabResultsByAppNo'] != null) { + patientLabOrders.orderNo = + res['ListLabResultsByAppNo'][0]['OrderNo'].toString(); + patientLabOrders.invoiceNo = + res['ListLabResultsByAppNo'][0]['InvoiceNo'].toString(); + patientLabOrders.clinicID = widget.appo.clinicID; + patientLabOrders.projectID = widget.appo.projectID.toString(); + print(patientLabOrders.invoiceNo); + print(patientLabOrders.orderNo); + navigateToLabResults(patientLabOrders); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + } + openAppointmentRadiology() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); @@ -438,10 +474,12 @@ class _AppointmentActionsState extends State { prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report)); }); print(prescriptionReportEnhList.length); + navigateToMedicinePrescriptionReport(prescriptionReportEnhList, res['ListPRM']); } else { AppToast.showErrorToast(message: TranslationBase.of(context).noRecords); } }).catchError((err) { + print(err); GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); }); @@ -459,6 +497,15 @@ class _AppointmentActionsState extends State { appo: widget.appo))); } + Future navigateToLabResults(PatientLabOrders patientLabOrders) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + LaboratoryResultPage(patientLabOrders: patientLabOrders))) + .then((value) {}); + } + Future navigateToRadiologyDetails(FinalRadiology finalRadiology) async { Navigator.push( context, diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index a320cf6b..d26c74ad 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1087,6 +1087,44 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "AppointmentNo": appoNo, + "ProjectID": projID, + "ClinicID": clinicID, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + await baseAppClient.post(GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future getPatientPrescriptionReports( AppoitmentAllHistoryResultList appo, BuildContext context) async { Map request; From 1f0d01b6ccff601fe1ddca1a656c11495fc4fc7d Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 13 Dec 2020 17:32:45 +0300 Subject: [PATCH 028/103] language issue fixed --- lib/pages/DrawerPages/family/my-family.dart | 380 ++++++++++---------- lib/widgets/drawer/app_drawer_widget.dart | 3 + 2 files changed, 196 insertions(+), 187 deletions(-) diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 80de8ecd..301ca97f 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -7,7 +7,8 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; -import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as list; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' + as list; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -29,9 +30,10 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:provider/provider.dart'; + class MyFamily extends StatefulWidget { final bool isAppbarVisible; - MyFamily({this.isAppbarVisible =true}); + MyFamily({this.isAppbarVisible = true}); @override _MyFamily createState() => _MyFamily(); } @@ -44,9 +46,9 @@ class _MyFamily extends State with TickerProviderStateMixin { TabController _tabController; int _tabIndex = 0; AuthenticatedUserObject authenticatedUserObject = - locator(); + locator(); AppointmentRateViewModel appointmentRateViewModel = - locator(); + locator(); ProjectViewModel projectViewModel; AuthenticatedUser user; @override @@ -59,118 +61,118 @@ class _MyFamily extends State with TickerProviderStateMixin { bool expandFlag = false; Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), + imagesInfo.add( + ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), ); - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), + imagesInfo.add( + ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), ); projectViewModel = Provider.of(context); - return AppScaffold( - appBarTitle: TranslationBase.of(context).myFamilyFiles, - isShowAppBar: widget.isAppbarVisible, + return AppScaffold( + appBarTitle: TranslationBase.of(context).myFamilyFiles, + isShowAppBar: widget.isAppbarVisible, imagesInfo: imagesInfo, description: TranslationBase.of(context).familyInfo, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), - height: 70.0, - ), + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, ), ), - Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.92, // 0.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.9), //width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - //indicatorSize: TabBarIndicatorSize.label, - indicatorSize: TabBarIndicatorSize.tab, - - indicatorColor: Theme.of(context).primaryColor, - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.92, // 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + //indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: AppText(TranslationBase.of(context).family), - ), + indicatorColor: Theme.of(context).primaryColor, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText(TranslationBase.of(context).family), ), - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: AppText(TranslationBase.of(context).request), - ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText(TranslationBase.of(context).request), ), - ], - ), + ), + ], ), ), ), - ], - ), - ), - body: Column( - children: [ - Expanded( - child: (user != null && projectViewModel.isLogin) ? TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - myFamilyDetails(context), - myFamilyRequest(context) - ], - ) : Container(child:AppText('Loading..')), - ) + ), ], ), ), - ); - - - + body: Column( + children: [ + Expanded( + child: (user != null && projectViewModel.isLogin) + ? TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + myFamilyDetails(context), + myFamilyRequest(context) + ], + ) + : Container(child: AppText('Loading..')), + ) + ], + ), + ), + ); return AppScaffold( appBarTitle: TranslationBase.of(context).myFamilyFiles, isShowAppBar: widget.isAppbarVisible, body: SingleChildScrollView( child: Container( - height: SizeConfig.screenHeight *.9, + height: SizeConfig.screenHeight * .9, width: SizeConfig.realScreenWidth, padding: EdgeInsets.all(20), child: Stack( @@ -179,11 +181,13 @@ class _MyFamily extends State with TickerProviderStateMixin { controller: _tabController, indicatorColor: Colors.red, tabs: [ - Tab( // padding: EdgeInsets.all(6), - child:AppText(TranslationBase.of(context).family)), Tab( // padding: EdgeInsets.all(6), - child:AppText(TranslationBase.of(context).request)), + child: AppText(TranslationBase.of(context).family)), + Tab( + // padding: EdgeInsets.all(6), + child: + AppText(TranslationBase.of(context).request)), ], ), TabBarView( @@ -317,13 +321,13 @@ class _MyFamily extends State with TickerProviderStateMixin { Widget myFamilyRequest(context) { return //Padding( - // padding: const EdgeInsets.symmetric(horizontal: 10.0), - // child: - SingleChildScrollView( - child: Container( + // padding: const EdgeInsets.symmetric(horizontal: 10.0), + // child: + SingleChildScrollView( + child: Container( height: MediaQuery.of(context).size.height, - margin: EdgeInsets.only(top:65), - child: Column( + margin: EdgeInsets.only(top: 65), + child: Column( children: [ RoundedContainer( child: ExpansionTile( @@ -375,13 +379,21 @@ class _MyFamily extends State with TickerProviderStateMixin { // )), Column(children: [ Padding( - padding: EdgeInsets.only(left:10, right:10), child:Row(children: [ - Expanded(flex: 3, child: AppText('Name')), - Expanded(flex: 1, child: AppText('Allow')), - Expanded(flex: 1, child: AppText('Reject')), - ])), + padding: EdgeInsets.only( + left: 10, right: 10), + child: Row(children: [ + Expanded( + flex: 3, child: AppText('Name')), + Expanded( + flex: 1, child: AppText('Allow')), + Expanded( + flex: 1, + child: AppText('Reject')), + ])), Column( - children:familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList + children: familyFileProvider + .allSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList .map((result) { return Padding( padding: EdgeInsets.all(10), @@ -400,7 +412,9 @@ class _MyFamily extends State with TickerProviderStateMixin { ), onPressed: () { acceptRemoveRequest( - result.iD, 3, context); + result.iD, + 3, + context); }, )), Expanded( @@ -412,7 +426,9 @@ class _MyFamily extends State with TickerProviderStateMixin { ), onPressed: () { acceptRemoveRequest( - result.iD,4, context); + result.iD, + 4, + context); }, )) ], @@ -462,13 +478,15 @@ class _MyFamily extends State with TickerProviderStateMixin { children: [ Expanded( flex: 3, - child: - Text(result.patientName)), + child: Text( + result.patientName)), Expanded( flex: 2, child: AppText( result.statusDescription, - color: result.status==3 ? Colors.green: Colors.red, + color: result.status == 3 + ? Colors.green + : Colors.red, )), ], )); @@ -487,8 +505,8 @@ class _MyFamily extends State with TickerProviderStateMixin { children: [ FutureBuilder( future: getUserViewRequest(), // async work - builder: - (BuildContext context, AsyncSnapshot snapshot) { + builder: (BuildContext context, + AsyncSnapshot snapshot) { switch (snapshot.connectionState) { case ConnectionState.waiting: return Padding( @@ -502,38 +520,43 @@ class _MyFamily extends State with TickerProviderStateMixin { else return Column( children: [ - // Padding( - // padding:EdgeInsets.only(left:10, right:10), - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Expanded( - // flex: 3, - // child: AppText( - // TranslationBase.of(context).request), - // ), - // Expanded( - // flex: 2, - // child: AppText( - // TranslationBase.of(context).switchUser, - // )), - // Expanded( - // flex: 1, - // child: AppText( - // TranslationBase.of(context).deleteView, - // )), - // ], - // )), + // Padding( + // padding:EdgeInsets.only(left:10, right:10), + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Expanded( + // flex: 3, + // child: AppText( + // TranslationBase.of(context).request), + // ), + // Expanded( + // flex: 2, + // child: AppText( + // TranslationBase.of(context).switchUser, + // )), + // Expanded( + // flex: 1, + // child: AppText( + // TranslationBase.of(context).deleteView, + // )), + // ], + // )), Column(children: [ - Padding( - padding:EdgeInsets.only(left:10, right:10), - child: Row(children: [ - Expanded(flex: 3, child: AppText('Name')), - Expanded(flex: 1, child: AppText('Delete')), - ])), + Padding( + padding: + EdgeInsets.only(left: 10, right: 10), + child: Row(children: [ + Expanded( + flex: 3, child: AppText('Name')), + Expanded( + flex: 1, child: AppText('Delete')), + ])), Column( - children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList + children: familyFileProvider + .allSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList .map((result) { return Padding( padding: EdgeInsets.all(10), @@ -541,7 +564,8 @@ class _MyFamily extends State with TickerProviderStateMixin { children: [ Expanded( flex: 3, - child: AppText(result.patientName)), + child: AppText( + result.patientName)), Expanded( flex: 1, child: IconButton( @@ -550,8 +574,8 @@ class _MyFamily extends State with TickerProviderStateMixin { color: Colors.black, ), onPressed: () { - deactivateRequest(result.iD, - 5, context); + deactivateRequest( + result.iD, 5, context); }, )), ], @@ -625,17 +649,17 @@ class _MyFamily extends State with TickerProviderStateMixin { } switchUser(user, context) { - GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context); // this // .familyFileProvider // .silentLoggin(user) // .then((value) => loginAfter(value, context)); - // Utils.showProgressDialog(context); + // Utils.showProgressDialog(context); this .familyFileProvider .silentLoggin(user is AuthenticatedUser ? null : user, - mainUser: user is AuthenticatedUser) + mainUser: user is AuthenticatedUser) .then((value) => loginAfter(value, context)) .catchError((err) { print(err); @@ -644,26 +668,9 @@ class _MyFamily extends State with TickerProviderStateMixin { }); } - loginAfter(result, context) async{ + loginAfter(result, context) async { GifLoaderDialogUtils.hideDialog(context); - // var familyFile = await sharedPref.getObject(FAMILY_FILE); - // var mainUser = await sharedPref.getObject(MAIN_USER); - // result = CheckActivationCode.fromJson(result); - // this.sharedPref.clear(); - // this.sharedPref.setObject(FAMILY_FILE, familyFile); - // this.sharedPref.setObject(MAIN_USER, mainUser); - // result.list.isFamily = true; - // this.sharedPref.setObject(USER_PROFILE, result.list); - // this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); - // this.sharedPref.setString(TOKEN, result.authenticationTokenID); - // - // authenticatedUserObject.isLogin = true; - // appointmentRateViewModel.isLogin = true; - // projectViewModel.isLogin = true; - // //this.checkIfUserAgreedBefore(result), - // Navigator.of(context).pushNamed( - // HOME, - // ); + var currentLang = await sharedPref.getString(APP_LANGUAGE); result = list.CheckActivationCode.fromJson(result); var familyFile = await sharedPref.getObject(FAMILY_FILE); var mainUser = await sharedPref.getObject(MAIN_USER); @@ -671,6 +678,7 @@ class _MyFamily extends State with TickerProviderStateMixin { if (mainUser["PatientID"] != result.list.patientID) { result.list.isFamily = true; } + this.sharedPref.setString(APP_LANGUAGE, currentLang); this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(FAMILY_FILE, familyFile); @@ -687,32 +695,30 @@ class _MyFamily extends State with TickerProviderStateMixin { Map request = {}; request["ID"] = ID; request["Status"] = status; - this.familyFileProvider.deactivateFamily(request).then((value) => { - GifLoaderDialogUtils.hideDialog(context), - refreshFamily(context) - }); + this.familyFileProvider.deactivateFamily(request).then((value) => + {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)}); } + acceptRemoveRequest(ID, status, context) { GifLoaderDialogUtils.showMyDialog(context); Map request = {}; request["ID"] = ID; request["Status"] = status; - this.familyFileProvider.acceptRejectFamily(request).then((value) => { - GifLoaderDialogUtils.hideDialog(context), - refreshFamily(context) - }); + this.familyFileProvider.acceptRejectFamily(request).then((value) => + {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)}); } - checkUserData() async{ + + checkUserData() async { if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); - var data2 = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(MAIN_USER)); - print(data2); - setState(() { - this.user = data; - }); + var data2 = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(MAIN_USER)); + print(data2); + setState(() { + this.user = data; + }); } } } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 41686aab..b30a3922 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -506,11 +506,14 @@ class _AppDrawerState extends State { Utils.hideProgressDialog(); result = CheckActivationCode.fromJson(result); var familyFile = await sharedPref.getObject(FAMILY_FILE); + var currentLang = await sharedPref.getString(APP_LANGUAGE); var mainUser = await sharedPref.getObject(MAIN_USER); this.sharedPref.clear(); if (mainUser["PatientID"] != result.list.patientID) { result.list.isFamily = true; } + this.sharedPref.setString(APP_LANGUAGE, currentLang); + this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(FAMILY_FILE, familyFile); From 951d9b553fa14d7c6cd91875da394b30eb1027ec Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 13 Dec 2020 17:53:14 +0300 Subject: [PATCH 029/103] fixes & updates --- lib/config/config.dart | 2 + .../all_habib_medical_service_page.dart | 2 +- lib/pages/BookAppointment/SearchResults.dart | 2 +- .../components/SearchByClinic.dart | 63 ++++++++++----- lib/pages/ToDoList/ToDo.dart | 6 +- lib/pages/landing/landing_page.dart | 4 +- lib/pages/paymentService/payment_service.dart | 76 +++++++++++-------- .../bottom_navigation/bottom_nav_bar.dart | 2 +- 8 files changed, 101 insertions(+), 56 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index c9f3186a..e14a544a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -43,6 +43,8 @@ const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabO /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; +const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; + const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 030e6c3e..870fef97 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -208,7 +208,7 @@ class _AllHabibMedicalServiceState extends State { onTap: () => Navigator.push( context, FadePage( - page: ToDo(), + page: ToDo(isShowAppBar: true), ), ), imageLocation: diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 72226c2e..e9897cf8 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -37,7 +37,7 @@ class _SearchResultsState extends State { ...List.generate( widget.patientDoctorAppointmentListHospital.length, (index) => AppExpandableNotifier( - isExpand: index == 1 ? true : false, + // isExpand: index == 0 ? true : false, title: widget.patientDoctorAppointmentListHospital[index] .filterName + " - " + diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 355bb52b..4d5d4d49 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -216,6 +216,9 @@ class _SearchByClinicState extends State { List arrDistance = []; List result; int numAll; + List _patientDoctorAppointmentListHospital = + List(); + DoctorsListService service = new DoctorsListService(); service .getDoctorsList( @@ -228,23 +231,48 @@ class _SearchByClinicState extends State { if (res['MessageStatus'] == 1) { setState(() { if (res['DoctorList'].length != 0) { - print(res['DoctorList']); + // print(res['DoctorList']); doctorsList.clear(); res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); + // arr.add(new DoctorList.fromJson(v).projectName); + // arrDistance.add(new DoctorList.fromJson(v) + // .projectDistanceInKiloMeters + // .toString()); + }); + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); - arr.add(new DoctorList.fromJson(v).projectName); - arrDistance.add(new DoctorList.fromJson(v) - .projectDistanceInKiloMeters - .toString()); + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + distanceInKMs: + element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } }); } else {} }); result = LinkedHashSet.from(arr).toList(); numAll = result.length; + // navigateToSearchResults( + // context, doctorsList, result, numAll, arrDistance); navigateToSearchResults( - context, doctorsList, result, numAll, arrDistance); + context, doctorsList, _patientDoctorAppointmentListHospital); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -267,17 +295,18 @@ class _SearchByClinicState extends State { } Future navigateToSearchResults( - context, docList, result, numAll, resultDistance) async { - Navigator.push( context, - MaterialPageRoute( - builder: (context) => BranchView( - doctorsList: docList, - result: result, - num: numAll, - resultDistance: resultDistance), - ), - ).then((value) { + List docList, + List + patientDoctorAppointmentListHospital) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => SearchResults( + isLiveCareAppointment: false, + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))).then((value) { getProjectsList(); }); } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 25f2e0a7..2e0a3047 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -30,6 +30,10 @@ class ToDo extends StatefulWidget { var languageID; MyInAppBrowser browser; + bool isShowAppBar = true; + + ToDo({@required this.isShowAppBar}); + @override _ToDoState createState() => _ToDoState(); } @@ -62,7 +66,7 @@ class _ToDoState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, imagesInfo: imagesInfo, - isShowAppBar: false, + isShowAppBar: widget.isShowAppBar, isShowDecPage: true, description: TranslationBase.of(context).infoTodo, body: SingleChildScrollView( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index f86511c1..b8d27d65 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -430,13 +430,13 @@ class _LandingPageState extends State with WidgetsBindingObserver { children: [ HomePage( goToMyProfile: () { - // _changeCurrentTab(1); + _changeCurrentTab(1); }, ), MedicalProfilePage(), BookingOptions(), MyFamily(isAppbarVisible: false), - ToDo(), + ToDo(isShowAppBar: false), ], // Please do not remove the BookingOptions from this array ), bottomNavigationBar: BottomNavBar( diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index 63d09f3a..126c3cdc 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -51,9 +51,11 @@ class PaymentService extends StatelessWidget { fontSize: 14, fontWeight: FontWeight.normal, ), - SizedBox(height: 12,), + SizedBox( + height: 12, + ), Container( - margin: EdgeInsets.only(left: 10,right: 10), + margin: EdgeInsets.only(left: 10, right: 10), child: Image.asset( 'assets/images/online_payment_icon.png', fit: BoxFit.fill, @@ -67,37 +69,43 @@ class PaymentService extends StatelessWidget { ), ), Expanded( - child: Container( - margin: EdgeInsets.all(5.0), - padding: EdgeInsets.all(9), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8.0), - shape: BoxShape.rectangle), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).onlineCheckIn, - color: HexColor('#B61422'), - bold: true, - ), - Texts( - TranslationBase.of(context).appointment, - fontSize: 14, - fontWeight: FontWeight.normal, - ), - SizedBox(height: 12,), - Align( - alignment: !projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Image.asset( - 'assets/images/device_icon.png', - height: 55, + child: InkWell( + onTap: () => + Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))), + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).onlineCheckIn, + color: HexColor('#B61422'), + bold: true, ), - ), - ], + Texts( + TranslationBase.of(context).appointment, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + SizedBox( + height: 12, + ), + Align( + alignment: !projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Image.asset( + 'assets/images/device_icon.png', + height: 55, + ), + ), + ], + ), ), ), ) @@ -130,7 +138,9 @@ class PaymentService extends StatelessWidget { fontSize: 14, fontWeight: FontWeight.normal, ), - SizedBox(height: 12,), + SizedBox( + height: 12, + ), Align( alignment: !projectViewModel.isArabic ? Alignment.centerRight diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 1ae7b684..2632ec4a 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -103,6 +103,6 @@ class _BottomNavBarState extends State { } Future navigateToToDoList(context) async { - Navigator.push(context, MaterialPageRoute(builder: (context) => ToDo())); + Navigator.push(context, MaterialPageRoute(builder: (context) => ToDo(isShowAppBar: false))); } } From a6d3fce6fc72c010f5ceaa37b35bde6c1b9a20ba Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 13 Dec 2020 17:36:36 +0200 Subject: [PATCH 030/103] remove ErOptions --- .../all_habib_medical_service_page.dart | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 316a2437..1672828a 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -179,20 +179,20 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).onlinePaymentService, ), - ServicesContainer( - onTap: () { - Navigator.push( - context, - FadePage( - page: ErOptions( - isAppbar: true, - ), - ), - ); - }, - imageLocation: 'assets/images/emergency_service_image.png', - title: TranslationBase.of(context).emergencyService, - ), + // ServicesContainer( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: ErOptions( + // isAppbar: true, + // ), + // ), + // ); + // }, + // imageLocation: 'assets/images/emergency_service_image.png', + // title: TranslationBase.of(context).emergencyService, + // ), ServicesContainer( onTap: () => Navigator.push( context, From 4e823c2be4cbb4eae66d5aa1ca86944ed99a8173 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 14 Dec 2020 15:28:24 +0200 Subject: [PATCH 031/103] fix chart and duplicated data in Patient Lab Result --- lib/core/model/labs/lab_result.dart | 3 +- .../viewModels/medical/labs_view_model.dart | 16 +- lib/pages/landing/home_page.dart | 6 + lib/widgets/avatar/large_avatar.dart | 2 +- .../medical/LabResult/LineChartCurved.dart | 194 ++++++++++++++++++ .../lab_result_chart_and_detials.dart | 9 +- .../data_display/medical/doctor_card.dart | 2 +- pubspec.yaml | 3 + 8 files changed, 217 insertions(+), 18 deletions(-) create mode 100644 lib/widgets/data_display/medical/LabResult/LineChartCurved.dart diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index adc2e5ff..2deb13f3 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -92,8 +92,7 @@ class LabResultList { String filterName = ""; List patientLabResultList = List(); - LabResultList( - {this.filterName, LabResult lab}) { + LabResultList({this.filterName, LabResult lab}) { patientLabResultList.add(lab); } } diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index c54084d6..1f938fb0 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -115,18 +115,16 @@ class LabsViewModel extends BaseViewModel { setState(ViewState.Error); } else { _labsService.labResultList.forEach((element) { - List patientLabOrdersClinic = labResultLists - .where( - (elementClinic) => elementClinic.filterName == element.testCode) - .toList(); + List patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList(); if (patientLabOrdersClinic.length != 0) { - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList - .add(element); + + var value= labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList + .where((e) => e.sampleCollectedOn== element.sampleCollectedOn && e.resultValue ==element.resultValue ).toList(); + if(value.isEmpty) + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element); } else { - labResultLists - .add(LabResultList(filterName: element.testCode, lab: element)); + labResultLists.add(LabResultList(filterName: element.testCode, lab: element)); } }); setState(ViewState.Idle); diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 1706ce8a..13d11a71 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -28,6 +28,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import '../../widgets/data_display/medical/LabResult/LineChartCurved.dart'; import '../../locator.dart'; class HomePage extends StatefulWidget { @@ -527,6 +528,11 @@ class _HomePageState extends State { ], ), ), + SizedBox(height: 8,), + // Padding( + // padding: const EdgeInsets.all(8.0), + // child: LineChartSample1(), + // ), SizedBox( height: 8, ), diff --git a/lib/widgets/avatar/large_avatar.dart b/lib/widgets/avatar/large_avatar.dart index ed904d03..fcfcaa94 100644 --- a/lib/widgets/avatar/large_avatar.dart +++ b/lib/widgets/avatar/large_avatar.dart @@ -37,7 +37,7 @@ class LargeAvatar extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(radius)), child: Image.network( url.trim(), - fit: BoxFit.cover, + fit: BoxFit.fill, width: width, height: height, ), diff --git a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart new file mode 100644 index 00000000..0056e23e --- /dev/null +++ b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart @@ -0,0 +1,194 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +import '../../../../core/model/labs/LabOrderResult.dart'; + +class LineChartCurved extends StatefulWidget { + final String title; + final List labResult; + + LineChartCurved({this.title, this.labResult}); + + @override + State createState() => LineChartCurvedState(); +} + +class LineChartCurvedState extends State { + bool isShowingMainData; + + @override + void initState() { + super.initState(); + isShowingMainData = true; + } + + @override + Widget build(BuildContext context) { + return AspectRatio( + aspectRatio: 1.23, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + Text( + widget.title, + style: TextStyle( + color: Colors.black, + fontSize: 32, + fontWeight: FontWeight.bold, + letterSpacing: 2), + textAlign: TextAlign.center, + ), + + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 16.0, left: 6.0), + child: LineChart( + sampleData1(), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + const SizedBox( + height: 10, + ), + ], + ), + ], + ), + ), + ); + } + + LineChartData sampleData1() { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData(show: true, drawVerticalLine: true,drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 12, + ), + margin: 10, + getTitles: (value) { + print(value); + if(widget.labResult.length>value.toInt()) + { DateTime date = DateUtil.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); + return '${date.day}/ ${date.year}';} + return ''; + } + + , + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 14, + ), + getTitles: (value) { + return '${value.toInt()}'; + }, + margin: 8, + //reservedSize: 30, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (widget.labResult.length-1).toDouble(), + maxY: getMaxY(), + minY: getMinY(), + lineBarsData: getData(), + ); + } + + double getMaxY(){ + double max =0; + widget.labResult.forEach((element) { + double resultValueDouble =double.parse(element.resultValue); + if(resultValueDouble>max) + max = resultValueDouble; + }); + + return max.roundToDouble(); + } + + double getMinY(){ + double min =double.parse(widget.labResult[0].resultValue); + + + widget.labResult.forEach((element) { + double resultValueDouble =double.parse(element.resultValue); + if(resultValueDouble getData() { + List spots = List(); + for (int index = 0; index < widget.labResult.length ; index++) { + var resultValueDouble = double.parse(widget.labResult[index].resultValue); + spots.add(FlSpot(index.toDouble(), resultValueDouble)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + + ), + ); + + return [ + lineChartBarData1, + ]; + } +} + + diff --git a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart index dabad6af..bec6d63a 100644 --- a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart +++ b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart @@ -7,6 +7,7 @@ import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; +import 'LineChartCurved.dart'; import 'Lab_Result_details_wideget.dart'; class LabResultChartAndDetails extends StatelessWidget { @@ -26,11 +27,9 @@ class LabResultChartAndDetails extends StatelessWidget { return Column( children: [ AppExpandableNotifier( - headerWidget: AppTimeSeriesChart( - seriesList: generateData(), - chartName: name, - startDate: DateUtil.convertStringToDate(labResult[0].verifiedOnDateTime), - endDate: DateUtil.convertStringToDate(labResult[labResult.length-1].verifiedOnDateTime), + headerWidget: Padding( + padding: const EdgeInsets.all(8.0), + child: LineChartCurved(title: name,labResult:labResult,), ), bodyWidget: LabResultDetailsWidget( labResult: labResult, diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 2e70f2ab..5f6f7032 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -140,7 +140,7 @@ class DoctorCard extends StatelessWidget { onTap: onEmailTap, child: Icon( Icons.email, - color: Colors.red, + color: Theme.of(context).primaryColor, ), ) ], diff --git a/pubspec.yaml b/pubspec.yaml index 7941c492..d65a4f8e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,6 +28,9 @@ dependencies: #Dependency Injection get_it: ^4.0.2 + #chart + fl_chart: ^0.12.1 + # Permissions permission_handler: ^5.0.0+hotfix.3 device_info: ^0.4.2+4 From 92e62751628f5ab8df307858661255f467fc7b8d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 14 Dec 2020 16:59:23 +0200 Subject: [PATCH 032/103] Add Confirm send email dialog --- lib/config/localized_values.dart | 8 + .../confirm_send_email_dialog.dart | 111 +++++++ .../prescription_items_page.dart | 283 ++++++++++-------- lib/uitl/translations_delegate_base.dart | 2 + 4 files changed, 284 insertions(+), 120 deletions(-) create mode 100644 lib/pages/medical/prescriptions/confirm_send_email_dialog.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index dfd13cca..e034b05e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1154,4 +1154,12 @@ const Map localizedValues = { "en": "This service allows you to chat with customer service directly without the need to call.", "ar": "المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً." }, + "send-email": { + "en": "Send a copy of this report to the email", + "ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني" + }, + "update-email": { + "en": "Update Email", + "ar": "تحديث البريد الالكتروني" + } }; diff --git a/lib/pages/medical/prescriptions/confirm_send_email_dialog.dart b/lib/pages/medical/prescriptions/confirm_send_email_dialog.dart new file mode 100644 index 00000000..047b663d --- /dev/null +++ b/lib/pages/medical/prescriptions/confirm_send_email_dialog.dart @@ -0,0 +1,111 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../../../routes.dart'; + +class ConfirmSendEmailDialog extends StatefulWidget { + final String email; + final GestureTapCallback onTapSendEmail; + + ConfirmSendEmailDialog({this.email, this.onTapSendEmail}); + + @override + _ConfirmSendEmailDialogState createState() => _ConfirmSendEmailDialogState(); +} + +class _ConfirmSendEmailDialogState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), + title: Center( + child: Texts( + TranslationBase.of(context).confirm, + color: Colors.black, + ), + ), + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: Texts( + TranslationBase.of(context).sendConfEmail, + color: Colors.grey, + ), + ), + Texts( + widget.email, + color: Colors.grey, + ), + SizedBox( + height: 5, + ), + Divider(), + SizedBox( + height: 5.0, + ), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Container( + width: double.maxFinite, + child: Center( + child: Texts( + TranslationBase.of(context).cancel, + color: Colors.red, + ), + ), + ), + ), + SizedBox( + height: 15.0, + ), + InkWell( + onTap: () { + Navigator.pop(context); + widget.onTapSendEmail(); + }, + child: Container( + width: double.maxFinite, + child: Center( + child: Texts(TranslationBase.of(context).sendEmail), + ), + ), + ), + SizedBox( + height: 15.0, + ), + InkWell( + onTap: () { + Navigator.of(context).pushNamed( + SETTINGS, + ); + }, + child: Container( + width: double.maxFinite, + child: Center( + child: Texts(TranslationBase.of(context).updateEmail), + ), + ), + ), + SizedBox( + height: 20.0, + ), + ], + ) + ], + ); + } +} diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index d4a9e500..ce2738dd 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -12,6 +12,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'confirm_send_email_dialog.dart'; + class PrescriptionItemsPage extends StatelessWidget { final Prescriptions prescriptions; @@ -30,121 +32,148 @@ class PrescriptionItemsPage extends StatelessWidget { height: MediaQuery.of(context).size.height * 0.8, child: Column( children: [ - - if(!prescriptions.isInOutPatient) - ...List.generate(model.prescriptionReportList.length, (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport: model.prescriptionReportList[index], - ), - ), - ), - child: Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.prescriptionReportList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, - ), - ), - SizedBox(width: 10,), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts(model.prescriptionReportList[index].itemDescription.isNotEmpty? - model.prescriptionReportList[index].itemDescription :model - .prescriptionReportList[index].itemDescriptionN)), - )), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], - ), - ), - )) - - else - ...List.generate( - model.prescriptionReportEnhList.length, + if (!prescriptions.isInOutPatient) + ...List.generate( + model.prescriptionReportList.length, (index) => InkWell( - onTap: (){ - PrescriptionReport prescriptionReport = PrescriptionReport( - imageSRCUrl: model.prescriptionReportEnhList[index].imageSRCUrl, - itemDescription: model.prescriptionReportEnhList[index].itemDescription, - itemDescriptionN: model.prescriptionReportEnhList[index].itemDescription, - routeN: model.prescriptionReportEnhList[index].route, - frequency: model.prescriptionReportEnhList[index].frequency, - frequencyN: model.prescriptionReportEnhList[index].frequency, - doseDailyQuantity: model.prescriptionReportEnhList[index].doseDailyQuantity, - days: model.prescriptionReportEnhList[index].days, - itemID: model.prescriptionReportEnhList[index].itemID, - remarks: model.prescriptionReportEnhList[index].remarks - ); - Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport:prescriptionReport, + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: + model.prescriptionReportList[index], + ), ), ), - ); - }, - child: Container( - margin: EdgeInsets.all(8.0), - color: Colors.white, - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, - ), - ), - SizedBox(width: 10,), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + child: Container( + width: double.infinity, + margin: + EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], width: 0.5), + ), + child: Row( children: [ - Texts(model.prescriptionReportEnhList[index] - .itemDescription), + ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(5)), + child: Image.network( + model.prescriptionReportList[index] + .imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts(model + .prescriptionReportList[index] + .itemDescription + .isNotEmpty + ? model.prescriptionReportList[index] + .itemDescription + : model.prescriptionReportList[index] + .itemDescriptionN)), + )), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) ], ), ), + )) + else + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => InkWell( + onTap: () { + PrescriptionReport prescriptionReport = + PrescriptionReport( + imageSRCUrl: model + .prescriptionReportEnhList[index].imageSRCUrl, + itemDescription: model + .prescriptionReportEnhList[index] + .itemDescription, + itemDescriptionN: model + .prescriptionReportEnhList[index] + .itemDescription, + routeN: + model.prescriptionReportEnhList[index].route, + frequency: model + .prescriptionReportEnhList[index].frequency, + frequencyN: model + .prescriptionReportEnhList[index].frequency, + doseDailyQuantity: model + .prescriptionReportEnhList[index] + .doseDailyQuantity, + days: model.prescriptionReportEnhList[index].days, + itemID: + model.prescriptionReportEnhList[index].itemID, + remarks: model + .prescriptionReportEnhList[index].remarks); + Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: prescriptionReport, + ), ), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], - ), - ), + ); + }, + child: Container( + margin: EdgeInsets.all(8.0), + color: Colors.white, + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + model + .prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(model.prescriptionReportEnhList[index] + .itemDescription), + ], + ), + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), ), - ) + ), + ) ], ), ), @@ -159,27 +188,41 @@ class PrescriptionItemsPage extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.8, child: Button( label: TranslationBase.of(context).sendCopy, - onTap: () => model.sendPrescriptionEmail( - appointmentDate: prescriptions.appointmentDate, - patientID: prescriptions.patientID, - clinicName: prescriptions.companyName, - doctorName: prescriptions.doctorName, - mes: TranslationBase.of(context).sendSuc, - projectID: prescriptions.projectID), + onTap: () { + showConfirmMessage(context,model); + }, loading: model.state == ViewState.BusyLocal, ), ), - if(false) - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - label:TranslationBase.of(context).resendOrder, - backgroundColor: Colors.green[200], - )) + if (false) + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: TranslationBase.of(context).resendOrder, + backgroundColor: Colors.green[200], + )) ], ), ), ), ); } + + void showConfirmMessage(BuildContext context, PrescriptionsViewModel model) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () { + model.sendPrescriptionEmail( + appointmentDate: prescriptions.appointmentDate, + patientID: prescriptions.patientID, + clinicName: prescriptions.companyName, + doctorName: prescriptions.doctorName, + mes: TranslationBase.of(context).sendSuc, + projectID: prescriptions.projectID); + }, + ), + ); + } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 80fb0cfe..bc28227d 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1015,6 +1015,8 @@ class TranslationBase { String get lastVisit => localizedValues['last-visit'][locale.languageCode]; String get tapTitle => localizedValues['tap-title'][locale.languageCode]; String get later => localizedValues['later'][locale.languageCode]; + String get sendConfEmail => localizedValues['send-email'][locale.languageCode]; + String get updateEmail => localizedValues['update-email'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 5606c88715b80e432d3892a45a5ec71a5791c7c6 Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Mon, 14 Dec 2020 18:13:38 +0300 Subject: [PATCH 033/103] hot fixes --- lib/config/localized_values.dart | 4 + lib/core/service/medical/reports_service.dart | 13 +- .../insurance/insurance_card_screen.dart | 3 +- .../insurance/insurance_update_screen.dart | 198 ++++++++++-------- .../medical/reports/report_home_page.dart | 39 +++- .../medical/reports/report_list_widget.dart | 55 +++-- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/buttons/secondary_button.dart | 2 +- 8 files changed, 192 insertions(+), 123 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 059b03ab..98bb0e74 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1162,4 +1162,8 @@ const Map localizedValues = { "en": "Please rate the clinic", "ar": "يرجى تقييم العيادة" }, + "fetch-data": { + "en": "Fetch Data", + "ar": "تحديث الان" + }, }; diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index 7acb92ea..b2f90e61 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -100,8 +100,6 @@ class ReportsService extends BaseService { String requestDate, String invoiceNo, int projectID, - String printID, - String procedureID, String stamp, String setupID) async { Map body = new Map(); @@ -114,19 +112,24 @@ class ReportsService extends BaseService { body['DateofBirth'] = user.dateofBirth; body['PatientIditificationNum'] = user.patientIdentificationNo; body['PatientMobileNumber'] = user.mobileNumber; - body['PatientName'] = user.firstName + " " + user.firstName; + body['PatientName'] = user.firstName + " " + user.lastName; body['ProjectName'] = projectName; body['ClinicName'] = clinicName; body['ProjectID'] = projectID; body['InvoiceNo'] = invoiceNo; - body['PrintedByName'] = user.firstName + " " + user.firstName; + body['PrintedByName'] = user.firstName + " " + user.lastName; + + dynamic response; hasError = false; await baseAppClient.post(SEND_MEDICAL_REPORT_EMAIL, - onSuccess: (dynamic response, int statusCode) {}, + onSuccess: (dynamic res, int statusCode) { + response = res; + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); + return response; } } diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index 42357eea..71c09635 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -167,7 +167,8 @@ class _InsuranceCardState extends State { onTap: () => { getDetails(model.insurance[index]) }, - label: TranslationBase.of(context).seeDetails, + label: TranslationBase.of(context) + .seeDetails, textColor: Colors.white, ), width: double.infinity, diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index a7e7c32b..8be58af4 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,5 +1,10 @@ +import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import '../base/base_view.dart'; @@ -15,6 +20,7 @@ class InsuranceUpdate extends StatefulWidget { class _InsuranceUpdateState extends State with SingleTickerProviderStateMixin { TabController _tabController; + InsuranceCardService _insuranceCardService = locator(); @override void initState() { @@ -103,94 +109,109 @@ class _InsuranceUpdateState extends State itemCount: model.getAllSharedRecordsByStatusResponse .getAllSharedRecordsByStatusList.length, itemBuilder: (BuildContext context, int index) { - return Container( - margin: EdgeInsets.all(10.0), - child: Card( - margin: - EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - child: Container( - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, - left: 10.0, - right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .patientName, - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, + return model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .status == + 3 + ? Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB( + 8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10), + ), + child: Container( + width: + MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Texts( + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientName, + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of( + context) + .fileno + + ": " + + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ) + ], + ), ), - SizedBox( - height: 8, + ), + if (false) + Expanded( + flex: 2, + child: Container( + margin: + EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase + .of(context) + .fetchData, + small: true, + textColor: + Colors.white, + onTap: () { + getDetails( + model); + }, + ), + ), + ], + ), ), - Texts( - TranslationBase.of(context) - .fileno + - ": " + - model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .patientID - .toString(), - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ) - ], - ), + ) + ], ), ), - if (false) - Expanded( - flex: 2, - child: Container( - // height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: TranslationBase.of( - context) - .updateInsurance, - small: true, - textColor: Colors.white, - // color: Colors.grey, - ), - //height: 45, - // width:90 - ), - ], - ), - ), - ) - ], - ), - ), - ), - ); + ), + ) + : Container(); }) : Container(), ), @@ -309,4 +330,13 @@ class _InsuranceUpdateState extends State ), ); } + + getDetails(data) { + GifLoaderDialogUtils.showMyDialog(context); + _insuranceCardService.getInsuranceDetails(data).then((value) => { + GifLoaderDialogUtils.hideDialog(context), + Navigator.push(context, + FadePage(page: InsuranceCardDetails(data: value[0]['CheckList']))) + }); + } } diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 636d4e00..b99fb40f 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -37,9 +37,21 @@ class _HomeReportPageState extends State @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png')); return BaseView( onModelReady: (model) => model.getReports(), //model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( @@ -93,7 +105,8 @@ class _HomeReportPageState extends State Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts(TranslationBase.of(context).requested), + child: + Texts(TranslationBase.of(context).requested), ), ), Container( @@ -105,13 +118,15 @@ class _HomeReportPageState extends State Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts(TranslationBase.of(context).completed), + child: + Texts(TranslationBase.of(context).completed), ), ), Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts(TranslationBase.of(context).cancelled), + child: + Texts(TranslationBase.of(context).cancelled), ), ), ], @@ -130,21 +145,23 @@ class _HomeReportPageState extends State controller: _tabController, children: [ ReportListWidget( - reportList: model.reportsOrderRequestList, + reportList: model.reportsOrderRequestList ), ReportListWidget( - reportList: model.reportsOrderReadyList, + reportList: model.reportsOrderReadyList ), ReportListWidget( - reportList: model.reportsOrderCompletedList, + reportList: model.reportsOrderCompletedList ), ReportListWidget( - reportList: model.reportsOrderCanceledList, + reportList: model.reportsOrderCanceledList ), ], ), ), - SizedBox(height: 110,) + SizedBox( + height: 110, + ) ], ), bottomSheet: Container( diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 4002b1ba..b838fd92 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -1,7 +1,10 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart'; import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -10,8 +13,9 @@ import 'package:flutter/material.dart'; class ReportListWidget extends StatelessWidget { final List reportList; + final Function onEmailTap; - ReportListWidget({@required this.reportList}); + ReportListWidget({@required this.reportList, this.onEmailTap}); @override Widget build(BuildContext context) { @@ -48,17 +52,6 @@ class ReportListWidget extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - reportList[index].status == 2 - ? Container( - child: InkWell( - onTap: sendReportEmail(), - child: Icon( - Icons.email, - color: Colors.red, - ), - ), - ) - : Container(), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -72,6 +65,21 @@ class ReportListWidget extends StatelessWidget { SizedBox(height: 12), ], ), + reportList[index].status == 2 + ? Container( + margin: EdgeInsets.only(left: 15.0, right: 15.0), + child: InkWell( + onTap: () { + sendReportEmail(reportList[index]); + }, + child: Icon( + Icons.email, + color: Theme.of(context).primaryColor, + size: 35.0, + ), + ), + ) + : Container(), ], ), ), @@ -86,21 +94,26 @@ class ReportListWidget extends StatelessWidget { } sendReportEmail(Reports report) { + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); ReportsService _reportsService = locator(); - _reportsService .sendEmailForMedicalReport( report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate), - report.invoiceNo.toString(), - report.projectID, - report.printID, - procedureID, - stamp, - setupID) - .then((value) {}) - .catchError(() {}); + report.invoiceNo.toString(), + report.projectID, + DateUtil.convertDateToString(report.requestDate), + report.setupId) + .then((value) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + print(value["IsSent"]); + AppToast.showSuccessToast( + message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + print(err); + }); } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index fece63a2..9836fadf 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1018,6 +1018,7 @@ class TranslationBase { String get lastAppointment => localizedValues['last-appointment'][locale.languageCode]; String get rateClinic => localizedValues['rate-clinic'][locale.languageCode]; + String get fetchData => localizedValues['fetch-data'][locale.languageCode]; } diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index 71a88554..ccb436fe 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -236,7 +236,7 @@ class _SecondaryButtonState extends State widget.label, style: TextStyle( color: widget.textColor, - fontSize: 17.0, + fontSize: widget.small ? 12.0 : 17.0, fontWeight: FontWeight.w800, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), ), From b9269f525adacdda43c42d3c4512b5fe1c0cd08a Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Mon, 14 Dec 2020 23:10:30 +0300 Subject: [PATCH 034/103] hot fixes --- lib/pages/MyAppointments/MyAppointments.dart | 51 ++++++++++--------- lib/pages/ToDoList/ToDo.dart | 2 +- lib/pages/login/login.dart | 2 +- .../medical/patient_sick_leave_page.dart | 46 +++++++++++++---- .../radiology/radiology_details_page.dart | 46 ++++++++++++----- .../medical/reports/report_home_page.dart | 12 +++-- .../medical/reports/report_list_widget.dart | 24 +++++++-- .../rate_appointment_doctor.dart | 14 ++--- lib/uitl/date_uitl.dart | 23 ++++++++- .../medical/time_line_widget.dart | 36 +++++++++---- 10 files changed, 177 insertions(+), 79 deletions(-) diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 47e539a0..80f2c9b7 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -84,17 +84,19 @@ class _MyAppointmentsState extends State color: Colors.grey[600], thickness: 0.5, ), - Expanded( - child: new TabBarView( - physics: NeverScrollableScrollPhysics(), - children: [ - isDataLoaded ? getBookedAppointments() : Container(), - isDataLoaded ? getConfirmedAppointments() : Container(), - isDataLoaded ? getArrivedAppointments() : Container() - ], - controller: _tabController, - ), - ), + isDataLoaded + ? Expanded( + child: new TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + getBookedAppointments(), + getConfirmedAppointments(), + getArrivedAppointments() + ], + controller: _tabController, + ), + ) + : Container(), ]), ), ); @@ -114,19 +116,17 @@ class _MyAppointmentsState extends State service.getPatientAppointmentHistory(false, context).then((res) { print(res['AppoimentAllHistoryResultList'].length); + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { - GifLoaderDialogUtils.hideDialog(context); - setState(() { - isDataLoaded = true; - if (res['AppoimentAllHistoryResultList'].length != 0) { - isDataLoaded = true; - res['AppoimentAllHistoryResultList'].forEach((v) { - widget.appoList - .add(new AppoitmentAllHistoryResultList.fromJson(v)); - }); - sortAppointmentList(); - } else {} - }); + // setState(() { + if (res['AppoimentAllHistoryResultList'].length != 0) { + // isDataLoaded = true; + res['AppoimentAllHistoryResultList'].forEach((v) { + widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + }); + sortAppointmentList(); + } else {} + // }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -256,6 +256,9 @@ class _MyAppointmentsState extends State return; } } + setState(() { + isDataLoaded = true; + }); } Widget getBookedAppointments() { @@ -419,6 +422,4 @@ class _MyAppointmentsState extends State ), ); } - - } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 129f5ce9..98d9cc10 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -54,7 +54,6 @@ class _ToDoState extends State { @override void initState() { - toDoProvider = Provider.of(context); widget.patientShareResponse = new PatientShareResponse(); WidgetsBinding.instance.addPostFrameCallback((_) { if (authenticatedUserObject.isLogin) getPatientData(); @@ -69,6 +68,7 @@ class _ToDoState extends State { @override Widget build(BuildContext context) { + toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, imagesInfo: imagesInfo, diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 366a49d9..729e294a 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -256,6 +256,7 @@ class _Login extends State { appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { + getToDoCount(), GifLoaderDialogUtils.hideDialog(context), if (appointmentRateViewModel.isHaveAppointmentNotRate) { @@ -268,7 +269,6 @@ class _Login extends State { } else { - getToDoCount(), Navigator.pushAndRemoveUntil( context, FadePage( diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 033295aa..fd8ecf0f 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -1,11 +1,14 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/model/sick_leave/sick_leave.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; class PatientSickLeavePage extends StatefulWidget { @override @@ -14,9 +17,14 @@ class PatientSickLeavePage extends StatefulWidget { class _PatientSickLeavePageState extends State { List imagesInfo = List(); + @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png')); return BaseView( onModelReady: (model) => model.getSickLeave(), builder: (_, model, w) => AppScaffold( @@ -37,16 +45,16 @@ class _PatientSickLeavePageState extends State { profileUrl: model.sickLeaveList[index].doctorImageURL, rat: model.sickLeaveList[index].actualDoctorRate.toDouble(), subName: model.sickLeaveList[index].projectName, - isInOutPatient: - model.sickLeaveList[index].isInOutPatient, + isInOutPatient: model.sickLeaveList[index].isInOutPatient, onEmailTap: () { - model.sendSickLeaveEmail( - message: TranslationBase.of(context).emailSentSuccessfully, - requestNo: model.sickLeaveList[index].requestNo, - doctorName: model.sickLeaveList[index].doctorName, - projectName: model.sickLeaveList[index].projectName, - setupID: model.sickLeaveList[index].setupID, - projectID: model.sickLeaveList[index].projectID); + showConfirmMessage(model, index); + // model.sendSickLeaveEmail( + // message: TranslationBase.of(context).emailSentSuccessfully, + // requestNo: model.sickLeaveList[index].requestNo, + // doctorName: model.sickLeaveList[index].doctorName, + // projectName: model.sickLeaveList[index].projectName, + // setupID: model.sickLeaveList[index].setupID, + // projectID: model.sickLeaveList[index].projectID); }, ), ), @@ -54,4 +62,22 @@ class _PatientSickLeavePageState extends State { ), ); } + + void showConfirmMessage(PatientSickLeaveViewMode model, int index) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () { + model.sendSickLeaveEmail( + message: TranslationBase.of(context).emailSentSuccessfully, + requestNo: model.sickLeaveList[index].requestNo, + doctorName: model.sickLeaveList[index].doctorName, + projectName: model.sickLeaveList[index].projectName, + setupID: model.sickLeaveList[index].setupID, + projectID: model.sickLeaveList[index].projectID); + }, + ), + ); + } } diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 0e0967d0..fb4ddddb 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -1,7 +1,9 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -51,29 +53,32 @@ class RadiologyDetailsPage extends StatelessWidget { ), bottomSheet: Container( width: double.infinity, - height: model.radImageURL.isNotEmpty ? MediaQuery.of(context).size.height * 0.2:MediaQuery.of(context).size.height * 0.15, + height: finalRadiology.dIAPACSURL != "" + ? MediaQuery.of(context).size.height * 0.2 + : MediaQuery.of(context).size.height * 0.15, color: Colors.grey[100], child: Column( mainAxisSize: MainAxisSize.min, children: [ Divider(), - if(model.radImageURL.isNotEmpty) + if (finalRadiology.dIAPACSURL != "") + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { + launch(model.radImageURL); + }, + label: TranslationBase.of(context).openRad, + backgroundColor: Colors.grey[800], + ), + ), Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( onTap: () { - launch(model.radImageURL); + showConfirmMessage( + finalRadiology: finalRadiology, model: model); }, - label: TranslationBase.of(context).openRad, - backgroundColor: Colors.grey[800], - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - onTap: () => model.sendRadReportEmail( - mes: TranslationBase.of(context).sendSuc, - finalRadiology: finalRadiology), label: TranslationBase.of(context).sendCopyRad, loading: model.state == ViewState.BusyLocal, backgroundColor: Theme.of(context).primaryColor, @@ -84,4 +89,19 @@ class RadiologyDetailsPage extends StatelessWidget { )), ); } + + void showConfirmMessage( + {FinalRadiology finalRadiology, RadiologyViewModel model}) { + showDialog( + context: AppGlobal.context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () { + model.sendRadReportEmail( + mes: TranslationBase.of(AppGlobal.context).sendSuc, + finalRadiology: finalRadiology); + }, + ), + ); + } } diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index b99fb40f..8866757f 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -145,16 +145,20 @@ class _HomeReportPageState extends State controller: _tabController, children: [ ReportListWidget( - reportList: model.reportsOrderRequestList + reportList: model.reportsOrderRequestList, + emailAddress: model.user.emailAddress ), ReportListWidget( - reportList: model.reportsOrderReadyList + reportList: model.reportsOrderReadyList, + emailAddress: model.user.emailAddress ), ReportListWidget( - reportList: model.reportsOrderCompletedList + reportList: model.reportsOrderCompletedList, + emailAddress: model.user.emailAddress ), ReportListWidget( - reportList: model.reportsOrderCanceledList + reportList: model.reportsOrderCanceledList, + emailAddress: model.user.emailAddress ), ], ), diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index b838fd92..39946cae 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart'; import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -13,9 +14,9 @@ import 'package:flutter/material.dart'; class ReportListWidget extends StatelessWidget { final List reportList; - final Function onEmailTap; + final String emailAddress; - ReportListWidget({@required this.reportList, this.onEmailTap}); + ReportListWidget({@required this.reportList, this.emailAddress}); @override Widget build(BuildContext context) { @@ -67,10 +68,12 @@ class ReportListWidget extends StatelessWidget { ), reportList[index].status == 2 ? Container( - margin: EdgeInsets.only(left: 15.0, right: 15.0), + margin: + EdgeInsets.only(left: 15.0, right: 15.0), child: InkWell( onTap: () { - sendReportEmail(reportList[index]); + showConfirmMessage(reportList[index]); + // sendReportEmail(reportList[index]); }, child: Icon( Icons.email, @@ -93,6 +96,18 @@ class ReportListWidget extends StatelessWidget { ); } + void showConfirmMessage(Reports report) { + showDialog( + context: AppGlobal.context, + child: ConfirmSendEmailDialog( + email: emailAddress, + onTapSendEmail: () { + sendReportEmail(report); + }, + ), + ); + } + sendReportEmail(Reports report) { GifLoaderDialogUtils.showMyDialog(AppGlobal.context); ReportsService _reportsService = locator(); @@ -108,7 +123,6 @@ class ReportListWidget extends StatelessWidget { report.setupId) .then((value) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); - print(value["IsSent"]); AppToast.showSuccessToast( message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); }).catchError((err) { diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 1cd560d4..4a1026f6 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -162,15 +162,15 @@ class _RateAppointmentDoctorState extends State { Form( key: formKey, child: TextFields( - hintText: "Notes", + hintText: TranslationBase.of(context).notes, minLines: 4, maxLines: 4, - validator: (value) { - if (value.isEmpty) - return 'Please enter your note'; - else if (rating == 0) return 'Rating cannot be \"0\"'; - return null; - }, + // validator: (value) { + // if (value.isEmpty) + // return 'Please enter your note'; + // else if (rating == 0) return 'Rating cannot be \"0\"'; + // return null; + // }, onChanged: (value) { setState(() { note = value; diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 3e6123c2..637b0795 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -23,8 +23,9 @@ class DateUtil { if (date != null) { try { var dateT = date.split('/'); - var year = dateT[2].substring(0,4); - var dateP = DateTime(int.parse(year),int.parse(dateT[1]),int.parse(dateT[0])); + var year = dateT[2].substring(0, 4); + var dateP = + DateTime(int.parse(year), int.parse(dateT[1]), int.parse(dateT[0])); return dateP; } catch (e) { print(e); @@ -277,6 +278,24 @@ class DateUtil { return ""; } + static String getMonthDayYearLangDateFormatted( + DateTime dateTime, String lang) { + if (dateTime != null) + return lang == 'en' + ? getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + " " + + dateTime.year.toString() + : dateTime.day.toString() + + " " + + getMonthArabic(dateTime.month) + + " " + + dateTime.year.toString(); + else + return ""; + } + /// get data formatted like 26/4/2020 /// [dateTime] convert DateTime to data formatted static String getDayMonthYearDateFormatted(DateTime dateTime) { diff --git a/lib/widgets/data_display/medical/time_line_widget.dart b/lib/widgets/data_display/medical/time_line_widget.dart index ddb3175a..6e946aa5 100644 --- a/lib/widgets/data_display/medical/time_line_widget.dart +++ b/lib/widgets/data_display/medical/time_line_widget.dart @@ -51,8 +51,12 @@ class TimeLineWidget extends StatelessWidget { LargeAvatar( onTap: () { //AppointmentDetails - Navigator.push(context, - FadePage(page: AppointmentDetails(appo: appoitmentAllHistoryResul,))); + Navigator.push( + context, + FadePage( + page: AppointmentDetails( + appo: appoitmentAllHistoryResul, + ))); }, name: appoitmentAllHistoryResul.doctorNameObj, url: appoitmentAllHistoryResul.doctorImageURL, @@ -69,7 +73,8 @@ class TimeLineWidget extends StatelessWidget { height: 15, decoration: BoxDecoration( color: Theme.of(context).primaryColor, - border: Border.all(color: Theme.of(context).primaryColor, width: 2), + border: Border.all( + color: Theme.of(context).primaryColor, width: 2), shape: BoxShape.rectangle, borderRadius: BorderRadius.all( Radius.circular(25.0), @@ -80,7 +85,10 @@ class TimeLineWidget extends StatelessWidget { height: 4, ), Texts( - DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul.appointmentDate)), + DateUtil.getMonthDayYearLangDateFormatted( + DateUtil.convertStringToDate( + appoitmentAllHistoryResul.appointmentDate), + projectViewModel.isArabic ? "ar" : "en"), color: Colors.white, fontSize: 12.5, fontWeight: FontWeight.normal, @@ -97,7 +105,7 @@ class TimeLineWidget extends StatelessWidget { ) else Positioned( - top:projectViewModel.isArabic ? 35 : 50, + top: projectViewModel.isArabic ? 35 : 50, child: Container( margin: EdgeInsets.only(left: 2, right: 2), child: Column( @@ -109,9 +117,10 @@ class TimeLineWidget extends StatelessWidget { fontWeight: FontWeight.normal, ), Texts( - DateUtil.getMonthDayYearDateFormatted( + DateUtil.getMonthDayYearLangDateFormatted( DateUtil.convertStringToDate( - appoitmentAllHistoryResul.appointmentDate)), + appoitmentAllHistoryResul.appointmentDate), + projectViewModel.isArabic ? "ar" : "en"), color: Colors.white, fontSize: 12.5, fontWeight: FontWeight.normal, @@ -124,7 +133,8 @@ class TimeLineWidget extends StatelessWidget { height: 15, decoration: BoxDecoration( color: Theme.of(context).primaryColor, - border: Border.all(color: Theme.of(context).primaryColor, width: 2), + border: Border.all( + color: Theme.of(context).primaryColor, width: 2), shape: BoxShape.rectangle, borderRadius: BorderRadius.all( Radius.circular(25.0), @@ -137,9 +147,13 @@ class TimeLineWidget extends StatelessWidget { color: Colors.white, ), LargeAvatar( - onTap: (){ - Navigator.push(context, - FadePage(page: AppointmentDetails(appo: appoitmentAllHistoryResul,))); + onTap: () { + Navigator.push( + context, + FadePage( + page: AppointmentDetails( + appo: appoitmentAllHistoryResul, + ))); }, name: appoitmentAllHistoryResul.doctorNameObj, url: appoitmentAllHistoryResul.doctorImageURL, From a2e385f28236544c747ffbe6b342da0ee145c440 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 15 Dec 2020 11:37:51 +0300 Subject: [PATCH 035/103] family file drawer --- lib/widgets/drawer/app_drawer_widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index b30a3922..9ac2f8f9 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -257,7 +257,7 @@ class _AppDrawerState extends State { padding: EdgeInsets.only(left: 5, right: 5), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), - AppText(TranslationBase.of(context).fileno + ": " + result.iD.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), + AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), ]))), ], ))) From bf999e611b092a05c1662e25b3aa65917f34ccd7 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 15 Dec 2020 14:19:28 +0300 Subject: [PATCH 036/103] my appointment fix --- lib/pages/MyAppointments/MyAppointments.dart | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 80f2c9b7..f36a2828 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -117,19 +117,22 @@ class _MyAppointmentsState extends State service.getPatientAppointmentHistory(false, context).then((res) { print(res['AppoimentAllHistoryResultList'].length); GifLoaderDialogUtils.hideDialog(context); - if (res['MessageStatus'] == 1) { - // setState(() { - if (res['AppoimentAllHistoryResultList'].length != 0) { - // isDataLoaded = true; - res['AppoimentAllHistoryResultList'].forEach((v) { - widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); - }); - sortAppointmentList(); - } else {} - // }); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } + setState(() { + if (res['MessageStatus'] == 1) { + // setState(() { + if (res['AppoimentAllHistoryResultList'].length != 0) { + // isDataLoaded = true; + res['AppoimentAllHistoryResultList'].forEach((v) { + widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + }); + sortAppointmentList(); + } else {} + // }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + isDataLoaded = true; + }); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); @@ -256,9 +259,6 @@ class _MyAppointmentsState extends State return; } } - setState(() { - isDataLoaded = true; - }); } Widget getBookedAppointments() { From de1e352e98f54846c445ad4a3f1431fcbce2c75c Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 15 Dec 2020 15:45:30 +0200 Subject: [PATCH 037/103] fix charts and vital sign --- lib/config/localized_values.dart | 6 +- lib/core/service/client/base_app_client.dart | 4 +- lib/core/service/medical/labs_service.dart | 3 +- .../service/medical/vital_sign_service.dart | 4 +- .../viewModels/medical/labs_view_model.dart | 10 +- lib/pages/DrawerPages/family/my-family.dart | 15 +- lib/pages/landing/home_page.dart | 1 + .../medical/labs/laboratory_result_page.dart | 33 ++- .../prescription_items_page.dart | 2 +- .../medical/vital_sign/LineChartCurved.dart | 194 ++++++++++++++++++ .../vital_sign/vital_sign_details_screen.dart | 10 +- .../vital_sing_chart_and_detials.dart | 40 +--- lib/uitl/translations_delegate_base.dart | 1 + .../medical/LabResult/LineChartCurved.dart | 74 ++++--- .../lab_result_chart_and_detials.dart | 1 + .../LabResult/laboratory_result_widget.dart | 190 +++++++++-------- .../dialogs}/confirm_send_email_dialog.dart | 2 +- lib/widgets/drawer/app_drawer_widget.dart | 5 +- .../others/app_expandable_notifier.dart | 18 +- 19 files changed, 429 insertions(+), 184 deletions(-) create mode 100644 lib/pages/medical/vital_sign/LineChartCurved.dart rename lib/{pages/medical/prescriptions => widgets/dialogs}/confirm_send_email_dialog.dart (99%) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e034b05e..530bb2c6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1161,5 +1161,9 @@ const Map localizedValues = { "update-email": { "en": "Update Email", "ar": "تحديث البريد الالكتروني" - } + }, + "noDataAvailable": { + "en": "No data available", + "ar": " لا يوجد بيانات متاحة " + }, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index d58054c4..457d8aa7 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -90,7 +90,7 @@ class BaseAppClient { body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID']; body['PatientOutSA'] = user['OutSA']; - body['SessionID'] = SESSION_ID; //getSessionId(token); + body['SessionID'] = getSessionId(token); } } @@ -172,6 +172,6 @@ class BaseAppClient { String getSessionId(String id) { ///return id.replaceAll(RegExp('/[^\w\s]/'), ''); - // return id.replaceAll(RegExp('/[^a-zA-Z ]'), ''); + return id.replaceAll(RegExp('/[^a-zA-Z ]'), ''); } } diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 8318025e..92914964 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -70,6 +70,7 @@ class LabsService extends BaseService { await baseAppClient.post(GET_Patient_LAB_RESULT, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); + labResultList.clear(); response['ListPLR'].forEach((lab) { labResultList.add(LabResult.fromJson(lab)); }); @@ -121,7 +122,7 @@ class LabsService extends BaseService { await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT, onSuccess: (dynamic response, int statusCode) { - AppToast.showSuccessToast(message: 'A copy has been sent to the email'); + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/medical/vital_sign_service.dart b/lib/core/service/medical/vital_sign_service.dart index 16909fd9..f8a6b356 100644 --- a/lib/core/service/medical/vital_sign_service.dart +++ b/lib/core/service/medical/vital_sign_service.dart @@ -5,14 +5,14 @@ import '../base_service.dart'; class VitalSignService extends BaseService { List vitalSignResModelList = List(); - Map body = Map(); + String weightKg = ""; String heightCm = ""; String bloadType = ""; Future getPatientRadOrders({int appointmentNo, int projectID}) async { hasError = false; - + Map body = Map(); if (appointmentNo != null && projectID != null) { body['TransNo'] = appointmentNo; body['ProjectID'] = projectID; diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 1f938fb0..06b7bd20 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; @@ -143,14 +144,11 @@ class LabsViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders patientLabOrder}) async { - setState(ViewState.Busy); + sendLabReportEmail({PatientLabOrders patientLabOrder,String mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { error = _labsService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } + }else + AppToast.showSuccessToast(message: mes); } } diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 301ca97f..a86503a7 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -3,6 +3,7 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -33,7 +34,9 @@ import 'package:provider/provider.dart'; class MyFamily extends StatefulWidget { final bool isAppbarVisible; + MyFamily({this.isAppbarVisible = true}); + @override _MyFamily createState() => _MyFamily(); } @@ -51,6 +54,8 @@ class _MyFamily extends State with TickerProviderStateMixin { locator(); ProjectViewModel projectViewModel; AuthenticatedUser user; + VitalSignService _vitalSignService = locator(); + @override void initState() { _tabController = new TabController(length: 2, vsync: this, initialIndex: 0); @@ -106,7 +111,8 @@ class _MyFamily extends State with TickerProviderStateMixin { child: Container( height: 60.0, margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.92, // 0.9, + width: MediaQuery.of(context).size.width * 0.92, + // 0.9, decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -660,8 +666,11 @@ class _MyFamily extends State with TickerProviderStateMixin { .familyFileProvider .silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser) - .then((value) => loginAfter(value, context)) - .catchError((err) { + .then((value) { + _vitalSignService.heightCm = ""; + _vitalSignService.weightKg = ""; + loginAfter(value, context); + }).catchError((err) { print(err); AppToast.showErrorToast(message: err); Navigator.of(context).pop(); diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 13d11a71..1b33225c 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -54,6 +54,7 @@ class _HomePageState extends State { return BaseView( onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, wi) => AppScaffold( + isShowDecPage: false, body: Container( width: double.infinity, diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index dc3d10cc..a251a1ce 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -1,37 +1,50 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/laboratory_result_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class LaboratoryResultPage extends StatelessWidget { +class LaboratoryResultPage extends StatefulWidget { final PatientLabOrders patientLabOrders; LaboratoryResultPage({Key key, this.patientLabOrders}); + @override + _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); +} + +class _LaboratoryResultPageState extends State { + + @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getLaboratoryResult( - invoiceNo: patientLabOrders.invoiceNo, - clinicID: patientLabOrders.clinicID, - projectID: patientLabOrders.projectID, - orderNo: patientLabOrders.orderNo), - builder: (_, model, widget) => AppScaffold( + invoiceNo: widget.patientLabOrders.invoiceNo, + clinicID: widget.patientLabOrders.clinicID, + projectID: widget.patientLabOrders.projectID, + orderNo: widget.patientLabOrders.orderNo), + builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).labResults, baseViewModel: model, body: Scaffold( body: ListView.builder( itemBuilder: (context, index) => LaboratoryResultWidget( - onTap: () => model.sendLabReportEmail(patientLabOrder: patientLabOrders), - billNo: patientLabOrders.invoiceNo, + onTap: ()async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders,mes: TranslationBase.of(context).sendSuc); + GifLoaderDialogUtils.hideDialog(context); + }, + billNo: widget.patientLabOrders.invoiceNo, details: model.patientLabSpecialResult[index].resultDataHTML, - orderNo: patientLabOrders.orderNo, - patientLabOrder: patientLabOrders, + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, ), itemCount: model.patientLabSpecialResult.length, ), diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index ce2738dd..c0ee178d 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -12,7 +12,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'confirm_send_email_dialog.dart'; +import '../../../widgets/dialogs/confirm_send_email_dialog.dart'; class PrescriptionItemsPage extends StatelessWidget { final Prescriptions prescriptions; diff --git a/lib/pages/medical/vital_sign/LineChartCurved.dart b/lib/pages/medical/vital_sign/LineChartCurved.dart new file mode 100644 index 00000000..f4c25a08 --- /dev/null +++ b/lib/pages/medical/vital_sign/LineChartCurved.dart @@ -0,0 +1,194 @@ +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartCurved extends StatelessWidget { + final String title; + final List timeSeries; + final int indexes; + + LineChartCurved({this.title, this.timeSeries, this.indexes}); + + List xAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + Text( + title, + style: TextStyle( + color: Colors.black, + fontSize: 32, + fontWeight: FontWeight.bold, + letterSpacing: 2), + textAlign: TextAlign.center, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 18.0, left: 16.0), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + const SizedBox( + height: 10, + ), + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries.length) { + xAxixs.add(mIndex); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + //rotateAngle:-65, + //rotateAngle:-65, + margin: 14, + getTitles: (value) { + if (timeSeries.length < 8) { + if (timeSeries.length > value.toInt()) { + return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.year}'; + if (value.toInt() == timeSeries.length - 1) + return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 11, + ), + getTitles: (value) { + return '${value.toInt()}'; + }, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries.length - 1).toDouble(), + maxY: getMaxY(), + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble() + 10; + } + + double getMinY() { + double min = timeSeries[0].sales; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [ + lineChartBarData1, + ]; + } +} diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart index c4273a09..908fab8c 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -108,7 +108,7 @@ class VitalSignDetailsScreen extends StatelessWidget { des: TranslationBase.of(context).body, icon: DQIcons.bmi, lastVal: mode - .vitalSignResModelList[0].pulseBeatPerMinute + .vitalSignResModelList[ mode.vitalSignResModelList.length - 1].pulseBeatPerMinute .toString(), unit: TranslationBase.of(context).mass, ), @@ -130,7 +130,7 @@ class VitalSignDetailsScreen extends StatelessWidget { des: TranslationBase.of(context).temperature, icon: DQIcons.thermometer, lastVal: mode - .vitalSignResModelList[0].temperatureCelcius + .vitalSignResModelList[ mode.vitalSignResModelList.length - 1].temperatureCelcius .toString(), unit: TranslationBase.of(context).tempC, ), @@ -156,7 +156,7 @@ class VitalSignDetailsScreen extends StatelessWidget { icon: DQIcons.heart, lastVal: mode .vitalSignResModelList[ - mode.vitalSignResModelList.length - 1] + mode.vitalSignResModelList.length - 1] .pulseBeatPerMinute .toString(), unit: TranslationBase.of(context).bpm, @@ -179,7 +179,7 @@ class VitalSignDetailsScreen extends StatelessWidget { icon: DQIcons.outline, lastVal: mode .vitalSignResModelList[ - mode.vitalSignResModelList.length - 1] + mode.vitalSignResModelList.length - 1] .respirationBeatPerMinute .toString(), unit: TranslationBase.of(context).respirationSigns, @@ -206,7 +206,7 @@ class VitalSignDetailsScreen extends StatelessWidget { icon: DQIcons.blood_pressure, lastVal: mode .vitalSignResModelList[ - mode.vitalSignResModelList.length - 1] + mode.vitalSignResModelList.length - 1] .bloodPressure .toString(), unit: TranslationBase.of(context).sysDias, diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart index a56ee0ba..a48970eb 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart @@ -6,6 +6,8 @@ import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; +import 'LineChartCurved.dart'; + class VitalSingChartAndDetials extends StatelessWidget { VitalSingChartAndDetials({ Key key, @@ -21,29 +23,16 @@ class VitalSingChartAndDetials extends StatelessWidget { final String viewKey; final String title1; final String title2; - List timeSeriesData = []; + List timeSeriesData = []; @override Widget build(BuildContext context) { + generateData(); return Column( children: [ AppExpandableNotifier( - headerWidget: AppTimeSeriesChart( - seriesList: generateData(), - chartName: name, - startDate: DateTime( - vitalList[vitalList.length - 1] - .vitalSignDate - .year, - vitalList[vitalList.length - 1] - .vitalSignDate - .month + - 3, - vitalList[vitalList.length - 1] - .vitalSignDate - .day), - endDate: vitalList[0].vitalSignDate, - ), + isExpand: true, + headerWidget: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/3.5,), bodyWidget: VitalSignDetailsWidget( vitalList: vitalList, title1: title1, @@ -61,23 +50,14 @@ class VitalSingChartAndDetials extends StatelessWidget { (element) { if( element.toJson()[viewKey]?.toInt()!=0) timeSeriesData.add( - TimeSeriesSales( - new DateTime(element.vitalSignDate.year, - element.vitalSignDate.month, element.vitalSignDate.day), - element.toJson()[viewKey]?.toInt(), + TimeSeriesSales2( + new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey].toDouble(), ), ); }, ); } - return [ - new charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, - domainFn: (TimeSeriesSales sales, _) => sales.time, - measureFn: (TimeSeriesSales sales, _) => sales.sales, - data: timeSeriesData, - ) - ]; + return timeSeriesData.reversed.toList(); } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index bc28227d..7b60d97e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1017,6 +1017,7 @@ class TranslationBase { String get later => localizedValues['later'][locale.languageCode]; String get sendConfEmail => localizedValues['send-email'][locale.languageCode]; String get updateEmail => localizedValues['update-email'][locale.languageCode]; + String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart index 0056e23e..ce811406 100644 --- a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart +++ b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart @@ -16,13 +16,26 @@ class LineChartCurved extends StatefulWidget { class LineChartCurvedState extends State { bool isShowingMainData; + List xAxixs = List(); + int indexes = 0; @override void initState() { super.initState(); + getXaxix(); isShowingMainData = true; } + getXaxix() { + indexes = widget.labResult.length ~/ 3.5; + for (int index = 0; index < widget.labResult.length; index++) { + int mIndex = indexes * index; + if (mIndex < widget.labResult.length) { + xAxixs.add(mIndex); + } + } + } + @override Widget build(BuildContext context) { return AspectRatio( @@ -40,7 +53,7 @@ class LineChartCurvedState extends State { const SizedBox( height: 4, ), - Text( + Text( widget.title, style: TextStyle( color: Colors.black, @@ -49,7 +62,6 @@ class LineChartCurvedState extends State { letterSpacing: 2), textAlign: TextAlign.center, ), - Expanded( child: Padding( padding: const EdgeInsets.only(right: 16.0, left: 6.0), @@ -79,7 +91,8 @@ class LineChartCurvedState extends State { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData(show: true, drawVerticalLine: true,drawHorizontalLine: true), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -90,20 +103,33 @@ class LineChartCurvedState extends State { margin: 10, getTitles: (value) { print(value); - if(widget.labResult.length>value.toInt()) - { DateTime date = DateUtil.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); - return '${date.day}/ ${date.year}';} - return ''; - } + DateTime date = DateUtil.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); + if (widget.labResult.length < 8) { + if (widget.labResult.length > value.toInt()) { + return '${date.day}/ ${date.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${date.day}/ ${date.year}'; + if (value.toInt() == widget.labResult.length - 1) + return '${date.day}/ ${date.year}'; + if (xAxixs.contains(value.toInt())) { + return '${date.day}/ ${date.year}'; + } + } + + - , + return ''; + }, ), leftTitles: SideTitles( showTitles: true, getTextStyles: (value) => const TextStyle( color: Colors.black, fontWeight: FontWeight.bold, - fontSize: 14, + fontSize: 10, ), getTitles: (value) { return '${value.toInt()}'; @@ -131,41 +157,38 @@ class LineChartCurvedState extends State { ), ), minX: 0, - maxX: (widget.labResult.length-1).toDouble(), + maxX: (widget.labResult.length - 1).toDouble(), maxY: getMaxY(), minY: getMinY(), lineBarsData: getData(), ); } - double getMaxY(){ - double max =0; + double getMaxY() { + double max = 0; widget.labResult.forEach((element) { - double resultValueDouble =double.parse(element.resultValue); - if(resultValueDouble>max) - max = resultValueDouble; + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble > max) max = resultValueDouble; }); return max.roundToDouble(); } - double getMinY(){ - double min =double.parse(widget.labResult[0].resultValue); - + double getMinY() { + double min = double.parse(widget.labResult[0].resultValue); widget.labResult.forEach((element) { - double resultValueDouble =double.parse(element.resultValue); - if(resultValueDouble getData() { List spots = List(); - for (int index = 0; index < widget.labResult.length ; index++) { + for (int index = 0; index < widget.labResult.length; index++) { var resultValueDouble = double.parse(widget.labResult[index].resultValue); spots.add(FlSpot(index.toDouble(), resultValueDouble)); } @@ -181,7 +204,6 @@ class LineChartCurvedState extends State { ), belowBarData: BarAreaData( show: false, - ), ); @@ -190,5 +212,3 @@ class LineChartCurvedState extends State { ]; } } - - diff --git a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart index bec6d63a..755e6a3a 100644 --- a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart +++ b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart @@ -34,6 +34,7 @@ class LabResultChartAndDetails extends StatelessWidget { bodyWidget: LabResultDetailsWidget( labResult: labResult, ), + isExpand: true, ), ], ); diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index 79cf632b..aa6ae3d9 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dar import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:flutter/cupertino.dart'; @@ -36,8 +37,8 @@ class LaboratoryResultWidget extends StatefulWidget { } class _LaboratoryResultWidgetState extends State { - bool _isShowMore = false; - bool _isShowMoreGeneral = false; + bool _isShowMore = true; + bool _isShowMoreGeneral = true; ProjectViewModel projectViewModel; @override @@ -55,8 +56,10 @@ class _LaboratoryResultWidgetState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + + Container( - margin: EdgeInsets.all(15), + margin: EdgeInsets.all(8), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -80,7 +83,9 @@ class _LaboratoryResultWidgetState extends State { ), ), InkWell( - onTap: widget.onTap, + onTap: (){ + showConfirmMessage(context,widget.onTap,projectViewModel.user.emailAddress); + }, child: Container( margin: EdgeInsets.only(left: 5, right: 5), decoration: BoxDecoration( @@ -110,6 +115,88 @@ class _LaboratoryResultWidgetState extends State { ], ), ), + SizedBox( + height: 12, + ), + if( model.labResultLists.isNotEmpty) + Container( + child: Column( + children: [ + InkWell( + onTap: () { + setState( + () { + _isShowMoreGeneral = !_isShowMoreGeneral; + }, + ); + }, + child: Container( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(5.0), + )), + child: Row( + children: [ + Expanded(child: Texts(TranslationBase.of(context).generalResult)), + Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context).primaryColor), + child: Icon( + _isShowMoreGeneral + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 22, + ), + ) + ], + ), + ), + ), + if (_isShowMoreGeneral) + AnimatedContainer( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + ), + ), + duration: Duration(milliseconds: 7000), + child: Container( + width: double.infinity, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + ...List.generate( + model.labResultLists.length, + (index) => LabResultWidget( + patientLabOrder: widget.patientLabOrder, + filterName: model + .labResultLists[index].filterName, + patientLabResultList: model + .labResultLists[index] + .patientLabResultList, + ), + ) + ], + ), + ), + ), + ], + ), + ), SizedBox( height: 10, ), @@ -163,90 +250,10 @@ class _LaboratoryResultWidgetState extends State { child: Container( width: double.infinity, child: Html( - data: widget.details ?? 'No Data', + data: widget.details ?? TranslationBase.of(context).noDataAvailable, )), ), - SizedBox( - height: 12, - ), - Container( - child: Column( - children: [ - InkWell( - onTap: () { - setState( - () { - _isShowMoreGeneral = !_isShowMoreGeneral; - }, - ); - }, - child: Container( - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(5.0), - )), - child: Row( - children: [ - Expanded(child: Texts(TranslationBase.of(context).generalResult)), - Container( - width: 25, - height: 25, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor), - child: Icon( - _isShowMoreGeneral - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.white, - size: 22, - ), - ) - ], - ), - ), - ), - if (_isShowMoreGeneral) - AnimatedContainer( - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(5.0), - bottomRight: Radius.circular(5.0), - ), - ), - duration: Duration(milliseconds: 7000), - child: Container( - width: double.infinity, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - ...List.generate( - model.labResultLists.length, - (index) => LabResultWidget( - patientLabOrder: widget.patientLabOrder, - filterName: model - .labResultLists[index].filterName, - patientLabResultList: model - .labResultLists[index] - .patientLabResultList, - ), - ) - ], - ), - ), - ), - ], - ), - ) + ], ), ], @@ -255,4 +262,15 @@ class _LaboratoryResultWidgetState extends State { ), ); } + void showConfirmMessage(BuildContext context, GestureTapCallback onTap,String email) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: email, + onTapSendEmail: () { + onTap(); + }, + ), + ); + } } diff --git a/lib/pages/medical/prescriptions/confirm_send_email_dialog.dart b/lib/widgets/dialogs/confirm_send_email_dialog.dart similarity index 99% rename from lib/pages/medical/prescriptions/confirm_send_email_dialog.dart rename to lib/widgets/dialogs/confirm_send_email_dialog.dart index 047b663d..694a1268 100644 --- a/lib/pages/medical/prescriptions/confirm_send_email_dialog.dart +++ b/lib/widgets/dialogs/confirm_send_email_dialog.dart @@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import '../../../routes.dart'; +import '../../routes.dart'; class ConfirmSendEmailDialog extends StatefulWidget { final String email; diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index b30a3922..82de66ad 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -491,7 +491,10 @@ class _AppDrawerState extends State { .familyFileProvider .silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser) - .then((value) { + .then((value) async{ + await authenticatedUserObject.getUser(); + _vitalSignService.heightCm = ""; + _vitalSignService.weightKg = ""; GifLoaderDialogUtils.hideDialog(context); loginAfter(value, context); }).catchError((err) { diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index 23a3a59f..eb422a63 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -57,17 +57,19 @@ class _AppExpandableNotifier extends State { header: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: EdgeInsets.all(10), - child: Text( - widget.title ?? TranslationBase.of(context).details, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2, + Expanded( + child: Padding( + padding: EdgeInsets.all(10), + child: Text( + widget.title ?? TranslationBase.of(context).details, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2, + ), ), ), ), - new IconButton( + IconButton( icon: new Container( height: 28.0, width: 30.0, From 3122f2438bb3c46ae52e45a3b99acfe3e7a52d15 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 15 Dec 2020 15:47:59 +0200 Subject: [PATCH 038/103] fix import dialog --- lib/pages/medical/patient_sick_leave_page.dart | 2 +- lib/pages/medical/radiology/radiology_details_page.dart | 2 +- lib/pages/medical/reports/report_list_widget.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index fd8ecf0f..d95e03af 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -2,10 +2,10 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/sick_leave/sick_leave.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/medical/prescriptions/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index fb4ddddb..a7566c43 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -3,10 +3,10 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/medical/prescriptions/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 39946cae..72d0422b 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -2,13 +2,13 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart'; import 'package:diplomaticquarterapp/locator.dart'; -import 'package:diplomaticquarterapp/pages/medical/prescriptions/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; From 9e3db622fa1da7b5ebabaaf4ac0ff1ec92cae3b7 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 15 Dec 2020 20:17:44 +0300 Subject: [PATCH 039/103] login loader issue fixed --- lib/pages/login/confirm-login.dart | 67 ++++++++--------------- lib/widgets/drawer/app_drawer_widget.dart | 6 +- 2 files changed, 25 insertions(+), 48 deletions(-) diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index cdd9c09b..1c6bde43 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -384,55 +384,34 @@ class _ConfirmLogin extends State { } getMobileInfo(request) { - GifLoaderDialogUtils.showMyDialog(context); - this - .authService - .getLoginInfo(request) - .then((result) => { - GifLoaderDialogUtils.hideDialog(context), - if (result['SMSLoginRequired'] == false) - { - this.loginTokenID = result.logInTokenID, - this.patientOutSA = result.patientOutSA, - // sms for register the biometric - if (result.isSMSSent) - { - this.onlySMSBox = false, - //this.button(); - } - else - {checkActivationCode()} - } - else - { - if (result['IsAuthenticated'] == true) - { - setState(() { - isMoreOption = true; - this.onlySMSBox = true; - // this.fingrePrintBefore = true; - }), - - //sharedPref.setBool(ONLY_SMS, true), - // this.cs.sharedService.setSharedData(true, AuthenticationService.ONLY_SMS); - //this.cs.sharedService.setSharedData(this.selectedOption, AuthenticationService.FINGUREPRINT_BEFORE); - // this.cs.confirmLogin(); - //this.button(); - } - // else - // { - // // this.cs.presentAlert(result.ErrorEndUserMessage); - // } - } - }) - .catchError((err) { + // GifLoaderDialogUtils.showMyDialog(context); + this.authService.getLoginInfo(request).then((result) { + GifLoaderDialogUtils.hideDialog(context); + if (result['SMSLoginRequired'] == false) { + this.loginTokenID = result.logInTokenID; + this.patientOutSA = result.patientOutSA; + // sms for register the biometric + if (result.isSMSSent) { + this.onlySMSBox = false; + //this.button(); + } else { + checkActivationCode(); + } + } else { + if (result['IsAuthenticated'] == true) { + setState(() { + isMoreOption = true; + this.onlySMSBox = true; + // this.fingrePrintBefore = true; + }); + } + } + }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); }); } - setUser() async {} - setDefault() async { if (await sharedPref.getObject(IMEI_USER_DATA) != null) user = SelectDeviceIMEIRES.fromJson( diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 6686cd54..ecb39330 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -64,7 +64,7 @@ class _AppDrawerState extends State { padding: EdgeInsets.zero, children: [ Container( - height: SizeConfig.screenHeight * .27, + height: SizeConfig.screenHeight * .28, padding: EdgeInsets.all(15), child: InkWell( child: Column( @@ -466,8 +466,6 @@ class _AppDrawerState extends State { Navigator.of(context).pushNamed(HOME); } - - login() async { var data = await sharedPref.getObject(IMEI_USER_DATA); sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); @@ -498,7 +496,7 @@ class _AppDrawerState extends State { .familyFileProvider .silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser) - .then((value) async{ + .then((value) async { await authenticatedUserObject.getUser(); _vitalSignService.heightCm = ""; _vitalSignService.weightKg = ""; From 3308aa47e1dcac07ec569b051c7d236b3ab8a179 Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Wed, 16 Dec 2020 02:07:52 +0300 Subject: [PATCH 040/103] fixes --- lib/config/localized_values.dart | 26 +++++++++++++++- lib/pages/BookAppointment/BookConfirm.dart | 2 +- .../components/DocAvailableAppointments.dart | 2 +- .../MyAppointments/AppointmentDetails.dart | 5 ++- .../MyAppointments/widgets/custom_radio.dart | 31 ++++++++++++------- .../widgets/reminder_dialog.dart | 15 ++++----- lib/pages/ToDoList/ToDo.dart | 16 +++++++--- .../rate_appointment_doctor.dart | 4 +-- lib/uitl/translations_delegate_base.dart | 14 ++++++--- 9 files changed, 78 insertions(+), 37 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a3c85b9b..6a0e2e54 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1162,6 +1162,10 @@ const Map localizedValues = { "en": "Please rate the clinic", "ar": "يرجى تقييم العيادة" }, + "rate": { + "en": "Rate", + "ar": "تقييم" + }, "fetch-data": { "en": "Fetch Data", "ar": "تحديث الان" @@ -1173,5 +1177,25 @@ const Map localizedValues = { "update-email": { "en": "Update Email", "ar": "تحديث البريد الالكتروني" - } + }, + "booked-success": { + "en": "The appointment has been successfully booked.", + "ar": "لقد تم حجز الموعد بنجاح" + }, + "appo-reminder-select-option-30": { + "en": "Before 30 Mins", + "ar": "قبل 30 دقيقة" + }, + "appo-reminder-select-option-60": { + "en": "Before 1 Hour", + "ar": "قبل ساعة واحدة" + }, + "appo-reminder-select-option-90": { + "en": "Before 1 Hour and 30 mins", + "ar": "قبل ساعة و 30 دقيقة" + }, + "appo-reminder-select-option-120": { + "en": "Before 2 Hours", + "ar": "قبل ساعتين" + }, }; diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 1d8a9d2f..d7e08a66 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -423,7 +423,7 @@ class _BookConfirmState extends State { context) .then((res) { if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: "Appointment Booked Successfully"); + AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); print(res['AppointmentNo']); Future.delayed(new Duration(milliseconds: 500), () { diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 8ac1d197..83bd360d 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -178,7 +178,7 @@ class _DocAvailableAppointmentsState extends State holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), ), daysOfWeekStyle: DaysOfWeekStyle( - weekendStyle: TextStyle().copyWith(color: Colors.blue[600]), + weekendStyle: TextStyle().copyWith(color: Colors.black), ), headerStyle: HeaderStyle( centerHeaderTitle: true, diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 4fc038a6..b638b2ff 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -37,13 +37,16 @@ class _AppointmentDetailsState extends State @override void initState() { _tabController = new TabController(length: 2, vsync: this); + AppointmentDetails.showFooterButton = false; super.initState(); } + @override void dispose() { super.dispose(); _tabController.dispose(); + AppointmentDetails.showFooterButton = false; } @override @@ -162,7 +165,7 @@ class _AppointmentDetailsState extends State ), Container( alignment: Alignment.center, - child: Text(widget.appo.startTime), + child: Text(widget.appo.startTime.substring(0, 5)), ), Container( margin: EdgeInsets.only(top: 10.0), diff --git a/lib/pages/MyAppointments/widgets/custom_radio.dart b/lib/pages/MyAppointments/widgets/custom_radio.dart index 2ea9a39c..b21e34ec 100644 --- a/lib/pages/MyAppointments/widgets/custom_radio.dart +++ b/lib/pages/MyAppointments/widgets/custom_radio.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; class CustomRadio extends StatefulWidget { @@ -21,17 +22,23 @@ class CustomRadioState extends State { void initState() { super.initState(); - if (widget.requestData != null) { - widget.requestData.forEach((element) { - sampleData.add( - new RadioModel(false, element.description, element.parameterCode)); - }); - } else { - sampleData.add(new RadioModel(false, "Before 30 Mins", 30)); - sampleData.add(new RadioModel(false, 'Before 1 Hour', 60)); - sampleData.add(new RadioModel(false, 'Before 2 Hours', 120)); - sampleData.add(new RadioModel(false, 'Before 4 Hours', 240)); - } + WidgetsBinding.instance.addPostFrameCallback((_) { + if (widget.requestData != null) { + widget.requestData.forEach((element) { + sampleData.add(new RadioModel( + false, element.description, element.parameterCode)); + }); + } else { + sampleData.add(new RadioModel( + false, TranslationBase.of(context).appoReminder30, 30)); + sampleData.add(new RadioModel( + false, TranslationBase.of(context).appoReminder60, 60)); + sampleData.add(new RadioModel( + false, TranslationBase.of(context).appoReminder90, 90)); + sampleData.add(new RadioModel( + false, TranslationBase.of(context).appoReminder120, 120)); + } + }); } @override @@ -96,7 +103,7 @@ class RadioItem extends StatelessWidget { ), ), new Container( - margin: new EdgeInsets.only(left: 15.0), + margin: new EdgeInsets.only(left: 15.0, right: 15.0), child: new Text(_item.text, style: TextStyle(fontSize: 16.0)), ), ], diff --git a/lib/pages/MyAppointments/widgets/reminder_dialog.dart b/lib/pages/MyAppointments/widgets/reminder_dialog.dart index 13955e5b..b8803469 100644 --- a/lib/pages/MyAppointments/widgets/reminder_dialog.dart +++ b/lib/pages/MyAppointments/widgets/reminder_dialog.dart @@ -27,19 +27,18 @@ class _ReminderDialogState extends State { shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), child: Container( - height: MediaQuery.of(context).size.height * 0.57, + // height: MediaQuery.of(context).size.height * 0.57, width: 450.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, + mainAxisSize: MainAxisSize.min, children: [ Container( margin: EdgeInsets.all(20.0), child: Text(TranslationBase.of(context).setReminder, style: TextStyle( fontSize: 20.0, - fontWeight: FontWeight.bold, - fontFamily: "Open-Sans-Bold")), + fontWeight: FontWeight.bold)), ), Container( transform: Matrix4.translationValues(0.0, -30.0, 0.0), @@ -61,13 +60,12 @@ class _ReminderDialogState extends State { child: Text(TranslationBase.of(context).confirm, style: TextStyle( color: Colors.white, - fontWeight: FontWeight.bold, - fontFamily: 'Open-Sans-Bold')), + fontWeight: FontWeight.bold)), ), ), Container( width: MediaQuery.of(context).size.width, - margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0), + margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0, bottom: 20.0), child: OutlineButton( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0)), @@ -81,8 +79,7 @@ class _ReminderDialogState extends State { child: Text(TranslationBase.of(context).cancel_nocaps, style: TextStyle( color: Colors.red, - fontWeight: FontWeight.bold, - fontFamily: 'Open-Sans-Bold')), + fontWeight: FontWeight.bold)), ), ), ]), diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 98d9cc10..9f93f45c 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; @@ -69,6 +70,7 @@ class _ToDoState extends State { @override Widget build(BuildContext context) { toDoProvider = Provider.of(context); + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, imagesInfo: imagesInfo, @@ -109,11 +111,15 @@ class _ToDoState extends State { height: 20.0), Container( margin: - EdgeInsets.only(left: 5.0, right: 20.0), + EdgeInsets.only(left: 10.0, right: 10.0), child: Text( - getDate(widget - .appoList[index].appointmentDate), - style: TextStyle(fontSize: 11.0)), + DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate(widget + .appoList[index].appointmentDate), + projectViewModel.isArabic + ? "ar" + : "en") + " " + widget.appoList[index].startTime.substring(0, 5), + style: TextStyle(fontSize: 10.0)), ), widget.appoList[index].isLiveCareAppointment ? SvgPicture.asset( @@ -141,7 +147,7 @@ class _ToDoState extends State { : "-", overflow: TextOverflow.clip, maxLines: 2, - style: TextStyle(fontSize: 11.0)), + style: TextStyle(fontSize: 10.0)), ), ], ), diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 4a1026f6..1c2c592e 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -40,7 +40,7 @@ class _RateAppointmentDoctorState extends State { headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), - title: Text('Rate'), + title: Text(TranslationBase.of(context).rate), leading: Builder( builder: (BuildContext context) { return IconButton( @@ -94,7 +94,7 @@ class _RateAppointmentDoctorState extends State { height: 22, ), Texts( - model.appointmentDetails.doctorName, + TranslationBase.of(context).dr + " " + model.appointmentDetails.doctorName, bold: true, ), SizedBox( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index bf7206e6..0cef21e6 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1009,20 +1009,24 @@ class TranslationBase { String get selectHospitalDec => localizedValues['select-hospital'][locale.languageCode]; String get start => localizedValues['start'][locale.languageCode]; String get infoChat => localizedValues['info-chat'][locale.languageCode]; - - String get noRecords => localizedValues['empty'][locale.languageCode]; String get lastVisit => localizedValues['last-visit'][locale.languageCode]; String get tapTitle => localizedValues['tap-title'][locale.languageCode]; String get later => localizedValues['later'][locale.languageCode]; - String get lastAppointment => localizedValues['last-appointment'][locale.languageCode]; String get rateClinic => localizedValues['rate-clinic'][locale.languageCode]; String get fetchData => localizedValues['fetch-data'][locale.languageCode]; - - String get sendConfEmail => localizedValues['send-email'][locale.languageCode]; String get updateEmail => localizedValues['update-email'][locale.languageCode]; + String get rate => localizedValues['rate'][locale.languageCode]; + String get bookedSuccess => localizedValues['booked-success'][locale.languageCode]; + String get appoReminder30 => localizedValues['appo-reminder-select-option-30'][locale.languageCode]; + String get appoReminder60 => localizedValues['appo-reminder-select-option-60'][locale.languageCode]; + String get appoReminder90 => localizedValues['appo-reminder-select-option-90'][locale.languageCode]; + String get appoReminder120 => localizedValues['appo-reminder-select-option-120'][locale.languageCode]; + + + } class TranslationBaseDelegate extends LocalizationsDelegate { From f38f53587beda52fc899f31997a4935008020efb Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 16 Dec 2020 01:08:24 +0200 Subject: [PATCH 041/103] fix issues --- assets/images/comments.png | Bin 0 -> 11678 bytes lib/config/localized_values.dart | 17 ++- .../feedback/feedback_view_model.dart | 53 -------- lib/pages/feedback/send_feedback_page.dart | 122 ++++++++++++------ lib/pages/feedback/status_feedback_page.dart | 118 ++++++++++------- lib/pages/landing/home_page.dart | 16 +-- lib/pages/medical/labs/labs_home_page.dart | 9 +- .../prescriptions_history_details_page.dart | 18 ++- .../prescriptions_history_page.dart | 8 +- .../radiology/radiology_details_page.dart | 2 +- .../radiology/radiology_home_page.dart | 9 +- .../rate_appointment_clinic.dart | 2 +- .../rate_appointment_doctor.dart | 2 +- lib/uitl/date_uitl.dart | 12 ++ lib/uitl/translations_delegate_base.dart | 4 + lib/widgets/bottom_options/BottomSheet.dart | 13 +- .../data_display/medical/doctor_card.dart | 10 +- lib/widgets/others/not_auh_page.dart | 5 +- 18 files changed, 242 insertions(+), 178 deletions(-) create mode 100644 assets/images/comments.png diff --git a/assets/images/comments.png b/assets/images/comments.png new file mode 100644 index 0000000000000000000000000000000000000000..353edf4ef5274f7a1f8d20b7f31ac1adc8390bc9 GIT binary patch literal 11678 zcmeHtXIE2S@NOC)ARr)JdI0Gt66qaDs1^{AB8rIgt|%=LQBY|?igYz9Nben@QUnAf z(xg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>IU&7@dj<+ zj0N%ce;T2?(lm|hbk05hK|!WqauT#0h+sQ)sChbE;0bhUD`x1K$+p%p%_&$~` z3>?+IC%4D2v(hedDC{?%hwj9_(Ox_GA)8!|N z>@ggauX8%@T(FlzVe6h9L>(S0JE_XIMv*`<`2*3Tnqssvee!8Fx0YC6VkAtJh1aJk z1q)wHIAxmik?Mw@0D2dX`v>e-YC`TaAYDoQb0LV>%hCfr8*T7f#~c z41wJ=sPE^-2w)w%@B?qMBz#Z`+h+560!L-wlJf!hlOa+{Dphn?cmb9Z!*v|7d!6MJ zucJS}Rk|DG{H0Y#st)-3Od(+FQW@CYeQNs5A)cy4=5zRb9eeGg%8>OFQQ`?_g)-qX y`NihLDBOEk8k7h8EYKQQk^b+LB}*<+p&7TZYoF-4<$(fg5X#8HuteYa;r{~jtz8@d literal 0 HcmV?d00001 diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6c94019e..960b97a3 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -912,7 +912,7 @@ const Map localizedValues = { "en": "Please enter the subject", "ar": "يرجى ادخال الموضوع" }, - "empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"}, + "empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الرسالة"}, "select-attachment": {"en": "Select Attachment", "ar": "إختر المرفق"}, "complain-appo": {"en": "Complaint for appointment", "ar": "شكوى على موعد"}, "complain-without-appo": { @@ -1178,4 +1178,19 @@ const Map localizedValues = { "en": "No data available", "ar": " لا يوجد بيانات متاحة " }, + "noSearchResult": { + "en": "No Search Result", + "ar": "لا توجد نتيجة بحث" + }, + "selectFileSouse": { + "en": "Select file souse", + "ar": "حدد الملف" + }, + "gallery": { + "en": "Gallery", + "ar": "معرض الصور" + }, "camera": { + "en": "Camera", + "ar": "كاميرا" + }, }; diff --git a/lib/core/viewModels/feedback/feedback_view_model.dart b/lib/core/viewModels/feedback/feedback_view_model.dart index 4956024d..6793c786 100644 --- a/lib/core/viewModels/feedback/feedback_view_model.dart +++ b/lib/core/viewModels/feedback/feedback_view_model.dart @@ -21,59 +21,8 @@ class FeedbackViewModel extends BaseViewModel { FeedbackService _feedbackService = locator(); List get cOCItemList => _feedbackService.cOCItemList; - MessageType messageType = MessageType.NON; - MessageType messageTypeDialog = MessageType.NON; - - String getSelected(BuildContext context) { - switch (messageType) { - case MessageType.ComplaintOnAnAppointment: - return TranslationBase.of(context).complainAppo; - break; - case MessageType.ComplaintWithoutAppointment: - return TranslationBase.of(context).complainWithoutAppo; - break; - case MessageType.Question: - return TranslationBase.of(context).question; - break; - case MessageType.Compliment: - return TranslationBase.of(context).compliment; - break; - case MessageType.Suggestion: - return TranslationBase.of(context).suggestion; - break; - case MessageType.NON: - return TranslationBase.of(context).notClassified; - break; - } - return TranslationBase.of(context).notClassified; - } - - setMessageDialogType(MessageType messageType) { - messageTypeDialog = messageType; - notifyListeners(); - } - - setMessageType(MessageType messageType) { - this.messageType = messageType; - switch (messageType) { - case MessageType.ComplaintOnAnAppointment: - break; - case MessageType.ComplaintWithoutAppointment: - break; - case MessageType.Question: - break; - case MessageType.Compliment: - break; - case MessageType.Suggestion: - break; - case MessageType.NON: - break; - } - notifyListeners(); - } - List get appointHistoryList => _feedbackService.appointHistoryList; @@ -93,11 +42,9 @@ class FeedbackViewModel extends BaseViewModel { if (_feedbackService.hasError) { error = _feedbackService.error; setState(ViewState.ErrorLocal); - setMessageType(MessageType.NON); return false; } else { setState(ViewState.Idle); - setMessageType(MessageType.NON); return true; } } diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 14463825..6f1d7871 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_mode import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; @@ -31,6 +32,41 @@ class _SendFeedbackPageState extends State { bool isShowListAppointHistory = true; String message; final formKey = GlobalKey(); + MessageType messageType = MessageType.NON; + + + String getSelected(BuildContext context) { + switch (messageType) { + case MessageType.ComplaintOnAnAppointment: + return TranslationBase.of(context).complainAppo; + break; + case MessageType.ComplaintWithoutAppointment: + return TranslationBase.of(context).complainWithoutAppo; + break; + case MessageType.Question: + return TranslationBase.of(context).question; + break; + case MessageType.Compliment: + return TranslationBase.of(context).compliment; + break; + case MessageType.Suggestion: + return TranslationBase.of(context).suggestion; + break; + case MessageType.NON: + return TranslationBase.of(context).notClassified; + break; + } + return TranslationBase.of(context).notClassified; + } + + + + setMessageType(MessageType messageType) { + setState(() { + this.messageType = messageType; + }); + + } @override Widget build(BuildContext context) { @@ -55,7 +91,6 @@ class _SendFeedbackPageState extends State { child: Texts( TranslationBase.of(context).likeToHear, textAlign: TextAlign.center, - variant: 'body2Link', ), ), InkWell( @@ -75,9 +110,8 @@ class _SendFeedbackPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - child: Texts( - model.getSelected(context), + getSelected(context), variant: 'bodyText', ), margin: EdgeInsets.only(left: 10,right: 10), @@ -91,7 +125,7 @@ class _SendFeedbackPageState extends State { ), ), ), - if (appointHistory != null && model.messageType == + if (appointHistory != null && messageType == MessageType.ComplaintOnAnAppointment) InkWell( onTap: () { @@ -167,12 +201,10 @@ class _SendFeedbackPageState extends State { ), ), ), - if (model.messageType == - MessageType.ComplaintOnAnAppointment && - model.appointHistoryList.length != 0 && + if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 && isShowListAppointHistory) Container( - height: MediaQuery.of(context).size.height * 0.4, + height: model.appointHistoryList.length>2?MediaQuery.of(context).size.height * 0.25:MediaQuery.of(context).size.height * 0.15, child: ListView.builder( itemCount: model.appointHistoryList.length, itemBuilder: (context, index) => InkWell( @@ -285,7 +317,7 @@ class _SendFeedbackPageState extends State { hintColor: Colors.black, fontWeight: FontWeight.w600, validator: (value) { - if (value == null) + if (value.isEmpty) return TranslationBase.of(context).emptySubject; else return null; @@ -303,7 +335,7 @@ class _SendFeedbackPageState extends State { minLines: 13, controller: messageController, validator: (value) { - if (value == null) + if (value.isEmpty) return TranslationBase.of(context).emptyMessage; else return null; @@ -376,7 +408,7 @@ class _SendFeedbackPageState extends State { ), )), SizedBox( - height: 30, + height: 45, ), ], ), @@ -396,14 +428,14 @@ class _SendFeedbackPageState extends State { loading: model.state == ViewState.BusyLocal, onTap: () { final form = formKey.currentState; - if (form.validate()) if (model.messageType != MessageType.NON) + if (form.validate()) if (messageType != MessageType.NON) model .sendCOCItem( title: titleController.text, attachment: images.length > 0 ? images[0] : "", details: messageController.text, - cOCTypeName: getCOCName(model), - appointHistory: model.messageType == + cOCTypeName: getCOCName(), + appointHistory:messageType == MessageType.ComplaintOnAnAppointment ? appointHistory : null) @@ -414,7 +446,7 @@ class _SendFeedbackPageState extends State { messageController.text = ""; images = []; }); - model.setMessageType(MessageType.NON); + setMessageType(MessageType.NON); AppToast.showSuccessToast( message: TranslationBase.of(context).yourFeedback); } else { @@ -433,8 +465,8 @@ class _SendFeedbackPageState extends State { ); } - String getCOCName(FeedbackViewModel model) { - switch (model.messageType) { + String getCOCName() { + switch (messageType) { case MessageType.ComplaintOnAnAppointment: return "1"; break; @@ -462,15 +494,18 @@ class _SendFeedbackPageState extends State { showDialog( context: context, child: FeedbackTypeDialog( + messageTypeDialog: messageType, onValueSelected: (MessageType value) { if (value == MessageType.ComplaintOnAnAppointment) { + GifLoaderDialogUtils.showMyDialog(context); model.getPatentAppointmentHistory().then((value) { + GifLoaderDialogUtils.hideDialog(context); setState(() { appointHistory = null; }); }); } - model.setMessageType(value); + setMessageType(value); }, )); } @@ -478,14 +513,30 @@ class _SendFeedbackPageState extends State { class FeedbackTypeDialog extends StatefulWidget { final Function(MessageType) onValueSelected; + final MessageType messageTypeDialog; - const FeedbackTypeDialog({Key key, this.onValueSelected}) : super(key: key); + const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog=MessageType.NON}) : super(key: key); @override State createState() => new FeedbackTypeDialogState(); } class FeedbackTypeDialogState extends State { + + + MessageType messageTypeDialog = MessageType.NON; + + setMessageDialogType(MessageType messageType) { + setState(() { + messageTypeDialog = messageType; + }); + } + @override + void initState() { + messageTypeDialog = widget.messageTypeDialog; + super.initState(); + } + Widget build(BuildContext context) { return BaseView( builder: (_, model, widge) => SimpleDialog( @@ -507,16 +558,16 @@ class FeedbackTypeDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () => model.setMessageDialogType( + onTap: () => setMessageDialogType( MessageType.ComplaintOnAnAppointment), child: ListTile( title: Texts(TranslationBase.of(context).complainAppo), leading: Radio( value: MessageType.ComplaintOnAnAppointment, - groupValue: model.messageTypeDialog, + groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, onChanged: (MessageType value) => - model.setMessageDialogType(value), + setMessageDialogType(value), ), ), ), @@ -531,16 +582,16 @@ class FeedbackTypeDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () => model.setMessageDialogType( + onTap: () => setMessageDialogType( MessageType.ComplaintWithoutAppointment), child: ListTile( title: Texts(TranslationBase.of(context).complainWithoutAppo), leading: Radio( value: MessageType.ComplaintWithoutAppointment, - groupValue: model.messageTypeDialog, + groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, onChanged: (MessageType value) => - model.setMessageDialogType(value), + setMessageDialogType(value), ), ), ), @@ -556,15 +607,15 @@ class FeedbackTypeDialogState extends State { flex: 1, child: InkWell( onTap: () => - model.setMessageDialogType(MessageType.Question), + setMessageDialogType(MessageType.Question), child: ListTile( title: Texts(TranslationBase.of(context).question), leading: Radio( value: MessageType.Question, - groupValue: model.messageTypeDialog, + groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, onChanged: (MessageType value) => - model.setMessageDialogType(value), + setMessageDialogType(value), ), ), ), @@ -580,15 +631,15 @@ class FeedbackTypeDialogState extends State { flex: 1, child: InkWell( onTap: () => - model.setMessageDialogType(MessageType.Compliment), + setMessageDialogType(MessageType.Compliment), child: ListTile( title: Texts(TranslationBase.of(context).compliment), leading: Radio( value: MessageType.Compliment, - groupValue: model.messageTypeDialog, + groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, onChanged: (MessageType value) => - model.setMessageDialogType(value), + setMessageDialogType(value), ), ), ), @@ -604,15 +655,14 @@ class FeedbackTypeDialogState extends State { flex: 1, child: InkWell( onTap: () => - model.setMessageDialogType(MessageType.Suggestion), + setMessageDialogType(MessageType.Suggestion), child: ListTile( title: Texts(TranslationBase.of(context).suggestion), leading: Radio( value: MessageType.Suggestion, - groupValue: model.messageTypeDialog, + groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - model.setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), @@ -660,7 +710,7 @@ class FeedbackTypeDialogState extends State { flex: 1, child: InkWell( onTap: () { - widget.onValueSelected(model.messageTypeDialog); + widget.onValueSelected(messageTypeDialog); Navigator.pop(context); }, child: Padding( diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 457ded60..ada758e9 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -14,7 +14,6 @@ class StatusFeedbackPage extends StatefulWidget { } class _StatusFeedbackPageState extends State { - @override Widget build(BuildContext context) { return BaseView( @@ -23,64 +22,85 @@ class _StatusFeedbackPageState extends State { builder: (_, model, widget) => AppScaffold( baseViewModel: model, isShowDecPage: false, - body: Container( - margin: EdgeInsets.only(top: 8.0,left: 8.0,right: 8.0 ), - padding: EdgeInsets.all(15.0), - child: ListView.builder( - itemCount: model.cOCItemList.length, - itemBuilder: (context, index) => Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - margin: EdgeInsets.all(4), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 8,), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts('${model.cOCItemList[index].cOCTitle}'), - Texts( - TranslationBase.of(context).number + ' : ${model.cOCItemList[index].itemID}', - variant: 'overline', - ), - ], - ), + body: model.cOCItemList.isNotEmpty + ? Container( + margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0), + padding: EdgeInsets.all(15.0), + child: ListView.builder( + itemCount: model.cOCItemList.length, + itemBuilder: (context, index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, ), - Expanded( + margin: EdgeInsets.all(4), + child: Padding( + padding: const EdgeInsets.all(8.0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('${model.cOCItemList[index].status}'), - Texts( - '${model.cOCItemList[index].date}', - variant: 'overline', + SizedBox( + height: 8, ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + '${model.cOCItemList[index].cOCTitle}'), + Texts( + TranslationBase.of(context).number + + ' : ${model.cOCItemList[index].itemID}', + variant: 'overline', + ), + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + '${model.cOCItemList[index].status}'), + Texts( + '${model.cOCItemList[index].date}', + variant: 'overline', + ), + ], + ), + ), + ], + ), + Texts('${model.cOCItemList[index].formType}'), + Divider( + height: 4.5, + color: Colors.grey[500], + ) ], ), ), - ], - ), - Texts('${model.cOCItemList[index].formType}'), - Divider(height: 4.5,color: Colors.grey[500],) + )), + ) + : Container( + child: Center( + child: Column( + children: [ + SizedBox(height: MediaQuery.of(context).size.height*0.4,), + Image.asset('assets/images/comments.png',width: 80,height: 80,), + SizedBox(height: 15,), + Texts(TranslationBase.of(context).noSearchResult), ], ), ), - )), - ), + ), ), ); } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 1e79d07c..4157ee78 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -82,8 +82,7 @@ class _HomePageState extends State { left: 5, right: 5, child: Container( - width: - MediaQuery.of(context).size.width * 0.8, + width: MediaQuery.of(context).size.width * 0.8, child: Container(), ), ) @@ -91,7 +90,7 @@ class _HomePageState extends State { ), ), - Container(width: double.infinity, height:projectViewModel.isArabic ? 120:110), + Container(width: double.infinity, height:projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.3 :110), ], ), Positioned( @@ -187,7 +186,7 @@ class _HomePageState extends State { ) : Container( width: double.infinity, - height: projectViewModel.isArabic ? 180 : 160, + // height: projectViewModel.isArabic ? 180 : 160, decoration: BoxDecoration( color: Theme.of(context).primaryColor, shape: BoxShape.rectangle, @@ -267,8 +266,7 @@ class _HomePageState extends State { ), child: Center( child: Texts( - TranslationBase.of(context) - .viewMore, + TranslationBase.of(context).myMedicalFile, color: Theme.of(context) .primaryColor, fontSize: 12, @@ -694,7 +692,7 @@ class _HomePageState extends State { ], ), ), - height: 106, + height: 112, imageName: 'ask_doctor_bg.png', //color: Colors.grey[700], width: MediaQuery.of(context).size.width * 0.45, @@ -735,7 +733,7 @@ class _HomePageState extends State { ], ), ), - height: 106, + height: 112, imageName: 'rectangle.png', color: Colors.grey[700], width: MediaQuery.of(context).size.width * 0.45, @@ -744,7 +742,7 @@ class _HomePageState extends State { ), ), SizedBox( - height: 120, + height: 130, ) ], ), diff --git a/lib/pages/medical/labs/labs_home_page.dart b/lib/pages/medical/labs/labs_home_page.dart index 4b412f5b..96356a0f 100644 --- a/lib/pages/medical/labs/labs_home_page.dart +++ b/lib/pages/medical/labs/labs_home_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'laboratory_result_page.dart'; @@ -18,6 +20,7 @@ class LabsHomePage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/ar/0.png')); return BaseView( onModelReady: (model) => model.getLabs(), @@ -91,10 +94,10 @@ class LabsHomePage extends StatelessWidget { ), ),isInOutPatient: labOrder.isInOutPatient, name: labOrder.doctorName, + billNo: ' ${labOrder.invoiceNo}', profileUrl: labOrder.doctorImageURL, - subName: TranslationBase.of(context).billNo+' ${labOrder.invoiceNo}', - date: DateUtil.getMonthDayYearDateFormatted( - labOrder.orderDate), + subName: labOrder.projectName, + date: projectViewModel.isArabic?DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate):DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate), ); }).toList(), ), diff --git a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart index 5061a8ba..0eac55df 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart @@ -33,9 +33,17 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget { SizedBox( height: 5, ), - Texts(TranslationBase.of(context).orderStatus +' : ${prescriptionsOrder.descriptionN}'), + Container( + width: double.infinity, + decoration: BoxDecoration( + color: prescriptionsOrder.status==3 ?Colors.red:prescriptionsOrder.status==2? Colors.green: Colors.grey, + borderRadius: BorderRadius.circular(5)), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts(TranslationBase.of(context).orderStatus +' : ${prescriptionsOrder.descriptionN}',color: Colors.white,), + )), SizedBox( - height: 5, + height: 15, ), Table( border: TableBorder.symmetric( @@ -60,17 +68,17 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget { ]), TableRow(children: [ Container( - height: 50, + height: 70, color: Colors.white, child: Center( child: Texts('${prescriptionsOrder.iD}'), ), ), Container( - height: 50, + height: 70, color: Colors.white, child: Center( - child: Texts('${prescriptionsOrder.createdOn}'), + child: Texts('${prescriptionsOrder.createdOn.year}-${prescriptionsOrder.createdOn.day}-${prescriptionsOrder.createdOn.day} ${prescriptionsOrder.createdOn.hour}:${prescriptionsOrder.createdOn.minute}'), ), ), ]) diff --git a/lib/pages/medical/prescriptions/prescriptions_history_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_page.dart index 9d63bf7d..84691773 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_details_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class PrescriptionsHistoryPage extends StatelessWidget { final PrescriptionsViewModel prescriptionsViewModel; @@ -15,6 +17,8 @@ class PrescriptionsHistoryPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( baseViewModel: prescriptionsViewModel, body: ListView.builder( @@ -41,9 +45,7 @@ class PrescriptionsHistoryPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - DateUtil.getDayMonthYearHourMinuteDateFormatted( - prescriptionsViewModel - .prescriptionsHistory[index].createdOn), + DateUtil.getDayMonthYearHourMinuteDateFormatted(prescriptionsViewModel.prescriptionsHistory[index].createdOn), fontWeight: FontWeight.w300, ), SizedBox( diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index a7566c43..75279eee 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -33,7 +33,7 @@ class RadiologyDetailsPage extends StatelessWidget { mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( + Texts( '${finalRadiology.reportData}', textAlign: TextAlign.center, ), diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index ebc3527d..80479a36 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -11,11 +12,13 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class RadiologyHomePage extends StatelessWidget { List imagesInfo = List(); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/0.png')); imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/1.png')); return BaseView( @@ -93,9 +96,9 @@ class RadiologyHomePage extends StatelessWidget { isInOutPatient: radiology.isInOutPatient, name: radiology.doctorName, profileUrl: radiology.doctorImageURL, - subName: '${radiology.projectName} \n${TranslationBase.of(context).billNo} ${radiology.invoiceNo}', - date: DateUtil.getMonthDayYearDateFormatted( - radiology.orderDate), + billNo: '${radiology.invoiceNo}', + subName: '${radiology.projectName}', + date: projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(radiology.orderDate):DateUtil.getMonthDayYearDateFormatted(radiology.orderDate), ), ); }).toList(), diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index 5ce1316f..f5ec34c3 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -146,7 +146,7 @@ class _RateAppointmentClinicState extends State { child: Container( key: ValueKey(rating), child: IconButton( - iconSize: 55.0, + iconSize: 45.0, onPressed: () { setState(() { rating = index + 1; diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 4a1026f6..c83b178e 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -138,7 +138,7 @@ class _RateAppointmentDoctorState extends State { child: Container( key: ValueKey(rating), child: IconButton( - iconSize: 55.0, + iconSize: 45.0, onPressed: () { setState(() { rating = index + 1; diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 637b0795..b64cf7d6 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -253,6 +253,18 @@ class DateUtil { else return ""; } + /// get data formatted like Apr 26,2020 + /// [dateTime] convert DateTime to data formatted Arabic + static String getMonthDayYearDateFormattedAr(DateTime dateTime) { + if (dateTime != null) + return getMonthArabic(dateTime.month) + + " " + + dateTime.day.toString() + + ", " + + dateTime.year.toString(); + else + return ""; + } /// get data formatted like Thursday, Apr 26,2020 /// [dateTime] convert DateTime to date formatted diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 3775ed4f..8c942d8b 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1024,6 +1024,10 @@ class TranslationBase { String get sendConfEmail => localizedValues['send-email'][locale.languageCode]; String get updateEmail => localizedValues['update-email'][locale.languageCode]; String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; + String get noSearchResult => localizedValues['noSearchResult'][locale.languageCode]; + String get selectFileSouse => localizedValues['selectFileSouse'][locale.languageCode]; + String get gallery => localizedValues['gallery'][locale.languageCode]; + String get camera => localizedValues['camera'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/bottom_options/BottomSheet.dart b/lib/widgets/bottom_options/BottomSheet.dart index 66ee36c4..494ddff3 100644 --- a/lib/widgets/bottom_options/BottomSheet.dart +++ b/lib/widgets/bottom_options/BottomSheet.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'dart:io'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:feather_icons_flutter/feather_icons_flutter.dart'; import 'package:flutter/material.dart'; @@ -15,10 +16,10 @@ class ImageOptions { return _BottomSheet( children: [ _BottomSheetItem( - title: "Select file souse", + title: TranslationBase.of(context).selectFileSouse, ), _BottomSheetItem( - title: "Gallery", + title: TranslationBase.of(context).gallery, icon: FeatherIcons.image, onTap: () async { File _image = @@ -32,7 +33,7 @@ class ImageOptions { }, ), _BottomSheetItem( - title: "Camera", + title: TranslationBase.of(context).camera, icon: FeatherIcons.camera, onTap: () async { File _image = @@ -46,8 +47,10 @@ class ImageOptions { }, ), _BottomSheetItem( - title: "Cancel", - onTap: (){}, + title: TranslationBase.of(context).cancel, + onTap: (){ + + }, ) ], ); diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index bc8de0a5..c6cbe23b 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -54,7 +54,7 @@ class DoctorCard extends StatelessWidget { children: [ Container( width:projectViewModel.isArabic? 27:20, - height: date == null ? projectViewModel.isArabic? 170 :100 : 150, + height: date == null ? projectViewModel.isArabic? 185 :100 : 180, decoration: BoxDecoration( color: !isInOutPatient ? Colors.red[900] @@ -113,18 +113,18 @@ class DoctorCard extends StatelessWidget { ), Texts( subName, - variant: 'caption3', + ), if (billNo != null) Row( children: [ Texts( - 'Bill No: ', - variant: 'caption3', + '${TranslationBase.of(context).billNo}: ', + ), Texts( billNo, - variant: 'caption3', + ) ], ), diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index 3fcb9025..56df1c21 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -70,10 +70,9 @@ class _NotAutPageState extends State { Row( children: [ Container( - width: 30, - height: 30, + width: 40, + height: 40, decoration: BoxDecoration( - // shape: BoxShape.circle, borderRadius: BorderRadius.circular(15), color: Theme.of(context).primaryColor), child: Center( From b759758a68a5dbb00a7d9925c0528a74a560de92 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 16 Dec 2020 12:21:13 +0300 Subject: [PATCH 042/103] bug fixes --- lib/config/localized_values.dart | 68 +++----- lib/config/shared_pref_kay.dart | 4 +- .../DrawerPages/family/add-family_type.dart | 2 +- lib/pages/DrawerPages/family/my-family.dart | 149 +++++++++++------- lib/pages/landing/landing_page.dart | 48 +++--- lib/pages/login/confirm-login.dart | 35 +++- lib/pages/login/login.dart | 1 + .../authentication/auth_provider.dart | 1 + .../family_files/family_files_provider.dart | 2 +- lib/uitl/translations_delegate_base.dart | 24 +-- lib/widgets/drawer/drawer_item_widget.dart | 17 +- 11 files changed, 212 insertions(+), 139 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6c94019e..03fc51a9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -75,7 +75,8 @@ const Map localizedValues = { 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء' }, "book-success-confirm-more-24-1-2": { - "en": "The online payment process will be available 24 hours before the appointment.", + "en": + "The online payment process will be available 24 hours before the appointment.", "ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة." }, 'upcoming-payment-pending': { @@ -1114,68 +1115,51 @@ const Map localizedValues = { "not-active": {"en": "Not Active", "ar": "غير نشط"}, "card-detail": {"en": "Insurance Details", "ar": "منافعك التامينية"}, "Dr": {"en": "Dr. ", "ar": "الدكتور."}, - "empty": { - "en": "You do not have any records.", - "ar": "ليس لديك أي سجلات" - }, + "empty": {"en": "You do not have any records.", "ar": "ليس لديك أي سجلات"}, "last-visit": { "en": "How was your last visit with doctor?", "ar": "كيف تقيم زيارتك الأخيرة للطبيب؟" }, - "tap-title": { - "en": "Please rate the doctor", - "ar": "يرجى تقييم الطبيب" - }, - "later": { - "en": "Later", - "ar": "لاحقاً" - }, - "sendSuc":{ - "en":"A copy has been sent to the email", - "ar":"تم إرسال نسخة إلى البريد الإلكتروني" + "tap-title": {"en": "Please rate the doctor", "ar": "يرجى تقييم الطبيب"}, + "later": {"en": "Later", "ar": "لاحقاً"}, + "sendSuc": { + "en": "A copy has been sent to the email", + "ar": "تم إرسال نسخة إلى البريد الإلكتروني" }, "instructions": { - "en": "You can now talk directly to the appointments department by chat or request a call back", - "ar": "يمكنك الان التحدث مباشرة مع قسم المواعيد عن طريق خدمة المحادثة النصية أو طلب معاودة الاتصال" + "en": + "You can now talk directly to the appointments department by chat or request a call back", + "ar": + "يمكنك الان التحدث مباشرة مع قسم المواعيد عن طريق خدمة المحادثة النصية أو طلب معاودة الاتصال" }, "instructions-pharmacies": { - "en": "You can now talk directly to the pharmacist by chat or request a call back", - "ar": "يمكنك الآن التحدث مباشرة إلى الصيدلي عن طريق الدردشة أو طلب معاودة الاتصال" - }, - "select-hospital": { - "en": "Choose Hospital", - "ar": "اختر المستشفى" - }, - "start": { - "en": "Start", - "ar": "ابدأ" + "en": + "You can now talk directly to the pharmacist by chat or request a call back", + "ar": + "يمكنك الآن التحدث مباشرة إلى الصيدلي عن طريق الدردشة أو طلب معاودة الاتصال" }, + "select-hospital": {"en": "Choose Hospital", "ar": "اختر المستشفى"}, + "start": {"en": "Start", "ar": "ابدأ"}, "info-chat": { - "en": "This service allows you to chat with customer service directly without the need to call.", - "ar": "المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً." + "en": + "This service allows you to chat with customer service directly without the need to call.", + "ar": + "المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً." }, "last-appointment": { "en": "How was your appointment?", "ar": "كيف كان موعدك الطبي ؟" }, - "rate-clinic": { - "en": "Please rate the clinic", - "ar": "يرجى تقييم العيادة" - }, - "fetch-data": { - "en": "Fetch Data", - "ar": "تحديث الان" - }, + "rate-clinic": {"en": "Please rate the clinic", "ar": "يرجى تقييم العيادة"}, + "fetch-data": {"en": "Fetch Data", "ar": "تحديث الان"}, "send-email": { "en": "Send a copy of this report to the email", "ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني" }, - "update-email": { - "en": "Update Email", - "ar": "تحديث البريد الالكتروني" - }, + "update-email": {"en": "Update Email", "ar": "تحديث البريد الالكتروني"}, "noDataAvailable": { "en": "No data available", "ar": " لا يوجد بيانات متاحة " }, + "thename": {"en": "The Name", "ar": "الاسم"} }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index bcd7195b..a4e17388 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -19,4 +19,6 @@ const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment'; const IS_VIBRATION = 'is_vibration'; const THEME_VALUE = 'is_vibration'; const MAIN_USER = 'main-user'; -const WEATHER = 'weather'; \ No newline at end of file +const WEATHER = 'weather'; +const BLOOD_TYPE = 'blood-type'; +const NOTIFICATION_COUNT = 'notification-count'; diff --git a/lib/pages/DrawerPages/family/add-family_type.dart b/lib/pages/DrawerPages/family/add-family_type.dart index 2c85b043..cec0a0ab 100644 --- a/lib/pages/DrawerPages/family/add-family_type.dart +++ b/lib/pages/DrawerPages/family/add-family_type.dart @@ -27,7 +27,7 @@ class AddFamilyMemberType extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( - 'assets/images/habib-logo.png', + 'assets/images/DQ/dq_logo_icon.png', height: 80, width: 80, ), diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index a86503a7..62dae624 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -55,7 +55,7 @@ class _MyFamily extends State with TickerProviderStateMixin { ProjectViewModel projectViewModel; AuthenticatedUser user; VitalSignService _vitalSignService = locator(); - + var isVaiable = false; @override void initState() { _tabController = new TabController(length: 2, vsync: this, initialIndex: 0); @@ -229,7 +229,8 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text("No data found")); + child: Text( + TranslationBase.of(context).noDataAvailable)); else return Padding( padding: EdgeInsets.only(top: 50), @@ -355,7 +356,8 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text('No data found')); + child: Text(TranslationBase.of(context) + .noDataAvailable)); else return Column( children: [ @@ -389,12 +391,20 @@ class _MyFamily extends State with TickerProviderStateMixin { left: 10, right: 10), child: Row(children: [ Expanded( - flex: 3, child: AppText('Name')), + flex: 3, + child: AppText( + TranslationBase.of(context) + .theName)), Expanded( - flex: 1, child: AppText('Allow')), + flex: 1, + child: AppText( + TranslationBase.of(context) + .allowView)), Expanded( flex: 1, - child: AppText('Reject')), + child: AppText( + TranslationBase.of(context) + .rejectView)), ])), Column( children: familyFileProvider @@ -469,12 +479,25 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text('No data found')); + child: Text(TranslationBase.of(context) + .noDataAvailable)); else - return SingleChildScrollView( - child: Container( - height: SizeConfig.screenHeight * .3, - child: ListView( + return Container( + height: SizeConfig.screenHeight * .3, + child: SingleChildScrollView( + child: Column( + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, right: 10), + child: Row(children: [ + Expanded( + flex: 3, + child: AppText( + TranslationBase.of(context) + .theName)) + ])), + Column( children: snapshot .data.getAllSharedRecordsByStatusList .map((result) { @@ -492,12 +515,17 @@ class _MyFamily extends State with TickerProviderStateMixin { result.statusDescription, color: result.status == 3 ? Colors.green - : Colors.red, + : result.status == 2 + ? Colors + .yellow[800] + : Colors.red, )), ], )); }).toList(), - ))); + ) + ], + ))); } }) ], @@ -522,70 +550,59 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text('No data found')); + child: Text(TranslationBase.of(context) + .noDataAvailable)); else return Column( children: [ - // Padding( - // padding:EdgeInsets.only(left:10, right:10), - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Expanded( - // flex: 3, - // child: AppText( - // TranslationBase.of(context).request), - // ), - // Expanded( - // flex: 2, - // child: AppText( - // TranslationBase.of(context).switchUser, - // )), - // Expanded( - // flex: 1, - // child: AppText( - // TranslationBase.of(context).deleteView, - // )), - // ], - // )), Column(children: [ Padding( padding: EdgeInsets.only(left: 10, right: 10), child: Row(children: [ Expanded( - flex: 3, child: AppText('Name')), + flex: 3, + child: AppText( + TranslationBase.of(context) + .theName)), Expanded( - flex: 1, child: AppText('Delete')), + flex: 1, + child: AppText( + TranslationBase.of(context) + .deleteView)), ])), Column( children: familyFileProvider .allSharedRecordsByStatusResponse .getAllSharedRecordsByStatusList .map((result) { - return Padding( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - flex: 3, - child: AppText( - result.patientName)), - Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.delete, - color: Colors.black, - ), - onPressed: () { - deactivateRequest( - result.iD, 5, context); - }, - )), - ], - )); + return result.status == 3 + ? Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: AppText( + result.patientName)), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.delete, + color: Colors.black, + ), + onPressed: () { + deactivateRequest( + result.iD, + 5, + context); + }, + )), + ], + )) + : Container( + child: AppText(isAvailable())); }).toList()) ]) ], @@ -600,6 +617,15 @@ class _MyFamily extends State with TickerProviderStateMixin { ); } + String isAvailable() { + if (isVaiable == false) { + this.isVaiable = true; + return TranslationBase.of(context).noDataAvailable; + } else { + return ""; + } + } + Future getFamilyFiles() async { if (user != null) { if (await sharedPref.getObject(FAMILY_FILE) != null) { @@ -689,6 +715,7 @@ class _MyFamily extends State with TickerProviderStateMixin { } this.sharedPref.setString(APP_LANGUAGE, currentLang); this.sharedPref.setObject(MAIN_USER, mainUser); + //sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']); this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index b8d27d65..2094efd9 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -32,7 +32,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; - +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import '../../locator.dart'; import '../../routes.dart'; import 'home_page.dart'; @@ -154,7 +154,10 @@ class _LandingPageState extends State with WidgetsBindingObserver { if (token != null && await sharedPref.getObject(USER_PROFILE) == null) { DEVICE_TOKEN = token; checkUserStatus(token); + } else { + getNotificationCount(token); } + requestPermissions(); }).catchError((err) { print(err); @@ -513,25 +516,13 @@ class _LandingPageState extends State with WidgetsBindingObserver { // themeNotifier.setTheme(defaultTheme); } void checkUserStatus(token) async { + GifLoaderDialogUtils.showMyDialog(context); authService .selectDeviceImei(token) - .then((SelectDeviceIMEIRES value) => setUserValues(value)); - if (await sharedPref.getObject(USER_PROFILE) != null) { - var data = - AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); - if (data != null) { - authService - .registeredAuthenticatedUser(data, token, 0, 0) - .then((res) => {print(res)}); - authService.getDashboard().then((value) => { - setState(() { - notificationCount = value['List_PatientDashboard'][0] - ['UnreadPatientNotificationCount'] - .toString(); - }) - }); - } - } + .then((SelectDeviceIMEIRES value) => setUserValues(value)) + .catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + }); } static Future myBackgroundMessageHandler( @@ -551,6 +542,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { } void setUserValues(value) async { + GifLoaderDialogUtils.hideDialog(context); sharedPref.setObject(IMEI_USER_DATA, value); } @@ -571,4 +563,24 @@ class _LandingPageState extends State with WidgetsBindingObserver { ); } } + + getNotificationCount(token) async { + if (await sharedPref.getObject(USER_PROFILE) != null) { + var data = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + if (data != null) { + authService + .registeredAuthenticatedUser(data, token, 0, 0) + .then((res) => {print(res)}); + authService.getDashboard().then((value) => { + setState(() { + notificationCount = value['List_PatientDashboard'][0] + ['UnreadPatientNotificationCount'] + .toString(); + sharedPref.setString(NOTIFICATION_COUNT, notificationCount); + }) + }); + } + } + } } diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 1c6bde43..7f7c883d 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -9,6 +9,8 @@ import 'package:diplomaticquarterapp/models/Authentication/check_activation_code import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; @@ -22,6 +24,7 @@ import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -512,6 +515,8 @@ class _ConfirmLogin extends State { sharedPref.remove(FAMILY_FILE), result.list.isFamily = false, userData = result.list, + // sharedPref.setString( + // BLOOD_TYPE, result['PatientBloodType']), sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(USER_PROFILE, result.list), loginTokenID = result.logInTokenID, @@ -570,7 +575,35 @@ class _ConfirmLogin extends State { appointmentRateViewModel.isLogin = true; projectViewModel.isLogin = true; getToDoCount(); - Navigator.of(context).pushNamed(HOME); + appointmentRateViewModel + .getIsLastAppointmentRatedList() + .then((value) => { + getToDoCount(), + // GifLoaderDialogUtils.hideDialog(context), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false) + } + }) + .catchError((err) { + print(err); + //GifLoaderDialogUtils.hideDialog(context); + }); + // SMSOTP.showLoadingDialog(context, false), } loading(flag) { diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 729e294a..e212550b 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -244,6 +244,7 @@ class _Login extends State { sharedPref.remove(FAMILY_FILE), result = CheckActivationCode.fromJson(result), result.list.isFamily = false, + // this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']), this.sharedPref.setObject(USER_PROFILE, result.list), this.sharedPref.setObject(MAIN_USER, result.list), this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 07e1e301..3476435b 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -256,6 +256,7 @@ class AuthProvider with ChangeNotifier { return Future.value(error); // throw error; }, body: neRequest.toJson()); + sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']); return Future.value(localRes); } catch (error) { throw error; diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index 0b0c1ef5..7a2dec81 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -299,7 +299,7 @@ class FamilyFilesProvider with ChangeNotifier { AppToast.showErrorToast(message: error); throw error; }, body: request); - + sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']); return Future.value(localRes); } catch (error) { print(error); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 3775ed4f..d87dc1f6 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1004,26 +1004,32 @@ class TranslationBase { String get cardDetail => localizedValues['card-detail'][locale.languageCode]; String get dr => localizedValues['Dr'][locale.languageCode]; String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; - String get instructions => localizedValues['instructions'][locale.languageCode]; - String get instructionsPharmacies => localizedValues['instructions-pharmacies'][locale.languageCode]; - String get selectHospitalDec => localizedValues['select-hospital'][locale.languageCode]; + String get instructions => + localizedValues['instructions'][locale.languageCode]; + String get instructionsPharmacies => + localizedValues['instructions-pharmacies'][locale.languageCode]; + String get selectHospitalDec => + localizedValues['select-hospital'][locale.languageCode]; String get start => localizedValues['start'][locale.languageCode]; String get infoChat => localizedValues['info-chat'][locale.languageCode]; - String get noRecords => localizedValues['empty'][locale.languageCode]; String get lastVisit => localizedValues['last-visit'][locale.languageCode]; String get tapTitle => localizedValues['tap-title'][locale.languageCode]; String get later => localizedValues['later'][locale.languageCode]; - String get lastAppointment => localizedValues['last-appointment'][locale.languageCode]; + String get lastAppointment => + localizedValues['last-appointment'][locale.languageCode]; String get rateClinic => localizedValues['rate-clinic'][locale.languageCode]; String get fetchData => localizedValues['fetch-data'][locale.languageCode]; - - String get sendConfEmail => localizedValues['send-email'][locale.languageCode]; - String get updateEmail => localizedValues['update-email'][locale.languageCode]; - String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; + String get sendConfEmail => + localizedValues['send-email'][locale.languageCode]; + String get updateEmail => + localizedValues['update-email'][locale.languageCode]; + String get noDataAvailable => + localizedValues['noDataAvailable'][locale.languageCode]; + String get theName => localizedValues['thename'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/drawer/drawer_item_widget.dart b/lib/widgets/drawer/drawer_item_widget.dart index e5a1eb50..100b9ae0 100644 --- a/lib/widgets/drawer/drawer_item_widget.dart +++ b/lib/widgets/drawer/drawer_item_widget.dart @@ -13,11 +13,13 @@ class DrawerItem extends StatefulWidget { final Color iconColor; final bool bottomLine; final bool sideArrow; + final Widget count; DrawerItem(this.title, this.icon, {this.textColor = Colors.black, this.iconColor = Colors.black87, this.subTitle = '', this.bottomLine = true, + this.count, this.sideArrow = false}); @override @@ -55,10 +57,15 @@ class _DrawerItemState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - Texts( - widget.title, - color: widget.textColor, - fontSize: SizeConfig.textMultiplier * 2.3, + Row( + children: [ + Texts( + widget.title, + color: widget.textColor, + fontSize: SizeConfig.textMultiplier * 2.3, + ), + widget.count ?? SizedBox(), + ], ), widget.subTitle != '' ? Texts( @@ -73,7 +80,7 @@ class _DrawerItemState extends State { flex: 1, child: Icon(Icons.keyboard_arrow_right, color: Colors.red)) - : Expanded(flex: 1, child: SizedBox()) + : Expanded(flex: 1, child: SizedBox()), ], ), )); From 9a578cafc291313182e83730b9773b6c5e7b609d Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 16 Dec 2020 12:21:23 +0300 Subject: [PATCH 043/103] bug fixes --- lib/widgets/drawer/app_drawer_widget.dart | 170 ++++++++++++++++------ 1 file changed, 124 insertions(+), 46 deletions(-) diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index ecb39330..24afde74 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -2,12 +2,15 @@ import 'dart:io'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notifications_page.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -16,6 +19,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -44,9 +48,11 @@ class _AppDrawerState extends State { AuthenticatedUserObject authenticatedUserObject = locator(); VitalSignService _vitalSignService = locator(); - + AppointmentRateViewModel appointmentRateViewModel = + locator(); ToDoCountProviderModel toDoProvider; - + String booldType; + String notificationCount; @override Widget build(BuildContext context) { toDoProvider = Provider.of(context); @@ -86,23 +92,27 @@ class _AppDrawerState extends State { children: [ Padding( padding: - EdgeInsets.only(right: 5), + EdgeInsets.only(right: 0), child: Icon( Icons.account_circle, color: Color(0xFF40ACC9), + size: 28, )), - AppText( - user.firstName + - ' ' + - user.lastName, - color: Color(0xFF40ACC9), - ) + Padding( + padding: + EdgeInsets.only(right: 5), + child: AppText( + user.firstName + + ' ' + + user.lastName, + color: Color(0xFF40ACC9), + )) ], ), Row(children: [ Padding( - padding: - EdgeInsets.only(left: 30), + padding: EdgeInsets.only( + left: 30, right: 10), child: Column( children: [ AppText( @@ -118,9 +128,9 @@ class _AppDrawerState extends State { 1.5, ), AppText( - user.bloodGroup != null + booldType != null ? 'Blood Group: ' + - user.bloodGroup + booldType : '', fontSize: SizeConfig .textMultiplier * @@ -128,7 +138,8 @@ class _AppDrawerState extends State { ), ], )) - ]) + ]), + Divider() ])) : SizedBox(), ], @@ -206,9 +217,15 @@ class _AppDrawerState extends State { children: < Widget>[ Expanded( - child: Icon( - Icons - .person), + child: + Icon( + Icons + .account_circle, + color: Color( + 0xFF40ACC9), + size: + 24, + ), ), Expanded( flex: 7, @@ -246,25 +263,25 @@ class _AppDrawerState extends State { result, context); }, - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: < - Widget>[ - Expanded( - child: - Icon(Icons.person, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), - ), - Expanded( - flex: 7, - child: Padding( - padding: EdgeInsets.only(left: 5, right: 5), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), - AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), - ]))), - ], - ))) + child: Padding( + padding: EdgeInsets.only(right: 5), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + child: Icon(Icons.account_circle, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), + ), + Expanded( + flex: 7, + child: Padding( + padding: EdgeInsets.only(left: 5, right: 5), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), + AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), + ]))), + ], + )))) : SizedBox(); }).toList()) ], @@ -286,10 +303,43 @@ class _AppDrawerState extends State { }, ), InkWell( - child: DrawerItem( - TranslationBase.of(context) - .notification, - Icons.notifications), + child: Stack( + children: [ + DrawerItem( + TranslationBase.of(context) + .notification, + Icons.notifications, + count: notificationCount != null + ? new Container( + padding: EdgeInsets.all(4), + margin: EdgeInsets.all(2), + decoration: new BoxDecoration( + color: Colors.red, + borderRadius: + BorderRadius.circular( + 20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + notificationCount, + style: new TextStyle( + color: Colors.white, + fontSize: projectProvider + .isArabic + ? 8 + : 9, + ), + textAlign: TextAlign.center, + ), + // ), + ) + : SizedBox(), + ), + ], + ), onTap: () { //NotificationsPage Navigator.of(context).pop(); @@ -446,8 +496,11 @@ class _AppDrawerState extends State { var data2 = AuthenticatedUser.fromJson( await this.sharedPref.getObject(MAIN_USER)); - print(data2); + booldType = await sharedPref.getString(BLOOD_TYPE); + notificationCount = await sharedPref.getString(NOTIFICATION_COUNT); + setState(() { + notificationCount = notificationCount; this.user = data; this.mainUser = data2; }); @@ -511,7 +564,6 @@ class _AppDrawerState extends State { } loginAfter(result, context) async { - Utils.hideProgressDialog(); result = CheckActivationCode.fromJson(result); var familyFile = await sharedPref.getObject(FAMILY_FILE); var currentLang = await sharedPref.getString(APP_LANGUAGE); @@ -521,15 +573,41 @@ class _AppDrawerState extends State { result.list.isFamily = true; } this.sharedPref.setString(APP_LANGUAGE, currentLang); - + // sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']); this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID); //this.checkIfUserAgreedBefore(result), - Navigator.of(context).pushNamed( - HOME, - ); + appointmentRateViewModel + .getIsLastAppointmentRatedList() + .then((value) => { + //getToDoCount(), + Utils.hideProgressDialog(), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false) + } + }) + .catchError((err) { + print(err); + Utils.hideProgressDialog(); + // GifLoaderDialogUtils.hideDialog(context); + }); } } From 4a8448369842a1516b5ba096527bed72a842ac28 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Wed, 16 Dec 2020 12:50:41 +0300 Subject: [PATCH 044/103] fixed order details --- assets/images/pharmacy/user.svg | 3 + lib/config/config.dart | 1 + lib/config/localized_values.dart | 3 +- .../order_model_view_model.dart | 48 +- lib/locator.dart | 2 + lib/pages/pharmacy/order/Order.dart | 42 +- lib/pages/pharmacy/order/OrderDetails.dart | 116 ++- lib/pages/pharmacy/order/ProductReview.dart | 343 +++---- lib/pages/pharmacy/profile/profile.dart | 850 ++++++++++-------- .../cancelOrder_service.dart | 21 +- .../orderDetails_service.dart | 2 +- .../pharmacy_services/order_service.dart | 8 +- .../writeReview_service.dart | 40 + lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/pharmacy/product_tile.dart | 26 +- 15 files changed, 864 insertions(+), 642 deletions(-) create mode 100644 assets/images/pharmacy/user.svg create mode 100644 lib/services/pharmacy_services/writeReview_service.dart diff --git a/assets/images/pharmacy/user.svg b/assets/images/pharmacy/user.svg new file mode 100644 index 00000000..8e978105 --- /dev/null +++ b/assets/images/pharmacy/user.svg @@ -0,0 +1,3 @@ + + + diff --git a/lib/config/config.dart b/lib/config/config.dart index 52cdd95c..d3fda732 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -368,6 +368,7 @@ const GET_ORDER = "orders?"; const GET_ORDER_DETAILS = "epharmacy/api/orders/"; const GET_ADDRESS = "Customers/"; const GET_Cancel_ORDER = "cancelorder/"; +const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8"; const GET_SHOPPING_CART = "epharmacy/api/shopping_cart_items/"; const GET_SHIPPING_OPTIONS = "epharmacy/api/get_shipping_option/"; const DELETE_SHOPPING_CART = "epharmacy/api/delete_shopping_cart_items/"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c3962b5b..c52739f2 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -658,6 +658,7 @@ const Map localizedValues = { "compare": {"en": " Compare", "ar": "مقارنه"}, "medicationsRefill": {"en": " Medication Refill", "ar": "اعادة تعبئة الدواء"}, "myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"}, + "quantity": {"en": " QTY ", "ar": "الكمية"}, "backMyAccount": { "en": "BACK TO MY ACCOUNT ", "ar": " الرجوع لحسابي الشخصي" @@ -672,7 +673,7 @@ const Map localizedValues = { "ar": " تقييمك سوف يساعد الأخرين في اختيار المنتج الأفضل" }, "shippedMethod": {"en": "SHIP BY:", "ar": " الشحن بواسطة:"}, - "orderDetail": {"en": "Order Detail", "ar": " تفاصيل الطلب"}, + "orderDetail": {"en": "Order Details", "ar": " تفاصيل الطلب"}, "orderSummary": {"en": "Order Summary", "ar": " تفاصيل المنتج"}, "subtotal": {"en": "Subtotal", "ar": " المجموع"}, "shipping": {"en": "Shipping", "ar": " الشحن"}, diff --git a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart index 04cbe8e3..f3262ba3 100644 --- a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart @@ -1,9 +1,13 @@ -//import 'dart:html'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:flutter/material.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; @@ -15,20 +19,24 @@ class OrderModelViewModel extends BaseViewModel { OrderDetailsService _orderDetailsService = locator(); List get orderDetails => _orderDetailsService.orderDetails; + CancelOrderService _cancelOrderService = locator(); + List get cancelOrder => _cancelOrderService.cancelOrderList; - Future getOrder(id, pageId) async { + + Future getOrder(customerId, pageID) async { + print("this is customer id"+ customerId); setState(ViewState.Busy); - await _orderService.getOrder(id,pageId); + await _orderService.getOrder(customerId, pageID); if (_orderService.hasError) { error = _orderService.error; setState(ViewState.Error); } else { //order = _orderService.orderList; - print(order.length); setState(ViewState.Idle); } + } Future getOrderDetails(orderId) async { @@ -38,23 +46,47 @@ class OrderModelViewModel extends BaseViewModel { error = _orderDetailsService.error; setState(ViewState.Error); } else { - + setState(ViewState.Idle); } } - Future getProductReview(orderId) async { + Future getProductReview() async { setState(ViewState.Busy); - await _orderService.getProductReview(orderId); + await _orderService.getProductReview(); if (_orderService.hasError) { error = _orderService.error; setState(ViewState.Error); } else { //order = _orderService.orderList; - print(order.length); setState(ViewState.Idle); } } + Future getCanceledOrder(order, context) async { + print("this is order id"+ order); + setState(ViewState.Busy); + dynamic res; + await _cancelOrderService.getCanceledOrder(order).then((value) { + res = value['success']['SuccessEndUserMsg']; + print(value['success']['SuccessEndUserMsg']); + AppToast.showSuccessToast(message: "Request Sent Successfully"); +// Navigator.pop(context); + + }); + if (_cancelOrderService.hasError) { + error = _cancelOrderService.error; + setState(ViewState.Error); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); +// AppToast.showSuccessToast(message: "Request Sent Successfully"); +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => OrderPage())); + + } + + return res; + } } \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 6d2375e7..c9ecdb06 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_ import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; @@ -173,6 +174,7 @@ void setupLocator() { locator.registerLazySingleton(() => OrderDetailsService()); locator.registerLazySingleton(() => CustomerAddressesService()); locator.registerLazySingleton(() => TermsConditionService()); + locator.registerLazySingleton(() => CancelOrderService()); /// View Model locator.registerFactory(() => HospitalViewModel()); diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart index f46eb08f..f153dd35 100644 --- a/lib/pages/pharmacy/order/Order.dart +++ b/lib/pages/pharmacy/order/Order.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -11,17 +12,24 @@ import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; + class OrderPage extends StatefulWidget { // orderList({this.customerId, this.pageId}); var languageID ; + String customerID; + + OrderPage({@required this.customerID}); + @override _OrderPageState createState() => _OrderPageState(); } class _OrderPageState extends State with SingleTickerProviderStateMixin{ - String customerId=""; - String page_id=""; + + String pageID= "1"; + String customerId = ""; + String order =""; List orderList = [] ; List deliveredOrderList = [] ; @@ -31,19 +39,23 @@ class _OrderPageState extends State with SingleTickerProviderStateMix TabController _tabController; AppSharedPreferences sharedPref = AppSharedPreferences(); + getLanguageID() async { + return await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + } @override void initState() { -// WidgetsBinding.instance.addPostFrameCallback((_) => getOrder()); getLanguageID(); super.initState(); + _tabController = new TabController(length: 4, vsync: this,); } @override Widget build(BuildContext context) { + print( "customerID" + widget.customerID); return BaseView( - onModelReady: (model) => model.getOrder(customerId, page_id), + onModelReady: (model) => model.getOrder(widget.customerID, pageID), builder: (_,model, wi )=> AppScaffold( appBarTitle:TranslationBase.of(context).order, baseViewModel: model, @@ -181,7 +193,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix indent: 0, endIndent: 0, ), - Row( + Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( @@ -196,7 +208,8 @@ class _OrderPageState extends State with SingleTickerProviderStateMix color: Colors.blue[700], borderRadius: BorderRadius.circular(30.0) ), - child: Text( + child: deliveredOrderList[index].orderStatusId == 30 + ? Text( // deliveredOrderList[0].orderStatus.toString().substring(12), TranslationBase.of(context).deliveredOrder, style: TextStyle( @@ -204,7 +217,15 @@ class _OrderPageState extends State with SingleTickerProviderStateMix fontSize: 15.0, fontWeight: FontWeight.bold, ), - ), + ) + : Text( + deliveredOrderList[index].orderStatus.toString().substring(12), + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ) ), Container( margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), @@ -1073,12 +1094,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ); } - getLanguageID() async { - var languageID = await sharedPref.getString(APP_LANGUAGE); - setState(() { - widget.languageID = languageID; - }); - } + } diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart index 94b1aba2..57cddeca 100644 --- a/lib/pages/pharmacy/order/OrderDetails.dart +++ b/lib/pages/pharmacy/order/OrderDetails.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart'; import 'package:diplomaticquarterapp/config/config.dart'; @@ -19,11 +20,11 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + class OrderDetailsPage extends StatefulWidget { var languageID ; - OrderModel orderModel; OrderDetailsPage({ @required this.orderModel @@ -34,10 +35,18 @@ class OrderDetailsPage extends StatefulWidget { } class _OrderDetailsPageState extends State { + + getLanguageID() async { + return await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + } + AppSharedPreferences sharedPref = AppSharedPreferences(); - String customerId=""; - String page_id=""; - String orderId="3516"; + String orderId=""; + + String customerId; + List orderList = [] ; + List cancelledOrderList = []; +// String orderId="3516"; var model; var isCancel = false; var isRefund = false; @@ -48,10 +57,10 @@ class _OrderDetailsPageState extends State { @override void initState() { super.initState(); + print(widget.orderModel.orderItems.length); getLanguageID(); - getCancelOrder(widget.orderModel.id); -// cancelOrderDetail(widget.orderModel.id); +// cancelOrderDetail(order) } @override @@ -98,10 +107,11 @@ class _OrderDetailsPageState extends State { color: getStatusBackgroundColor(), borderRadius: BorderRadius.circular(30.0) ), - child: Text(widget.orderModel.orderStatus.toString().substring(12), -// widget.languageID == "ar" -// ? widget.orderModel.orderStatusn.toString() -// : widget.orderModel.orderStatus.toString().substring(12) , + child: Text( +// widget.orderModel.orderStatus.toString().substring(12), + widget.languageID == "ar" + ? widget.orderModel.orderStatusn.toString() + : widget.orderModel.orderStatus.toString().substring(12) , // TranslationBase.of(context).delivered, style: TextStyle( color: Colors.white, @@ -117,7 +127,7 @@ class _OrderDetailsPageState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(model.order[0].shippingAddress.firstName.toString().substring(10) + ' ' +model.order[0].shippingAddress.lastName.toString().substring(9), + Text(widget.orderModel.shippingAddress.firstName.toString().substring(10) + ' ' +model.order[0].shippingAddress.lastName.toString().substring(9), style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, ), ), @@ -125,12 +135,12 @@ class _OrderDetailsPageState extends State { ), ), Container( - margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0), + margin: EdgeInsets.fromLTRB(11.0, 5.0, 1.0, 5.0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(model.order[0].shippingAddress.address1.toString().substring(9), - style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, + Text(widget.orderModel.shippingAddress.address1.toString().substring(9), + style: TextStyle(fontSize: 11.0, fontWeight: FontWeight.bold, color: Colors.grey, ), ), @@ -142,8 +152,10 @@ class _OrderDetailsPageState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(model.order[0].shippingAddress.address2.toString().substring(9), - style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, + Text(widget.orderModel.shippingAddress.address2.toString().substring(9) + + ' ' + widget.orderModel.shippingAddress.country.toString() + + ' ' + widget.orderModel.shippingAddress.zipPostalCode.toString(), + style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.bold, color: Colors.grey, ), ), @@ -161,7 +173,7 @@ class _OrderDetailsPageState extends State { ), Container( margin: EdgeInsets.only(top: 5.0, bottom: 5.0), - child: Text(model.order[0].shippingAddress.phoneNumber.toString(), + child: Text(widget.orderModel.shippingAddress.phoneNumber.toString(), style: TextStyle(fontSize: 15.0, ), ), @@ -193,7 +205,7 @@ class _OrderDetailsPageState extends State { ), ), Container( - child: model.order[0].shippingRateComputationMethodSystemName == "Shipping.FixedOrByWeight" + child: widget.orderModel.shippingRateComputationMethodSystemName == "Shipping.FixedOrByWeight" ? Container( margin: EdgeInsets.only(bottom: 10.0, top: 10.0), child: SvgPicture.asset( @@ -236,7 +248,7 @@ class _OrderDetailsPageState extends State { ), Container( margin: EdgeInsets.only(bottom: 10.0, top: 10.0), - child:Text(model.order[0].paymentName.toString().substring(12), + child:Text(widget.orderModel.paymentName.toString().substring(12), style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold, ), ), @@ -274,8 +286,11 @@ class _OrderDetailsPageState extends State { productPrice: widget.orderModel.orderItems[index].product.price.toString(), productRate: widget.orderModel.orderItems[index].product.approvedRatingSum.toDouble(), productReviews:widget.orderModel.orderItems[index].product.approvedTotalReviews, - totalPrice: widget.orderModel.orderItems[index].priceExclTax.toString(), - qyt: widget.orderModel.orderItems[index].quantity.toString(),), + totalPrice: "${(widget.orderModel.orderItems[index].product.price + * widget.orderModel.orderItems[index].quantity).toStringAsFixed(2)}", + qyt: widget.orderModel.orderItems[index].quantity.toString(), + img:widget.orderModel.orderItems[index].product.images[0].src.toString(), + status: widget.orderModel.orderStatusId,), ); } ), @@ -318,7 +333,7 @@ class _OrderDetailsPageState extends State { ), ), ), - Text(model.order[0].orderSubtotalExclTax.toString(), + Text(widget.orderModel.orderSubtotalExclTax.toString(), style: TextStyle(fontSize: 13.0, ), ), @@ -352,7 +367,7 @@ class _OrderDetailsPageState extends State { ), ), ), - Text(model.order[0].orderShippingExclTax.toString(), + Text(widget.orderModel.orderShippingExclTax.toString(), style: TextStyle(fontSize: 13.0, ), ), @@ -418,7 +433,7 @@ class _OrderDetailsPageState extends State { ), ), ), - Text(model.order[0].orderTotal.toString(), + Text(widget.orderModel.orderTotal.toString(), style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, ), ), @@ -428,8 +443,9 @@ class _OrderDetailsPageState extends State { ], ), widget.orderModel.orderStatusId == 10 ? InkWell( - onTap: (){ - // payOnline link + onTap: () { +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => InAppBrowser())); }, child: Container( // margin: EdgeInsets.only(top: 20.0), @@ -458,12 +474,11 @@ class _OrderDetailsPageState extends State { ), ), ) : Container(), - // getCancelOrder(canCancel, canRefund), isCancel ? InkWell( onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => presentConfirmDialog())); + presentConfirmDialog(model,widget.orderModel.id);//(widget.orderModel.id)); +// }, child: Container( // padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), @@ -537,37 +552,40 @@ class _OrderDetailsPageState extends State { } } - presentConfirmDialog(){ +// .getCanceledOrder + presentConfirmDialog(cancelFunction, id){ ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: TranslationBase.of(context).confirmCancellation, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => { -// cancelOrderDetail(widget.orderModel.id), - ConfirmDialog.closeAlertDialog(context) - }, - cancelFunction: () => {}); + okFunction: () => cancelFunction.getCanceledOrder(id, context).then((value){ + print(":D"); + print(value); +// Navigator.pop(context); + Navigator.push(context, + MaterialPageRoute(builder: (context) => + OrderPage(customerID: widget.orderModel.customerId.toString())), + );}), + + cancelFunction: () => {} + ); dialog.showAlertDialog(context); } -// cancelOrderDetail(order){ -// if(widget.orderModel.canCancel && widget.orderModel.canRefund == false){ -//// setState(() { -// cancelOrderDetail(order); + getCanceledOrder(order){ + Navigator.pop(context); + if(widget.orderModel.canCancel && widget.orderModel.canRefund == false){ +// getCanceledOrder(order); // AppToast.showSuccessToast(message: "Request Sent Successfully"); -//// }); -//// return OrderPage(); -// } -// else{} -// } +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => OrderPage())); + + } - getLanguageID() async { - var languageID = await sharedPref.getString(APP_LANGUAGE); - setState(() { - widget.languageID = languageID; - }); } + + } diff --git a/lib/pages/pharmacy/order/ProductReview.dart b/lib/pages/pharmacy/order/ProductReview.dart index 0f9217b7..37ede97c 100644 --- a/lib/pages/pharmacy/order/ProductReview.dart +++ b/lib/pages/pharmacy/order/ProductReview.dart @@ -1,19 +1,21 @@ + import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; -import 'package:rating_bar/rating_bar.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; -import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:rating_bar/rating_bar.dart'; class ProductReviewPage extends StatefulWidget { + OrderModel orderModel; + ProductReviewPage({ + @required this.orderModel + }); @override _ProductReviewPageState createState() => _ProductReviewPageState(); } @@ -26,193 +28,212 @@ class _ProductReviewPageState extends State { String submitTxt =""; var doctorRating= ""; var reviewObj = {}; + AppSharedPreferences sharedPref = AppSharedPreferences(); @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model)=>model.getProductReview(orderId), + onModelReady: (model)=>model.getOrderDetails(widget.orderModel.id), builder: (_,model, wi )=> AppScaffold( appBarTitle: TranslationBase.of(context).writeReview, isShowAppBar: true, isPharmacy:true , - body: Container( - color: Colors.white, - child: SingleChildScrollView( - child: Column( - children: [ -// Container( -// child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00, -// productReviews:4, ), -// ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - margin: EdgeInsets.only(left: 10), - child: SvgPicture.asset( -// model.order[0].orderItems[0].product.images[0].src.toString(), + body: Container( + color: Colors.white, + child: SingleChildScrollView( + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount:widget.orderModel.orderItems.length, + itemBuilder: (context, index){ + return Container( + margin: EdgeInsets.only(top :15.0, bottom: 15.0), + child: Row( + children:[ + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + margin: EdgeInsets.only(left: 10), + child: SvgPicture.asset( +// widget.orderModel.orderItems[index].product.images[index].src.toString(), 'assets/images/al-habib_onlne_pharmacy_bg.png', - fit: BoxFit.cover, - width: 80, - height: 80, + fit: BoxFit.cover, + width: 80, + height: 80, ), - ),] - ), - Container( - margin: EdgeInsets.only(top :15.0, bottom: 15.0), - child: Column( - children: [ - Row( - children: [ - Text(model.order[0].orderItems[0].product.name.toString(), - style: TextStyle(fontSize: 16.0, + ), + ] ), - ), - ], - ), - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text(model.order[0].orderItems[0].product.price.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, + ], + ), + Column( + children: [ + Row( + children: [ + Text(widget.orderModel.orderItems[index].product.name.toString(), + style: TextStyle(fontSize: 16.0, + ), ), - ), + ], ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, + Row( + children: [ + Container( + margin: EdgeInsets.only(left: 5), + child: Text(widget.orderModel.orderItems[index].product.price.toString(), + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, + ), + ), ), - ), - ), - ], - ), - Row( - children: [ - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RatingBar.readOnly( - initialRating: 3, - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, + Container( + margin: EdgeInsets.only(left: 5), + child: Text(TranslationBase.of(context).sar, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, + ), + ), ), - ), + ], ), - Container( - child: Text(model.order[0].orderItems[0].product.approvedRatingSum.toString(), - style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, + Row( + children: [ + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RatingBar.readOnly( + initialRating: 3, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text("(" + model.order[0].orderItems[0].product.approvedTotalReviews.toString() - + ' ' + TranslationBase.of(context).review +")", - style: TextStyle(fontSize: 12.0, + Container( + child: Text(widget.orderModel.orderItems[index].product.approvedRatingSum.toString(), + style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, + ), + ), ), - ), + Container( + margin: EdgeInsets.only(left: 5), + child: Text("(" + widget.orderModel.orderItems[index].product.approvedTotalReviews.toString() + + ' ' + TranslationBase.of(context).review +")", + style: TextStyle(fontSize: 12.0, + ), + ), + ), + ], ), ], ), - ], - ), - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, + ] + ), + ); + } ), - Container( - margin: EdgeInsets.only( top: 12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar( - // initialRating: - // this.doctor.actualDoctorRate.toDouble(), - size: 40.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ], + ]), + + Divider( + color: Colors.grey[350], + height: 20, + thickness: 8, + indent: 0, + endIndent: 0, + ), + Container( + margin: EdgeInsets.only( top: 12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar( + // initialRating: + // this.doctor.actualDoctorRate.toDouble(), + size: 40.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, ), - ), - Container( - padding: EdgeInsets.fromLTRB(8.0, 20.0, 8.0,20.0), - child: Column( - children: [ - TextFormField ( - decoration: InputDecoration( - contentPadding: const EdgeInsets.symmetric(vertical: 60.0), - border: InputBorder.none, - hintText: 'Tell us more about product!', - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(5.0), - borderSide: BorderSide(width: 1, color: Colors.grey[400]), - ), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Colors.grey[400], width: 1), - ), - ), + ], + ), + ), + Container( + padding: EdgeInsets.fromLTRB(8.0, 20.0, 8.0,20.0), + child: Column( + children: [ + TextFormField ( + decoration: InputDecoration( + contentPadding: const EdgeInsets.symmetric(vertical: 60.0), + border: InputBorder.none, + hintText: 'Tell us more about product!', + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(5.0), + borderSide: BorderSide(width: 1, color: Colors.grey[400]), ), - ], + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Colors.grey[400], width: 1), + ), + ), ), - ), - InkWell( - onTap: () { + ], + ), + ), + InkWell( + onTap: () { // Navigator.push(context, // MaterialPageRoute(builder: (context) => )); - }, - child: Container( - height: 50.0, - width: 400.0, - color: Colors.transparent, - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.yellow[700], - style: BorderStyle.solid, - width: 1.0 - ), + }, + child: Container( + height: 50.0, + width: 400.0, + color: Colors.transparent, + child: Container( + decoration: BoxDecoration( + border: Border.all( color: Colors.yellow[700], - borderRadius: BorderRadius.circular(5.0) + style: BorderStyle.solid, + width: 1.0 ), - child: Center( - child: Text( - TranslationBase.of(context).shareReview, - style: TextStyle( - color: Colors.white, - fontSize: 16.0, - fontWeight: FontWeight.bold, - ), - ), + color: Colors.yellow[700], + borderRadius: BorderRadius.circular(5.0) + ), + child: Center( + child: Text( + TranslationBase.of(context).shareReview, + style: TextStyle( + color: Colors.white, + fontSize: 16.0, + fontWeight: FontWeight.bold, ), ), ), ), - ], - ), + ), ), - ),), - ); + ], + ), + ), + ),), + ); } @@ -346,4 +367,4 @@ class _ProductReviewPageState extends State { submitProductReview(){ } -} +} \ No newline at end of file diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index 0336370c..e52d059b 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -1,21 +1,18 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; -import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; - +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; class PharmacyProfilePage extends StatefulWidget { @override @@ -24,416 +21,501 @@ class PharmacyProfilePage extends StatefulWidget { class _ProfilePageState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); - String customerId=""; - String page_id=""; + + AuthenticatedUser user; + bool isLogin = false; + String firstName; + String customerId; + _ProfilePageState({this.customerId}); + + getCustomer() async { + String custID; + custID = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + + setState(() { + customerId = custID; + }); + print("customer Id is"+ customerId); + return customerId; + } + + getUser() async { + var userData = await sharedPref.getObject(USER_PROFILE); + if (userData != null) user = AuthenticatedUser.fromJson(userData); + setState(() { + firstName = user.firstName.toString(); + print("this is user" + user.firstName.toString()); + }); +// this.isLogin = user != null; + } + void initState() { + getCustomer(); + super.initState(); + getUser(); + } @override Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getOrder(customerId, page_id), - builder: (_,model, wi )=> AppScaffold( - appBarTitle: TranslationBase.of(context).myAccount, - isShowAppBar: true, - isPharmacy:true , - body: Container( - child:SingleChildScrollView( - child: Column( - children:[ - Container( - child:Row( - children: [ - Container( - padding:EdgeInsets.only(top:20.0, left:10.0, right:10.0, bottom:10.0,), - child: LargeAvatar(name: "profile", url:'' ,), - ), - Container( - child: Column( + return AppScaffold( + appBarTitle: TranslationBase.of(context).myAccount, + isShowAppBar: true, + isPharmacy: true, + body: Container( + child: SingleChildScrollView( + child: Column( + children: [ + Container( + child: Row( + children: [ +// Container( +// padding:EdgeInsets.only(top:20.0, left:10.0, right:10.0, bottom:10.0,), +// child: LargeAvatar( +// name: "", +// url: "" ,), +// ), + Row( + children: [ + Column( + children: [ + Container( + padding:EdgeInsets.only(top:10.0, left:10.0, right:10.0, bottom:15.0,), + child: SvgPicture.asset( + 'assets/images/pharmacy/user.svg', + width: 60, + height: 60, + ), + ),] + ), + Column( + crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( TranslationBase.of(context).welcome, - style: TextStyle(fontSize: 14.0, + style: TextStyle( + fontSize: 14.0, fontWeight: FontWeight.bold, - color:Colors.grey - ), + color: Colors.grey), ), - Text("Name", -// model.order[0].customer.firstName.toString(), + Text( + user.firstName.toString()+ " " + user.lastName.toString(), style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold - ), + fontSize: 14.0, fontWeight: FontWeight.bold), ), ], ), - ) - ], - ), - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 15, + ], + ) + ], ), - Container( - child:Row( - children: [ - Expanded( - child: InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderPage())); - }, - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/orders_icon.svg', - width: 50, - height: 50,), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).orders, - style: TextStyle(fontSize: 13.0, - fontWeight: FontWeight.bold,), - ), - ], - ), + ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 5, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 15, + ), + Container( + child: Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => OrderPage(customerID: customerId))); + }, + child: Column( + children: [ +// Image(image: AssetImage('assets/images/pharmacy/orders_icon.svg')), + SvgPicture.asset( + 'assets/images/pharmacy/orders_icon.svg', + width: 50, + height: 50, ), - ), - Expanded( - child: InkWell( - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/lakum_icon.svg', - width: 50, - height: 50,), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).lakum, - style: TextStyle(fontSize: 13.0, - fontWeight: FontWeight.bold - ), - ), - ], - ), - ), - ), - Expanded( - child: InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => WishlistPage())); - }, - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/wishlist_icon.svg', - width: 50, - height: 50,), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).wishlist, - style: TextStyle(fontSize: 13.0, - fontWeight: FontWeight.bold,), - ), - ], - ), + SizedBox( + height: 5, ), - ), - Expanded( - child: InkWell( - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/review_icon.svg', - width: 50, - height: 50,), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).reviews, - style: TextStyle(fontSize: 13.0, - fontWeight: FontWeight.bold,), - ), - ], + Text( + TranslationBase.of(context).orders, + style: TextStyle( + fontSize: 13.0, + fontWeight: FontWeight.bold, ), ), - ), - ], - ) - ), - SizedBox( - height: 15, - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 10, - ), - Container( - padding: EdgeInsets.only(left: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).myAccount, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold - ), - ), - SizedBox( - height: 10, + ], ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => HomePrescriptionsPage())); + ), + ), + Expanded( + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LakumMainPage())); }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/my_prescription_icon.svg', - width: 28, - height: 28,), - SizedBox( - width: 15, - ), - Text(TranslationBase.of(context).myPrescription, - style: TextStyle(fontSize: 13.0, - ), - ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, + child: Column( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/lakum_icon.svg', + width: 50, + height: 50, + ), + SizedBox( + height: 5, + ), + Text( + TranslationBase.of(context).lakum, + style: TextStyle( + fontSize: 13.0, fontWeight: FontWeight.bold), + ), + ], ), - InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => MyFamily())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/compare.png', - width: 28, - height: 28,), - SizedBox( - width: 15, - ), - Text(TranslationBase.of(context).compare, - style: TextStyle(fontSize: 13.0, - ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => WishlistPage())); + }, + child: Column( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/wishlist_icon.svg', + width: 50, + height: 50, + ), + SizedBox( + height: 5, + ), + Text( + TranslationBase.of(context).wishlist, + style: TextStyle( + fontSize: 13.0, + fontWeight: FontWeight.bold, ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, + ), + ], ), - InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => HomePrescriptionsPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/medication_refill_icon.svg', - width: 30, - height: 30,), - SizedBox( - width: 20, - ), - Text(TranslationBase.of(context).medicationsRefill, - style: TextStyle(fontSize: 13.0, - ), + ), + ), + Expanded( + child: InkWell( + child: Column( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/review_icon.svg', + width: 50, + height: 50, + ), + SizedBox( + height: 5, + ), + Text( + TranslationBase.of(context).reviews, + style: TextStyle( + fontSize: 13.0, + fontWeight: FontWeight.bold, ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, + ), + ], ), - InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => MyFamily())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/my_family_icon.svg', - width: 20, - height: 20,), - SizedBox( - width: 20, - ), - Text(TranslationBase.of(context).family, - style: TextStyle(fontSize: 13.0, - ), + ), + ), + ], + )), + SizedBox( + height: 15, + ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 5, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 10, + ), + Container( + padding: EdgeInsets.only(left: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).myAccount, + style: TextStyle( + fontSize: 16.0, fontWeight: FontWeight.bold), + ), + SizedBox( + height: 10, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => HomePrescriptionsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/my_prescription_icon.svg', + width: 28, + height: 28, + ), + SizedBox( + width: 15, + ), + Text( + TranslationBase.of(context).myPrescription, + style: TextStyle( + fontSize: 13.0, ), - ], - ), + ), + ], ), - SizedBox( - height: 5, + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MyFamily())); + }, + child: Row( + children: [ + Image.asset('assets/images/pharmacy/compare.png', + width: 35, height: 35), + SizedBox( + width: 15, + ), + Text( + TranslationBase.of(context).compare, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], ), - Divider( - color: Colors.grey, - height: 20, + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => HomePrescriptionsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/medication_refill_icon.svg', + width: 30, + height: 30, + ), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).medicationsRefill, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], ), - InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => PharmacyAddressesPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/shipping_addresses_icon.svg', - width: 30, - height: 30,), - SizedBox( - width: 20, + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MyFamily())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/my_family_icon.svg', + width: 20, + height: 20, + ), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).family, + style: TextStyle( + fontSize: 13.0, ), - Text(TranslationBase.of(context).shippingAddresses, - style: TextStyle(fontSize: 13.0, - ), + ), + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PharmacyAddressesPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/shipping_addresses_icon.svg', + width: 30, + height: 30, + ), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).shippingAddresses, + style: TextStyle( + fontSize: 13.0, ), - ], - ), + ), + ], ), - ], - ), - ), - SizedBox( - height: 10, - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 10, + ), + ], ), - Container( - padding: EdgeInsets.only(left: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).reachUs, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => LiveChatPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/contact_us_icon.svg', - width: 20, - height: 20,), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).contactUs, - style: TextStyle(fontSize: 13.0), - ), - ], - ), - ), - SizedBox( - height: 5, + ), + SizedBox( + height: 10, + ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 5, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 10, + ), + Container( + padding: EdgeInsets.only(left: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).reachUs, + style: TextStyle( + fontSize: 16.0, fontWeight: FontWeight.bold), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LiveChatPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/contact_us_icon.svg', + width: 20, + height: 20, + ), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).contactUs, + style: TextStyle(fontSize: 13.0), + ), + ], ), - Divider( - color: Colors.grey, - height: 20, + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => FindUsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/our_locations_icon.svg', + width: 30, + height: 30, + ), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).ourLocations, + style: TextStyle(fontSize: 13.0), + ), + ], ), - InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => FindUsPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/our_locations_icon.svg', - width: 30, - height: 30,), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).ourLocations, - style: TextStyle(fontSize: 13.0), - ), - ], - ), - ) - ], - ), - ) - ], - ), + ) + ], + ), + ) + ], ), ), ), ); - }} - - - - + } +// getUser() async { +// var userData = await sharedPref.getObject(USER_PROFILE); +// if (userData != null) user = AuthenticatedUser.fromJson(userData); +// } +} diff --git a/lib/services/pharmacy_services/cancelOrder_service.dart b/lib/services/pharmacy_services/cancelOrder_service.dart index de80a473..f848c2ff 100644 --- a/lib/services/pharmacy_services/cancelOrder_service.dart +++ b/lib/services/pharmacy_services/cancelOrder_service.dart @@ -16,24 +16,29 @@ class CancelOrderService extends BaseService{ AuthenticatedUser authUser = new AuthenticatedUser(); AuthProvider authProvider = new AuthProvider(); - List get orderDetails => orderDetails; - List _orderList = List(); - List get orderList => _orderList; + List _cancelOrderList = List(); + List get cancelOrderList => _cancelOrderList; String url =""; - Future cancelOrderDetail(order) async { + Future getCanceledOrder(order) async { print("step 1"); hasError = false; + + dynamic res; + await baseAppClient.getPharmacy(GET_Cancel_ORDER+order, onSuccess: (dynamic response, int statusCode) { - _orderList.clear(); - response['orders'].forEach((item) { - _orderList.add(OrderModel.fromJson(item)); - }); + res = response; + print(res); +// _cancelOrderList.clear(); +// response['success'].forEach((item) { +// _cancelOrderList.add(OrderModel.fromJson(item)); +// }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }); + return res; } } \ No newline at end of file diff --git a/lib/services/pharmacy_services/orderDetails_service.dart b/lib/services/pharmacy_services/orderDetails_service.dart index fb58097f..5adbbc24 100644 --- a/lib/services/pharmacy_services/orderDetails_service.dart +++ b/lib/services/pharmacy_services/orderDetails_service.dart @@ -23,7 +23,7 @@ class OrderDetailsService extends BaseService{ Future getOrderDetails(orderId) async { - print("step 1"); + print("step 2" + orderId); hasError = false; await baseAppClient.getPharmacy(GET_ORDER_DETAILS+orderId, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/services/pharmacy_services/order_service.dart b/lib/services/pharmacy_services/order_service.dart index 70523da1..e426b801 100644 --- a/lib/services/pharmacy_services/order_service.dart +++ b/lib/services/pharmacy_services/order_service.dart @@ -18,12 +18,12 @@ class OrderService extends BaseService{ List get orderList => _orderList; String url =""; - Future getOrder(custmerId, page_id) async { - print("step 1"); + Future getOrder(customerId, pageId) async { hasError = false; - url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; -// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$page_id&limit=200&customer_id=$custmerId"; + // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; + url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId"; print(url); + await baseAppClient.getPharmacy(url, onSuccess: (dynamic response, int statusCode) { _orderList.clear(); diff --git a/lib/services/pharmacy_services/writeReview_service.dart b/lib/services/pharmacy_services/writeReview_service.dart new file mode 100644 index 00000000..573095eb --- /dev/null +++ b/lib/services/pharmacy_services/writeReview_service.dart @@ -0,0 +1,40 @@ + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/material.dart'; + + +class writeReviewService extends BaseService{ + + + + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + List get writeReview => writeReview; + List _writeReviewList = List(); + List get orderList => _writeReviewList; + + + Future getProductReview() async { + hasError = false; + await baseAppClient.getPharmacy(WRITE_REVIEW, + onSuccess: (dynamic response, int statusCode) { + _writeReviewList.clear(); + response[''].forEach((item) { + _writeReviewList.add(OrderModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } +} \ No newline at end of file diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 7be0a051..d10cb542 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -773,6 +773,7 @@ class TranslationBase { String get compare => localizedValues['compare'][locale.languageCode]; String get medicationsRefill => localizedValues['medicationsRefill'][locale.languageCode]; String get myPrescription => localizedValues['myPrescription'][locale.languageCode]; + String get quantity => localizedValues['quantity'][locale.languageCode]; // pharmacy module diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart index f16ff7e5..b56fc625 100644 --- a/lib/widgets/pharmacy/product_tile.dart +++ b/lib/widgets/pharmacy/product_tile.dart @@ -17,11 +17,14 @@ class productTile extends StatelessWidget { final String qyt; final String totalPrice; final bool isOrderDetails; + final String img; + final int status; productTile({this.productName, this.productPrice, this.productRate, - this.qyt, this.totalPrice, this.productReviews, - this.isOrderDetails=true}); + this.qyt, this.totalPrice, this.productReviews, this.img, + this.isOrderDetails=true, this.status}); + @override Widget build(BuildContext context) { @@ -37,13 +40,10 @@ class productTile extends StatelessWidget { children: [ Container( margin: EdgeInsets.only(left: 10), - child: Image( - image: - AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'), - fit: BoxFit.cover, - width: 80, - height: 80, - ), + child: Image.network(img), +// fit: BoxFit.cover, + width: 80, + height: 80, ), Expanded( flex: 5, @@ -119,7 +119,7 @@ class productTile extends StatelessWidget { margin: EdgeInsets.only(bottom: 5.0), child: RichText( text: TextSpan( - text: 'QYT: $qyt', + text: TranslationBase.of(context).quantity+"" +'$qyt', style: TextStyle( fontWeight: FontWeight.bold, color: Colors.grey, @@ -163,8 +163,8 @@ class productTile extends StatelessWidget { ), ): Container(), // this.isOrderDetails == true && model.order[0].orderStatusId == 30? - this.isOrderDetails == true? - Expanded( + + if(status ==30 && this.isOrderDetails == true ) Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ @@ -227,7 +227,7 @@ class productTile extends StatelessWidget { ), ], ), - ) : Container(), + ), ], ), ); From 02d72fa27c9c687dbe6f6707f906d217453c0f94 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 16 Dec 2020 13:25:39 +0200 Subject: [PATCH 045/103] fix issues --- lib/config/localized_values.dart | 24 ++- lib/core/service/AuthenticatedUserObject.dart | 9 +- lib/core/service/pharmacies_service.dart | 10 +- lib/core/viewModels/base_view_model.dart | 2 +- .../viewModels/medical/labs_view_model.dart | 9 ++ .../medical/reports_view_model.dart | 4 +- lib/pages/ContactUs/findus/findus_page.dart | 2 +- .../ContactUs/findus/hospitrals_page.dart | 12 +- .../ContactUs/findus/pharmacies_page.dart | 18 +-- .../ContactUs/widgets/card_common_contat.dart | 18 +-- .../insurance/insurance_approval_screen.dart | 142 +++++++++--------- .../insurance/insurance_card_screen.dart | 71 +++++---- .../insurance/insurance_update_screen.dart | 96 ++++++++++-- lib/pages/login/login.dart | 30 ++-- .../medical/reports/report_home_page.dart | 19 ++- lib/pages/medical/reports/reports_page.dart | 27 ++-- .../medical/vital_sign/LineChartCurved.dart | 43 ++++-- .../vital_sing_chart_and_detials.dart | 2 +- lib/uitl/app_toast.dart | 4 +- lib/uitl/translations_delegate_base.dart | 5 + lib/widgets/buttons/button.dart | 5 +- .../medical/LabResult/LabResultWidget.dart | 2 +- .../lab_result_chart_and_detials.dart | 33 ---- .../LabResult/laboratory_result_widget.dart | 3 +- lib/widgets/pharmacy/drug_item.dart | 11 +- 25 files changed, 350 insertions(+), 251 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 960b97a3..75638ae8 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -322,7 +322,7 @@ const Map localizedValues = { "reject-view": {"en": "Reject", "ar": "رفض"}, "delete-view": {"en": "Delete", "ar": "حذف"}, // "my-family": {"en": "MY FAMILY", "ar": "عائلتي"}, - "approvals": {"en": "Approvals", "ar": "موفقات التأمين"}, + "approvals": {"en": "Approvals", "ar": "موافقات التأمين"}, "approvalNo": {"en": "Approval No.: ", "ar": "رقم الموافقة: "}, "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, "receiptOn": {"en": "Receipt on: ", "ar": "تاريخ الفاتورة: "}, @@ -923,7 +923,7 @@ const Map localizedValues = { "message-type": {"en": "Message Type", "ar": "نوع الرسالة"}, "compliment": {"en": "compliment", "ar": "ثناء"}, "suggestion": {"en": "Suggestion", "ar": "إقتراح"}, - "your-feedback": {"en": "Your feedback was sent", "ar": "إقتراح"}, + "your-feedback": {"en": "Your feedback was sent", "ar": "لقد تم ارسال اقراحك شكرا لك"}, "select-part": { "en": "Please select the part that complain about", "ar": "يرجى تحديد الجزء الذي تشكو منه" @@ -1193,4 +1193,24 @@ const Map localizedValues = { "en": "Camera", "ar": "كاميرا" }, + "med-report": { + "en": "Medical Reports", + "ar": "التقارير الطبية" + }, + "new-med-report": { + "en": "Requests", + "ar": "الطلبات" + }, + "requestReport":{ + "en":"Request a report", + "ar":" طلب تقرير" + }, + "confirm-msg-report": { + "en": "Request for medical report?", + "ar": "طلب تقرير طبي؟" + }, + "successSendReport": { + "en": "The request has been submitted successfully", + "ar": "تم تنفيذ طلبك بنجاح" + }, }; diff --git a/lib/core/service/AuthenticatedUserObject.dart b/lib/core/service/AuthenticatedUserObject.dart index f48b1179..4fe8716f 100644 --- a/lib/core/service/AuthenticatedUserObject.dart +++ b/lib/core/service/AuthenticatedUserObject.dart @@ -11,13 +11,14 @@ class AuthenticatedUserObject { getUser(); } - getUser() async { - if (user == null) { + getUser({bool getUser = false}) async { + if (getUser) { + var userData = await sharedPref.getObject(USER_PROFILE); + if (userData != null) user = AuthenticatedUser.fromJson(userData); + } else if (user == null) { var userData = await sharedPref.getObject(USER_PROFILE); if (userData != null) user = AuthenticatedUser.fromJson(userData); } - - // var isLogin = await sharedPref.getString(LOGIN_TOKEN_ID); this.isLogin = user != null; } diff --git a/lib/core/service/pharmacies_service.dart b/lib/core/service/pharmacies_service.dart index e2bb225b..8f85d82e 100644 --- a/lib/core/service/pharmacies_service.dart +++ b/lib/core/service/pharmacies_service.dart @@ -60,8 +60,8 @@ class PharmacyService extends BaseService { projectID: 15, ); - double _latitude; - double _longitude; + double _latitude=0; + double _longitude=0; _getCurrentLocation() async { await Geolocator.getLastKnownPosition().then((value) { @@ -75,13 +75,13 @@ class PharmacyService extends BaseService { Future getMedicineList({String drugName}) async { hasError = false; - // await _getCurrentLocation(); + await _getCurrentLocation(); Map body = Map(); body['PHR_itemName'] = drugName; body['isLoginForDoctorApp'] = true; body['isDentalAllowedBackend'] = true; - // body['Latitude'] = _latitude; - // body['Longitude'] = _longitude; + body['Latitude'] = _latitude; + body['Longitude'] = _longitude; await baseAppClient.post(GET_PHARMCY_ITEMS, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart index d8ea5196..db709f6b 100644 --- a/lib/core/viewModels/base_view_model.dart +++ b/lib/core/viewModels/base_view_model.dart @@ -33,7 +33,7 @@ class BaseViewModel extends ChangeNotifier { //authenticatedUserObject.getUser(); user = authenticatedUserObject.user; this.isLogin = authenticatedUserObject.isLogin; - _getUser(); + } _getUser() async { diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 06b7bd20..9e3f09e5 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -140,6 +140,15 @@ class LabsViewModel extends BaseViewModel { error = _labsService.error; setState(ViewState.Error); } else { + bool isShouldClear = false; + if(_labsService.labOrdersResultsList.length==1) + { + labOrdersResultsList.forEach((element) { + if(element.resultValue.contains('/') ||element.resultValue.contains('*' )|| element.resultValue.isEmpty ) + isShouldClear = true; + });} + if(isShouldClear) + _labsService.labOrdersResultsList.clear(); setState(ViewState.Idle); } } diff --git a/lib/core/viewModels/medical/reports_view_model.dart b/lib/core/viewModels/medical/reports_view_model.dart index e0fdfaa3..271b5463 100644 --- a/lib/core/viewModels/medical/reports_view_model.dart +++ b/lib/core/viewModels/medical/reports_view_model.dart @@ -69,7 +69,7 @@ class ReportsViewModel extends BaseViewModel { } - insertRequestForMedicalReport(AppointmentHistory appointmentHistory)async{ + insertRequestForMedicalReport(AppointmentHistory appointmentHistory,String mes)async{ setState(ViewState.Busy); await _reportsService.insertRequestForMedicalReport(appointmentHistory); if (_reportsService.hasError) { @@ -77,7 +77,7 @@ class ReportsViewModel extends BaseViewModel { AppToast.showErrorToast(message: error); setState(ViewState.ErrorLocal); } else { - AppToast.showSuccessToast(message: 'The order was send '); + AppToast.showSuccessToast(message: mes); setState(ViewState.Idle); } } diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index f920de9f..75ca62e2 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -82,7 +82,7 @@ class _FindUsPageState extends State //indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Colors.red[800], + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 7aa968a5..308dbeca 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -116,9 +116,9 @@ class _HospitalsPageState extends State { CrossAxisAlignment.center, children: [ IconButton( - // icon: Icon(Icons.location_on,color: Colors.red,), - icon: new Image.asset( - 'assets/images/new-design/navigate.png'), + icon: Icon(Icons.location_on,color: Theme.of(context).primaryColor,size: 35,), + // icon: new Image.asset( + // 'assets/images/new-design/navigate.png'), tooltip: '', onPressed: () { setState(() { @@ -139,9 +139,9 @@ class _HospitalsPageState extends State { }, ), IconButton( - // icon: Icon(Icons.phone,color: Colors.red,), - icon: new Image.asset( - 'assets/images/new-design/call.png'), + icon: Icon(Icons.phone,color: Theme.of(context).primaryColor,size: 35,), + // icon: new Image.asset( + // 'assets/images/new-design/call.png'), tooltip: '', onPressed: () { setState(() { diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart index cab201e3..6cf94728 100644 --- a/lib/pages/ContactUs/findus/pharmacies_page.dart +++ b/lib/pages/ContactUs/findus/pharmacies_page.dart @@ -140,13 +140,7 @@ class _PharmaciesPageState extends State { child: Row( children: [ IconButton( - // icon: Icon( - // Icons - // .location_on, - // color: Colors.red, - // ), - icon: new Image.asset( - 'assets/images/new-design/navigate.png'), + icon: Icon(Icons.location_on,color: Theme.of(context).primaryColor,size: 35,), tooltip: '', onPressed: () { setState(() { @@ -163,21 +157,15 @@ class _PharmaciesPageState extends State { .findusPharmaciesModelList[ index] .locationName); - // _volume += 10; }); }, ), IconButton( - // icon: Icon( - // Icons.phone, - // color: Colors.red, - // ), - icon: new Image.asset( - 'assets/images/new-design/call.png'), + icon: Icon(Icons.phone,color: Theme.of(context).primaryColor,size: 35,), tooltip: 'I', onPressed: () { setState(() { - // _volume += 10; + launch("tel://" + widget .findusPharmaciesModelList[ diff --git a/lib/pages/ContactUs/widgets/card_common_contat.dart b/lib/pages/ContactUs/widgets/card_common_contat.dart index 67580dbf..cfb9108b 100644 --- a/lib/pages/ContactUs/widgets/card_common_contat.dart +++ b/lib/pages/ContactUs/widgets/card_common_contat.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -34,19 +35,16 @@ class CardCommonContact extends StatelessWidget { children: [ Container( margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), - child: Text(this.text, - overflow: TextOverflow.clip, - style: TextStyle( - color: new Color(0xFFc5272d), - letterSpacing: 1.0, - fontSize: 20.0)), + child: Texts(this.text, + // overflow: TextOverflow.clip, + color:Theme.of(context).primaryColor, + fontWeight: FontWeight.w700, + fontSize: 20.0), ), Container( margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), - child: Text(this.subText, - overflow: TextOverflow.clip, - style: TextStyle( - color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), + child: Texts(this.subText, + color: Colors.black, fontSize: 15.0), ), Align( alignment: projectViewModel.isArabic? Alignment.bottomLeft:Alignment.bottomRight, diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index d21e06a5..d81e704e 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -63,27 +63,24 @@ class _InsuranceApprovalState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - Text( + Texts( TranslationBase.of(context).totalApproval, - style: TextStyle( color: Color(0xff60688B), fontSize: 19.0, fontWeight: FontWeight.w600, - ), ), if (model.insuranceApproval.length > 0) Container( width: 60, - height: 35, + height: 40, decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(19.0)), child: Center( - child: Text( + child: Texts( model.insuranceApproval[0].unUsedCount .toString(), - style: TextStyle( - color: Colors.white, fontSize: 19.0), + color: Colors.white, fontSize: 17.0, ), )) ], @@ -138,22 +135,18 @@ class _InsuranceApprovalState extends State { Padding( padding: EdgeInsets.symmetric( vertical: 10.0), - child: Text( + child: Texts( model.insuranceApproval[index] .clinicName, - style: TextStyle( - fontSize: 20.0, - color: Color(0xff60686B), - fontWeight: FontWeight.w600, - ), + fontSize: 20.0, + color: Color(0xff60686B), + fontWeight: FontWeight.w600, ), ), - Text( + Texts( model.insuranceApproval[index] .doctorName, - style: TextStyle( - fontSize: 17.0, - fontStyle: FontStyle.italic), + fontSize: 17.0, ), ], ), @@ -166,45 +159,53 @@ class _InsuranceApprovalState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase.of(context) - .approvalNo + - model.insuranceApproval[index] - .approvalNo - .toString(), - style: TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.w600, - ), + Row( + children: [ + Texts( + TranslationBase.of(context).approvalNo, + fontSize: 18.0, + ), + Texts(model.insuranceApproval[index].approvalNo.toString(), + fontSize: 18.0, + fontWeight: FontWeight.w600,), + ], ), Divider( color: Colors.black, height: 25.0, thickness: 1.0, ), - Text( - TranslationBase.of(context) - .procedureStatus + - model.insuranceApproval[index] - .approvalStatusDescption, - style: TextStyle( + Row( + children: [ + Texts( + TranslationBase.of(context).procedureStatus , + fontSize: 17.5, + ), + SizedBox(width: 12,), + Texts( + model.insuranceApproval[index].approvalStatusDescption, fontWeight: FontWeight.w600, - fontSize: 17.5), + fontSize: 17.5, + ), + ], ), Divider( color: Colors.black, height: 25.0, thickness: 1.0, ), - Text( - TranslationBase.of(context) - .unusedCount + - model.insuranceApproval[index] - .unUsedCount - .toString(), - style: TextStyle( + Row( + children: [ + Texts( + TranslationBase.of(context).unusedCount, + fontSize: 17.5, + ), + Texts( + model.insuranceApproval[index].unUsedCount.toString(), fontSize: 17.5, - fontWeight: FontWeight.w600), + fontWeight: FontWeight.w600, + ), + ], ), Divider( color: Colors.black, @@ -223,13 +224,10 @@ class _InsuranceApprovalState extends State { // fontSize: 17.5, // fontWeight: FontWeight.w600), // ), - Text( - TranslationBase.of(context) - .companyName, - style: TextStyle( + Texts( + TranslationBase.of(context).companyName, fontWeight: FontWeight.w600, fontSize: 17.5, - ), ), Divider( @@ -237,32 +235,42 @@ class _InsuranceApprovalState extends State { height: 25.0, thickness: 1.0, ), - Text( - TranslationBase.of(context) - .receiptOn + - convertDateFormat(model - .insuranceApproval[index] - .rceiptOn), - style: TextStyle( - fontSize: 17.5, - fontWeight: FontWeight.w600, - ), + Row( + children: [ + Texts( + TranslationBase.of(context).receiptOn , + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + Texts( + convertDateFormat(model.insuranceApproval[index].rceiptOn), + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + ], ), Divider( color: Colors.black, height: 25.0, thickness: 1.0, ), - Text( - TranslationBase.of(context) - .expiryDate + - convertDateFormat(model - .insuranceApproval[index] - .expiryDate), - style: TextStyle( - fontSize: 17.5, - fontWeight: FontWeight.w600, - ), + Row( + children: [ + Texts( + TranslationBase.of(context).expiryDate, + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + Texts( + convertDateFormat(model.insuranceApproval[index].expiryDate), + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + ], ), Divider( color: Colors.black, diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index 71c09635..ebd3eada 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -101,6 +101,7 @@ class _InsuranceCardState extends State { TranslationBase.of(context).companyName + model.insurance[index].companyName, fontSize: 20.0, + fontWeight: FontWeight.w700, ), Divider( color: Colors.black, @@ -111,52 +112,58 @@ class _InsuranceCardState extends State { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Text( - TranslationBase.of(context).category + + Texts( + TranslationBase.of(context).category +": "+ model.insurance[index] .subCategoryDesc, - style: TextStyle(fontSize: 18.5), + fontSize: 18.5, ), - Text( - TranslationBase.of(context) - .expirationDate + - convertDateFormat(model - .insurance[index].cardValidTo), - style: TextStyle(fontSize: 18.5), + Row( + children: [ + Texts( + TranslationBase.of(context) + .expirationDate +": "+ + convertDateFormat(model + .insurance[index].cardValidTo), + fontSize: 18.5, + ), + Expanded( + child: Column( + children: [ + model.insurance[index].isActive == true + ? Texts( + TranslationBase.of(context) + .activeInsurence, + color: Colors.green, + fontWeight: FontWeight.w900, + fontSize: 17.9) + : Texts( + TranslationBase.of(context) + .notActive, + color: Colors.red, + fontWeight: FontWeight.w900, + fontSize: 17.9) + ], + ), + ), + ], ), - Text( + Texts( TranslationBase.of(context) - .patientCard + + .patientCard +": "+ model .insurance[index].patientCardID, - style: TextStyle(fontSize: 18.5), + fontSize: 18.5, ), - Text( + Texts( TranslationBase.of(context) - .policyNumber + + .policyNumber +" "+ model.insurance[index] .insurancePolicyNumber, - style: TextStyle(fontSize: 18.5), + fontSize: 18.5, ), ], ), - Column( - children: [ - model.insurance[index].isActive == true - ? Texts( - TranslationBase.of(context) - .activeInsurence, - color: Colors.green, - fontWeight: FontWeight.w900, - fontSize: 17.9) - : Texts( - TranslationBase.of(context) - .notActive, - color: Colors.red, - fontWeight: FontWeight.w900, - fontSize: 17.9) - ], - ), SizedBox( height: 14.5, ), diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 8be58af4..70a3a302 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -102,19 +102,12 @@ class _InsuranceUpdateState extends State controller: _tabController, children: [ Container( - child: model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList != - null + child: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.isNotEmpty ? ListView.builder( itemCount: model.getAllSharedRecordsByStatusResponse .getAllSharedRecordsByStatusList.length, itemBuilder: (BuildContext context, int index) { - return model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .status == - 3 + return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 ? Container( margin: EdgeInsets.all(10.0), child: Card( @@ -213,7 +206,90 @@ class _InsuranceUpdateState extends State ) : Container(); }) - : Container(), + : Container( + height: 80, + margin: EdgeInsets.all(10.0), + child: Column( + children: [ + SizedBox(height: 65,), + Container( + color: Colors.white, + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Texts( + model.user.firstName+" "+model.user.lastName, + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of( + context) + .fileno + + ": " + + model.user.patientID.toString(), + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ) + ], + ), + ), + ), + if (false) + Expanded( + flex: 2, + child: Container( + margin: + EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase + .of(context) + .fetchData, + small: true, + textColor: + Colors.white, + onTap: () { + getDetails( + model); + }, + ), + ), + ], + ), + ), + ) + ], + ), + ), + ], + ), + ), ), Container( child: ListView.builder( diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 729e294a..740de4b8 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -240,19 +240,19 @@ class _Login extends State { request['PatientID'] = int.parse(nationalIDorFile.text); } // request.isRegister = false; - this.authService.checkActivationCode(request, code).then((result) => { - sharedPref.remove(FAMILY_FILE), - result = CheckActivationCode.fromJson(result), - result.list.isFamily = false, - this.sharedPref.setObject(USER_PROFILE, result.list), - this.sharedPref.setObject(MAIN_USER, result.list), - this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - this.sharedPref.setString(TOKEN, result.authenticationTokenID), - authenticatedUserObject.getUser(), - // authenticatedUserObject.user = AuthenticatedUser.fromJson(result.list), - authenticatedUserObject.isLogin = true, - appointmentRateViewModel.isLogin = true, - projectViewModel.isLogin = true, + this.authService.checkActivationCode(request, code).then((result) async{ + sharedPref.remove(FAMILY_FILE); + result = CheckActivationCode.fromJson(result); + result.list.isFamily = false; + this.sharedPref.setObject(USER_PROFILE, result.list); + this.sharedPref.setObject(MAIN_USER, result.list); + this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); + this.sharedPref.setString(TOKEN, result.authenticationTokenID); + await authenticatedUserObject.getUser(getUser: true); + authenticatedUserObject.isLogin = true; + appointmentRateViewModel.isLogin = true; + projectViewModel.isLogin = true; + projectViewModel.user = authenticatedUserObject.user; appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { @@ -280,8 +280,8 @@ class _Login extends State { .catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); - }), - // SMSOTP.showLoadingDialog(context, false), + }); + }); } diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 8866757f..3de1eda0 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -56,7 +56,7 @@ class _HomeReportPageState extends State onModelReady: (model) => model.getReports(), //model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).monthReport, + appBarTitle: TranslationBase.of(context).newMedReport, description: TranslationBase.of(context).infoMonthReport, baseViewModel: model, imagesInfo: imagesInfo, @@ -103,30 +103,29 @@ class _HomeReportPageState extends State unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.22, + width: MediaQuery.of(context).size.width * 0.15, child: Center( - child: - Texts(TranslationBase.of(context).requested), + child: Texts(TranslationBase.of(context).requested,fontSize: 12,), ), ), Container( - width: MediaQuery.of(context).size.width * 0.22, + width: MediaQuery.of(context).size.width * 0.15, child: Center( - child: Texts(TranslationBase.of(context).ready), + child: Texts(TranslationBase.of(context).ready,fontSize: 12,), ), ), Container( - width: MediaQuery.of(context).size.width * 0.22, + width: MediaQuery.of(context).size.width * 0.15, child: Center( child: - Texts(TranslationBase.of(context).completed), + Texts(TranslationBase.of(context).completed,fontSize: 11,), ), ), Container( - width: MediaQuery.of(context).size.width * 0.22, + width: MediaQuery.of(context).size.width * 0.15, child: Center( child: - Texts(TranslationBase.of(context).cancelled), + Texts(TranslationBase.of(context).cancelled,fontSize: 12,), ), ), ], diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index 5b64bc4e..8d45750e 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -1,34 +1,36 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class MedicalReports extends StatelessWidget { @override Widget build(BuildContext context) { - void confirmBox( - AppointmentHistory model, ReportsViewModel reportsViewModel) { + void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) { showDialog( context: context, child: ConfirmDialog( appointmentHistory: model, - onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model), + onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model,TranslationBase.of(context).successSendReport), ), ); } - + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPatentAppointmentHistory(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: 'Medical Reports', + appBarTitle: TranslationBase.of(context).medReport, body: ListView.builder( itemCount: model.appointHistoryList.length, itemBuilder: (context, index) => Padding( @@ -69,8 +71,7 @@ class MedicalReports extends StatelessWidget { ), Texts(model.appointHistoryList[index].projectName), Texts(model.appointHistoryList[index].clinicName), - Texts(DateUtil.getMonthDayYearDateFormatted( - model.appointHistoryList[index].appointmentDate)), + Texts(projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.appointHistoryList[index].appointmentDate):DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)), StarRating( totalAverage: model .appointHistoryList[index].actualDoctorRate @@ -89,7 +90,7 @@ class MedicalReports extends StatelessWidget { onTap: () => confirmBox(model.appointHistoryList[index], model), child: Container( - width: 80, + width: 85, height: 50, decoration: BoxDecoration( color: Colors.black54, @@ -102,7 +103,7 @@ class MedicalReports extends StatelessWidget { ), child: Center( child: Texts( - 'Request', + TranslationBase.of(context).requestReport, fontSize: 12, color: Colors.white, ), @@ -137,13 +138,13 @@ class _ConfirmDialogState extends State { @override Widget build(BuildContext context) { return SimpleDialog( - title: Text('Confirm'), + title: Texts(TranslationBase.of(context).confirm), children: [ Container( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Texts('Request a medical report'), + Texts(TranslationBase.of(context).confirmMsgReport), SizedBox( height: 5.0, ), @@ -166,7 +167,7 @@ class _ConfirmDialogState extends State { child: Container( child: Center( child: Texts( - 'cancel', + TranslationBase.of(context).cancel, color: Colors.red, ), ), @@ -190,7 +191,7 @@ class _ConfirmDialogState extends State { padding: const EdgeInsets.all(8.0), child: Center( child: Texts( - 'ok', + TranslationBase.of(context).ok, fontWeight: FontWeight.w400, ), ), diff --git a/lib/pages/medical/vital_sign/LineChartCurved.dart b/lib/pages/medical/vital_sign/LineChartCurved.dart index f4c25a08..8bf43053 100644 --- a/lib/pages/medical/vital_sign/LineChartCurved.dart +++ b/lib/pages/medical/vital_sign/LineChartCurved.dart @@ -10,10 +10,12 @@ class LineChartCurved extends StatelessWidget { LineChartCurved({this.title, this.timeSeries, this.indexes}); List xAxixs = List(); + List yAxixs = List(); @override Widget build(BuildContext context) { getXaxix(); + getYaxix(); return AspectRatio( aspectRatio: 1.1, child: Container( @@ -66,6 +68,15 @@ class LineChartCurved extends StatelessWidget { } } } + getYaxix() { + int indexess= (timeSeries.length*0.30).toInt(); + for (int index = 0; index < timeSeries.length; index++) { + int mIndex = indexess * index; + if (mIndex < timeSeries.length) { + yAxixs.add(timeSeries[mIndex].sales); + } + } + } LineChartData sampleData1(context) { return LineChartData( @@ -86,22 +97,22 @@ class LineChartCurved extends StatelessWidget { color: Colors.black, fontSize: 10, ), + rotateAngle:-65, //rotateAngle:-65, - //rotateAngle:-65, - margin: 14, + margin: 22, getTitles: (value) { - if (timeSeries.length < 8) { + if (timeSeries.length < 15) { if (timeSeries.length > value.toInt()) { - return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.year}'; + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; } else return ''; } else { if (value.toInt() == 0) - return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.year}'; + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; if (value.toInt() == timeSeries.length - 1) - return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.year}'; + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; if (xAxixs.contains(value.toInt())) { - return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.year}'; + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; } } return ''; @@ -112,9 +123,21 @@ class LineChartCurved extends StatelessWidget { getTextStyles: (value) => const TextStyle( color: Colors.black, fontWeight: FontWeight.bold, - fontSize: 11, + fontSize: 10, ), getTitles: (value) { + // if (timeSeries.length < 10) { + // return '${value.toInt()}'; + // } else { + // if (value == getMinY()) + // return '${value.toInt()}'; + // if (value == getMaxY()) + // return '${value.toInt()}'; + // if (yAxixs.contains(value)) { + // return '${value.toInt()}'; + // } + // return ''; + // } return '${value.toInt()}'; }, margin: 12, @@ -140,7 +163,7 @@ class LineChartCurved extends StatelessWidget { ), minX: 0, maxX: (timeSeries.length - 1).toDouble(), - maxY: getMaxY(), + maxY: getMaxY()+0.3, minY: getMinY(), lineBarsData: getData(context), ); @@ -153,7 +176,7 @@ class LineChartCurved extends StatelessWidget { if (resultValueDouble > max) max = resultValueDouble; }); - return max.roundToDouble() + 10; + return max.roundToDouble() ; } double getMinY() { diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart index a48970eb..d6d70cb3 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart @@ -32,7 +32,7 @@ class VitalSingChartAndDetials extends StatelessWidget { children: [ AppExpandableNotifier( isExpand: true, - headerWidget: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/3.5,), + headerWidget: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/5.5,), bodyWidget: VitalSignDetailsWidget( vitalList: vitalList, title1: title1, diff --git a/lib/uitl/app_toast.dart b/lib/uitl/app_toast.dart index 8e45e3ce..5c917009 100644 --- a/lib/uitl/app_toast.dart +++ b/lib/uitl/app_toast.dart @@ -64,7 +64,7 @@ class AppToast { FlutterFlexibleToast.showToast( message: message, toastLength: toastLength, - timeInSeconds: timeInSeconds, + timeInSeconds: timeInSeconds=2, fontSize: fontSize, toastGravity: toastGravity, backgroundColor: Colors.green, @@ -87,7 +87,7 @@ class AppToast { static void showErrorToast({ @required String message, Toast toastLength = Toast.LENGTH_LONG, - int timeInSeconds, + int timeInSeconds=2, double fontSize = 16, ToastGravity toastGravity = ToastGravity.TOP, Color textColor = Colors.white, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 8c942d8b..605a865e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1028,6 +1028,11 @@ class TranslationBase { String get selectFileSouse => localizedValues['selectFileSouse'][locale.languageCode]; String get gallery => localizedValues['gallery'][locale.languageCode]; String get camera => localizedValues['camera'][locale.languageCode]; + String get medReport => localizedValues['med-report'][locale.languageCode]; + String get newMedReport => localizedValues['new-med-report'][locale.languageCode]; + String get requestReport => localizedValues['requestReport'][locale.languageCode]; + String get confirmMsgReport => localizedValues['confirm-msg-report'][locale.languageCode]; + String get successSendReport => localizedValues['successSendReport'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/buttons/button.dart b/lib/widgets/buttons/button.dart index 457a1d42..677d145d 100644 --- a/lib/widgets/buttons/button.dart +++ b/lib/widgets/buttons/button.dart @@ -1,7 +1,9 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; /// Button widget /// [label] button label @@ -80,6 +82,7 @@ class _ButtonState extends State