|
|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/insurance/UpdateInsuranceManually.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
|
@ -9,6 +9,7 @@ import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
import '../../locator.dart';
|
|
|
|
|
import '../../widgets/dialogs/confirm_dialog.dart';
|
|
|
|
|
import 'insurance_card_update_details.dart';
|
|
|
|
|
|
|
|
|
|
class InsurancePage extends StatelessWidget {
|
|
|
|
|
@ -144,7 +145,9 @@ class InsurancePage extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, bool isFamily, int parentID = 0, BuildContext context}) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
_insuranceCardService.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID).then((value) {
|
|
|
|
|
_insuranceCardService
|
|
|
|
|
.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID)
|
|
|
|
|
.then((value) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
@ -159,8 +162,20 @@ class InsurancePage extends StatelessWidget {
|
|
|
|
|
model.getInsuranceUpdated();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: _insuranceCardService.error);
|
|
|
|
|
// AppToast.showErrorToast(message: _insuranceCardService.error);
|
|
|
|
|
updateManually(context, _insuranceCardService.error);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void updateManually(BuildContext context, String errorMsg) {
|
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
confirmMessage: errorMsg + ". " + TranslationBase.of(context).updateInsuranceManuallyDialog,
|
|
|
|
|
okText: TranslationBase.of(context).yes,
|
|
|
|
|
cancelText: TranslationBase.of(context).no,
|
|
|
|
|
okFunction: () => {Navigator.pop(context), Navigator.push(context, FadePage(page: UpdateInsuranceManually()))},
|
|
|
|
|
cancelFunction: () => {});
|
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|