hot fixes
parent
a8b0af9ee1
commit
9c12e949e8
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,88 @@
|
|||||||
|
class InsuranceCardDetailsModel {
|
||||||
|
int approvalLimit;
|
||||||
|
int companyGroupID;
|
||||||
|
String companyName;
|
||||||
|
String companyRemarks;
|
||||||
|
String dOB;
|
||||||
|
int deductible;
|
||||||
|
String effectiveFrom;
|
||||||
|
String effectiveTo;
|
||||||
|
String eligabilityFailureReason;
|
||||||
|
bool isMemberEligible;
|
||||||
|
String memberID;
|
||||||
|
String memberName;
|
||||||
|
String memberStatus;
|
||||||
|
dynamic message;
|
||||||
|
String nationalId;
|
||||||
|
String policyNumber;
|
||||||
|
String responseMessage;
|
||||||
|
String room;
|
||||||
|
String subCategory;
|
||||||
|
|
||||||
|
InsuranceCardDetailsModel(
|
||||||
|
{this.approvalLimit,
|
||||||
|
this.companyGroupID,
|
||||||
|
this.companyName,
|
||||||
|
this.companyRemarks,
|
||||||
|
this.dOB,
|
||||||
|
this.deductible,
|
||||||
|
this.effectiveFrom,
|
||||||
|
this.effectiveTo,
|
||||||
|
this.eligabilityFailureReason,
|
||||||
|
this.isMemberEligible,
|
||||||
|
this.memberID,
|
||||||
|
this.memberName,
|
||||||
|
this.memberStatus,
|
||||||
|
this.message,
|
||||||
|
this.nationalId,
|
||||||
|
this.policyNumber,
|
||||||
|
this.responseMessage,
|
||||||
|
this.room,
|
||||||
|
this.subCategory});
|
||||||
|
|
||||||
|
InsuranceCardDetailsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
approvalLimit = json['ApprovalLimit'];
|
||||||
|
companyGroupID = json['CompanyGroupID'];
|
||||||
|
companyName = json['CompanyName'];
|
||||||
|
companyRemarks = json['CompanyRemarks'];
|
||||||
|
dOB = json['DOB'];
|
||||||
|
deductible = json['Deductible'];
|
||||||
|
effectiveFrom = json['EffectiveFrom'];
|
||||||
|
effectiveTo = json['EffectiveTo'];
|
||||||
|
eligabilityFailureReason = json['EligabilityFailureReason'];
|
||||||
|
isMemberEligible = json['IsMemberEligible'];
|
||||||
|
memberID = json['MemberID'];
|
||||||
|
memberName = json['MemberName'];
|
||||||
|
memberStatus = json['MemberStatus'];
|
||||||
|
message = json['Message'];
|
||||||
|
nationalId = json['NationalId'];
|
||||||
|
policyNumber = json['PolicyNumber'];
|
||||||
|
responseMessage = json['ResponseMessage'];
|
||||||
|
room = json['Room'];
|
||||||
|
subCategory = json['SubCategory'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['ApprovalLimit'] = this.approvalLimit;
|
||||||
|
data['CompanyGroupID'] = this.companyGroupID;
|
||||||
|
data['CompanyName'] = this.companyName;
|
||||||
|
data['CompanyRemarks'] = this.companyRemarks;
|
||||||
|
data['DOB'] = this.dOB;
|
||||||
|
data['Deductible'] = this.deductible;
|
||||||
|
data['EffectiveFrom'] = this.effectiveFrom;
|
||||||
|
data['EffectiveTo'] = this.effectiveTo;
|
||||||
|
data['EligabilityFailureReason'] = this.eligabilityFailureReason;
|
||||||
|
data['IsMemberEligible'] = this.isMemberEligible;
|
||||||
|
data['MemberID'] = this.memberID;
|
||||||
|
data['MemberName'] = this.memberName;
|
||||||
|
data['MemberStatus'] = this.memberStatus;
|
||||||
|
data['Message'] = this.message;
|
||||||
|
data['NationalId'] = this.nationalId;
|
||||||
|
data['PolicyNumber'] = this.policyNumber;
|
||||||
|
data['ResponseMessage'] = this.responseMessage;
|
||||||
|
data['Room'] = this.room;
|
||||||
|
data['SubCategory'] = this.subCategory;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,147 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class AttachInsuranceCardImageDialog extends StatefulWidget {
|
||||||
|
final String name;
|
||||||
|
final String fileNo;
|
||||||
|
final Function(File file, String image) image;
|
||||||
|
|
||||||
|
const AttachInsuranceCardImageDialog(
|
||||||
|
{Key key, this.name, this.fileNo, this.image})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_AttachInsuranceCardImageDialogState createState() =>
|
||||||
|
_AttachInsuranceCardImageDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AttachInsuranceCardImageDialogState
|
||||||
|
extends State<AttachInsuranceCardImageDialog> {
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
String image;
|
||||||
|
File file;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SimpleDialog(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Texts(TranslationBase.of(context).attachInsuraceImage),
|
||||||
|
Divider(),
|
||||||
|
Texts(widget.name),
|
||||||
|
SizedBox(
|
||||||
|
height: 3,
|
||||||
|
),
|
||||||
|
Texts(TranslationBase.of(context).fileNo + " " + widget.fileNo),
|
||||||
|
SizedBox(
|
||||||
|
height: 5.0,
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
ImageOptions.showImageOptions(context, (String image,File file) {
|
||||||
|
setState(() {
|
||||||
|
this.image = image;
|
||||||
|
this.file = file;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: image == null
|
||||||
|
? Padding(
|
||||||
|
padding: const EdgeInsets.all(18.0),
|
||||||
|
child: Container(
|
||||||
|
width: double.maxFinite,
|
||||||
|
height: 250,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(2),
|
||||||
|
border: Border.all(color: Colors.grey, width: 1.5)),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.,
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 25,),
|
||||||
|
Icon(
|
||||||
|
Icons.camera_enhance_rounded,
|
||||||
|
size: 85,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Icon(Icons.attach_file),
|
||||||
|
Texts(TranslationBase.of(context).selectAttachment.toUpperCase())
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Image.file(
|
||||||
|
file,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
height: 250,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 25.0,
|
||||||
|
),
|
||||||
|
Divider(),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
TranslationBase.of(context).cancel.toUpperCase(),
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 1,
|
||||||
|
height: 30,
|
||||||
|
color: Colors.grey[500],
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
widget.image(file, image);
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
TranslationBase.of(context).ok,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,235 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'AttachInsuranceCardImageDialog.dart';
|
||||||
|
|
||||||
|
class InsuranceCardUpdateDetails extends StatelessWidget {
|
||||||
|
final InsuranceCardDetailsModel insuranceCardDetailsModel;
|
||||||
|
final String patientIdentificationID;
|
||||||
|
final int patientID;
|
||||||
|
final String name;
|
||||||
|
|
||||||
|
|
||||||
|
const InsuranceCardUpdateDetails({Key key,
|
||||||
|
this.insuranceCardDetailsModel,
|
||||||
|
this.patientIdentificationID,
|
||||||
|
this.patientID, this.name})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
ProjectViewModel projectViewModel = Provider.of(context);
|
||||||
|
return BaseView<InsuranceViewModel>(
|
||||||
|
builder: (context, model, w) =>
|
||||||
|
AppScaffold(
|
||||||
|
isShowAppBar: true,
|
||||||
|
isShowDecPage: false,
|
||||||
|
appBarTitle: TranslationBase
|
||||||
|
.of(context)
|
||||||
|
.cardDetail,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
width: double.maxFinite,
|
||||||
|
margin: EdgeInsets.only(left: 8, right: 8, top: 8),
|
||||||
|
height:projectViewModel.isArabic?350: 270,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(25),
|
||||||
|
color: Color(0xff515B5D),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(12.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
insuranceCardDetailsModel.memberID,
|
||||||
|
textScaleFactor: 2.1,
|
||||||
|
style: TextStyle(color: Colors.white,
|
||||||
|
letterSpacing: 8.0,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
fontSize: 17),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
insuranceCardDetailsModel.companyName,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 25,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: [
|
||||||
|
Texts(TranslationBase
|
||||||
|
.of(context)
|
||||||
|
.policyHolder, color: Colors.white),
|
||||||
|
Texts(
|
||||||
|
insuranceCardDetailsModel.memberName,
|
||||||
|
color: Colors.white),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Texts(TranslationBase
|
||||||
|
.of(context)
|
||||||
|
.policyNo, color: Colors.white),
|
||||||
|
Texts(insuranceCardDetailsModel
|
||||||
|
.policyNumber, color: Colors.white),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 25,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: [
|
||||||
|
Texts(
|
||||||
|
TranslationBase
|
||||||
|
.of(context)
|
||||||
|
.expiryDateTitle,
|
||||||
|
color: Colors.white),
|
||||||
|
Texts(insuranceCardDetailsModel.dOB,
|
||||||
|
color: Colors.white),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Texts(TranslationBase
|
||||||
|
.of(context)
|
||||||
|
.classTitle, color: Colors.white),
|
||||||
|
Texts(
|
||||||
|
insuranceCardDetailsModel.subCategory,
|
||||||
|
color: Colors.white),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Texts(TranslationBase
|
||||||
|
.of(context)
|
||||||
|
.approval, color: Colors.white),
|
||||||
|
Texts(insuranceCardDetailsModel
|
||||||
|
.approvalLimit
|
||||||
|
.toString(), color: Colors.white),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomSheet: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: MediaQuery
|
||||||
|
.of(context)
|
||||||
|
.size
|
||||||
|
.height * 0.21,
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(left: 8, right: 8),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 8,),
|
||||||
|
SecondaryButton(
|
||||||
|
textColor: Colors.white,
|
||||||
|
label: TranslationBase
|
||||||
|
.of(context)
|
||||||
|
.agree
|
||||||
|
.toUpperCase(),
|
||||||
|
color: Theme
|
||||||
|
.of(context)
|
||||||
|
.primaryColor,
|
||||||
|
onTap: () async {
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID,patientID: patientID);
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
if (model.state == ViewState.ErrorLocal ) {
|
||||||
|
|
||||||
|
AppToast.showErrorToast(message: model.error);
|
||||||
|
} else {
|
||||||
|
AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(height: 12,),
|
||||||
|
SecondaryButton(
|
||||||
|
textColor: Colors.white,
|
||||||
|
label: TranslationBase
|
||||||
|
.of(context)
|
||||||
|
.disagree
|
||||||
|
.toUpperCase(),
|
||||||
|
color: Colors.grey[800],
|
||||||
|
onTap: () async {
|
||||||
|
confirmSelectFamilyDialog(context: context, name: name, fileNo: patientID.toString(),model: model);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void confirmSelectFamilyDialog({BuildContext context, String name, String fileNo,InsuranceViewModel model}) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
child: AttachInsuranceCardImageDialog(
|
||||||
|
fileNo: fileNo,
|
||||||
|
name: name,
|
||||||
|
image: (file, image) async{
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
await model.uploadInsuranceCard(patientIdentificationID: patientIdentificationID,patientID: patientID,image: image);
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
if (model.state == ViewState.ErrorLocal ||
|
||||||
|
model.state == ViewState.Error) {
|
||||||
|
|
||||||
|
AppToast.showErrorToast(message: model.error);
|
||||||
|
} else {
|
||||||
|
AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent);
|
||||||
|
}
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue