You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
185 lines
7.3 KiB
Dart
185 lines
7.3 KiB
Dart
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
|
|
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
|
|
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart';
|
|
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart';
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.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:flutter_flexible_toast/flutter_flexible_toast.dart';
|
|
import 'package:flutter_html/flutter_html.dart';
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
import 'dialogs/ConfirmSendEmailDialog.dart';
|
|
|
|
class VaccinationTablePage extends StatelessWidget {
|
|
final List_BabyInformationModel babyInfo;
|
|
final List_UserInformationModel informationModel;
|
|
|
|
const VaccinationTablePage({Key key, this.babyInfo, this.informationModel})
|
|
: super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var checkedValue;
|
|
return BaseView<VaccinationTableViewModel>(
|
|
onModelReady: (model) => model.getCreateVaccinationTable(babyInfo: babyInfo, informationModel: informationModel),
|
|
builder: (_, model, w) => AppScaffold(
|
|
isShowAppBar: true,
|
|
baseViewModel: model,
|
|
appBarTitle: TranslationBase.of(context).vaccination,
|
|
body: SingleChildScrollView(
|
|
child: Container(
|
|
margin: EdgeInsets.only(left: 15, right: 15, top: 10),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
child: Column(
|
|
children: [
|
|
Texts(TranslationBase.of(context).childName),
|
|
Texts(
|
|
babyInfo.babyName ?? '',
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Column(
|
|
children: [
|
|
Texts(TranslationBase.of(context).childDob),
|
|
Row(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Icon(
|
|
FontAwesomeIcons.calendarCheck,
|
|
color: Colors.red,
|
|
),
|
|
SizedBox(
|
|
width: 15,
|
|
),
|
|
Texts(DateUtil.yearMonthDay(babyInfo.dOB) ?? ''),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
SizedBox(
|
|
height: 15,
|
|
),
|
|
Divider(),
|
|
Column(
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Texts(TranslationBase.of(context).visit),
|
|
SizedBox(
|
|
width: 10,
|
|
),
|
|
Expanded(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Texts(TranslationBase.of(context)
|
|
.descriptionVaccination),
|
|
],
|
|
),
|
|
),
|
|
Texts(TranslationBase.of(context).dueDate),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
...List.generate(
|
|
model.creteVaccinationTableModelList.length,
|
|
(index) => Container(
|
|
padding: EdgeInsets.all(12),
|
|
width: double.infinity,
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Texts(model
|
|
.creteVaccinationTableModelList[index].visit),
|
|
SizedBox(
|
|
width: 10,
|
|
),
|
|
Expanded(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Html(
|
|
data: model
|
|
.creteVaccinationTableModelList[index]
|
|
.vaccinesDescription,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Texts(model
|
|
.creteVaccinationTableModelList[index].givenAt),
|
|
],
|
|
),
|
|
Divider(
|
|
color: Colors.white,
|
|
height: 3,
|
|
thickness: 1.0,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
bottomSheet: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Container(
|
|
height: MediaQuery.of(context).size.height * 0.10,
|
|
width: double.infinity,
|
|
padding: EdgeInsets.all(12),
|
|
child: SecondaryButton(
|
|
textColor: Colors.white,
|
|
color: checkedValue == false
|
|
? Colors.white24
|
|
: Color.fromRGBO(
|
|
63,
|
|
72,
|
|
74,
|
|
1,
|
|
),
|
|
label: TranslationBase.of(context).sendEmail,
|
|
onTap: () {
|
|
showDialog(
|
|
context: context,
|
|
child: ConfirmSendEmailDialog(
|
|
email: informationModel.emailAddress,
|
|
onTap: () async {
|
|
await model.getCreateVaccinationTable(babyInfo: babyInfo, informationModel: informationModel,isSendEmail: true);
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).emailSuccess,toastLength: Toast.LENGTH_LONG);
|
|
|
|
},
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|