Merge branch 'development_v2.5' into zik_new_design_flutter_v2.5

* development_v2.5:
  Updates & fixes

# Conflicts: resolved
#	lib/pages/medical/balance/confirm_payment_page.dart
merge-update-with-lab-changes
Zohaib Iqbal Kambrani 4 years ago
commit ff508de9f7

@ -12,12 +12,12 @@ class LacumService extends BaseService{
LacumAccountInformation lacumInformation; LacumAccountInformation lacumInformation;
LacumAccountInformation lacumGroupInformation; LacumAccountInformation lacumGroupInformation;
Future getLacumAccountInformation() async { Future getLacumAccountInformation(String identificationNo) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = identificationNo;
try { try {
await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION, await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION,
@ -32,12 +32,12 @@ class LacumService extends BaseService{
} }
} }
Future getLacumGroupInformation() async { Future getLacumGroupInformation(String identificationNo) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = identificationNo;
body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}"; body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}";
body['IsDetailsRequired'] = true; body['IsDetailsRequired'] = true;

@ -22,14 +22,14 @@ class LacumViewModel extends BaseViewModel {
String get successMsg => String get successMsg =>
_lacumService.successMsg; _lacumService.successMsg;
Future getLacumData() async { Future getLacumData(String identificationNo) async {
await getLacumAccountData(); await getLacumAccountData(identificationNo);
getLacumGroupData(); getLacumGroupData(identificationNo);
} }
Future getLacumAccountData() async { Future getLacumAccountData(String identificationNo) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _lacumService.getLacumAccountInformation(); await _lacumService.getLacumAccountInformation(identificationNo);
if (_lacumService.hasError) { if (_lacumService.hasError) {
error = _lacumService.error; error = _lacumService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -38,9 +38,9 @@ class LacumViewModel extends BaseViewModel {
} }
} }
Future getLacumGroupData() async { Future getLacumGroupData(String identificationNo) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _lacumService.getLacumGroupInformation(); await _lacumService.getLacumGroupInformation(identificationNo);
if (_lacumService.hasError) { if (_lacumService.hasError) {
error = _lacumService.error; error = _lacumService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -49,7 +49,7 @@ class LacumViewModel extends BaseViewModel {
} }
} }
Future makeAccountActivate() async { Future makeAccountActivate(String identificationNo) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _lacumService.makeAccountActivate(); await _lacumService.makeAccountActivate();
if (_lacumService.hasError) { if (_lacumService.hasError) {
@ -57,11 +57,11 @@ class LacumViewModel extends BaseViewModel {
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
lacumGroupInformation.lakumInquiryInformationObjVersion.accountStatus = "Active"; lacumGroupInformation.lakumInquiryInformationObjVersion.accountStatus = "Active";
getLacumAccountData(); getLacumAccountData(identificationNo);
} }
} }
Future makeAccountDeactivate() async { Future makeAccountDeactivate(String identificationNo) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _lacumService.makeAccountDeactivate(); await _lacumService.makeAccountDeactivate();
if (_lacumService.hasError) { if (_lacumService.hasError) {
@ -69,7 +69,7 @@ class LacumViewModel extends BaseViewModel {
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
lacumGroupInformation.lakumInquiryInformationObjVersion.accountStatus = "Cancelled"; lacumGroupInformation.lakumInquiryInformationObjVersion.accountStatus = "Cancelled";
getLacumAccountData(); getLacumAccountData(identificationNo);
} }
} }

@ -5,8 +5,8 @@ class ApplePayRequest {
dynamic customerEmail; dynamic customerEmail;
String orderdescription; String orderdescription;
String liveServiceid; String liveServiceid;
String longitude; dynamic longitude;
String latitude; dynamic latitude;
String devicetoken; String devicetoken;
String clientrequestid; String clientrequestid;
String projectid; String projectid;

@ -567,10 +567,6 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
); );
} }
callPayfortApplePayAPI(ApplePayResponse applePayResponse) {
}
Widget showFloating(String icon) { Widget showFloating(String icon) {
return Container( return Container(
width: MediaQuery.of(context).size.width * 0.06, width: MediaQuery.of(context).size.width * 0.06,

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
@ -6,6 +7,8 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_mod
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';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/apple_pay_request.dart';
import 'package:diplomaticquarterapp/models/apple_pay_response.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
@ -22,8 +25,8 @@ import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.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:pay/pay.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'new_text_Field.dart'; import 'new_text_Field.dart';
class ConfirmPaymentPage extends StatefulWidget { class ConfirmPaymentPage extends StatefulWidget {
@ -40,24 +43,16 @@ class ConfirmPaymentPage extends StatefulWidget {
class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> { class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
MyInAppBrowser browser; MyInAppBrowser browser;
ProjectViewModel projectViewModel;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
String transID = ""; String transID = "";
ProjectViewModel projectViewModel;
Pay _payClient = Pay.withAssets([ Pay _payClient = Pay.withAssets([
'applepay.json', 'applepay.json',
]); ]);
var _paymentItems = [
PaymentItem(
label: 'Total',
amount: '99.99',
status: PaymentItemStatus.final_price,
)
];
void submit(MyBalanceViewModel model, code) { void submit(MyBalanceViewModel model, code) {
final activationCode = code; final activationCode = code;
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
@ -66,15 +61,18 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
Navigator.pop(context, true); Navigator.pop(context, true);
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.patientInfoAndMobileNumber.projectID; appo.projectID = widget.patientInfoAndMobileNumber.projectID;
if (widget.selectedPaymentMethod == "ApplePay") {
startApplePay();
} else {
projectViewModel.analytics.advancePayments.payment_otp_confirmation(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet'); projectViewModel.analytics.advancePayments.payment_otp_confirmation(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet');
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null);
double.parse(widget.advanceModel.amount), null); }
}); });
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
void showSMSDialog(MyBalanceViewModel model) { void showSMSDialog(MyBalanceViewModel model) {
new SMSOTP( new SMSOTP(
context, context,
@ -211,6 +209,8 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
if (model.state != ViewState.ErrorLocal && if (model.state != ViewState.ErrorLocal &&
model.state != ViewState.Error) showSMSDialog(model); model.state != ViewState.Error) showSMSDialog(model);
}); });
startApplePay();
// if()
// GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
// model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) { // model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) {
// GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
@ -224,6 +224,87 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
); );
} }
startApplePay() {
GifLoaderDialogUtils.showMyDialog(context);
ApplePayResponse applePayResponse;
var _paymentItems = [
PaymentItem(
label: 'Total',
amount: widget.advanceModel.amount,
status: PaymentItemStatus.final_price,
)
];
_payClient.userCanPay(PayProvider.apple_pay).then((value) async {
print(value);
final result = await _payClient.showPaymentSelector(
provider: PayProvider.apple_pay,
paymentItems: _paymentItems,
);
print(result);
applePayResponse = ApplePayResponse.fromJson(result);
callPayfortApplePayAPI(applePayResponse);
});
}
callPayfortApplePayAPI(ApplePayResponse applePayResponse) async {
DoctorsListService service = new DoctorsListService();
ApplePayRequest applePayRequest = new ApplePayRequest();
AppleHeader appleHeader = new AppleHeader();
ApplePaymentMethod applePaymentMethod = new ApplePaymentMethod();
applePayRequest.amount = widget.advanceModel.amount;
applePayRequest.currency = "SAR";
applePayRequest.language = projectViewModel.isArabic ? "ar" : "en";
applePayRequest.customername = projectViewModel.user.firstName;
applePayRequest.customerEmail = projectViewModel.user.emailAddress;
applePayRequest.orderdescription = "Advance Payment";
applePayRequest.liveServiceid = "";
applePayRequest.latitude = await this.sharedPref.getDouble(USER_LAT);
applePayRequest.longitude = await this.sharedPref.getDouble(USER_LONG);
applePayRequest.devicetoken = await sharedPref.getString(PUSH_TOKEN);
applePayRequest.clientrequestid = Utils.getAdvancePaymentTransID(widget.advanceModel.hospitalsModel.iD, int.parse(widget.advanceModel.fileNumber));
applePayRequest.projectid = widget.advanceModel.hospitalsModel.iD.toString();
applePayRequest.serviceid = "3";
applePayRequest.patientid = projectViewModel.user.patientID.toString();
applePayRequest.appleData = applePayResponse.token.data;
applePayRequest.appleSignature = applePayResponse.token.signature;
appleHeader.appleEphemeralPublicKey = applePayResponse.token.header.ephemeralPublicKey;
appleHeader.appleTransactionId = applePayResponse.token.header.transactionId;
appleHeader.applePublicKeyHash = applePayResponse.token.header.publicKeyHash;
applePaymentMethod.appleType = getApplePayPaymentType(applePayResponse.paymentMethod.type);
applePaymentMethod.appleNetwork = applePayResponse.paymentMethod.network;
applePaymentMethod.appleDisplayName = applePayResponse.paymentMethod.displayName;
applePayRequest.appleHeader = appleHeader;
applePayRequest.applePaymentMethod = applePaymentMethod;
service.callPayfortApplePayAPI(applePayRequest, context).then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
// _showMyDialog(err, this.context);
});
}
String getApplePayPaymentType(dynamic paymentMethod) {
switch (paymentMethod) {
case 1:
return 'debit';
break;
case 2:
return 'credit';
break;
case 3:
return 'prepaid';
break;
}
return 'debit';
}
String getImagePath(String paymentMethod) { String getImagePath(String paymentMethod) {
switch (paymentMethod) { switch (paymentMethod) {
case "MADA": case "MADA":

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
@ -7,16 +8,19 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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:provider/provider.dart';
import 'lacum-registration-page.dart'; import 'lacum-registration-page.dart';
class LakumActivationVidaPage extends StatelessWidget { class LakumActivationVidaPage extends StatelessWidget {
ProjectViewModel projectViewModel;
TextEditingController _identificationNumberController = TextEditingController _identificationNumberController =
new TextEditingController(); new TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
projectViewModel = Provider.of(context);
return BaseView<LacumRegistrationViewModel>( return BaseView<LacumRegistrationViewModel>(
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
@ -72,7 +76,7 @@ class LakumActivationVidaPage extends StatelessWidget {
fontSize: 16, fontSize: 16,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
handler: _identificationNumberController.text != null && handler: _identificationNumberController.text != null ||
_identificationNumberController.text != "" _identificationNumberController.text != ""
? () { ? () {
model model
@ -89,7 +93,7 @@ class LakumActivationVidaPage extends StatelessWidget {
.text))) .text)))
.then((status) => { .then((status) => {
if (status == 200) if (status == 200)
{Navigator.pop(context, "")} {model.makeAccountActivate(projectViewModel.user.patientIdentificationNo)}
// back to previous page // back to previous page
}) })
} }

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lacum-banner-widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lacum-banner-widget.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class LakumSettingPage extends StatefulWidget { class LakumSettingPage extends StatefulWidget {
final LacumAccountInformation lacumInformation; final LacumAccountInformation lacumInformation;
@ -26,6 +28,8 @@ class _LakumSettingPageState extends State<LakumSettingPage> {
TextEditingController _nameController = new TextEditingController(); TextEditingController _nameController = new TextEditingController();
TextEditingController _phoneController = new TextEditingController(); TextEditingController _phoneController = new TextEditingController();
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
_lakumAccountActivated = widget.lacumGroupInformation _lakumAccountActivated = widget.lacumGroupInformation
@ -39,6 +43,7 @@ class _LakumSettingPageState extends State<LakumSettingPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
projectViewModel = Provider.of(context);
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
onModelReady: (model) => model.setLakumData( onModelReady: (model) => model.setLakumData(
@ -126,9 +131,9 @@ class _LakumSettingPageState extends State<LakumSettingPage> {
value: _lakumAccountActivated, value: _lakumAccountActivated,
onChanged: (val) { onChanged: (val) {
if (_lakumAccountActivated) { if (_lakumAccountActivated) {
model.makeAccountDeactivate(); model.makeAccountDeactivate(projectViewModel.user.patientIdentificationNo);
} else { } else {
model.makeAccountActivate(); model.makeAccountActivate(projectViewModel.user.patientIdentificationNo);
} }
setState(() { setState(() {
_lakumAccountActivated = val; _lakumAccountActivated = val;

@ -27,7 +27,7 @@ class LakumMainPage extends StatelessWidget {
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getLacumData(); await model.getLacumData(projectViewModel.user.patientIdentificationNo);
if (model.lacumInformation.yahalaAccountNo == 0 || model.lacumInformation.yahalaAccountNo == null) { if (model.lacumInformation.yahalaAccountNo == 0 || model.lacumInformation.yahalaAccountNo == null) {
navigateToLakumRegister(context); navigateToLakumRegister(context);
} else { } else {
@ -73,7 +73,7 @@ class LakumMainPage extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
LakumHomeButtons(mediaQuery, model), LakumHomeButtons(mediaQuery, model, projectViewModel),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -253,25 +253,26 @@ class LakumMainPage extends StatelessWidget {
navigateToLakumRegister(BuildContext context) { navigateToLakumRegister(BuildContext context) {
Navigator.pushReplacement(context, FadePage(page: LakumRegistrationPage(projectViewModel.user.patientIdentificationNo))); Navigator.pushReplacement(context, FadePage(page: LakumRegistrationPage(projectViewModel.user.patientIdentificationNo)));
} }
}
List<Widget> _buildAppBarICons(BuildContext context, LacumViewModel model) { List<Widget> _buildAppBarICons(BuildContext context, LacumViewModel model) {
return [ return [
IconButton( IconButton(
icon: Icon(Icons.settings), icon: Icon(Icons.settings),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
Navigator.push(context, FadePage(page: LakumSettingPage(model.lacumInformation, model.lacumGroupInformation))).then((result) => {model.getLacumGroupData()}); Navigator.push(context, FadePage(page: LakumSettingPage(model.lacumInformation, model.lacumGroupInformation))).then((result) => {model.getLacumGroupData(projectViewModel.user.patientIdentificationNo)});
}, },
), ),
]; ];
}
} }
class LakumHomeButtons extends StatelessWidget { class LakumHomeButtons extends StatelessWidget {
final MediaQueryData mediaQuery; final MediaQueryData mediaQuery;
final LacumViewModel model; final LacumViewModel model;
ProjectViewModel projectViewModel;
LakumHomeButtons(this.mediaQuery, this.model); LakumHomeButtons(this.mediaQuery, this.model, this.projectViewModel);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -328,7 +329,7 @@ class LakumHomeButtons extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: LacumTransferPage(model.lacumInformation, model.lacumGroupInformation))).then((result) { Navigator.push(context, FadePage(page: LacumTransferPage(model.lacumInformation, model.lacumGroupInformation))).then((result) {
model.getLacumGroupData(); model.getLacumGroupData(projectViewModel.user.patientIdentificationNo);
}); });
}, },
child: Container( child: Container(

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -12,8 +13,7 @@ class LakumTermsConditions extends StatelessWidget {
final String firstName, lastName, mobileNo, identificationNo; final String firstName, lastName, mobileNo, identificationNo;
final int languageId; final int languageId;
LakumTermsConditions(this.identificationNo, this.firstName, this.lastName, LakumTermsConditions(this.identificationNo, this.firstName, this.lastName, this.mobileNo, this.languageId);
this.mobileNo, this.languageId);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -37,13 +37,9 @@ class LakumTermsConditions extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (model.listUserAgreement != null && if (model.listUserAgreement != null && model.listUserAgreement.userAgreementLAKUM != null)
model.listUserAgreement.userAgreementLAKUM !=
null)
Html( Html(
data: projectProvider.isArabic data: projectProvider.isArabic ? model.listUserAgreement.userAgreementLAKUMn : model.listUserAgreement.userAgreementLAKUM,
? model.listUserAgreement.userAgreementLAKUMn
: model.listUserAgreement.userAgreementLAKUM,
), ),
], ],
), ),
@ -62,9 +58,12 @@ class LakumTermsConditions extends StatelessWidget {
vPadding: 12, vPadding: 12,
handler: () { handler: () {
model.createNewLakumAccount("$firstName $lastName", mobileNo, identificationNo, languageId).then((status) => { model.createNewLakumAccount("$firstName $lastName", mobileNo, identificationNo, languageId).then((status) => {
if (status == 200) {Navigator.pop(context, "")} if (status == 200) {Navigator.pop(context, "")} else {
// back to previous page Navigator.pop(context, ""),
}); AppToast.showErrorToast(message: model.error)
}
// back to previous page
});
}, },
), ),
), ),

Loading…
Cancel
Save