|
|
|
@ -1,16 +1,21 @@
|
|
|
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/theme/colors.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_html/flutter_html.dart';
|
|
|
|
import 'package:flutter_html/flutter_html.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'dialogs/SelectGenderDialog.dart';
|
|
|
|
import 'dialogs/SelectGenderDialog.dart';
|
|
|
|
|
|
|
|
|
|
|
|
@ -23,6 +28,7 @@ class VaccinationTablePage extends StatelessWidget {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
var size = MediaQuery.of(context).size;
|
|
|
|
var size = MediaQuery.of(context).size;
|
|
|
|
final double height = (size.height - kToolbarHeight - 60);
|
|
|
|
final double height = (size.height - kToolbarHeight - 60);
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
|
|
var checkedValue;
|
|
|
|
var checkedValue;
|
|
|
|
return BaseView<VaccinationTableViewModel>(
|
|
|
|
return BaseView<VaccinationTableViewModel>(
|
|
|
|
@ -31,121 +37,107 @@ class VaccinationTablePage extends StatelessWidget {
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
appBarTitle: TranslationBase.of(context).vaccination,
|
|
|
|
appBarTitle: TranslationBase.of(context).vaccination,
|
|
|
|
|
|
|
|
showNewAppBar: true,
|
|
|
|
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
|
|
|
|
backgroundColor: CustomColors.appBackgroudGrey2Color,
|
|
|
|
body: Container(
|
|
|
|
body: Container(
|
|
|
|
height: height * 0.85,
|
|
|
|
height: double.infinity,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(left: 16, right: 16, top: 16),
|
|
|
|
margin: EdgeInsets.only(left: 16, right: 16, top: 16),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Container(
|
|
|
|
|
|
|
|
decoration: containerRadius(Colors.white, 12),
|
|
|
|
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Text(
|
|
|
|
child: Texts(TranslationBase.of(context).childName),
|
|
|
|
babyInfo.babyName,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
letterSpacing: -0.64,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Texts(TranslationBase.of(context).dob),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 10,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
mHeight(8),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Text(
|
|
|
|
child: Texts(babyInfo.babyName),
|
|
|
|
TranslationBase.of(context).gender + " :",
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
letterSpacing: -0.4,
|
|
|
|
|
|
|
|
color: CustomColors.textColor,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Texts(DateUtil.getFormattedDate(
|
|
|
|
|
|
|
|
babyInfo.dOB, "MMM dd,yyyy")),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
Text(
|
|
|
|
|
|
|
|
babyInfo.gender == 1 ? TranslationBase.of(context).female : TranslationBase.of(context).male,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
letterSpacing: -0.4,
|
|
|
|
|
|
|
|
color: CustomColors.black,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 10,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Divider(
|
|
|
|
],
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(TranslationBase.of(context).visit),
|
|
|
|
Text(
|
|
|
|
SizedBox(
|
|
|
|
TranslationBase.of(context).dateOfBirth + " :",
|
|
|
|
width: 25,
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
letterSpacing: -0.4,
|
|
|
|
|
|
|
|
color: CustomColors.textColor,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Text(TranslationBase.of(context).description)),
|
|
|
|
|
|
|
|
Text(TranslationBase.of(context).dueDate),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
...List.generate(
|
|
|
|
Text(
|
|
|
|
model.creteVaccinationTableModelList.length,
|
|
|
|
DateUtil.getFormattedDate(babyInfo.dOB, "MMM dd,yyyy"),
|
|
|
|
(index) => Container(
|
|
|
|
style: TextStyle(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
fontSize: 12,
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
// border: Border.all(color: Colors.white, width: 0.5),
|
|
|
|
letterSpacing: -0.4,
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
|
|
|
color: CustomColors.black,
|
|
|
|
// color: Colors.white,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(model
|
|
|
|
|
|
|
|
.creteVaccinationTableModelList[index]
|
|
|
|
|
|
|
|
.visit),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
width: 10,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
],
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Html(
|
|
|
|
|
|
|
|
// data:"<html><head><style type='text/css'>.Test {list-style-image:url('http://10.50.100.198:4444/Images/Bullet_List_Small.png');}</style></head><body><table><tr align='left'><td align='left'>BCG</td></tr><tr align='left'><td align='left'>HEPATITIS B</td></tr></table></body></html>"//model.creteVaccinationTableModelList[index].vaccinesDescription
|
|
|
|
|
|
|
|
data: model
|
|
|
|
|
|
|
|
.creteVaccinationTableModelList[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.vaccinesDescription,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(model
|
|
|
|
mHeight(12),
|
|
|
|
.creteVaccinationTableModelList[index]
|
|
|
|
Container(
|
|
|
|
.givenAt),
|
|
|
|
decoration: containerRadius(Colors.white, 12),
|
|
|
|
],
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
|
|
|
child: Table(
|
|
|
|
|
|
|
|
columnWidths: {
|
|
|
|
|
|
|
|
0: FlexColumnWidth(1.8),
|
|
|
|
|
|
|
|
1: FlexColumnWidth(1.8),
|
|
|
|
|
|
|
|
2: FlexColumnWidth(1.8),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
children: fullData(context, model, projectViewModel),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Divider(
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)))
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bottomSheet: Container(
|
|
|
|
Container(
|
|
|
|
height: height * 0.15,
|
|
|
|
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
child: SecondaryButton(
|
|
|
|
child: SecondaryButton(
|
|
|
|
textColor: Colors.white,
|
|
|
|
textColor: Colors.white,
|
|
|
|
color: checkedValue == false
|
|
|
|
color: CustomColors.accentColor,
|
|
|
|
? Colors.white24
|
|
|
|
|
|
|
|
: Color.fromRGBO(
|
|
|
|
|
|
|
|
63,
|
|
|
|
|
|
|
|
72,
|
|
|
|
|
|
|
|
74,
|
|
|
|
|
|
|
|
1,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
label: TranslationBase.of(context).sendEmail,
|
|
|
|
label: TranslationBase.of(context).sendEmail,
|
|
|
|
//
|
|
|
|
//
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
@ -157,21 +149,52 @@ class VaccinationTablePage extends StatelessWidget {
|
|
|
|
okFunction: () async {
|
|
|
|
okFunction: () async {
|
|
|
|
await model.getCreateVaccinationTable(babyInfo, true);
|
|
|
|
await model.getCreateVaccinationTable(babyInfo, true);
|
|
|
|
if (model.state == ViewState.Idle) {
|
|
|
|
if (model.state == ViewState.Idle) {
|
|
|
|
AppToast.showSuccessToast(
|
|
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).emailSentSuccessfully);
|
|
|
|
message: TranslationBase.of(context)
|
|
|
|
|
|
|
|
.emailSentSuccessfully);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
AppToast.showErrorToast(
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).EmailSentError);
|
|
|
|
message: TranslationBase.of(context)
|
|
|
|
|
|
|
|
.EmailSentError);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
//=========
|
|
|
|
//=========
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<TableRow> fullData(BuildContext context, VaccinationTableViewModel model, ProjectViewModel projectViewModel) {
|
|
|
|
|
|
|
|
List<TableRow> tableRow = [];
|
|
|
|
|
|
|
|
tableRow.add(
|
|
|
|
|
|
|
|
TableRow(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Utils.tableColumnTitle(TranslationBase.of(context).visit),
|
|
|
|
|
|
|
|
Utils.tableColumnTitle(TranslationBase.of(context).description),
|
|
|
|
|
|
|
|
Utils.tableColumnTitle(TranslationBase.of(context).dueDate),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
model.creteVaccinationTableModelList.forEach(
|
|
|
|
|
|
|
|
(diabtec) {
|
|
|
|
|
|
|
|
tableRow.add(
|
|
|
|
|
|
|
|
TableRow(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Utils.tableColumnValue(diabtec.visit, isCapitable: false, mProjectViewModel: projectViewModel),
|
|
|
|
|
|
|
|
// Utils.tableColumnValue(diabtec.vaccinesDescription, isCapitable: false, mProjectViewModel: projectViewModel),
|
|
|
|
|
|
|
|
Html(
|
|
|
|
|
|
|
|
// data:"<html><head><style type='text/css'>.Test {list-style-image:url('http://10.50.100.198:4444/Images/Bullet_List_Small.png');}</style></head><body><table><tr align='left'><td align='left'>BCG</td></tr><tr align='left'><td align='left'>HEPATITIS B</td></tr></table></body></html>"//model.creteVaccinationTableModelList[index].vaccinesDescription
|
|
|
|
|
|
|
|
data: diabtec.vaccinesDescription,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Utils.tableColumnValue(diabtec.givenAt, isCapitable: false, mProjectViewModel: projectViewModel),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
return tableRow;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|