Merge branch 'diplomatic-quarter-live' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into diplomatic-quarter-live
# Conflicts: # ios/Flutter/.last_build_id # lib/config/config.dart # lib/core/service/medical/labs_service.dart # lib/pages/insurance/insurance_update_screen.dart # lib/pages/landing/home_page.dart # lib/pages/medical/medical_profile_page.dartdiplomatic-quarter-haroon
commit
afbd73363e
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 147 KiB |
@ -0,0 +1,6 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<g id="Group_1261" data-name="Group 1261" transform="translate(-148.52 -172.52)">
|
||||||
|
<path id="Path_1724" data-name="Path 1724" d="M9,0a9,9,0,0,1,9,9,9.18,9.18,0,0,1-1.863,5.483A8.844,8.844,0,0,1,9,18,9,9,0,0,1,9,0Z" transform="translate(148.52 172.52)" fill="#e6b71b"/>
|
||||||
|
<path id="hourglass_2_" data-name="hourglass (2)" d="M10.865,10.178H10.4V8.663a2.662,2.662,0,0,0-.88-1.977l-.783-.7a.578.578,0,0,1,0-.86l.783-.7a2.665,2.665,0,0,0,.88-1.978V.925h.463a.463.463,0,0,0,0-.925h-7.4a.463.463,0,0,0,0,.925h.463V2.439a2.662,2.662,0,0,0,.88,1.977l.783.7a.578.578,0,0,1,0,.86l-.783.7a2.665,2.665,0,0,0-.88,1.978v1.514H3.463a.463.463,0,1,0,0,.925h7.4a.463.463,0,0,0,0-.925ZM5.313,8.711a1.264,1.264,0,0,1,.373-.9L6.918,6.578a.347.347,0,0,1,.491,0L8.642,7.811a1.264,1.264,0,0,1,.373.9v1.467h-3.7Z" transform="translate(150.356 175.968)" fill="#fff"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 947 B |
@ -0,0 +1,8 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<g id="Group_1261" data-name="Group 1261" transform="translate(-148.52 -172.52)">
|
||||||
|
<path id="Path_1724" data-name="Path 1724" d="M9,0a9,9,0,0,1,9,9,9.18,9.18,0,0,1-1.863,5.483A8.844,8.844,0,0,1,9,18,9,9,0,0,1,9,0Z" transform="translate(148.52 172.52)" fill="#5ab145"/>
|
||||||
|
<g id="check_4_" data-name="check (4)" transform="translate(151.64 177.596)">
|
||||||
|
<path id="Path_1722" data-name="Path 1722" d="M10.35,68.552l-5.79,5.79L1.411,71.193,0,72.6l4.56,4.56,7.2-7.2Z" transform="translate(0 -68.552)" fill="#fff"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 627 B |
@ -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,346 @@
|
|||||||
|
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 List<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: [
|
||||||
|
...List.generate(
|
||||||
|
insuranceCardDetailsModel.length,
|
||||||
|
(index) => Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
width: double.maxFinite,
|
||||||
|
margin: EdgeInsets.only(left: 8, right: 8, top: 8),
|
||||||
|
height: projectViewModel.isArabic ? 320 : 240,
|
||||||
|
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[index].memberID,
|
||||||
|
textScaleFactor: 2.1,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
letterSpacing: 8.0,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
fontSize: 15),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
insuranceCardDetailsModel[index].companyName,
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 25,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Texts(
|
||||||
|
TranslationBase.of(context).policyHolder,
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
insuranceCardDetailsModel[index]
|
||||||
|
.memberName,
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Texts(TranslationBase.of(context).policyNo,
|
||||||
|
color: Colors.white),
|
||||||
|
Texts(
|
||||||
|
insuranceCardDetailsModel[index]
|
||||||
|
.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,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
insuranceCardDetailsModel[index].dOB,
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Texts(
|
||||||
|
TranslationBase.of(context).classTitle,
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
insuranceCardDetailsModel[index]
|
||||||
|
.subCategory,
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Texts(
|
||||||
|
TranslationBase.of(context).approval,
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
insuranceCardDetailsModel[index]
|
||||||
|
.approvalLimit
|
||||||
|
.toString(),
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if(insuranceCardDetailsModel.isEmpty)
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(10.0),
|
||||||
|
child: Card(
|
||||||
|
margin: EdgeInsets.fromLTRB(
|
||||||
|
8.0, 16.0, 8.0, 8.0),
|
||||||
|
color: Colors.white,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
padding: EdgeInsets.all(10.0),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(
|
||||||
|
top: 2.0,
|
||||||
|
left: 10.0,
|
||||||
|
right: 20.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Texts(
|
||||||
|
name,
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w500,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
TranslationBase.of(
|
||||||
|
context)
|
||||||
|
.fileno +
|
||||||
|
": " +patientID.toString(),
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w500,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 150,),
|
||||||
|
Image.asset('assets/images/no-data-found.png',width: 80,height: 80,),
|
||||||
|
SizedBox(height: 8,),
|
||||||
|
Texts(TranslationBase.of(context).noDataAvailable)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomSheet: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height:insuranceCardDetailsModel.isEmpty? MediaQuery.of(context).size.height * 0.14:MediaQuery.of(context).size.height * 0.21,
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(left: 8, right: 8),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
if(insuranceCardDetailsModel.isEmpty)
|
||||||
|
SecondaryButton(
|
||||||
|
textColor: Colors.white,
|
||||||
|
label: TranslationBase.of(context).scanNow.toUpperCase(),
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
onTap: () async {
|
||||||
|
confirmAttachInsuranceCardImageDialogDialog(
|
||||||
|
context: context,
|
||||||
|
name: name,
|
||||||
|
fileNo: patientID.toString(),
|
||||||
|
model: model);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
if(insuranceCardDetailsModel.isNotEmpty)
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),if(insuranceCardDetailsModel.isNotEmpty)
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),if(insuranceCardDetailsModel.isNotEmpty)
|
||||||
|
SecondaryButton(
|
||||||
|
textColor: Colors.white,
|
||||||
|
label: TranslationBase.of(context).disagree.toUpperCase(),
|
||||||
|
color: Colors.grey[800],
|
||||||
|
onTap: () async {
|
||||||
|
confirmAttachInsuranceCardImageDialogDialog(
|
||||||
|
context: context,
|
||||||
|
name: name,
|
||||||
|
fileNo: patientID.toString(),
|
||||||
|
model: model);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void confirmAttachInsuranceCardImageDialogDialog(
|
||||||
|
{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);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,261 @@
|
|||||||
|
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/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/transitions/fade_page.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../locator.dart';
|
||||||
|
import 'insurance_card_update_details.dart';
|
||||||
|
|
||||||
|
class InsurancePage extends StatelessWidget {
|
||||||
|
final InsuranceViewModel model;
|
||||||
|
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
|
||||||
|
|
||||||
|
InsurancePage({Key key, this.model}) : super(key: key);
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 65,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(10.0),
|
||||||
|
color: Colors.white,
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
padding: EdgeInsets.all(10.0),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: <Widget>[
|
||||||
|
if (model.user != null)
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(
|
||||||
|
top: 2.0,
|
||||||
|
left: 10.0,
|
||||||
|
right: 20.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Texts(
|
||||||
|
model.user.firstName ?? '' + " " + model.user.lastName ?? '',
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.fileno +
|
||||||
|
": " +
|
||||||
|
model.user.patientID
|
||||||
|
.toString(),
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(top: 2.0),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
child: SecondaryButton(
|
||||||
|
label: TranslationBase.of(
|
||||||
|
context)
|
||||||
|
.fetchData,
|
||||||
|
small: true,
|
||||||
|
textColor: Colors.white,
|
||||||
|
onTap: () {
|
||||||
|
getDetails(
|
||||||
|
setupID: '010266',
|
||||||
|
projectID: 15,
|
||||||
|
patientIdentificationID:
|
||||||
|
model.user
|
||||||
|
.patientIdentificationNo,
|
||||||
|
patientID: model
|
||||||
|
.user.patientID,
|
||||||
|
name: model.user
|
||||||
|
.firstName +
|
||||||
|
" " +
|
||||||
|
model
|
||||||
|
.user.lastName,context: context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false)
|
||||||
|
...List.generate(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, (index) =>
|
||||||
|
model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
|
||||||
|
? Container(
|
||||||
|
margin: EdgeInsets.all(10.0),
|
||||||
|
child: Card(
|
||||||
|
margin: EdgeInsets.fromLTRB(
|
||||||
|
8.0, 16.0, 8.0, 8.0),
|
||||||
|
color: Colors.white,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
padding: EdgeInsets.all(10.0),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(
|
||||||
|
top: 2.0,
|
||||||
|
left: 10.0,
|
||||||
|
right: 20.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Texts(
|
||||||
|
model
|
||||||
|
.getAllSharedRecordsByStatusResponse
|
||||||
|
.getAllSharedRecordsByStatusList[
|
||||||
|
index]
|
||||||
|
.patientName,
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w500,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
TranslationBase.of(
|
||||||
|
context)
|
||||||
|
.fileno +
|
||||||
|
": " +
|
||||||
|
model
|
||||||
|
.getAllSharedRecordsByStatusResponse
|
||||||
|
.getAllSharedRecordsByStatusList[
|
||||||
|
index]
|
||||||
|
.patientID
|
||||||
|
.toString(),
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w500,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Container(
|
||||||
|
margin:
|
||||||
|
EdgeInsets.only(top: 2.0),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
child: SecondaryButton(
|
||||||
|
label: TranslationBase
|
||||||
|
.of(context)
|
||||||
|
.fetchData,
|
||||||
|
small: true,
|
||||||
|
textColor:
|
||||||
|
Colors.white,
|
||||||
|
onTap: () {
|
||||||
|
getDetails(
|
||||||
|
projectID: 15,
|
||||||
|
patientIdentificationID: model
|
||||||
|
.getAllSharedRecordsByStatusResponse
|
||||||
|
.getAllSharedRecordsByStatusList[
|
||||||
|
index]
|
||||||
|
.patientIdenficationNumber,
|
||||||
|
setupID:
|
||||||
|
'010266',
|
||||||
|
patientID: model
|
||||||
|
.getAllSharedRecordsByStatusResponse
|
||||||
|
.getAllSharedRecordsByStatusList[
|
||||||
|
index]
|
||||||
|
.responseID,
|
||||||
|
name: model
|
||||||
|
.getAllSharedRecordsByStatusResponse
|
||||||
|
.getAllSharedRecordsByStatusList[
|
||||||
|
index].patientName,context: context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Container()
|
||||||
|
),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getDetails(
|
||||||
|
{String setupID,
|
||||||
|
int projectID,
|
||||||
|
String patientIdentificationID,
|
||||||
|
int patientID,
|
||||||
|
String name,BuildContext context}) {
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
_insuranceCardService
|
||||||
|
.getPatientInsuranceDetails(
|
||||||
|
setupID: setupID,
|
||||||
|
projectID: projectID,
|
||||||
|
patientID: patientID,
|
||||||
|
patientIdentificationID: patientIdentificationID)
|
||||||
|
.then((value) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
FadePage(
|
||||||
|
page: InsuranceCardUpdateDetails(
|
||||||
|
insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList,
|
||||||
|
patientID: patientID,
|
||||||
|
patientIdentificationID: patientIdentificationID,
|
||||||
|
name: name,
|
||||||
|
)));
|
||||||
|
} else {
|
||||||
|
AppToast.showErrorToast(message: _insuranceCardService.error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,257 @@
|
|||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:fl_chart/fl_chart.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class LineChartCurvedBloodPressure extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final List<TimeSeriesSales2> timeSeries1;
|
||||||
|
final List<TimeSeriesSales2> timeSeries2;
|
||||||
|
final int indexes;
|
||||||
|
|
||||||
|
LineChartCurvedBloodPressure(
|
||||||
|
{this.title, this.timeSeries1, this.indexes, this.timeSeries2});
|
||||||
|
|
||||||
|
List<int> xAxixs = List();
|
||||||
|
List<double> yAxixs = List();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
getXaxix();
|
||||||
|
return AspectRatio(
|
||||||
|
aspectRatio: 1.1,
|
||||||
|
child: Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(18)),
|
||||||
|
// color: Colors.white,
|
||||||
|
),
|
||||||
|
child: Stack(
|
||||||
|
children: <Widget>[
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: <Widget>[
|
||||||
|
const SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black, fontSize: 15, letterSpacing: 2),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
|
||||||
|
child: LineChart(
|
||||||
|
sampleData1(context),
|
||||||
|
swapAnimationDuration: const Duration(milliseconds: 250),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
color: Theme.of(context).primaryColor),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5,),
|
||||||
|
Texts(TranslationBase.of(context).systolicLng)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(width: 15,),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
color: Colors.grey),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5,),
|
||||||
|
Texts(TranslationBase.of(context).diastolicLng)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getXaxix() {
|
||||||
|
for (int index = 0; index < timeSeries1.length; index++) {
|
||||||
|
int mIndex = indexes * index;
|
||||||
|
if (mIndex < timeSeries1.length) {
|
||||||
|
xAxixs.add(mIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LineChartData sampleData1(context) {
|
||||||
|
return LineChartData(
|
||||||
|
lineTouchData: LineTouchData(
|
||||||
|
touchTooltipData: LineTouchTooltipData(
|
||||||
|
tooltipBgColor: Colors.white,
|
||||||
|
),
|
||||||
|
touchCallback: (LineTouchResponse touchResponse) {},
|
||||||
|
handleBuiltInTouches: true,
|
||||||
|
),
|
||||||
|
gridData: FlGridData(
|
||||||
|
show: true, drawVerticalLine: true, drawHorizontalLine: true),
|
||||||
|
titlesData: FlTitlesData(
|
||||||
|
bottomTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
getTextStyles: (value) => const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
rotateAngle: -65,
|
||||||
|
//rotateAngle:-65,
|
||||||
|
margin: 22,
|
||||||
|
getTitles: (value) {
|
||||||
|
if (timeSeries1.length < 15) {
|
||||||
|
if (timeSeries1.length > value.toInt()) {
|
||||||
|
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||||
|
} else
|
||||||
|
return '';
|
||||||
|
} else {
|
||||||
|
if (value.toInt() == 0)
|
||||||
|
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||||
|
if (value.toInt() == timeSeries1.length - 1)
|
||||||
|
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||||
|
if (xAxixs.contains(value.toInt())) {
|
||||||
|
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
),
|
||||||
|
leftTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
getTextStyles: (value) => const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
getTitles: (value) {
|
||||||
|
return '${value.toInt()}';
|
||||||
|
},
|
||||||
|
margin: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
borderData: FlBorderData(
|
||||||
|
show: true,
|
||||||
|
border: const Border(
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Colors.black,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
left: BorderSide(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
right: BorderSide(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
top: BorderSide(
|
||||||
|
color: Colors.transparent,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
minX: 0,
|
||||||
|
maxX: (timeSeries1.length - 1).toDouble(),
|
||||||
|
maxY: getMaxY() + 0.3,
|
||||||
|
minY: getMinY(),
|
||||||
|
lineBarsData: getData(context),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
double getMaxY() {
|
||||||
|
double max = 0;
|
||||||
|
timeSeries1.forEach((element) {
|
||||||
|
double resultValueDouble = element.sales;
|
||||||
|
if (resultValueDouble > max) max = resultValueDouble;
|
||||||
|
});
|
||||||
|
timeSeries2.forEach((element) {
|
||||||
|
double resultValueDouble = element.sales;
|
||||||
|
if (resultValueDouble > max) max = resultValueDouble;
|
||||||
|
});
|
||||||
|
|
||||||
|
return max.roundToDouble();
|
||||||
|
}
|
||||||
|
|
||||||
|
double getMinY() {
|
||||||
|
double min = timeSeries1[0].sales;
|
||||||
|
timeSeries1.forEach((element) {
|
||||||
|
double resultValueDouble = element.sales;
|
||||||
|
if (resultValueDouble < min) min = resultValueDouble;
|
||||||
|
});
|
||||||
|
timeSeries2.forEach((element) {
|
||||||
|
double resultValueDouble = element.sales;
|
||||||
|
if (resultValueDouble < min) min = resultValueDouble;
|
||||||
|
});
|
||||||
|
|
||||||
|
int value = min.toInt();
|
||||||
|
|
||||||
|
return value.toDouble();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<LineChartBarData> getData(context) {
|
||||||
|
List<FlSpot> spots = List();
|
||||||
|
for (int index = 0; index < timeSeries1.length; index++) {
|
||||||
|
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<FlSpot> spots2 = List();
|
||||||
|
for (int index = 0; index < timeSeries2.length; index++) {
|
||||||
|
spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales));
|
||||||
|
}
|
||||||
|
|
||||||
|
final LineChartBarData lineChartBarData1 = LineChartBarData(
|
||||||
|
spots: spots,
|
||||||
|
isCurved: true,
|
||||||
|
colors: [Theme.of(context).primaryColor],
|
||||||
|
barWidth: 5,
|
||||||
|
isStrokeCapRound: true,
|
||||||
|
dotData: FlDotData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
belowBarData: BarAreaData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
final LineChartBarData lineChartBarData2 = LineChartBarData(
|
||||||
|
spots: spots2,
|
||||||
|
isCurved: true,
|
||||||
|
colors: [Colors.grey],
|
||||||
|
barWidth: 5,
|
||||||
|
isStrokeCapRound: true,
|
||||||
|
dotData: FlDotData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
belowBarData: BarAreaData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return [lineChartBarData1, lineChartBarData2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,146 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class VitalSignBloodPressureWidget extends StatefulWidget {
|
||||||
|
final List<VitalSignResModel> vitalList;
|
||||||
|
final String title1;
|
||||||
|
final String title2;
|
||||||
|
final String title3;
|
||||||
|
final String viewKey1;
|
||||||
|
final String viewKey2;
|
||||||
|
|
||||||
|
VitalSignBloodPressureWidget(
|
||||||
|
{Key key, this.vitalList, this.title1, this.title2, this.viewKey1, this.title3, this.viewKey2});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
ProjectViewModel projectViewModel = Provider.of(context);
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.transparent,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)),
|
||||||
|
border: Border.all(color: Colors.grey, width: 1),
|
||||||
|
),
|
||||||
|
margin: EdgeInsets.all(20),
|
||||||
|
child: Container(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Table(
|
||||||
|
border: TableBorder.symmetric(
|
||||||
|
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
|
||||||
|
),
|
||||||
|
children: fullData(projectViewModel),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TableRow> fullData(ProjectViewModel projectViewModel) {
|
||||||
|
List<TableRow> tableRow = [];
|
||||||
|
tableRow.add(TableRow(children: [
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
|
||||||
|
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
TranslationBase.of(context).date,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
height: 60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Texts(widget.title2, color: Colors.white),
|
||||||
|
),
|
||||||
|
height: 60),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
|
||||||
|
topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Texts(widget.title3, color: Colors.white),
|
||||||
|
),
|
||||||
|
height: 60),
|
||||||
|
),
|
||||||
|
]));
|
||||||
|
widget.vitalList.forEach((vital) {
|
||||||
|
var data = vital.toJson()[widget.viewKey1];
|
||||||
|
if (data != 0)
|
||||||
|
tableRow.add(TableRow(children: [
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
color: Colors.white,
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
'${projectViewModel.isArabic ? DateUtil.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtil.getMonthArabic(vital.vitalSignDate.month) : DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
color: Colors.white,
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
'${vital.toJson()[widget.viewKey1]}',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
color: Colors.white,
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
'${vital.toJson()[widget.viewKey2]}',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]));
|
||||||
|
});
|
||||||
|
return tableRow;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_blood_pressurewideget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_wideget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'package:charts_flutter/flutter.dart' as charts;
|
||||||
|
|
||||||
|
import 'LineChartCurved.dart';
|
||||||
|
import 'LineChartCurvedBloodPressure.dart';
|
||||||
|
|
||||||
|
class VitalSingChartBloodPressure extends StatelessWidget {
|
||||||
|
VitalSingChartBloodPressure({
|
||||||
|
Key key,
|
||||||
|
@required this.vitalList,
|
||||||
|
@required this.name,
|
||||||
|
@required this.viewKey1,
|
||||||
|
@required this.viewKey2,
|
||||||
|
@required this.title1,
|
||||||
|
@required this.title2,
|
||||||
|
@required this.title3,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final List<VitalSignResModel> vitalList;
|
||||||
|
final String name;
|
||||||
|
final String viewKey1;
|
||||||
|
final String viewKey2;
|
||||||
|
final String title1;
|
||||||
|
final String title2;
|
||||||
|
final String title3;
|
||||||
|
List<TimeSeriesSales2> timeSeriesData1 = [];
|
||||||
|
List<TimeSeriesSales2> timeSeriesData2 = [];
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
generateData();
|
||||||
|
return Column(
|
||||||
|
children: <Widget>[
|
||||||
|
AppExpandableNotifier(
|
||||||
|
isExpand: true,
|
||||||
|
headerWidget: LineChartCurvedBloodPressure(
|
||||||
|
title: name,
|
||||||
|
timeSeries1: timeSeriesData1,
|
||||||
|
timeSeries2: timeSeriesData2,
|
||||||
|
indexes: timeSeriesData1.length ~/ 5.5,
|
||||||
|
),
|
||||||
|
bodyWidget: VitalSignBloodPressureWidget(
|
||||||
|
vitalList: vitalList,
|
||||||
|
title1: title1,
|
||||||
|
title2: title2,
|
||||||
|
title3: title3,
|
||||||
|
viewKey1: viewKey1,
|
||||||
|
viewKey2: viewKey2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
generateData() {
|
||||||
|
if (vitalList.length > 0) {
|
||||||
|
vitalList.reversed.toList().forEach(
|
||||||
|
(element) {
|
||||||
|
if (element.toJson()[viewKey1]?.toInt() != 0)
|
||||||
|
timeSeriesData1.add(
|
||||||
|
TimeSeriesSales2(
|
||||||
|
new DateTime(element.vitalSignDate.year,
|
||||||
|
element.vitalSignDate.month, element.vitalSignDate.day),
|
||||||
|
element.toJson()[viewKey1].toDouble(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (element.toJson()[viewKey2]?.toInt() != 0)
|
||||||
|
timeSeriesData2.add(
|
||||||
|
TimeSeriesSales2(
|
||||||
|
new DateTime(element.vitalSignDate.year,
|
||||||
|
element.vitalSignDate.month, element.vitalSignDate.day),
|
||||||
|
element.toJson()[viewKey2].toDouble(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue