|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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';
|
|
|
|
|
@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import '../../locator.dart';
|
|
|
|
|
import '../../widgets/dialogs/confirm_dialog.dart';
|
|
|
|
|
@ -18,8 +20,11 @@ class InsurancePage extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
InsurancePage({Key key, this.model}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(12.0),
|
|
|
|
|
@ -36,11 +41,16 @@ class InsurancePage extends StatelessWidget {
|
|
|
|
|
getDetails(
|
|
|
|
|
setupID: '010266',
|
|
|
|
|
projectID: 15,
|
|
|
|
|
patientIdentificationID: model.user.patientIdentificationNo,
|
|
|
|
|
patientID: model.user.patientID,
|
|
|
|
|
patientIdentificationID: projectViewModel.user.patientIdentificationNo,
|
|
|
|
|
//model.user.patientIdentificationNo,
|
|
|
|
|
patientID: projectViewModel.user.patientID,
|
|
|
|
|
//model.user.patientID,
|
|
|
|
|
parentID: 0,
|
|
|
|
|
isFamily: false,
|
|
|
|
|
name: model.user.firstName + " " + model.user.lastName,
|
|
|
|
|
isFamily: projectViewModel.isLoginChild,
|
|
|
|
|
//false,
|
|
|
|
|
name: projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
|
|
|
|
|
mobileNumber: projectViewModel.user.mobileNumber,
|
|
|
|
|
//model.user.firstName + " " + model.user.lastName,
|
|
|
|
|
context: context,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
@ -54,7 +64,7 @@ class InsurancePage extends StatelessWidget {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
model.user.firstName + " " + model.user.lastName,
|
|
|
|
|
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
@ -62,7 +72,7 @@ class InsurancePage extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).fileno + ": " + model.user.patientID.toString(),
|
|
|
|
|
TranslationBase.of(context).fileno + ": " + projectViewModel.user.patientID.toString(), //model.user.patientID.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
@ -79,71 +89,73 @@ class InsurancePage extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false)
|
|
|
|
|
ListView.separated(
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
|
|
|
|
|
? InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
getDetails(
|
|
|
|
|
projectID: 15,
|
|
|
|
|
patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber,
|
|
|
|
|
setupID: '010266',
|
|
|
|
|
patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID,
|
|
|
|
|
name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
|
|
|
|
|
parentID: model.user.patientID,
|
|
|
|
|
isFamily: true,
|
|
|
|
|
context: context);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin: EdgeInsets.only(top: 12.0),
|
|
|
|
|
if (!projectViewModel.isLoginChild)
|
|
|
|
|
if (model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false)
|
|
|
|
|
ListView.separated(
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
|
|
|
|
|
? InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
getDetails(
|
|
|
|
|
projectID: 15,
|
|
|
|
|
patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber,
|
|
|
|
|
setupID: '010266',
|
|
|
|
|
patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID,
|
|
|
|
|
name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
|
|
|
|
|
parentID: model.user.patientID,
|
|
|
|
|
isFamily: true,
|
|
|
|
|
mobileNumber: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].mobileNumber,
|
|
|
|
|
context: context);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: cardRadius(12),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(12.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
|
|
|
|
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin: EdgeInsets.only(top: 12.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: cardRadius(12),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(12.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
|
|
|
|
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Icon(Icons.arrow_forward),
|
|
|
|
|
],
|
|
|
|
|
Icon(Icons.arrow_forward),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container();
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
|
return mHeight(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 ? 8 : 0);
|
|
|
|
|
},
|
|
|
|
|
itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container();
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
|
return mHeight(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 ? 8 : 0);
|
|
|
|
|
},
|
|
|
|
|
itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, bool isFamily, int parentID = 0, BuildContext context}) {
|
|
|
|
|
getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, String mobileNumber, bool isFamily, int parentID = 0, BuildContext context}) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
_insuranceCardService
|
|
|
|
|
.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID)
|
|
|
|
|
@ -158,23 +170,34 @@ class InsurancePage extends StatelessWidget {
|
|
|
|
|
patientID: patientID,
|
|
|
|
|
patientIdentificationID: patientIdentificationID,
|
|
|
|
|
name: name,
|
|
|
|
|
mobileNo: mobileNumber,
|
|
|
|
|
))).then((value) {
|
|
|
|
|
model.getInsuranceUpdated();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// AppToast.showErrorToast(message: _insuranceCardService.error);
|
|
|
|
|
updateManually(context, _insuranceCardService.error);
|
|
|
|
|
updateManually(context, _insuranceCardService.error, patientIdentificationID, patientID, mobileNumber);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void updateManually(BuildContext context, String errorMsg) {
|
|
|
|
|
void updateManually(BuildContext context, String errorMsg, String patientIdentificationID, int patientID, String mobileNumber) {
|
|
|
|
|
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()))},
|
|
|
|
|
okFunction: () => {
|
|
|
|
|
Navigator.pop(context),
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: UpdateInsuranceManually(
|
|
|
|
|
patientIdentificationNo: patientIdentificationID,
|
|
|
|
|
patientID: patientID,
|
|
|
|
|
patientMobileNumber: mobileNumber,
|
|
|
|
|
)))
|
|
|
|
|
},
|
|
|
|
|
cancelFunction: () => {});
|
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
|
}
|
|
|
|
|
|