diff --git a/lib/core/service/parmacyModule/order-preview-service.dart b/lib/core/service/parmacyModule/order-preview-service.dart index b9368180..17dfaf99 100644 --- a/lib/core/service/parmacyModule/order-preview-service.dart +++ b/lib/core/service/parmacyModule/order-preview-service.dart @@ -176,7 +176,7 @@ class OrderPreviewService extends BaseService { } } - Future makeOrder(PaymentCheckoutData paymentCheckoutData, List shoppingCarts) async { + Future makeOrder(PaymentCheckoutData paymentCheckoutData, List shoppingCarts, bool isLakumEnabled) async { paymentCheckoutData.address.isChecked = true; hasError = false; super.error = ""; @@ -201,7 +201,7 @@ class OrderPreviewService extends BaseService { orderBody['custom_values_xml'] = "PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}"; orderBody['shippingOption'] = paymentCheckoutData.shippingOption; orderBody['shipping_address'] = paymentCheckoutData.address; - // orderBody['lakum_amount'] = paymentCheckoutData.usedLakumPoints; + orderBody['lakum_amount'] = isLakumEnabled ? paymentCheckoutData.usedLakumPoints : 0; List> itemsList = List(); shoppingCarts.forEach((item) { diff --git a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart index 12623290..eb074e59 100644 --- a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart @@ -209,11 +209,11 @@ class OrderPreviewViewModel extends BaseViewModel { }); } - Future makeOrder() async { + Future makeOrder(bool isLakumEnabled) async { setState(ViewState.Busy); await pharmacyModuleViewModel.generatePharmacyToken(); - await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts); + await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts, isLakumEnabled); if (_orderService.hasError) { error = _orderService.error; setState(ViewState.ErrorLocal); diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 75b9a473..8fa20eaa 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -1,6 +1,7 @@ +import 'dart:math' as math; + import 'package:auto_size_text/auto_size_text.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/service/packages_offers/PackagesOffersServices.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; @@ -9,24 +10,19 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/models/gradient_color.dart'; import 'package:diplomaticquarterapp/models/hmg_services.dart'; import 'package:diplomaticquarterapp/models/slider_data.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart'; -import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart'; import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesPage.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/pages/conference/web_rtc/call_home_page.dart'; -import 'dart:math' as math; class HomePageFragment2 extends StatefulWidget { DashboardViewModel model; @@ -284,150 +280,166 @@ class _HomePageFragment2State extends State { child: InkWell( onTap: () { AuthenticatedUser user = projectViewModel.user; - Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage(user))); + if (projectViewModel.havePrivilege(82)) Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage(user))); }, - child: Container( - width: double.infinity, - height: double.infinity, - clipBehavior: Clip.antiAlias, - decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor), - child: Stack( - children: [ - Container( - width: double.infinity, - height: double.infinity, - // color: Color(0xFF2B353E), - decoration: containerRadius(Color(0xFF2B353E), 20), - ), - Container( - width: double.infinity, - height: double.infinity, - clipBehavior: Clip.antiAlias, - decoration: projectViewModel.isArabic - ? containerBottomRightRadiusWithGradientForAr(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor) - : containerBottomRightRadiusWithGradient(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor), - child: Stack( - children: [ - SvgPicture.asset( - "assets/images/new/strips.svg", - width: double.infinity, - height: double.infinity, - fit: BoxFit.cover, - ), - ], - ), - ), - projectViewModel.isArabic - ? Positioned( - left: 20, - top: 12, - child: Opacity( - opacity: 0.04, - child: SvgPicture.asset( - "assets/images/new/logo.svg", - height: MediaQuery.of(context).size.width * 0.14, - ), - ), - ) - : Positioned( - right: 20, - top: 12, - child: Opacity( - opacity: 0.04, - child: SvgPicture.asset( - "assets/images/new/logo.svg", - height: MediaQuery.of(context).size.width * 0.14, + child: Stack( + children: [ + Container( + width: double.infinity, + height: double.infinity, + clipBehavior: Clip.antiAlias, + decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor), + child: Stack( + children: [ + Container( + width: double.infinity, + height: double.infinity, + // color: Color(0xFF2B353E), + decoration: containerRadius(Color(0xFF2B353E), 20), + ), + Container( + width: double.infinity, + height: double.infinity, + clipBehavior: Clip.antiAlias, + decoration: projectViewModel.isArabic + ? containerBottomRightRadiusWithGradientForAr(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor) + : containerBottomRightRadiusWithGradient(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor), + child: Stack( + children: [ + SvgPicture.asset( + "assets/images/new/strips.svg", + width: double.infinity, + height: double.infinity, + fit: BoxFit.cover, ), - ), + ], ), - projectViewModel.isArabic - ? Positioned( - right: -16, - top: 2, - child: Transform.rotate( - angle: math.pi / 4, - child: Container( - padding: EdgeInsets.only(left: 18, right: 18, top: 6, bottom: 3), - color: CustomColors.accentColor, - child: Text( - TranslationBase.of(context).newDes, - style: TextStyle( - color: Colors.white, - fontSize: 9, - height: 0.8, - letterSpacing: -0.27, + ), + projectViewModel.isArabic + ? Positioned( + left: 20, + top: 12, + child: Opacity( + opacity: 0.04, + child: SvgPicture.asset( + "assets/images/new/logo.svg", + height: MediaQuery.of(context).size.width * 0.14, + ), + ), + ) + : Positioned( + right: 20, + top: 12, + child: Opacity( + opacity: 0.04, + child: SvgPicture.asset( + "assets/images/new/logo.svg", + height: MediaQuery.of(context).size.width * 0.14, ), ), ), - ), - ) - : Positioned( - left: -16, - top: 2, - child: Transform.rotate( - angle: -math.pi / 4, - child: Container( - padding: EdgeInsets.only(left: 18, right: 18, top: 6, bottom: 3), - color: CustomColors.accentColor, - child: Text( - TranslationBase.of(context).newDes, - style: TextStyle( - color: Colors.white, - fontSize: 9, - letterSpacing: -0.27, - height: 1.2, + projectViewModel.isArabic + ? Positioned( + right: -16, + top: 2, + child: Transform.rotate( + angle: math.pi / 4, + child: Container( + padding: EdgeInsets.only(left: 18, right: 18, top: 6, bottom: 3), + color: CustomColors.accentColor, + child: Text( + TranslationBase.of(context).newDes, + style: TextStyle( + color: Colors.white, + fontSize: 9, + height: 0.8, + letterSpacing: -0.27, + ), + ), + ), + ), + ) + : Positioned( + left: -16, + top: 2, + child: Transform.rotate( + angle: -math.pi / 4, + child: Container( + padding: EdgeInsets.only(left: 18, right: 18, top: 6, bottom: 3), + color: CustomColors.accentColor, + child: Text( + TranslationBase.of(context).newDes, + style: TextStyle( + color: Colors.white, + fontSize: 9, + letterSpacing: -0.27, + height: 1.2, + ), + ), ), ), ), - ), - ), - Container( - width: double.infinity, - height: double.infinity, - padding: EdgeInsets.only(left: projectViewModel.isArabic ? 20 : 25, right: projectViewModel.isArabic ? 25 : 20), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - mFlex(3), - AutoSizeText( - TranslationBase.of(context).offersdiscount, - maxLines: 1, - style: TextStyle( - color: Colors.black, - fontSize: 14, - fontWeight: FontWeight.bold, - letterSpacing: -0.75, - height: 1, - ), - ), - projectViewModel.isArabic ? mHeight(4) : Container(), - Text( - TranslationBase.of(context).explore, - style: TextStyle( - color: Colors.black, - fontSize: 9, - fontWeight: FontWeight.w600, - letterSpacing: -0.27, - height: projectViewModel.isArabic ? 0.8 : 1, - ), - ), - mFlex(1), - Row( + Container( + width: double.infinity, + height: double.infinity, + padding: EdgeInsets.only(left: projectViewModel.isArabic ? 20 : 25, right: projectViewModel.isArabic ? 25 : 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, children: [ - showFloating("assets/images/new/ear.svg"), - mWidth(4), - showFloating("assets/images/new/head.svg"), - mWidth(4), - showFloating("assets/images/new/tooth.svg"), + mFlex(3), + AutoSizeText( + TranslationBase.of(context).offersdiscount, + maxLines: 1, + style: TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.bold, + letterSpacing: -0.75, + height: 1, + ), + ), + projectViewModel.isArabic ? mHeight(4) : Container(), + Text( + TranslationBase.of(context).explore, + style: TextStyle( + color: Colors.black, + fontSize: 9, + fontWeight: FontWeight.w600, + letterSpacing: -0.27, + height: projectViewModel.isArabic ? 0.8 : 1, + ), + ), + mFlex(1), + Row( + children: [ + showFloating("assets/images/new/ear.svg"), + mWidth(4), + showFloating("assets/images/new/head.svg"), + mWidth(4), + showFloating("assets/images/new/tooth.svg"), + ], + ), + mFlex(2) ], ), - mFlex(2) - ], - ), + ), + ], ), - ], - ), + ), + projectViewModel.havePrivilege(82) + ? Container() + : Container( + width: double.infinity, + height: double.infinity, + clipBehavior: Clip.antiAlias, + decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor.withOpacity(0.7), darkColor: CustomColors.lightGreyColor.withOpacity(0.7)), + child: Icon( + Icons.lock_outline, + size: 40, + ), + ) + ], ), ), ); diff --git a/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart b/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart index dc8dc0d7..48dbcbad 100644 --- a/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart +++ b/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart @@ -2,6 +2,7 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_address_widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_payment_option_widget.dart'; @@ -14,17 +15,12 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'lakum_widget.dart'; - class OrderPreviewPage extends StatefulWidget { final List addresses; final OrderPreviewViewModel model; - - OrderPreviewPage({this.addresses, this.model}); - @override _OrderPreviewPageState createState() => _OrderPreviewPageState(); } @@ -34,9 +30,6 @@ class _OrderPreviewPageState extends State { bool isLoading = true; bool isChecked = false; - - - @override void initState() { super.initState(); @@ -50,12 +43,11 @@ class _OrderPreviewPageState extends State { }); } - @override Widget build(BuildContext context) { final mediaQuery = MediaQuery.of(context); final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; - // OrderPreviewViewModel widget.model = Provider.of(context); + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: "${TranslationBase.of(context).checkOut}", isShowAppBar: true, @@ -73,108 +65,108 @@ class _OrderPreviewPageState extends State { color: Color(0xFFF1F1F1), child: Column( children: [ - SelectAddressWidget(widget.model, widget.addresses, changeMainState, isUpdating: true,), + SelectAddressWidget( + widget.model, + widget.addresses, + changeMainState, + isUpdating: true, + ), SizedBox( height: 10, ), - SelectPaymentOptionWidget(widget.model, changeMainState,isUpdating: true,), + SelectPaymentOptionWidget( + widget.model, + changeMainState, + isUpdating: true, + ), SizedBox( height: 10, ), widget.model.paymentCheckoutData.lacumInformation != null - ? AbsorbPointer( - absorbing: true, - child: Stack( + ? Stack( children: [ Container( - child: Column( - children: [ - // LakumWidget(widget.model), - Container( - color: Colors.white, - padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), - child: Row( - children: [ - Row( - children: [ - SizedBox( - height: 24.0, - width: 24.0, - child: Checkbox( - activeColor: CustomColors.green, - value: isChecked, - onChanged: (bool value) { - setState(() { - isChecked = value; - print(isChecked); - if (value){ - // isChecked; + child: Column( + children: [ + Container( + color: Colors.white, + padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), + child: Row( + children: [ + Row( + children: [ + SizedBox( + height: 24.0, + width: 24.0, + child: Checkbox( + activeColor: CustomColors.green, + value: isChecked, + onChanged: (bool value) { + setState(() { + isChecked = value; + if (value) { PaymentBottomWidget.isChecked = true; - print(value); - }else{ + } else { PaymentBottomWidget.isChecked = false; } - setState(() { - }); - }); - }, - ), + setState(() {}); + }); + }, ), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Text( - TranslationBase.of(context).useLakumPoints + - " (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})", - style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), - ), - ], - ), - Expanded( - child: Container( - decoration: BoxDecoration(color: Color(0x99ffffff)), - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - decoration: BoxDecoration(color: Color(0x99ffffff)), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "${TranslationBase.of(context).availableBalance}", - fontSize: 12, - fontWeight: FontWeight.bold, - ), - Text( - "${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}", - style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56) - ), - ], - ), + ), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Text( + TranslationBase.of(context).useLakumPoints + + " (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})", + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), + ), + ], + ), + Expanded( + child: Container( + decoration: BoxDecoration(color: Color(0x99ffffff)), + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + decoration: BoxDecoration(color: Color(0x99ffffff)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "${TranslationBase.of(context).availableBalance}", + fontSize: 12, + fontWeight: FontWeight.bold, + ), + Text( + "${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}", + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), + ], ), - ], - ), - + ), + ], ), ), - - ], - ), - ), - SizedBox( - height: 10, + ), + ], ), - ], - ), + ), + SizedBox( + height: 10, + ), + ], ), - Container( - height: MediaQuery.of(context).size.height * .10, - color: Colors.white.withOpacity(0.6), - ) + ), + projectViewModel.havePrivilege(83) + ? Container() + : Container( + height: MediaQuery.of(context).size.height * .10, + color: Colors.white.withOpacity(0.6), + ) ], - ), - ) + ) : Container(), Container( color: Colors.white, @@ -284,65 +276,70 @@ class _OrderPreviewPageState extends State { indent: 0, endIndent: 0, ), - isChecked ? - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - "${TranslationBase.of(context).lakum}", - fontSize: 14, - color: Colors.green, - fontWeight: FontWeight.w500, - ), - Texts( - "- ${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", - fontSize: 14, - color: Colors.green, - fontWeight: FontWeight.w500, - ), - ], - ) : Container(), - isChecked ? const Divider( - color: Color(0xFFD6D6D6), - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ): Container(), - isChecked ? Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - TranslationBase.of(context).total, - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Texts( - " ${TranslationBase.of(context).sar}""${(widget.model.cartResponse.totalAmount - widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ], - ) - : Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - TranslationBase.of(context).total, - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Texts( - " ${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ], - ), + isChecked + ? Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + "${TranslationBase.of(context).lakum}", + fontSize: 14, + color: Colors.green, + fontWeight: FontWeight.w500, + ), + Texts( + "- ${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", + fontSize: 14, + color: Colors.green, + fontWeight: FontWeight.w500, + ), + ], + ) + : Container(), + isChecked + ? const Divider( + color: Color(0xFFD6D6D6), + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ) + : Container(), + isChecked + ? Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).total, + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Texts( + " ${TranslationBase.of(context).sar}" + "${(widget.model.cartResponse.totalAmount - widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ], + ) + : Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).total, + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Texts( + " ${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}", + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ], + ), SizedBox( height: 10, ), @@ -364,12 +361,9 @@ class _OrderPreviewPageState extends State { child: PaymentBottomWidget(widget.model), ), ); - } changeMainState() { setState(() {}); } - - } diff --git a/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart b/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart index 00595711..61248543 100644 --- a/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart +++ b/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.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/Authentication/authenticated_user.dart'; @@ -25,7 +26,7 @@ class PaymentBottomWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final scaffold = Scaffold.of(context); + ProjectViewModel projectViewModel = Provider.of(context); this.context = context; OrderPreviewViewModel orderPreviewViewModel = Provider.of(context); return Container( @@ -88,7 +89,7 @@ class PaymentBottomWidget extends StatelessWidget { onPressed: (orderPreviewViewModel.paymentCheckoutData.address != null && orderPreviewViewModel.paymentCheckoutData.paymentOption != null) ? () async { GifLoaderDialogUtils.showMyDialog(context); - await model.makeOrder(); + await model.makeOrder(projectViewModel.havePrivilege(83)); if (model.state == ViewState.Idle) { AppToast.showSuccessToast(message: TranslationBase.of(context).compeleteOrderMsg); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index f396a2f4..427b16e1 100644 --- a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -183,7 +183,7 @@ class LabResultWidget extends StatelessWidget { children: [ Padding( padding: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 12, right: projectViewModel.isArabic ? 12 : 0), - child: Utils.tableColumnValue(labResultList[i].description, isLast: true), + child: Utils.tableColumnValue(labResultList[i].description ?? "", isLast: true), ), Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: true), Utils.tableColumnValue(labResultList[i].referanceRange, isLast: true, isCapitable: false), diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 9e363e4d..82af9e49 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -28,12 +28,11 @@ var _InAppBrowserOptions = InAppBrowserClassOptions( class MyInAppBrowser extends InAppBrowser { _PAYMENT_TYPE paymentType; - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - //static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store @@ -77,7 +76,7 @@ class MyInAppBrowser extends InAppBrowser { @override Future onLoadStart(Uri url) async { - if (onLoadStartCallback != null) onLoadStartCallback(url); + if (onLoadStartCallback != null) onLoadStartCallback(url.toString()); } @override