merge-update-with-lab-changes
haroon amjad 5 years ago
parent 363cf78884
commit 4560037f97

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/doctor_post_pre_images_page.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/doctor_post_pre_images_page.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
@ -19,7 +20,6 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_material_pickers/flutter_material_pickers.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'BookConfirm.dart'; import 'BookConfirm.dart';
@ -115,7 +115,14 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
widget.doctor.noOfPatientsRate, widget.doctor.noOfPatientsRate,
"", "",
), ),
onTap: () {}, onTap: () {
Navigator.push(
context,
FadePage(
page: SchedulePage(widget.doctor),
),
);
},
onRatingAndReviewTap: () { onRatingAndReviewTap: () {
getDoctorRatingsDetails(); getDoctorRatingsDetails();
}, },

@ -194,7 +194,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: CustomColors.green, disabledColor: CustomColors.green,
onPressed: () async { onPressed: () async {
if (await Permission.contacts.request().isGranted) { if (await Permission.calendar.request().isGranted) {
_showReminderDialog(context); _showReminderDialog(context);
} else { } else {
requestPermissions().then((results) { requestPermissions().then((results) {

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -17,7 +18,6 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
@ -44,10 +44,17 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
DoctorList doctorList = new DoctorList();
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 2, vsync: this); _tabController = new TabController(length: 2, vsync: this);
AppointmentDetails.showFooterButton = false; AppointmentDetails.showFooterButton = false;
doctorList.doctorID = widget.appo.doctorID;
doctorList.clinicID = widget.appo.clinicID;
doctorList.projectID = widget.appo.projectID;
super.initState(); super.initState();
} }
@ -165,7 +172,14 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
buttonIcon: 'assets/images/new/Boo_ Appointment.svg', buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
onRatingAndReviewTap: getDoctorRatingsDetails, onRatingAndReviewTap: getDoctorRatingsDetails,
onTap: () {}, onTap: () {
Navigator.push(
context,
FadePage(
page: SchedulePage(doctorList),
),
);
},
), ),
SizedBox(height: 10), SizedBox(height: 10),
TabBar( TabBar(
@ -256,11 +270,18 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).cancel, TranslationBase.of(context).cancel,
() => { () {
// Navigator.of(context).push(FadePage(page: Register())), ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).cancelAppoMsg,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: cancelAppointment,
cancelFunction: () => {});
dialog.showAlertDialog(context);
}, },
color: Color(0xffEAEAEA), // color: Color(0xffEAEAEA),
textColor: Color(0xff000000), // textColor: Color(0xff000000),
), ),
), ),
); );
@ -269,7 +290,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).reviewAppointment, TranslationBase.of(context).reviewAppointment,
DocAvailableAppointments.areSlotsAvailable ? goToBookConfirm : null, goToBookConfirm,
// DocAvailableAppointments.areSlotsAvailable ? goToBookConfirm : null,
color: Color(0xFFD02127), color: Color(0xFFD02127),
disabledColor: Color(0xff28323A).withOpacity(0.3), disabledColor: Color(0xff28323A).withOpacity(0.3),
), ),

@ -4,12 +4,12 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class ConfirmedButtons { class ConfirmedButtons {
var buttons = [ var buttons = [
{"title": TranslationBase.of(AppGlobal.context).reschedule, "subtitle": TranslationBase.of(AppGlobal.context).appointment, "icon": "reschedule.svg", "caller": "openReschedule"}, {"title": TranslationBase.of(AppGlobal.context).reschedule, "subtitle": TranslationBase.of(AppGlobal.context).appointment, "icon": "reschedule.svg", "caller": "openReschedule"},
{ // {
"title": TranslationBase.of(AppGlobal.context).cancel_nocaps, // "title": TranslationBase.of(AppGlobal.context).cancel_nocaps,
"subtitle": TranslationBase.of(AppGlobal.context).appointment, // "subtitle": TranslationBase.of(AppGlobal.context).appointment,
"icon": "assets/images/new-design/cancel_icon.png", // "icon": "assets/images/new-design/cancel_icon.png",
"caller": "onCancelAppointment" // "caller": "onCancelAppointment"
}, // },
{"title": TranslationBase.of(AppGlobal.context).raise, "subtitle": TranslationBase.of(AppGlobal.context).complaint, "icon": "raise_comp.svg", "caller": "insertComplaint"}, {"title": TranslationBase.of(AppGlobal.context).raise, "subtitle": TranslationBase.of(AppGlobal.context).complaint, "icon": "raise_comp.svg", "caller": "insertComplaint"},
{"title": TranslationBase.of(AppGlobal.context).add, "subtitle": TranslationBase.of(AppGlobal.context).reminder, "icon": "add_reminder.svg", "caller": "addReminder"}, {"title": TranslationBase.of(AppGlobal.context).add, "subtitle": TranslationBase.of(AppGlobal.context).reminder, "icon": "add_reminder.svg", "caller": "addReminder"},
{"title": TranslationBase.of(AppGlobal.context).hospital, "subtitle": TranslationBase.of(AppGlobal.context).location, "icon": "hosp_location.svg", "caller": "navigateToProject"}, {"title": TranslationBase.of(AppGlobal.context).hospital, "subtitle": TranslationBase.of(AppGlobal.context).location, "icon": "hosp_location.svg", "caller": "navigateToProject"},

@ -9,12 +9,12 @@ class ConfirmedButtonsAllowCheckIn {
"icon": "reschedule.svg", "icon": "reschedule.svg",
"caller": "openReschedule", "caller": "openReschedule",
}, },
{ // {
"title": TranslationBase.of(AppGlobal.context).cancel_nocaps, // "title": TranslationBase.of(AppGlobal.context).cancel_nocaps,
"subtitle": TranslationBase.of(AppGlobal.context).appointment, // "subtitle": TranslationBase.of(AppGlobal.context).appointment,
"icon": "assets/images/new-design/cancel_icon.png", // "icon": "assets/images/new-design/cancel_icon.png",
"caller": "onCancelAppointment", // "caller": "onCancelAppointment",
}, // },
{ {
"title": TranslationBase.of(AppGlobal.context).raise, "title": TranslationBase.of(AppGlobal.context).raise,
"subtitle": TranslationBase.of(AppGlobal.context).complaint, "subtitle": TranslationBase.of(AppGlobal.context).complaint,

@ -47,8 +47,7 @@ class _ToDoState extends State<ToDo> {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; AuthenticatedUser authUser;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
@ -62,11 +61,8 @@ class _ToDoState extends State<ToDo> {
if (authenticatedUserObject.isLogin) getPatientData(); if (authenticatedUserObject.isLogin) getPatientData();
}); });
super.initState(); super.initState();
imagesInfo.add(ImagesInfo( imagesInfo
imageEn: .add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png'));
'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png'));
int endTime = DateTime.now().millisecondsSinceEpoch + 1000 * 30; int endTime = DateTime.now().millisecondsSinceEpoch + 1000 * 30;
controller = CountdownTimerController(endTime: endTime); controller = CountdownTimerController(endTime: endTime);
} }
@ -93,12 +89,8 @@ class _ToDoState extends State<ToDo> {
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length, itemCount: widget.appoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
print("ttt "+getNextActionImage(widget print("ttt " + getNextActionImage(widget.appoList[index].nextAction));
.appoList[index] print("ttt " + widget.appoList[index].nextAction.toString());
.nextAction));
print("ttt "+widget
.appoList[index]
.nextAction.toString());
return Container( return Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.all(10.0),
child: Column( child: Column(
@ -120,50 +112,23 @@ class _ToDoState extends State<ToDo> {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset("assets/images/new-design/time_icon.png", width: 20.0, height: 20.0),
"assets/images/new-design/time_icon.png",
width: 20.0,
height: 20.0),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10.0, right: 10.0),
left: 10.0, right: 10.0),
child: Text( child: Text(
DateUtil.getWeekDayMonthDayYearDateFormatted( DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate( DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") +
widget.appoList[index]
.appointmentDate),
projectViewModel.isArabic
? "ar"
: "en") +
" " + " " +
widget.appoList[index].startTime widget.appoList[index].startTime.substring(0, 5),
.substring(0, 5),
style: TextStyle(fontSize: 10.0)), style: TextStyle(fontSize: 10.0)),
), ),
!widget.appoList[index] !widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(),
.isLiveCareAppointment
? Image.asset(
"assets/images/new-design/hospital_address_icon.png",
width: 20.0,
height: 20.0)
: Container(),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 5.0, right: 5.0),
left: 5.0, right: 5.0), child: widget.appoList[index].isLiveCareAppointment
child: widget.appoList[index]
.isLiveCareAppointment
? Container() ? Container()
: Text( : Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-",
widget.appoList[index] overflow: TextOverflow.clip, maxLines: 2, style: TextStyle(fontSize: 10.0)),
.projectName !=
null
? widget.appoList[index]
.projectName
: "-",
overflow: TextOverflow.clip,
maxLines: 2,
style:
TextStyle(fontSize: 10.0)),
), ),
], ],
), ),
@ -179,76 +144,39 @@ class _ToDoState extends State<ToDo> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: MediaQuery.of(context) height: MediaQuery.of(context).size.height * 0.1,
.size
.height *
0.1,
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),
child: ClipRRect( child: ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(100.0),
BorderRadius.circular(100.0), child: Image.network(widget.appoList[index].doctorImageURL, fit: BoxFit.fill),
child: Image.network(
widget.appoList[index]
.doctorImageURL,
fit: BoxFit.fill),
), ),
), ),
), ),
Expanded( Expanded(
flex: 3, flex: 3,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
top: 10.0,
left: 20.0,
right: 20.0),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
widget.appoList[index] style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.bold, letterSpacing: 1.0)),
.doctorTitle +
" " +
widget.appoList[index]
.doctorNameObj,
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight:
FontWeight.bold,
letterSpacing: 1.0)),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
top: 3.0, bottom: 3.0), child: Text(getDoctorSpeciality(widget.appoList[index].doctorSpeciality).trim(),
child: Text( style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: 1.0)),
getDoctorSpeciality(widget
.appoList[index]
.doctorSpeciality)
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment
.spaceBetween,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
RatingBar.readOnly( RatingBar.readOnly(
initialRating: widget initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
.appoList[index]
.actualDoctorRate
.toDouble(),
size: 20.0, size: 20.0,
filledColor: filledColor: Colors.yellow[700],
Colors.yellow[700], emptyColor: Colors.grey[500],
emptyColor:
Colors.grey[500],
isHalfAllowed: true, isHalfAllowed: true,
halfFilledIcon: halfFilledIcon: Icons.star_half,
Icons.star_half,
filledIcon: Icons.star, filledIcon: Icons.star,
emptyIcon: Icons.star, emptyIcon: Icons.star,
), ),
@ -256,28 +184,14 @@ class _ToDoState extends State<ToDo> {
), ),
Container( Container(
child: CountdownTimer( child: CountdownTimer(
controller: new CountdownTimerController( controller:
endTime: DateTime.now() new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60),
.millisecondsSinceEpoch + widgetBuilder: (_, CurrentRemainingTime time) {
(widget
.appoList[
index]
.remaniningHoursTocanPay *
1000) *
60),
widgetBuilder: (_,
CurrentRemainingTime
time) {
return time != null return time != null
? Text( ? Text(
'${time.days != null ? time.days : "0"}:${time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours}:${time.min}:${time.sec} ' + '${time.days != null ? time.days : "0"}:${time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours}:${time.min}:${time.sec} ' +
TranslationBase.of( TranslationBase.of(context).upcomingTimeLeft,
context) style: TextStyle(fontSize: 12.0, color: Color(0xff40ACC9)))
.upcomingTimeLeft,
style: TextStyle(
fontSize: 12.0,
color: Color(
0xff40ACC9)))
: Container(); : Container();
}, },
), ),
@ -289,29 +203,15 @@ class _ToDoState extends State<ToDo> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => performNextAction( onTap: () => performNextAction(widget.appoList[index]),
widget.appoList[index]),
child: Container( child: Container(
margin: EdgeInsets.only(top: 20.0), margin: EdgeInsets.only(top: 20.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(getNextActionImage(widget.appoList[index].nextAction), width: 50.0, height: 50.0),
getNextActionImage(widget
.appoList[index]
.nextAction),
width: 50.0,
height: 50.0),
Container( Container(
margin: margin: EdgeInsets.only(top: 5.0),
EdgeInsets.only(top: 5.0), child: Text(getNextActionText(widget.appoList[index].nextAction), textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
child: Text(
getNextActionText(widget
.appoList[index]
.nextAction),
textAlign:
TextAlign.center,
style: TextStyle(
fontSize: 12.0)),
) )
], ],
), ),
@ -329,33 +229,18 @@ class _ToDoState extends State<ToDo> {
Expanded( Expanded(
flex: 2, flex: 2,
child: Container( child: Container(
child: Text( child: Text(getNextActionDescription(widget.appoList[index].nextAction), style: TextStyle(fontSize: 12.0, color: Colors.grey[700])),
getNextActionDescription(widget
.appoList[index].nextAction),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[700])),
), ),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
navigateToAppointmentDetails( navigateToAppointmentDetails(context, widget.appoList[index]);
context,
widget.appoList[index]);
}, },
child: Container( child: Container(
child: Text( child: Text(TranslationBase.of(context).upcomingDetails,
TranslationBase.of(context) textAlign: TextAlign.end, style: TextStyle(fontSize: 12.0, color: new Color(0xFF40ACC9), decoration: TextDecoration.underline)),
.upcomingDetails,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12.0,
color:
new Color(0xFF40ACC9),
decoration: TextDecoration
.underline)),
), ),
), ),
) )
@ -368,38 +253,21 @@ class _ToDoState extends State<ToDo> {
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10.0), bottomRight: Radius.circular(10.0)),
bottomLeft: Radius.circular(10.0),
bottomRight: Radius.circular(10.0)),
color: Color(0xff20bc44), color: Color(0xff20bc44),
), ),
height: 30.0, height: 30.0,
padding: EdgeInsets.only(right:15), padding: EdgeInsets.only(right: 15),
margin: EdgeInsets.symmetric(horizontal:20), margin: EdgeInsets.symmetric(horizontal: 20),
transform: Matrix4.translationValues(0.0, -8.0, 0.0), transform: Matrix4.translationValues(0.0, -8.0, 0.0),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/video.png") : Image.asset("assets/images/new-design/walkin.png"),
widget.appoList[index].isLiveCareAppointment widget.appoList[index].isLiveCareAppointment
? Image.asset( ? Text(TranslationBase.of(context).videoAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
"assets/images/new-design/video.png") : Text(TranslationBase.of(context).walkinAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
: Image.asset(
"assets/images/new-design/walkin.png"),
widget.appoList[index].isLiveCareAppointment
? Text(
TranslationBase.of(context).videoAppo,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 11.0))
: Text(
TranslationBase.of(context)
.walkinAppo,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 11.0))
], ],
), ),
), ),
@ -428,15 +296,11 @@ class _ToDoState extends State<ToDo> {
break; break;
case 15: case 15:
return widget.languageID == 'ar' return widget.languageID == 'ar' ? "assets/images/new-design/pay_online_button_arabic_disabled.png" : "assets/images/new-design/pay_online_button_disabled.png";
? "assets/images/new-design/pay_online_button_arabic_disabled.png"
: "assets/images/new-design/pay_online_button_disabled.png";
break; break;
case 20: case 20:
return widget.languageID == 'ar' return widget.languageID == 'ar' ? "assets/images/new-design/pay_online_button_arabic.png" : "assets/images/new-design/pay_online_button.png";
? "assets/images/new-design/pay_online_button_arabic.png"
: "assets/images/new-design/pay_online_button.png";
break; break;
case 30: case 30:
@ -567,8 +431,7 @@ class _ToDoState extends State<ToDo> {
} }
getLanguageID() async { getLanguageID() async {
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
setState(() { setState(() {
widget.languageID = languageID; widget.languageID = languageID;
}); });
@ -605,12 +468,8 @@ class _ToDoState extends State<ToDo> {
return docSpeciality; return docSpeciality;
} }
Future navigateToAppointmentDetails(context, appo) async { Future navigateToAppointmentDetails(context, AppoitmentAllHistoryResultList appo) async {
Navigator.push( Navigator.push(context, FadePage(page: AppointmentDetails(appo: appo, parentIndex: appo.patientStatusType == 42 ? 1 : 0))).then((value) {
context,
FadePage(
page: AppointmentDetails(appo: appo)))
.then((value) {
getPatientAppointmentHistory(); getPatientAppointmentHistory();
}); });
} }
@ -626,8 +485,7 @@ class _ToDoState extends State<ToDo> {
if (res['AppoimentAllHistoryResultList'].length != 0) { if (res['AppoimentAllHistoryResultList'].length != 0) {
widget.appoList.clear(); widget.appoList.clear();
res['AppoimentAllHistoryResultList'].forEach((v) { res['AppoimentAllHistoryResultList'].forEach((v) {
widget.appoList widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
.add(new AppoitmentAllHistoryResultList.fromJson(v));
}); });
} else { } else {
Navigator.of(context).popAndPushNamed(HOME); Navigator.of(context).popAndPushNamed(HOME);
@ -649,10 +507,7 @@ class _ToDoState extends State<ToDo> {
getLiveCareAppointmentPatientShare(context, service, appo); getLiveCareAppointmentPatientShare(context, service, appo);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) {
.getPatientShare(appo.appointmentNo.toString(), appo.clinicID,
appo.projectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse); openPaymentDialog(appo, widget.patientShareResponse);
@ -664,13 +519,9 @@ class _ToDoState extends State<ToDo> {
} }
} }
getLiveCareAppointmentPatientShare(context, DoctorsListService service, getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) {
AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) {
.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(),
appo.clinicID, appo.projectID, context)
.then((res) {
print(res); print(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
@ -706,33 +557,28 @@ class _ToDoState extends State<ToDo> {
}); });
} }
Future navigateToQR( Future navigateToQR(context, String appoQR, PatientShareResponse patientShareResponse) async {
context, String appoQR, PatientShareResponse patientShareResponse) async {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: QRCode( page: QRCode(
patientShareResponse: patientShareResponse, patientShareResponse: patientShareResponse,
appoQR: appoQR, appoQR: appoQR,
))).then((value) { ))).then((value) {
getPatientAppointmentHistory(); getPatientAppointmentHistory();
}); });
} }
openPaymentDialog(AppoitmentAllHistoryResultList appo, openPaymentDialog(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) {
PatientShareResponse patientShareResponse) {
showGeneralDialog( showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5), barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) { transitionBuilder: (context, a1, a2, widget) {
final curvedValue = final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform( return Transform(
transform: transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity( child: Opacity(
opacity: a1.value, opacity: a1.value,
child: PaymentDialog( child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse),
appo: appo, patientShareResponse: patientShareResponse),
), ),
); );
}, },
@ -750,22 +596,13 @@ class _ToDoState extends State<ToDo> {
}); });
} }
openPayment( openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) {
String paymentMethod, widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
AuthenticatedUser authenticatedUser,
double amount,
PatientShareResponse patientShareResponse,
AppoitmentAllHistoryResultList appo) {
widget.browser = new MyInAppBrowser(
onExitCallback: onBrowserExit,
appo: appo,
onLoadStartCallback: onBrowserLoadStart);
widget.browser.openPaymentBrowser( widget.browser.openPaymentBrowser(
amount, amount,
"Appointment check in", "Appointment check in",
Utils.getAppointmentTransID( Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(), appo.projectID.toString(),
authenticatedUser.emailAddress, authenticatedUser.emailAddress,
paymentMethod, paymentMethod,
@ -810,12 +647,7 @@ class _ToDoState extends State<ToDo> {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) {
.checkPaymentStatus(
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
@ -833,36 +665,20 @@ class _ToDoState extends State<ToDo> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'],
res['Fort_id'], res['PaymentMethod'], context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['OnlineCheckInAppointments'][0]); print(res['OnlineCheckInAppointments'][0]);
addAdvancedNumberRequest( addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo, res['OnlineCheckInAppointments'][0]);
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString(),
appo,
res['OnlineCheckInAppointments'][0]);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
} }
addAdvancedNumberRequest( addAdvancedNumberRequest(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo, dynamic apptData) {
String advanceNumber,
String paymentReference,
String appointmentID,
AppoitmentAllHistoryResultList appo,
dynamic apptData) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (appo.isLiveCareAppointment) if (appo.isLiveCareAppointment)
addVIDARequestInsert(advanceNumber, paymentReference, apptData); addVIDARequestInsert(advanceNumber, paymentReference, apptData);
@ -874,13 +690,10 @@ class _ToDoState extends State<ToDo> {
}); });
} }
addVIDARequestInsert( addVIDARequestInsert(String advanceNumber, String paymentReference, dynamic apptData) {
String advanceNumber, String paymentReference, dynamic apptData) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.addVIDARequest(advanceNumber, paymentReference, apptData, context).then((res) {
.addVIDARequest(advanceNumber, paymentReference, apptData, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res); print(res);
}).catchError((err) { }).catchError((err) {
@ -892,8 +705,7 @@ class _ToDoState extends State<ToDo> {
getPatientData() async { getPatientData() async {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
if (await sharedPref.getObject(USER_PROFILE) != null) { if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
setState(() { setState(() {
print(data); print(data);
authUser = data; authUser = data;
@ -902,31 +714,20 @@ class _ToDoState extends State<ToDo> {
} }
} }
Future navigateToPaymentMethod( Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
context,
PatientShareResponse patientShareResponse,
AppoitmentAllHistoryResultList appo) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
setState(() { setState(() {
authUser = data; authUser = data;
}); });
} }
Navigator.push( Navigator.push(context, FadePage(page: PaymentMethod())).then((value) {
context, FadePage(page: PaymentMethod()))
.then((value) {
print(value); print(value);
getPatientAppointmentHistory(); getPatientAppointmentHistory();
if (value != null) { if (value != null) {
openPayment( openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
value,
authUser,
double.parse(patientShareResponse.patientShareWithTax.toString()),
patientShareResponse,
appo);
} }
}); });
} }
@ -934,10 +735,7 @@ class _ToDoState extends State<ToDo> {
confirmAppointment(AppoitmentAllHistoryResultList appo) { confirmAppointment(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context).then((res) {
.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.isLiveCareAppointment, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
@ -958,10 +756,7 @@ class _ToDoState extends State<ToDo> {
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) { insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, context).then((res) {
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.serviceID, appo.doctorID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);

@ -242,6 +242,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
requestPermissions().then((results) { requestPermissions().then((results) {
_firebaseMessaging.getToken().then((String token) { _firebaseMessaging.getToken().then((String token) {
print("Firebase Token: " + token);
sharedPref.setString(PUSH_TOKEN, token); sharedPref.setString(PUSH_TOKEN, token);
if (token != null && DEVICE_TOKEN == "") { if (token != null && DEVICE_TOKEN == "") {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;

@ -282,7 +282,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(48) ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) : null, onTap: () {
if (projectViewModel.havePrivilege(48)) Navigator.push(context, FadePage(page: ActiveMedicationsPage()));
},
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical, title: TranslationBase.of(context).myMedical,
imagePath: 'active_medication.svg', imagePath: 'active_medication.svg',
@ -594,8 +596,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => onTap: () => projectViewModel.havePrivilege(48) ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) : null,
projectViewModel.havePrivilege(48) ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical, title: TranslationBase.of(context).myMedical,
imagePath: 'active_medications.png', imagePath: 'active_medications.png',
@ -614,15 +615,11 @@ class Utils {
) )
: null, : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myDoctor, title: TranslationBase.of(context).myDoctor, imagePath: 'doctor_icon.png', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)),
imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context).myDoctorSubtitle,
isEnable: projectViewModel.havePrivilege(6)),
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null,
projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myInvoice, title: TranslationBase.of(context).myInvoice,
imagePath: 'Invoice.png', imagePath: 'Invoice.png',
@ -632,8 +629,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null,
projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).eye, title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png', imagePath: 'eye_measurement_icon.png',
@ -664,8 +660,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => onTap: () => projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null,
projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval, title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approvals_icon.png', imagePath: 'insurance_approvals_icon.png',
@ -695,8 +690,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => onTap: () => projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null,
projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medical, title: TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png', imagePath: 'medical_reports_icon.png',
@ -706,8 +700,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => onTap: () => projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null,
projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).monthly, title: TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png', imagePath: 'monthly_reports_icon.png',
@ -717,8 +710,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => onTap: () => projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null,
projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).sick, title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png', imagePath: 'sick_leaves_icons.png',
@ -826,8 +818,8 @@ class Utils {
}); });
} }
static bool route(Route route, {@required Type equalsTo}){ static bool route(Route route, {@required Type equalsTo}) {
if((route is FadePage)){ if ((route is FadePage)) {
return route.page.runtimeType == equalsTo; return route.page.runtimeType == equalsTo;
} }
return route.runtimeType == equalsTo; return route.runtimeType == equalsTo;
@ -875,13 +867,7 @@ class Utils {
} }
} }
Widget applyShadow( Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) {
{Color color = Colors.grey,
double shadowOpacity = 0.5,
double spreadRadius = 2,
double blurRadius = 7,
Offset offset = const Offset(2, 2),
@required Widget child}) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [ boxShadow: [
@ -897,7 +883,6 @@ Widget applyShadow(
); );
} }
Future<AuthenticatedUser> userData() async { Future<AuthenticatedUser> userData() async {
var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER)); var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER));
return userData; return userData;
@ -922,19 +907,18 @@ openAppStore({String androidPackageName, String iOSAppID}) async {
} }
} }
String labelFrom({@required String className}){ String labelFrom({@required String className}) {
RegExp exp = RegExp(r'(?<=[a-z])[A-Z]'); RegExp exp = RegExp(r'(?<=[a-z])[A-Z]');
String result = className.replaceAllMapped(exp, (m) { String result = className.replaceAllMapped(exp, (m) {
var str = m.group(0); var str = m.group(0);
if(str != null){ if (str != null) {
return ('_' + str); return ('_' + str);
} }
return ""; return "";
}); });
if(result.isEmpty) if (result.isEmpty) return className;
return className;
result = result.replaceAll("_", " "); result = result.replaceAll("_", " ");
return result; return result;

Loading…
Cancel
Save