re-design child vaccine and fix some funcrionalities

merge-update-with-lab-changes
mosazaid 5 years ago
parent ff85b2f1b2
commit f5d478fd27

@ -242,6 +242,10 @@ const Map localizedValues = {
"en": "Email Sent Successfully", "en": "Email Sent Successfully",
"ar": "تم إرسال البريد الإلكتروني بنجاح" "ar": "تم إرسال البريد الإلكتروني بنجاح"
}, },
"EmailSentError": {
"en": "Error Sending Email",
"ar": "خطأ في إرسال البريد الإلكتروني"
},
"close": {"en": "Close", "ar": "مغلق"}, "close": {"en": "Close", "ar": "مغلق"},
"booked": {"en": "Booked", "ar": "محجوز"}, "booked": {"en": "Booked", "ar": "محجوز"},
"confirmed": {"en": "Confirmed", "ar": "مؤكد"}, "confirmed": {"en": "Confirmed", "ar": "مؤكد"},
@ -1218,6 +1222,10 @@ const Map localizedValues = {
"en": "Send a copy of this report to the email", "en": "Send a copy of this report to the email",
"ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني" "ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني"
}, },
"update-email-msg": {
"en": "Email updated",
"ar": "تم تحديث البريد الالكتروني"
},
"update-email": {"en": "Update Email", "ar": "تحديث البريد الالكتروني"}, "update-email": {"en": "Update Email", "ar": "تحديث البريد الالكتروني"},
"booked-success": { "booked-success": {
"en": "The appointment has been successfully booked.", "en": "The appointment has been successfully booked.",
@ -1465,4 +1473,30 @@ const Map localizedValues = {
"en": "Nearest ER", "en": "Nearest ER",
"ar": "أقرب ER" "ar": "أقرب ER"
}, },
"covid19_driveThrueTest": {
"en": "'Covid-19- Drive-Thru Test'",
"ar": "Covid-19- الفحص من خلال القيادة"
},
"E-Referral": {
"en": "'E-Referral'",
"ar": "الإحالة الإلكترونية"
},
"childName": {
"en": "'CHILD NAME'",
"ar": "إسم الطفل"
},
"recordDeleted": {
"en": "'Record Deleted'",
"ar": "تم حذف السجل"
},
"msg_email_address_up_to_date": {
"en": "Please ensure that the email address is up-to-date and process to view the schedule",
"ar": "يرجى التأكد من أن عنوان البريد الإلكتروني محدث وأن العملية لعرض الجدول الزمني"
},
"add-new-child": {"en" : "ADD NEW CHILD", "ar": "إضافة طفل جديد"},
"visit": {"en" : "Visit", "ar": "الزيارة"},
"send-child-email-msg": {"en" : "Send the child's schedule to the email", "ar": "أرسل جدول الطفل إلى البريد الإلكتروني"},
"vaccination-add-child-msg": {"en" : "Add the child's information below to receive the schedule of vaccinations.", "ar": "أضف معلومات الطفل أدناه للحصول على جدول التطعيمات."},
"child_added_successfully": {"en" : "Child added successfully", "ar": "تمت إضافة الطفل بنجاح"},
}; };

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import '../base_service.dart'; import '../base_service.dart';
class VaccinationTableService extends BaseService { class VaccinationTableService extends BaseService {
@ -10,19 +12,18 @@ class VaccinationTableService extends BaseService {
Future getCreateVaccinationTableOrders() async { Future getCreateVaccinationTableOrders(List_BabyInformationModel babyInfo, bool sendEmail) async {
String babyBDFormatted = "${DateUtil.convertDateToString(babyInfo.dOB)}/";
hasError = false; hasError = false;
await getUser(); await getUser();
body['BabyName']="fffffffffff eeeeeeeeeeeeee"; body['BabyName']= babyInfo.babyName;
body['DOB'] = "/Date(1585774800000+0300)/"; body['DOB'] = babyBDFormatted;
body['EmailAddress'] = user.emailAddress; body['EmailAddress'] = user.emailAddress;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['SendEmail'] = false; body['SendEmail'] = sendEmail;
body['IsLogin'] =true; body['IsLogin'] =true;
await baseAppClient.post(GET_TABLE_REQUEST, await baseAppClient.post(GET_TABLE_REQUEST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
createVaccinationTableModelList.clear(); createVaccinationTableModelList.clear();

@ -1,4 +1,5 @@
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/add_newchild_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart';
@ -11,14 +12,12 @@ import '../base_view_model.dart';
class VaccinationTableViewModel extends BaseViewModel{ class VaccinationTableViewModel extends BaseViewModel{
VaccinationTableService _creteVaccinationTableService = locator<VaccinationTableService>(); VaccinationTableService _creteVaccinationTableService = locator<VaccinationTableService>();
List<CreateVaccinationTable> get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;
// String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent; getCreateVaccinationTable(List_BabyInformationModel babyInfo, bool sendEmail) async {
//String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent;
List<CreateVaccinationTable> get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList;
getCreateVaccinationTable() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders(); await _creteVaccinationTableService.getCreateVaccinationTableOrders(babyInfo, sendEmail);//getCreateNewBabyOrders();
if ( _creteVaccinationTableService.hasError) { if ( _creteVaccinationTableService.hasError) {
error = _creteVaccinationTableService.error; error = _creteVaccinationTableService.error;

@ -203,7 +203,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
imageLocation: imageLocation:
'assets/images/al-habib_online_payment_service_icon.png', 'assets/images/al-habib_online_payment_service_icon.png',
title: 'Covid-19- Drive-Thru Test', title: TranslationBase.of(context).covid19_driveThrueTest,
), ),
ServicesContainer( ServicesContainer(
onTap: () { onTap: () {
@ -227,7 +227,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
), ),
imageLocation: 'assets/images/pharmacy_logo.png', imageLocation: 'assets/images/pharmacy_logo.png',
title: 'Pharmacy'), title: TranslationBase.of(context).pharmacy),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -248,7 +248,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
: EReferralPage()), : EReferralPage()),
), ),
imageLocation: 'assets/images/ereferral_service_icon.png', imageLocation: 'assets/images/ereferral_service_icon.png',
title: 'E-Referral', title: TranslationBase.of(context).ereferral,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
@ -259,7 +259,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
imageLocation: imageLocation:
'assets/images/new-design/family_menu_icon_red.png', 'assets/images/new-design/family_menu_icon_red.png',
title: 'My Family', title: TranslationBase.of(context).myFamily,
), ),
if(projectViewModel.havePrivilege(35)) if(projectViewModel.havePrivilege(35))
ServicesContainer( ServicesContainer(
@ -269,7 +269,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
imageLocation: imageLocation:
'assets/images/new-design/children_vaccines_icon.png', 'assets/images/new-design/children_vaccines_icon.png',
title: 'Child Vaccines', title: TranslationBase.of(context).childVaccine,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
@ -289,7 +289,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
FadePage(page: SymptomInfo()), FadePage(page: SymptomInfo()),
), ),
imageLocation: 'assets/images/new-design/body_icon.png', imageLocation: 'assets/images/new-design/body_icon.png',
title: 'Symptom Checker'), title: TranslationBase.of(context).symptomCheckerTitle),
if(projectViewModel.havePrivilege(36)) if(projectViewModel.havePrivilege(36))
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
@ -297,7 +297,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
FadePage(page: BloodDonationPage()), FadePage(page: BloodDonationPage()),
), ),
imageLocation: 'assets/images/new-design/blood_icon.png', imageLocation: 'assets/images/new-design/blood_icon.png',
title: 'Blood Donation', title: TranslationBase.of(context).bloodD,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
@ -308,7 +308,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
imageLocation: imageLocation:
'assets/images/new-design/health_calculator_icon.png', 'assets/images/new-design/health_calculator_icon.png',
title: 'Health Calculators', title: TranslationBase.of(context).calculators,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
@ -319,7 +319,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
imageLocation: imageLocation:
'assets/images/new-design/health_convertor_icon.png', 'assets/images/new-design/health_convertor_icon.png',
title: 'Health Converter', title: TranslationBase.of(context).converters,
), ),
if(projectViewModel.havePrivilege(38)) if(projectViewModel.havePrivilege(38))
ServicesContainer( ServicesContainer(
@ -370,7 +370,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
}, },
imageLocation: imageLocation:
'assets/images/new-design/twitter_dashboard_icon.png', 'assets/images/new-design/twitter_dashboard_icon.png',
title: 'Latest News', title: TranslationBase.of(context).latestNews,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart'; import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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';
@ -84,10 +85,12 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
return BaseView<AddNewChildViewModel>( return BaseView<AddNewChildViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: "Vaccintion", appBarTitle: TranslationBase.of(context).vaccination,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
@ -96,10 +99,10 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
// crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox( SizedBox(
height: 50, height: 20,
), ),
Texts( Texts(
"Add the child's information below to recieve the schedule of vaccinations.", TranslationBase.of(context).vaccinationAddChildMsg,
//+model.user.firstName, //+model.user.firstName,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
@ -107,14 +110,14 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
height: 12, height: 12,
), ),
NewTextFields( NewTextFields(
hintText: "First Name", hintText: TranslationBase.of(context).firstName,
controller: _firstTextController, controller: _firstTextController,
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
NewTextFields( NewTextFields(
hintText: "Second Name", hintText: TranslationBase.of(context).middleName,
controller: _secondTextController, controller: _secondTextController,
), ),
SizedBox( SizedBox(
@ -124,34 +127,28 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Gender:", TranslationBase.of(context).gender,
textAlign: TextAlign.end, textAlign: TextAlign.end,
), ),
], ],
), ),
Container( Container(
height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity, width: double.infinity,
height: size.height * 0.12,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( Expanded(
height: MediaQuery.of(context).size.height * 0.12, child: Container(
width: 175,
color: Colors.white, color: Colors.white,
child: SecondaryButton( child: SecondaryButton(
textColor: textColor:
checkedValue == 1 ? Colors.white : Colors.black, checkedValue == 1 ? Colors.white : Colors.black,
color: checkedValue == 1 ? Colors.red : Colors.white, color: checkedValue == 1 ? Colors.red : Colors.white,
label: TranslationBase.of(context).male,
label: "Male",
//
onTap: () { onTap: () {
setState(() { setState(() {
checkedValue = 1; checkedValue = 1;
print("checkedValue=" + checkedValue.toString()); print("checkedValue=" + checkedValue.toString());
@ -161,15 +158,15 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
}, },
), ),
), ),
Container( ),
height: MediaQuery.of(context).size.height * 0.12, Expanded(
width: 175, child: Container(
color: Colors.white, color: Colors.white,
child: SecondaryButton( child: SecondaryButton(
textColor: textColor:
checkedValue == 2 ? Colors.white : Colors.black, checkedValue == 2 ? Colors.white : Colors.black,
color: checkedValue == 2 ? Colors.red : Colors.white, color: checkedValue == 2 ? Colors.red : Colors.white,
label: "Female", label: TranslationBase.of(context).female,
// //
onTap: () { onTap: () {
setState(() { setState(() {
@ -181,6 +178,7 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
// bloodDetails. // bloodDetails.
}, },
), ),
),
) )
], ],
), ),
@ -193,7 +191,7 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Date Of Birth::", TranslationBase.of(context).dob,
textAlign: TextAlign.end, textAlign: TextAlign.end,
), ),
], ],
@ -254,24 +252,24 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
74, 74,
1, 1,
), ),
label: "Add", label: TranslationBase.of(context).add,
// //
onTap: () async{ onTap: () async {
newChild.babyName = _firstTextController.text + " " + _secondTextController.text; newChild.babyName = _firstTextController.text +
" " +
_secondTextController.text;
newChild.gender = checkedValue.toString(); newChild.gender = checkedValue.toString();
newChild.strDOB = getStartDay(); newChild.strDOB = getStartDay();
newChild.tempValue = true; newChild.tempValue = true;
newChild.isLogin = true; newChild.isLogin = true;
await model.createNewBabyOrders(newChild: newChild); await model.createNewBabyOrders(newChild: newChild);
if(model.isAdded){ if (model.isAdded) {
AppToast.showSuccessToast(message: "Record Added"); AppToast.showSuccessToast(message: TranslationBase.of(context).childAddedSuccessfully);
Navigator.pop(context,model.isAdded); Navigator.pop(context, model.isAdded);
}else{ } else {
//TODO handling error //TODO handling error
} }
}, },
), ),
), ),

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'
import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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';
@ -22,29 +23,50 @@ class ChildPage extends StatefulWidget {
class _ChildPageState extends State<ChildPage> class _ChildPageState extends State<ChildPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
DeleteBaby deleteBaby = DeleteBaby(); DeleteBaby deleteBaby = DeleteBaby();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
final double height = (size.height - kToolbarHeight - 60);
final double itemWidth = size.width / 2;
final double itemHeight = height / 2 + 40;
var checkedValue = true; var checkedValue = true;
return BaseView<ChildVaccinesViewModel>( return BaseView<ChildVaccinesViewModel>(
onModelReady: (model) => model.getNewUserOrders(), onModelReady: (model) => model.getNewUserOrders(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: " Vaccination", appBarTitle: TranslationBase.of(context).vaccination,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: Container(
height: height * 0.85,
child: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(left: 15, right: 15, top: 70), margin: EdgeInsets.only(left: 8, right: 8, top: 16),
child: Column( child: GridView.count(
crossAxisCount: 2,
childAspectRatio: (itemWidth / (itemHeight + 0)),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
controller: ScrollController(keepScrollOffset: true),
shrinkWrap: true,
padding: const EdgeInsets.all(4.0),
children: [ children: [
...List.generate( ...List.generate(
model.babyInformationModelList.length, model.babyInformationModelList.length,
(index) => Container( (index) => InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: VaccinationTablePage(model.babyInformationModelList[index]),
),
);
},
child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 0, right: 0, bottom: 20), left: 0, right: 0, bottom: 20),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(
@ -54,11 +76,12 @@ class _ChildPageState extends State<ChildPage>
color: Colors.white, color: Colors.white,
), ),
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: 200,//double.infinity, //double.infinity,
child: Column( child: Column(
children: [ children: [
Row(children: [ Row(children: [
Texts("CHILD NAME"), Texts(TranslationBase.of(context)
.childName),
]), ]),
Row(children: [ Row(children: [
Texts(model Texts(model
@ -96,19 +119,14 @@ class _ChildPageState extends State<ChildPage>
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: VaccinationTablePage(model.babyInformationModelList[index]),
page: VaccinationTablePage(),
), ),
); );
}, },
) )
]), ]),
Row(children: [ Row(children: [
Texts("Birthday"), Texts(TranslationBase.of(context).dob),
]), ]),
Row(children: [ Row(children: [
IconButton( IconButton(
@ -116,9 +134,7 @@ class _ChildPageState extends State<ChildPage>
'assets/images/new-design/calender-secondary.png'), 'assets/images/new-design/calender-secondary.png'),
tooltip: '', tooltip: '',
onPressed: () { onPressed: () {
setState(() { setState(() {});
});
}, },
), ),
Texts(DateUtil.yearMonthDay(model Texts(DateUtil.yearMonthDay(model
@ -130,49 +146,47 @@ class _ChildPageState extends State<ChildPage>
icon: new Image.asset( icon: new Image.asset(
'assets/images/new-design/garbage.png'), 'assets/images/new-design/garbage.png'),
tooltip: '', tooltip: '',
onPressed: ()async { onPressed: () async {
//===================== //=====================
await model.deleteBabyOrders(newChild:deleteBaby ); await model.deleteBabyOrders(
newChild: deleteBaby);
deleteBaby.babyID = model
deleteBaby.babyID=model.babyInformationModelList[index] .babyInformationModelList[index]
.babyID; .babyID;
await model.deleteBabyOrders(newChild:deleteBaby ); await model.deleteBabyOrders(
if(model.isDeleted){ newChild: deleteBaby);
AppToast.showSuccessToast(message: "Record Deleted"); if (model.isDeleted) {
Navigator.pop(context,model.isDeleted); AppToast.showSuccessToast(
}else{ message:
TranslationBase.of(context)
.recordDeleted);
Navigator.pop(
context, model.isDeleted);
} else {
//TODO handling error //TODO handling error
} }
}, },
), ),
Texts("Delete"), Texts(TranslationBase.of(context)
.deleteView),
]), ]),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
], ],
), ),
), ),
),
) )
], ],
)) ))),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12, height: height * 0.15,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(16),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: checkedValue == false color: checkedValue == false
@ -183,7 +197,7 @@ class _ChildPageState extends State<ChildPage>
74, 74,
1, 1,
), ),
label: "ADD NEW CHILD ", label: TranslationBase.of(context).addNewChild,
// //
onTap: () { onTap: () {
Navigator.push( Navigator.push(

@ -1,10 +1,10 @@
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
@ -13,27 +13,26 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ChildVaccinesPage extends StatefulWidget { class ChildVaccinesPage extends StatefulWidget {
@override @override
_ChildVaccinesPageState createState() => _ChildVaccinesPageState(); _ChildVaccinesPageState createState() => _ChildVaccinesPageState();
} }
class _ChildVaccinesPageState extends State<ChildVaccinesPage> class _ChildVaccinesPageState extends State<ChildVaccinesPage>
with SingleTickerProviderStateMixin{ with SingleTickerProviderStateMixin {
TextEditingController titleController = TextEditingController(); TextEditingController titleController = TextEditingController();
var checkedValue=false; var checkedValue = false;
String addEmail=""; String addEmail = "";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<UserInformationViewModel>( return BaseView<UserInformationViewModel>(
onModelReady: (model) => model.getUserInformationRequestOrders(), onModelReady: (model) => model.getUserInformationRequestOrders(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, appBarTitle: TranslationBase.of(context).vaccination,
//TranslationBase.of(context).advancePayment,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Column( child: Column(
@ -43,57 +42,61 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child:Container( child: Container(
child: Texts("Welcome back",fontSize: 20,), child: Texts(
) , TranslationBase.of(context).welcomeBack,
fontSize: 20,
),
),
),
Divider(
color: Colors.black,
indent: 10,
endIndent: 10,
), ),
Divider(color:Colors.black , indent: 10,
endIndent: 10,),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child:Container( child: Container(
child: Texts("Please ensure that the email address is up-to-date and process to view the schedule",fontSize: 20,), child: Texts(
) , TranslationBase.of(context).msg_email_address_up_to_date,
fontSize: 20,
),
),
), ),
Divider(color:Colors.black , indent: 10, Divider(
endIndent: 10,), color: Colors.black,
indent: 10,
endIndent: 10,
),
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child:Container( child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
fillColor: Colors.red, fillColor: Colors.red,
hintText: model.user.emailAddress, hintText: model.user.emailAddress,
controller: titleController, controller: titleController,
fontSize: 20, fontSize: 20,
hintColor: Colors.black, hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
onChanged: (text) { onChanged: (text) {
addEmail=text; addEmail = text;
model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true; model.user.emailAddress == addEmail
? checkedValue = false
: checkedValue = true;
}, },
validator: (value) { validator: (value) {
if (value == null) {
if (value == null) return model.user.emailAddress;
{ } else {
return model.user.emailAddress; return model.user.emailAddress;
} }
else
{
return model.user.emailAddress;}
}, },
), ),
), ),
@ -101,46 +104,49 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
Container( Container(
height: MediaQuery.of(context).size.height * 0.12, height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), color: checkedValue == false
label: "UPDATE EMAIL", ? Colors.white24
: Color.fromRGBO(
63,
72,
74,
1,
),
label: TranslationBase.of(context).updateEmail,
// //
onTap: (){ onTap: () {
model.user.emailAddress=addEmail.toString(); model.user.emailAddress = addEmail.toString();
AppToast.showSuccessToast( AppToast.showSuccessToast(
message: "Email updated"); message: TranslationBase.of(context).updateEmailMsg);
// bloodDetails.city=_selectedHospital.toString(); // bloodDetails.city=_selectedHospital.toString();
// bloodDetails. // bloodDetails.
}, },
), ),
), ),
Container( Container(
height: MediaQuery.of(context).size.height * 0.12, height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: Color.fromRGBO(63, 72, 74, 1,), color: Color.fromRGBO(
label: " VIEW LIST OF CHILDREN", 63,
72,
74,
1,
),
label: TranslationBase.of(context).viewListChildren,
// //
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage( FadePage(
page: ChildPage(), page: ChildPage(),
), ),
), ),
), ),
), ),
@ -217,10 +223,8 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
) )
], ],
), ),
), ),
), ),
); );
} }
} }

@ -7,8 +7,11 @@ import 'package:flutter/material.dart';
class SelectGenderDialog extends StatefulWidget { class SelectGenderDialog extends StatefulWidget {
final Email; final Email;
final Function okFunction;
const SelectGenderDialog({Key key, this.Email, this.okFunction})
: super(key: key);
const SelectGenderDialog({Key key, this.Email}) : super(key: key);
@override @override
_SelectGenderDialogState createState() => _SelectGenderDialogState(); _SelectGenderDialogState createState() => _SelectGenderDialogState();
} }
@ -33,9 +36,8 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "), title: Text(
"${TranslationBase.of(context).sendChildEmailMsg}\n Tamer.dasdasdas@gmail.com "),
), ),
), ),
) )
@ -44,7 +46,6 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
SizedBox( SizedBox(
height: 5.0, height: 5.0,
), ),
SizedBox( SizedBox(
height: 5.0, height: 5.0,
), ),
@ -82,7 +83,7 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
AppToast.showSuccessToast(message: "Email Sended"); widget.okFunction();
// widget.onValueSelected(beneficiaryType); // widget.onValueSelected(beneficiaryType);
Navigator.pop(context); Navigator.pop(context);
}, },
@ -105,7 +106,4 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
], ],
); );
} }
} }

@ -1,8 +1,13 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.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/medical/reports_monthly_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/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/uitl/translations_delegate_base.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/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';
@ -12,77 +17,138 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'dialogs/SelectGenderDialog.dart'; import 'dialogs/SelectGenderDialog.dart';
class VaccinationTablePage extends StatelessWidget { class VaccinationTablePage extends StatelessWidget {
final List_BabyInformationModel babyInfo;
VaccinationTablePage(this.babyInfo);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
final double height = (size.height - kToolbarHeight - 60);
var checkedValue; var checkedValue;
return BaseView<VaccinationTableViewModel>( return BaseView<VaccinationTableViewModel>(
onModelReady: (model) => model.getCreateVaccinationTable(),//getUserTermsAndConditions(), onModelReady: (model) => model.getCreateVaccinationTable(babyInfo, false),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
appBarTitle: "Vaccination", appBarTitle: TranslationBase.of(context).vaccination,
body: SingleChildScrollView( body: Container(
child:Container( height: height * 0.85,
margin: EdgeInsets.only(left: 15,right: 15,top: 70), child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(left: 16, right: 16, top: 16),
child: Column( child: Column(
children: [//babyInformationModelList.length children: [
...List.generate(model.creteVaccinationTableModelList.length, (index) => Row(
Container( children: [
Expanded(
child: Texts(TranslationBase.of(context).childName),
),
Expanded(
child: Texts(TranslationBase.of(context).dob),
),
],
),
SizedBox(
height: 10,
),
Row(
children: [
Expanded(
child: Texts(babyInfo.babyName),
),
Expanded(
child: Texts(DateUtil.getFormattedDate(
babyInfo.dOB, "MMM dd,yyyy")),
),
],
),
SizedBox(
height: 10,
),
Divider(
color: Colors.black,
),
Row(
children: [
Text(TranslationBase.of(context).visit),
SizedBox(
width: 25,
),
Expanded(
child: Text(TranslationBase.of(context).description)),
Text(TranslationBase.of(context).dueDate),
],
),
...List.generate(
model.creteVaccinationTableModelList.length,
(index) => Container(
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all(color: Colors.white, width: 0.5), // border: Border.all(color: Colors.white, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(5)), borderRadius: BorderRadius.all(Radius.circular(5)),
color: Colors.white, // color: Colors.white,
), ),
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
child: Column( child: Column(
children: [ children: [
Row(children: [ Row(
Text(model.creteVaccinationTableModelList[index].visit), children: [
SizedBox(width: 10,), Text(model
.creteVaccinationTableModelList[index]
.visit),
SizedBox(
width: 10,
),
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start, MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Html( 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:"<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, data: model
.creteVaccinationTableModelList[
index]
.vaccinesDescription,
), ),
],), ],
), ),
Text(model.creteVaccinationTableModelList[index].givenAt), ),
Text(model
.creteVaccinationTableModelList[index]
],), .givenAt),
Divider(color:Colors.black ,),
], ],
) ),
Divider(
color: Colors.black,
) ),
],
) )))
], ],
), ),
),
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12, height: height * 0.15,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), color: checkedValue == false
label: "Send Email ", ? Colors.white24
: Color.fromRGBO(
63,
72,
74,
1,
),
label: TranslationBase.of(context).sendEmail,
// //
onTap: () { onTap: () {
//SelectGenderDialog(); //SelectGenderDialog();
@ -90,13 +156,22 @@ class VaccinationTablePage extends StatelessWidget {
showDialog( showDialog(
context: context, context: context,
child: SelectGenderDialog( child: SelectGenderDialog(
okFunction: () async {
await model.getCreateVaccinationTable(babyInfo, true);
if (model.state == ViewState.Idle) {
AppToast.showSuccessToast(
message: TranslationBase.of(context)
.emailSentSuccessfully);
} else {
AppToast.showErrorToast(
message: TranslationBase.of(context)
.EmailSentError);
}
},
), ),
); );
//========= //=========
} }),
),
), ),
), ),
); );

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_wideget.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_wideget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';

@ -4,7 +4,7 @@ import 'package:intl/intl.dart';
class DateUtil { class DateUtil {
/// convert String To Date function /// convert String To Date function
/// [date] String we want to convert /// [date] String we want to convert
static DateTime convertStringToDate(String date) { static DateTime convertStringToDate(String date) { // /Date(1585774800000+0300)/
if (date != null) { if (date != null) {
const start = "/Date("; const start = "/Date(";
const end = "+0300)"; const end = "+0300)";

@ -581,6 +581,8 @@ class TranslationBase {
localizedValues['UpdateSuccessfully'][locale.languageCode]; localizedValues['UpdateSuccessfully'][locale.languageCode];
String get emailSentSuccessfully => String get emailSentSuccessfully =>
localizedValues['EmailSentSuccessfully'][locale.languageCode]; localizedValues['EmailSentSuccessfully'][locale.languageCode];
String get EmailSentError =>
localizedValues['EmailSentError'][locale.languageCode];
String get checkVaccineAvailability => String get checkVaccineAvailability =>
localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode]; localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode];
String get myVaccinesAvailability => String get myVaccinesAvailability =>
@ -1172,6 +1174,7 @@ class TranslationBase {
String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode]; String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode];
String get scanNow => localizedValues['scan-now'][locale.languageCode]; String get scanNow => localizedValues['scan-now'][locale.languageCode];
String get pharmacyServiceTermsCondition => localizedValues['pharmacyServiceTermsCondition'][locale.languageCode]; String get pharmacyServiceTermsCondition => localizedValues['pharmacyServiceTermsCondition'][locale.languageCode];
String get recordDeleted => localizedValues['recordDeleted'][locale.languageCode];
String get referralStatus => String get referralStatus =>
localizedValues['referralStatus'][locale.languageCode]; localizedValues['referralStatus'][locale.languageCode];
@ -1214,7 +1217,6 @@ class TranslationBase {
String get viewListChildren => String get viewListChildren =>
localizedValues['view-list-children'][locale.languageCode]; localizedValues['view-list-children'][locale.languageCode];
String get addChild => localizedValues['add-child'][locale.languageCode]; String get addChild => localizedValues['add-child'][locale.languageCode];
String get childName => localizedValues['child-name'][locale.languageCode];
String get childDob => localizedValues['childDob'][locale.languageCode]; String get childDob => localizedValues['childDob'][locale.languageCode];
String get deletedChildMes => String get deletedChildMes =>
localizedValues['deleted-child-mes'][locale.languageCode]; localizedValues['deleted-child-mes'][locale.languageCode];
@ -1247,7 +1249,16 @@ class TranslationBase {
String get driveThru => localizedValues['driveThru'][locale.languageCode]; String get driveThru => localizedValues['driveThru'][locale.languageCode];
String get NearestErDesc => localizedValues['NearestErDesc'][locale.languageCode]; String get NearestErDesc => localizedValues['NearestErDesc'][locale.languageCode];
String get NearestEr => localizedValues['NearestEr'][locale.languageCode]; String get NearestEr => localizedValues['NearestEr'][locale.languageCode];
String get covid19_driveThrueTest => localizedValues['covid19_driveThrueTest'][locale.languageCode];
String get eReferral => localizedValues['E-Referral'][locale.languageCode];
String get vaccination => localizedValues["vaccination"][locale.languageCode];
String get msg_email_address_up_to_date => localizedValues["msg_email_address_up_to_date"][locale.languageCode];
String get updateEmailMsg => localizedValues["update-email-msg"][locale.languageCode];
String get childName => localizedValues["childName"][locale.languageCode];
String get addNewChild => localizedValues["add-new-child"][locale.languageCode];
String get sendChildEmailMsg => localizedValues["send-child-email-msg"][locale.languageCode];
String get vaccinationAddChildMsg => localizedValues["vaccination-add-child-msg"][locale.languageCode];
String get childAddedSuccessfully => localizedValues["child_added_successfully"][locale.languageCode];
} }

Loading…
Cancel
Save