From 1f4f81b454b38f7c95835cc8a30ca6ccd71e6b9a Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 17 Nov 2020 07:37:42 +0300 Subject: [PATCH] insurance card details --- lib/core/model/insurance/insurance_card.dart | 6 ++++++ lib/core/service/insurance_service.dart | 7 ++++--- lib/pages/insurance/insurance_card_screen.dart | 8 ++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/core/model/insurance/insurance_card.dart b/lib/core/model/insurance/insurance_card.dart index 998df241..ebab8d71 100644 --- a/lib/core/model/insurance/insurance_card.dart +++ b/lib/core/model/insurance/insurance_card.dart @@ -16,7 +16,9 @@ class InsuranceCardModel { int patientType; String groupName; String companyName; + int companyID; String subCategoryDesc; + int subCategoryID; String patientCardID; String insurancePolicyNumber; bool isActive; @@ -25,6 +27,7 @@ class InsuranceCardModel { InsuranceCardModel({ this.insurancePolicyNumber, this.subCategoryDesc, + this.subCategoryID, this.versionID, this.channel, this.languageID, @@ -40,6 +43,7 @@ class InsuranceCardModel { this.patientType, this.groupName, this.companyName, + this.companyID, this.patientCardID, this.isActive, this.cardValidTo @@ -50,6 +54,7 @@ class InsuranceCardModel { insurancePolicyNumber = json['InsurancePolicyNo']; patientCardID = json['PatientCardID']; companyName = json['CompanyName']; + companyID = json['CompanyID']; groupName = json['GroupName']; versionID = json['VersionID']; channel = json['Channel']; @@ -65,6 +70,7 @@ class InsuranceCardModel { patientTypeID = json['PatientTypeID']; patientType = json['PatientType']; subCategoryDesc = json['SubCategoryDesc']; + subCategoryID = json["SubCategoryID"]; cardValidTo = json['CardValidTo']; } diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index 04c63b0d..cc920646 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -125,14 +125,15 @@ class InsuranceCardService extends BaseService { throw error; } } - Future getInsuranceDetails() async{ + Future getInsuranceDetails(data) async{ dynamic localRes; await baseAppClient.post(INSURANCE_DETAILS, onSuccess: (dynamic response, int statusCode) { - localRes = response; + localRes = response['List_InsuranceCheckList']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: Map()); + }, body:{'CompanyID': data.companyID,'SubCategoryID':data.subCategoryID },); + return Future.value(localRes); } } diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index e37e8dae..f78b9f85 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -145,7 +145,7 @@ class _InsuranceCardState extends State { Container( color: Colors.transparent, child: SecondaryButton( - onTap: getDetails(), + onTap:()=>{ getDetails(model.insurance[index])}, label: TranslationBase.of(context).seeDetails, textColor: Colors.white, ), @@ -185,10 +185,10 @@ class _InsuranceCardState extends State { return newDate.toString(); } - getDetails(){ - _insuranceCardService.getInsuranceDetails().then((value) => { + getDetails(data){ + _insuranceCardService.getInsuranceDetails(data).then((value) => { Navigator.push(context, - FadePage(page: InsuranceCardDetails(data:value))) + FadePage(page: InsuranceCardDetails(data:value[0]['CheckList']))) }); }