From bedafa24cd012ef6f64d2a70da707de1d53b5a2a Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 16 Nov 2020 16:42:47 +0300 Subject: [PATCH] insurance details --- lib/config/config.dart | 4 ++++ lib/core/service/insurance_service.dart | 10 ++++++++++ lib/core/viewModels/insurance_card_View_model.dart | 1 + lib/core/viewModels/project_view_model.dart | 3 ++- lib/pages/insurance/insurance_card_screen.dart | 13 +++++++++++++ lib/pages/insurance/insurance_details.dart | 3 ++- lib/pages/login/register.dart | 2 +- lib/widgets/others/app_scaffold_widget.dart | 2 +- pubspec.yaml | 5 +++-- 9 files changed, 37 insertions(+), 6 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index efb15b36..1f260de8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -254,6 +254,10 @@ const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; + +const INSURANCE_DETAILS = + "Services/Patients.svc/REST/Get_InsuranceCheckList"; + const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; const GET_PAtIENTS_INSURANCE_APPROVALS = diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index 02061612..04c63b0d 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -125,4 +125,14 @@ class InsuranceCardService extends BaseService { throw error; } } + Future getInsuranceDetails() async{ + dynamic localRes; + await baseAppClient.post(INSURANCE_DETAILS, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } } diff --git a/lib/core/viewModels/insurance_card_View_model.dart b/lib/core/viewModels/insurance_card_View_model.dart index e99a53f6..62c45d1b 100644 --- a/lib/core/viewModels/insurance_card_View_model.dart +++ b/lib/core/viewModels/insurance_card_View_model.dart @@ -72,4 +72,5 @@ class InsuranceViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + } diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 91e9b9a3..d2b7cf8b 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -18,7 +18,8 @@ class ProjectViewModel extends BaseViewModel { bool isError = false; String error = ''; dynamic searchvalue; - bool isLogin = false; + bool isLogin + = false; dynamic get searchValue => searchvalue; diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index a7065399..e37e8dae 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -1,11 +1,15 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -21,6 +25,7 @@ class InsuranceCard extends StatefulWidget { } //TODO fix it class _InsuranceCardState extends State { + InsuranceCardService _insuranceCardService = locator(); @override Widget build(BuildContext context) { return BaseView( @@ -140,6 +145,7 @@ class _InsuranceCardState extends State { Container( color: Colors.transparent, child: SecondaryButton( + onTap: getDetails(), label: TranslationBase.of(context).seeDetails, textColor: Colors.white, ), @@ -179,4 +185,11 @@ class _InsuranceCardState extends State { return newDate.toString(); } + getDetails(){ + _insuranceCardService.getInsuranceDetails().then((value) => { + Navigator.push(context, + FadePage(page: InsuranceCardDetails(data:value))) + + }); + } } diff --git a/lib/pages/insurance/insurance_details.dart b/lib/pages/insurance/insurance_details.dart index 4d9abf81..0617dd61 100644 --- a/lib/pages/insurance/insurance_details.dart +++ b/lib/pages/insurance/insurance_details.dart @@ -1,5 +1,5 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/insurance/config/size_config.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:html2md/html2md.dart' as html2md; import 'package:flutter_markdown/flutter_markdown.dart'; @@ -34,4 +34,5 @@ class _InsuranceCardInsuranceCardDetailsState extends State { okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => { - ConfirmDialog.closeAlertDialog(context) + ConfirmDialog.closeAlertDialog(context), Navigator.of(context).pushNamed( REGISTER, ), diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 86a07958..a807b02e 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -126,7 +126,7 @@ class AppScaffold extends StatelessWidget { description: description, infoList: infoList, ) - : baseViewModel != null + : baseViewModel != null ? NetworkBaseView( child: buildBodyWidget(), baseViewModel: baseViewModel, diff --git a/pubspec.yaml b/pubspec.yaml index af3c6673..72f34d11 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -141,7 +141,7 @@ dependencies: screen: ^0.0.5 #google maps places google_maps_place_picker: ^1.0.0 - + #Dependencies for video call implementation native_device_orientation: ^0.3.0 enum_to_string: ^1.0.9 @@ -150,7 +150,8 @@ dependencies: after_layout: ^1.0.7 twilio_programmable_video: ^0.5.0+3 flutter_tts: ^1.2.6 - + html2md: "^0.5.1" + flutter_markdown: "^0.5.0" speech_to_text: path: speech_to_text