Merge branch 'mirza_home_page' into development_new_design_2.0

merge-update-with-lab-changes
Mirza.Shafique 4 years ago
commit 957ff9039b

@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.da
import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/new/child_initial_page.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/new/child_vaccine_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/new/child_vaccine_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart';
@ -278,7 +279,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage(page: ChildVaccinePage()), FadePage(page: ChildInitialPage()),
), ),
imageLocation: 'assets/images/new-design/children_vaccines_icon.png', imageLocation: 'assets/images/new-design/children_vaccines_icon.png',
title: TranslationBase.of(context).childVaccine, title: TranslationBase.of(context).childVaccine,

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/add_new_chil
import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.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/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';
@ -27,15 +28,7 @@ class AddNewChildPage extends StatefulWidget {
String dateAdd; String dateAdd;
List<DateTime> _scheduleList = List(); List<DateTime> _scheduleList = List();
List<DayOfWeek> daysOfWeek = [ List<DayOfWeek> daysOfWeek = [DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Saturday, DayOfWeek.Sunday];
DayOfWeek.Monday,
DayOfWeek.Tuesday,
DayOfWeek.Wednesday,
DayOfWeek.Thursday,
DayOfWeek.Friday,
DayOfWeek.Saturday,
DayOfWeek.Sunday
];
DateTime startDay; DateTime startDay;
DateTime endDay; DateTime endDay;
@ -43,13 +36,11 @@ class AddNewChildPage extends StatefulWidget {
//AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) : super(key: key); //AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) : super(key: key);
AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) { AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) {
startDay = DateTime.now(); startDay = DateTime.now();
endDay = endDay = DateTime.now(); //endDay = DateTime.now().add(Duration(days: days));
DateTime.now(); //endDay = DateTime.now().add(Duration(days: days));
int hour = 24; //(24 / frequency).round(); int hour = 24; //(24 / frequency).round();
int durations = 24 ~/ hour; int durations = 24 ~/ hour;
for (int count = 0; count < durations; count++) { for (int count = 0; count < durations; count++) {
_scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, _scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, (hour * count)));
DateTime.now().day, (hour * count)));
} }
} }
@ -81,117 +72,105 @@ 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: TranslationBase.of(context).vaccination, appBarTitle: TranslationBase.of(context).vaccination,
body: SingleChildScrollView( showNewAppBar: true,
physics: ScrollPhysics(), body: Container(
child: Container(
margin: EdgeInsets.all(12),
child: Column( child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox( Expanded(
height: 20, child: Padding(
), padding: EdgeInsets.all(12),
Texts( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).vaccinationAddChildMsg, TranslationBase.of(context).vaccinationAddChildMsg,
//+model.user.firstName, //+model.user.firstName,
textAlign: TextAlign.center, style: TextStyle(
fontSize: 16,
letterSpacing: -0.64,
fontWeight: FontWeight.w600,
),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
NewTextFields( inputWidget(TranslationBase.of(context).firstName, "", _firstTextController),
hintText: TranslationBase.of(context).firstName,
controller: _firstTextController,
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
NewTextFields( inputWidget(TranslationBase.of(context).middleName, "", _secondTextController),
hintText: TranslationBase.of(context).middleName,
controller: _secondTextController,
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text( Text(
TranslationBase.of(context).gender, TranslationBase.of(context).selectGender,
textAlign: TextAlign.end, style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
), ),
],
), ),
Container( Row(
width: double.infinity,
height: size.height * 0.12,
padding: EdgeInsets.all(12),
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Container( child: Row(
color: Colors.white, children: [
child: SecondaryButton( Radio(
textColor: value: checkedValue,
checkedValue == 1 ? Colors.white : Colors.black, groupValue: 1,
color: checkedValue == 1 ? Colors.red : Colors.white, onChanged: (v) {
label: TranslationBase.of(context).male,
onTap: () {
setState(() { setState(() {
checkedValue = 1; checkedValue = 1;
print("checkedValue=" + checkedValue.toString());
}); });
}),
// bloodDetails. Text(
}, TranslationBase.of(context).male,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
), ),
)
],
), ),
), ),
Expanded( Expanded(
child: Container( child: Row(
color: Colors.white, children: [
child: SecondaryButton( Radio(
textColor: value: checkedValue,
checkedValue == 2 ? Colors.white : Colors.black, groupValue: 2,
color: checkedValue == 2 ? Colors.red : Colors.white, onChanged: (v) {
label: TranslationBase.of(context).female,
//
onTap: () {
setState(() { setState(() {
checkedValue = 2; checkedValue = 2;
print("checkedValue=" + checkedValue.toString());
}); });
// bloodDetails.city=_selectedHospital.toString(); }),
Text(
// bloodDetails. TranslationBase.of(context).female,
}, style: TextStyle(
), fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
), ),
) )
], ],
), ),
), ),
],
),
//========== //==========
SizedBox( SizedBox(
height: 6, height: 6,
), ),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).dob,
textAlign: TextAlign.end,
),
],
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showDatePicker( DatePicker.showDatePicker(
@ -211,21 +190,51 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
); );
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(15),
color: Colors.white), color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(//getStartDay() Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).dob,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
//getStartDay()
// DateUtil.yearMonthDay(DateTime.now()) // DateUtil.yearMonthDay(DateTime.now())
getStartDay()), getStartDay(),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
),
],
),
Icon( Icon(
Icons.calendar_today, Icons.calendar_today,
color: Colors.black, color: Color(0xff575757),
size: 18,
) )
], ],
), ),
@ -234,26 +243,23 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
//=========
],
),
),
),
Container( Container(
height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(16),
color: Colors.white,
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: checkedValue == false color: checkedValue == false ? Colors.white24 : CustomColors.accentColor,
? Colors.white24
: Color.fromRGBO(
63,
72,
74,
1,
),
label: TranslationBase.of(context).add, label: TranslationBase.of(context).add,
// //
onTap: () async { onTap: () async {
newChild.babyName = _firstTextController.text + newChild.babyName = _firstTextController.text + " " + _secondTextController.text;
" " +
_secondTextController.text;
newChild.gender = checkedValue.toString(); newChild.gender = checkedValue.toString();
newChild.strDOB = getStartDay(); newChild.strDOB = getStartDay();
newChild.tempValue = true; newChild.tempValue = true;
@ -269,11 +275,9 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
}, },
), ),
), ),
//=========
], ],
), ),
), ),
),
// bottomSheet: // bottomSheet:
), ),
); );
@ -313,4 +317,77 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
), ),
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text,
controller: _controller,
maxLines: lines,
onChanged: (value) => {setState(() {})},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
suffixIconConstraints: BoxConstraints(minWidth: 50),
suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
),
);
}
} }

@ -0,0 +1,149 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'child_vaccine_page.dart';
class ChildInitialPage extends StatefulWidget {
@override
_ChildVaccinesPageState createState() => _ChildVaccinesPageState();
}
class _ChildVaccinesPageState extends State<ChildInitialPage> with SingleTickerProviderStateMixin {
TextEditingController titleController = TextEditingController();
var checkedValue = false;
String addEmail = "";
@override
Widget build(BuildContext context) {
return BaseView<UserInformationViewModel>(
onModelReady: (model) => model.getUserInformationRequestOrders(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isShowDecPage: true,
showNewAppBarTitle: true,
showNewAppBar: true,
description: TranslationBase.of(context).childVaccineInfo,
imagesInfo: [
ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/child-vaccines/en/0.png',
imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/child-vaccines/ar/0.png'),
ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/child-vaccines/en/1.png',
imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/child-vaccines/ar/1.png')
],
appBarTitle: TranslationBase.of(context).vaccination,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).welcomeBack,
style: TextStyle(
fontSize: 16,
letterSpacing: -0.64,
fontWeight: FontWeight.w600,
),
),
SizedBox(
height: 16,
),
Text(
TranslationBase.of(context).msg_email_address_up_to_date,
style: TextStyle(
fontSize: 16,
letterSpacing: -0.64,
fontWeight: FontWeight.w600,
),
),
SizedBox(
height: 20,
),
TextFields(
fillColor: Colors.red,
hintText: model.user != null ? model.user.emailAddress : "",
controller: titleController,
fontSize: 14,
hintColor: Colors.black,
fontWeight: FontWeight.w600,
suffixIcon: checkedValue ? Icons.check_box : Icons.check_box_outline_blank,
onSuffixTap: () {
setState(() {
checkedValue = !checkedValue;
});
},
onChanged: (text) {
addEmail = text;
model.user.emailAddress == addEmail ? checkedValue = false : checkedValue = true;
},
validator: (value) {
if (value == null) {
return model.user.emailAddress;
} else {
return model.user.emailAddress;
}
},
),
],
),
),
mFlex(1),
Container(
width: double.infinity,
color: Colors.white,
padding: EdgeInsets.all(16),
child: Column(
children: [
if (checkedValue)
SecondaryButton(
textColor: Colors.white,
color: checkedValue == false ? Colors.white24 : CustomColors.green,
label: TranslationBase.of(context).updateEmail,
//
onTap: () {
model.user.emailAddress = addEmail.toString();
AppToast.showSuccessToast(message: TranslationBase.of(context).updateEmailMsg);
// bloodDetails.city=_selectedHospital.toString();
// bloodDetails.
},
),
if (checkedValue) mHeight(16),
SecondaryButton(
textColor: Colors.white,
color: CustomColors.accentColor,
label: TranslationBase.of(context).viewListChildren,
//
onTap: () => Navigator.push(
context,
FadePage(
page: ChildVaccinePage(),
),
),
),
],
),
),
],
),
),
);
}
}

@ -56,7 +56,7 @@ class _ChildPageState extends State<ChildVaccinePage> with SingleTickerProviderS
); );
}, },
child: Container( child: Container(
margin: EdgeInsets.only(left: 16, right: 16), margin: EdgeInsets.only(left: 16, right: 16,top: index==0?16:0,bottom: index==model.babyInformationModelList.length-1?16:0),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(12)), borderRadius: BorderRadius.all(Radius.circular(12)),

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.da
import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/new/child_initial_page.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/new/child_vaccine_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/new/child_vaccine_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart';
@ -103,7 +104,7 @@ class ServicesView extends StatelessWidget {
} else if (index == 14) { } else if (index == 14) {
Navigator.push( Navigator.push(
context, context,
FadePage(page: ChildVaccinePage()), FadePage(page: ChildInitialPage()),
); );
} else if (index == 15) { } else if (index == 15) {
Navigator.pop(context); Navigator.pop(context);

Loading…
Cancel
Save