Merge branch 'haroon_development_2.5' into 'development_v2.5'

Haroon development 2.5

See merge request Cloud_Solution/diplomatic-quarter!572
merge-requests/573/merge
haroon amjad 4 years ago
commit d624136eab

@ -176,7 +176,7 @@ class OrderPreviewService extends BaseService {
} }
} }
Future makeOrder(PaymentCheckoutData paymentCheckoutData, List<ShoppingCart> shoppingCarts) async { Future makeOrder(PaymentCheckoutData paymentCheckoutData, List<ShoppingCart> shoppingCarts, bool isLakumEnabled) async {
paymentCheckoutData.address.isChecked = true; paymentCheckoutData.address.isChecked = true;
hasError = false; hasError = false;
super.error = ""; super.error = "";
@ -201,7 +201,7 @@ class OrderPreviewService extends BaseService {
orderBody['custom_values_xml'] = "PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}"; orderBody['custom_values_xml'] = "PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}";
orderBody['shippingOption'] = paymentCheckoutData.shippingOption; orderBody['shippingOption'] = paymentCheckoutData.shippingOption;
orderBody['shipping_address'] = paymentCheckoutData.address; orderBody['shipping_address'] = paymentCheckoutData.address;
// orderBody['lakum_amount'] = paymentCheckoutData.usedLakumPoints; orderBody['lakum_amount'] = isLakumEnabled ? paymentCheckoutData.usedLakumPoints : 0;
List<Map<String, dynamic>> itemsList = List(); List<Map<String, dynamic>> itemsList = List();
shoppingCarts.forEach((item) { shoppingCarts.forEach((item) {

@ -209,11 +209,11 @@ class OrderPreviewViewModel extends BaseViewModel {
}); });
} }
Future makeOrder() async { Future makeOrder(bool isLakumEnabled) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await pharmacyModuleViewModel.generatePharmacyToken(); await pharmacyModuleViewModel.generatePharmacyToken();
await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts); await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts, isLakumEnabled);
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -1,6 +1,7 @@
import 'dart:math' as math;
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/size_config.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/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.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/gradient_color.dart';
import 'package:diplomaticquarterapp/models/hmg_services.dart'; import 'package:diplomaticquarterapp/models/hmg_services.dart';
import 'package:diplomaticquarterapp/models/slider_data.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/AlHabibMedicalService/all_habib_medical_service_page2.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.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/services_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/slider_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/pages/packages_offers/OfferAndPackagesPage.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.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 { class HomePageFragment2 extends StatefulWidget {
DashboardViewModel model; DashboardViewModel model;
@ -284,150 +280,166 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
AuthenticatedUser user = projectViewModel.user; 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( child: Stack(
width: double.infinity, children: [
height: double.infinity, Container(
clipBehavior: Clip.antiAlias, width: double.infinity,
decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor), height: double.infinity,
child: Stack( clipBehavior: Clip.antiAlias,
children: [ decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor),
Container( child: Stack(
width: double.infinity, children: [
height: double.infinity, Container(
// color: Color(0xFF2B353E), width: double.infinity,
decoration: containerRadius(Color(0xFF2B353E), 20), height: double.infinity,
), // color: Color(0xFF2B353E),
Container( decoration: containerRadius(Color(0xFF2B353E), 20),
width: double.infinity, ),
height: double.infinity, Container(
clipBehavior: Clip.antiAlias, width: double.infinity,
decoration: projectViewModel.isArabic height: double.infinity,
? containerBottomRightRadiusWithGradientForAr(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor) clipBehavior: Clip.antiAlias,
: containerBottomRightRadiusWithGradient(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor), decoration: projectViewModel.isArabic
child: Stack( ? containerBottomRightRadiusWithGradientForAr(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor)
children: [ : containerBottomRightRadiusWithGradient(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor),
SvgPicture.asset( child: Stack(
"assets/images/new/strips.svg", children: [
width: double.infinity, SvgPicture.asset(
height: double.infinity, "assets/images/new/strips.svg",
fit: BoxFit.cover, 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,
), ),
), ],
), ),
projectViewModel.isArabic ),
? Positioned( projectViewModel.isArabic
right: -16, ? Positioned(
top: 2, left: 20,
child: Transform.rotate( top: 12,
angle: math.pi / 4, child: Opacity(
child: Container( opacity: 0.04,
padding: EdgeInsets.only(left: 18, right: 18, top: 6, bottom: 3), child: SvgPicture.asset(
color: CustomColors.accentColor, "assets/images/new/logo.svg",
child: Text( height: MediaQuery.of(context).size.width * 0.14,
TranslationBase.of(context).newDes, ),
style: TextStyle( ),
color: Colors.white, )
fontSize: 9, : Positioned(
height: 0.8, right: 20,
letterSpacing: -0.27, top: 12,
child: Opacity(
opacity: 0.04,
child: SvgPicture.asset(
"assets/images/new/logo.svg",
height: MediaQuery.of(context).size.width * 0.14,
), ),
), ),
), ),
), projectViewModel.isArabic
) ? Positioned(
: Positioned( right: -16,
left: -16, top: 2,
top: 2, child: Transform.rotate(
child: Transform.rotate( angle: math.pi / 4,
angle: -math.pi / 4, child: Container(
child: Container( padding: EdgeInsets.only(left: 18, right: 18, top: 6, bottom: 3),
padding: EdgeInsets.only(left: 18, right: 18, top: 6, bottom: 3), color: CustomColors.accentColor,
color: CustomColors.accentColor, child: Text(
child: Text( TranslationBase.of(context).newDes,
TranslationBase.of(context).newDes, style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontSize: 9,
fontSize: 9, height: 0.8,
letterSpacing: -0.27, letterSpacing: -0.27,
height: 1.2, ),
),
),
),
)
: 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,
Container( height: double.infinity,
width: double.infinity, padding: EdgeInsets.only(left: projectViewModel.isArabic ? 20 : 25, right: projectViewModel.isArabic ? 25 : 20),
height: double.infinity, child: Column(
padding: EdgeInsets.only(left: projectViewModel.isArabic ? 20 : 25, right: projectViewModel.isArabic ? 25 : 20), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( mainAxisAlignment: MainAxisAlignment.center,
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(
children: [ children: [
showFloating("assets/images/new/ear.svg"), mFlex(3),
mWidth(4), AutoSizeText(
showFloating("assets/images/new/head.svg"), TranslationBase.of(context).offersdiscount,
mWidth(4), maxLines: 1,
showFloating("assets/images/new/tooth.svg"), 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,
),
)
],
), ),
), ),
); );

@ -2,6 +2,7 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.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/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_address_widget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_payment_option_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:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'lakum_widget.dart';
class OrderPreviewPage extends StatefulWidget { class OrderPreviewPage extends StatefulWidget {
final List<Addresses> addresses; final List<Addresses> addresses;
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
OrderPreviewPage({this.addresses, this.model}); OrderPreviewPage({this.addresses, this.model});
@override @override
_OrderPreviewPageState createState() => _OrderPreviewPageState(); _OrderPreviewPageState createState() => _OrderPreviewPageState();
} }
@ -34,9 +30,6 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
bool isLoading = true; bool isLoading = true;
bool isChecked = false; bool isChecked = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -50,12 +43,11 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
}); });
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
// OrderPreviewViewModel widget.model = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: "${TranslationBase.of(context).checkOut}", appBarTitle: "${TranslationBase.of(context).checkOut}",
isShowAppBar: true, isShowAppBar: true,
@ -73,108 +65,108 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
color: Color(0xFFF1F1F1), color: Color(0xFFF1F1F1),
child: Column( child: Column(
children: [ children: [
SelectAddressWidget(widget.model, widget.addresses, changeMainState, isUpdating: true,), SelectAddressWidget(
widget.model,
widget.addresses,
changeMainState,
isUpdating: true,
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
SelectPaymentOptionWidget(widget.model, changeMainState,isUpdating: true,), SelectPaymentOptionWidget(
widget.model,
changeMainState,
isUpdating: true,
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
widget.model.paymentCheckoutData.lacumInformation != null widget.model.paymentCheckoutData.lacumInformation != null
? AbsorbPointer( ? Stack(
absorbing: true,
child: Stack(
children: [ children: [
Container( Container(
child: Column( child: Column(
children: [ children: [
// LakumWidget(widget.model), Container(
Container( color: Colors.white,
color: Colors.white, padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), child: Row(
child: Row( children: [
children: [ Row(
Row( children: [
children: [ SizedBox(
SizedBox( height: 24.0,
height: 24.0, width: 24.0,
width: 24.0, child: Checkbox(
child: Checkbox( activeColor: CustomColors.green,
activeColor: CustomColors.green, value: isChecked,
value: isChecked, onChanged: (bool value) {
onChanged: (bool value) { setState(() {
setState(() { isChecked = value;
isChecked = value; if (value) {
print(isChecked);
if (value){
// isChecked;
PaymentBottomWidget.isChecked = true; PaymentBottomWidget.isChecked = true;
print(value); } else {
}else{
PaymentBottomWidget.isChecked = false; PaymentBottomWidget.isChecked = false;
} }
setState(() { setState(() {});
}); });
}); },
},
),
), ),
Padding( ),
padding: const EdgeInsets.only(left: 8.0, right: 8.0), Padding(
child: Text( padding: const EdgeInsets.only(left: 8.0, right: 8.0),
TranslationBase.of(context).useLakumPoints + child: Text(
" (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})", TranslationBase.of(context).useLakumPoints +
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), " (${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( Expanded(
decoration: BoxDecoration(color: Color(0x99ffffff)), child: Container(
padding: const EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration(color: Color(0x99ffffff)),
child: Row( padding: const EdgeInsets.symmetric(horizontal: 8),
mainAxisAlignment: MainAxisAlignment.end, child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.end,
Container( children: [
decoration: BoxDecoration(color: Color(0x99ffffff)), Container(
child: Column( decoration: BoxDecoration(color: Color(0x99ffffff)),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Texts( children: [
"${TranslationBase.of(context).availableBalance}", Texts(
fontSize: 12, "${TranslationBase.of(context).availableBalance}",
fontWeight: FontWeight.bold, fontSize: 12,
), fontWeight: FontWeight.bold,
Text( ),
"${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}", Text(
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56) "${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, projectViewModel.havePrivilege(83)
color: Colors.white.withOpacity(0.6), ? Container()
) : Container(
height: MediaQuery.of(context).size.height * .10,
color: Colors.white.withOpacity(0.6),
)
], ],
), )
)
: Container(), : Container(),
Container( Container(
color: Colors.white, color: Colors.white,
@ -284,65 +276,70 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
indent: 0, indent: 0,
endIndent: 0, endIndent: 0,
), ),
isChecked ? isChecked
Row( ? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts( Texts(
"${TranslationBase.of(context).lakum}", "${TranslationBase.of(context).lakum}",
fontSize: 14, fontSize: 14,
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
Texts( Texts(
"- ${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", "- ${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
], ],
) : Container(), )
isChecked ? const Divider( : Container(),
color: Color(0xFFD6D6D6), isChecked
height: 20, ? const Divider(
thickness: 1, color: Color(0xFFD6D6D6),
indent: 0, height: 20,
endIndent: 0, thickness: 1,
): Container(), indent: 0,
isChecked ? Row( endIndent: 0,
mainAxisAlignment: MainAxisAlignment.spaceBetween, )
children: [ : Container(),
Texts( isChecked
TranslationBase.of(context).total, ? Row(
fontSize: 14, mainAxisAlignment: MainAxisAlignment.spaceBetween,
color: Colors.black, children: [
fontWeight: FontWeight.bold, Texts(
), TranslationBase.of(context).total,
Texts( fontSize: 14,
" ${TranslationBase.of(context).sar}""${(widget.model.cartResponse.totalAmount - widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", color: Colors.black,
fontSize: 14, fontWeight: FontWeight.bold,
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,
: Row( color: Colors.black,
mainAxisAlignment: MainAxisAlignment.spaceBetween, fontWeight: FontWeight.bold,
children: [ ),
Texts( ],
TranslationBase.of(context).total, )
fontSize: 14, : Row(
color: Colors.black, mainAxisAlignment: MainAxisAlignment.spaceBetween,
fontWeight: FontWeight.bold, children: [
), Texts(
Texts( TranslationBase.of(context).total,
" ${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}", fontSize: 14,
fontSize: 14, color: Colors.black,
color: Colors.black, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, ),
), Texts(
], " ${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}",
), fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -364,12 +361,9 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
child: PaymentBottomWidget(widget.model), child: PaymentBottomWidget(widget.model),
), ),
); );
} }
changeMainState() { changeMainState() {
setState(() {}); setState(() {});
} }
} }

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.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/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -25,7 +26,7 @@ class PaymentBottomWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final scaffold = Scaffold.of(context); ProjectViewModel projectViewModel = Provider.of(context);
this.context = context; this.context = context;
OrderPreviewViewModel orderPreviewViewModel = Provider.of(context); OrderPreviewViewModel orderPreviewViewModel = Provider.of(context);
return Container( return Container(
@ -88,7 +89,7 @@ class PaymentBottomWidget extends StatelessWidget {
onPressed: (orderPreviewViewModel.paymentCheckoutData.address != null && orderPreviewViewModel.paymentCheckoutData.paymentOption != null) onPressed: (orderPreviewViewModel.paymentCheckoutData.address != null && orderPreviewViewModel.paymentCheckoutData.paymentOption != null)
? () async { ? () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.makeOrder(); await model.makeOrder(projectViewModel.havePrivilege(83));
if (model.state == ViewState.Idle) { if (model.state == ViewState.Idle) {
AppToast.showSuccessToast(message: TranslationBase.of(context).compeleteOrderMsg); AppToast.showSuccessToast(message: TranslationBase.of(context).compeleteOrderMsg);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -183,7 +183,7 @@ class LabResultWidget extends StatelessWidget {
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 12, right: projectViewModel.isArabic ? 12 : 0), 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].resultValue + " " + labResultList[i].uOM, isLast: true),
Utils.tableColumnValue(labResultList[i].referanceRange, isLast: true, isCapitable: false), Utils.tableColumnValue(labResultList[i].referanceRange, isLast: true, isCapitable: false),

@ -28,12 +28,11 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType; _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/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 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 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 @override
Future onLoadStart(Uri url) async { Future onLoadStart(Uri url) async {
if (onLoadStartCallback != null) onLoadStartCallback(url); if (onLoadStartCallback != null) onLoadStartCallback(url.toString());
} }
@override @override

Loading…
Cancel
Save