Booking appointment 1.1

merge-update-with-lab-changes
Mirza.Shafique 5 years ago
parent bd1cf9bcc7
commit d2b2b4063d

@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -57,7 +57,7 @@ const Map localizedValues = {
'gender': {'en': 'Gender', 'ar': 'الجنس'}, 'gender': {'en': 'Gender', 'ar': 'الجنس'},
'nationality': {'en': 'Nationality', 'ar': 'الجنسية'}, 'nationality': {'en': 'Nationality', 'ar': 'الجنسية'},
'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'}, 'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'},
'confirmAppoHeading': {'en': 'Kindly confirm your Appointment', 'ar': 'يرجى تأكيد موعدك'}, 'confirmAppoHeading': {'en': 'Kindly review your Appointment', 'ar': 'يرجى تأكيد موعدك'},
'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المريض'}, 'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المريض'},
'bookSuccess': {'en': 'Book Success', 'ar': 'تم حجز الموعد بنجاح'}, 'bookSuccess': {'en': 'Book Success', 'ar': 'تم حجز الموعد بنجاح'},
'patientShare': {'en': 'Patient Share', 'ar': 'المبلغ المستحق'}, 'patientShare': {'en': 'Patient Share', 'ar': 'المبلغ المستحق'},
@ -516,6 +516,7 @@ const Map localizedValues = {
"recommended": {"en": " Recommended For You", "ar": "موصى لك"}, "recommended": {"en": " Recommended For You", "ar": "موصى لك"},
"myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"}, "myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"},
"quantity": {"en": " QTY ", "ar": "الكمية"}, "quantity": {"en": " QTY ", "ar": "الكمية"},
"reviewAppointment": {"en": " Review Appointment ", "ar": "مراجعة الموعد"},
"backMyAccount": {"en": "BACK TO MY ACCOUNT ", "ar": " الرجوع لحسابي الشخصي"}, "backMyAccount": {"en": "BACK TO MY ACCOUNT ", "ar": " الرجوع لحسابي الشخصي"},
"reviewSuccessful": {"en": "Review Successful", "ar": " تقييم ناجح"}, "reviewSuccessful": {"en": "Review Successful", "ar": " تقييم ناجح"},
"reviewShared": {"en": "Your review has been shared on product review section", "ar": " تمت مشاركة تقييمك في قسم تقييم المنتج"}, "reviewShared": {"en": "Your review has been shared on product review section", "ar": " تمت مشاركة تقييمك في قسم تقييم المنتج"},

@ -4,15 +4,19 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.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/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/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.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:flutter/material.dart'; import 'package:flutter/material.dart';
@ -31,11 +35,7 @@ class BookConfirm extends StatefulWidget {
String appoTimeFormatted = ""; String appoTimeFormatted = "";
bool isLiveCareAppointment; bool isLiveCareAppointment;
BookConfirm( BookConfirm({@required this.doctor, @required this.selectedDate, @required this.isLiveCareAppointment, @required this.selectedTime});
{@required this.doctor,
@required this.selectedDate,
@required this.isLiveCareAppointment,
@required this.selectedTime});
DoctorsListService service; DoctorsListService service;
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
@ -61,340 +61,184 @@ class _BookConfirmState extends State<BookConfirm> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
toDoProvider = Provider.of<ToDoCountProviderModel>(context); toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name,
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Column(
margin: EdgeInsets.all(20.0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
mainAxisSize: MainAxisSize.max, DoctorHeader(
children: <Widget>[ headerModel: HeaderModel(
Container( widget.doctor.name,
margin: EdgeInsets.only(bottom: 5.0), widget.doctor.doctorImageURL,
alignment: Alignment.center, widget.doctor.speciality,
child: Text(TranslationBase.of(context).confirmAppoHeading, "",
textAlign: TextAlign.center, widget.doctor.projectName,
style: TextStyle( null,
fontSize: 22.0, null,
color: new Color(0xFF60686b), widget.doctor.nationalityFlagURL,
letterSpacing: 0.9))), widget.doctor.doctorRate,
Divider( null,
color: Colors.grey[400], widget.doctor.noOfPatientsRate,
"",
), ),
Container( isNeedToShowButton: false,
margin: EdgeInsets.only(top: 15.0), ),
child: Text(TranslationBase.of(context).docInfo, Padding(
style: TextStyle( padding: const EdgeInsets.all(20.0),
fontSize: 22.0, child: Column(
color: Colors.black, crossAxisAlignment: CrossAxisAlignment.start,
letterSpacing: 0.9))), children: [
Container( Text(
child: Card( TranslationBase.of(context).confirmAppoHeading,
color: Colors.white, textAlign: TextAlign.center,
margin: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 16.0), style: TextStyle(
shape: RoundedRectangleBorder( fontSize: 16.0,
borderRadius: BorderRadius.circular(10), letterSpacing: -0.64,
side: BorderSide(color: Colors.grey[400], width: 0.6)), fontWeight: FontWeight.w600,
child: Container( ),
padding: EdgeInsets.all(7.0), ),
width: MediaQuery.of(context).size.width, mHeight(20),
child: Row( Card(
mainAxisAlignment: MainAxisAlignment.start, shape: cardRadius(12),
children: <Widget>[ margin: EdgeInsets.zero,
ClipRRect( elevation: 0,
borderRadius: BorderRadius.circular(100.0), child: Padding(
child: Image.network(widget.doctor.doctorImageURL, padding: const EdgeInsets.fromLTRB(16, 20, 16, 20),
fit: BoxFit.fill, height: 70.0, width: 70.0), child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
Container( children: [
width: MediaQuery.of(context).size.width * 0.58, Text(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0), TranslationBase.of(context).appoInfo,
child: Column( style: TextStyle(
fontSize: 12.0,
color: Colors.black,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
),
),
mHeight(16),
Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Text( if (!widget.isLiveCareAppointment) showInfo(TranslationBase.of(context).hospital, widget.doctor.projectName),
widget.doctor.doctorTitle + showInfo(TranslationBase.of(context).clinic, widget.doctor.clinicName),
"" + showInfo(TranslationBase.of(context).date, getDate()),
widget.doctor.name, showInfo(TranslationBase.of(context).time, widget.selectedTime)
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(widget.doctor.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text(
getDoctorSpeciality(
widget.doctor.speciality)
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: widget
.doctor.actualDoctorRate
.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
],
),
], ],
), ),
), ],
], ),
), ),
), ),
), mHeight(12),
), Card(
Container( shape: cardRadius(12),
margin: EdgeInsets.only(top: 15.0), elevation: 0,
child: Text(TranslationBase.of(context).appoInfo, margin: EdgeInsets.zero,
style: TextStyle( child: Padding(
fontSize: 22.0, padding: const EdgeInsets.fromLTRB(16, 20, 16, 20),
color: Colors.black, child: Column(
letterSpacing: 0.9))), crossAxisAlignment: CrossAxisAlignment.start,
Container( children: [
child: Card( Text(
color: Colors.white, TranslationBase.of(context).patientInfo,
margin: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 16.0), style: TextStyle(
shape: RoundedRectangleBorder( fontSize: 12.0,
borderRadius: BorderRadius.circular(10), color: Colors.black,
side: BorderSide(color: Colors.grey[400], width: 0.6)), letterSpacing: -0.36,
child: Container( fontWeight: FontWeight.w600,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
!widget.isLiveCareAppointment ? Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
margin:
EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Image.asset(
"assets/images/new-design/icon_hospital.png"),
),
Container(
margin:
EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text(
TranslationBase.of(context).hospital +
": " +
widget.doctor.projectName,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
),
],
) : Container(),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Image.asset(
"assets/images/new-design/icon_hospital.png"),
),
Container(
width: MediaQuery.of(context).size.width * 0.7,
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text(
TranslationBase.of(context).clinic +
": " +
widget.doctor.clinicName,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
), ),
], ),
), mHeight(16),
Row( Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
child: Icon(
Icons.today,
color: Colors.grey[700],
),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0),
child: Text(
TranslationBase.of(context).date +
": " +
getDate(),
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
child: Icon(
Icons.timer,
color: Colors.grey[700],
),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text(
TranslationBase.of(context).time +
": " +
widget.selectedTime,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
),
],
),
],
),
),
),
),
Container(
margin: EdgeInsets.only(top: 15.0),
child: Text(TranslationBase.of(context).patientInfo,
style: TextStyle(
fontSize: 22.0,
color: Colors.black,
letterSpacing: 0.9))),
Container(
child: Card(
color: Colors.white,
margin: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 16.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(color: Colors.grey[400], width: 0.6)),
child: Container(
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
padding: EdgeInsets.all(10.0),
child: Image.asset(
"assets/images/new-design/appointment_info.png",
fit: BoxFit.fill,
height: 60.0,
width: 60.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.58,
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Text( showInfo(TranslationBase.of(context).name, widget.authUser.firstName + " " + widget.authUser.lastName),
widget.authUser.firstName + showInfo(TranslationBase.of(context).gender, widget.authUser.genderDescription),
" " + showInfo(TranslationBase.of(context).age, widget.authUser.age.toString())
widget.authUser.lastName,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(
TranslationBase.of(context).gender +
": " +
widget.authUser.genderDescription,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
child: Text(
TranslationBase.of(context).age +
": " +
widget.authUser.age.toString(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
], ],
), ),
), ],
], ),
), ),
), ),
), ],
),
SizedBox(
height: 120.0,
), ),
], ),
), SizedBox(
height: 120.0,
),
],
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
width: MediaQuery.of(context).size.width, color: CustomColors.appBackgroudGreyColor,
height: 50.0, child: Container(
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0), width: MediaQuery.of(context).size.width,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( margin: EdgeInsets.all(16),
color: new Color(0xFF60686b), child: ButtonTheme(
textColor: Colors.white, shape: RoundedRectangleBorder(
disabledTextColor: Colors.white, borderRadius: BorderRadius.circular(10.0),
disabledColor: new Color(0xFFbcc2c4), ),
onPressed: () { minWidth: MediaQuery.of(context).size.width * 0.7,
if (!widget.isLiveCareAppointment) { height: 40.0,
insertAppointment(context, widget.doctor); child: RaisedButton(
} else { color:CustomColors.green,
insertLiveCareScheduledAppointment(context, widget.doctor); textColor: Colors.white,
} disabledTextColor: Colors.white,
}, disabledColor: new Color(0xFFbcc2c4),
child: Text(TranslationBase.of(context).bookNow, onPressed: () {
style: TextStyle(fontSize: 18.0)), if (!widget.isLiveCareAppointment) {
insertAppointment(context, widget.doctor);
} else {
insertLiveCareScheduledAppointment(context, widget.doctor);
}
},
child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0,letterSpacing: -0.48)),
),
), ),
), ),
), ),
); );
} }
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, Widget showInfo(String title, String des) {
BuildContext context) { return Container(
child: Row(
children: [
Text(
title + ": ",
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
letterSpacing: -0.4,
),
),
Text(
des,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Colors.black,
letterSpacing: -0.48,
),
),
],
),
);
}
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
@ -420,23 +264,13 @@ class _BookConfirmState extends State<BookConfirm> {
insertAppointment(context, DoctorList docObject) { insertAppointment(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
widget.service widget.service.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, context).then((res) {
.insertAppointment(
docObject.doctorID,
docObject.clinicID,
docObject.projectID,
widget.selectedTime,
widget.selectedDate,
context)
.then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast( AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
message: TranslationBase.of(context).bookedSuccess);
print(res['AppointmentNo']); print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 500), () { Future.delayed(new Duration(milliseconds: 500), () {
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
docObject.projectID, docObject);
getToDoCount(); getToDoCount();
}); });
} else { } else {
@ -472,23 +306,13 @@ class _BookConfirmState extends State<BookConfirm> {
insertLiveCareScheduledAppointment(context, DoctorList docObject) { insertLiveCareScheduledAppointment(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
widget.service widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) {
.insertLiveCareScheduleAppointment(
docObject.doctorID,
docObject.clinicID,
docObject.projectID,
docObject.serviceID,
widget.selectedTime,
widget.selectedDate,
context)
.then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully"); AppToast.showSuccessToast(message: "Appointment Booked Successfully");
print(res['AppointmentNo']); print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 500), () { Future.delayed(new Duration(milliseconds: 500), () {
getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
docObject.clinicID, docObject.projectID, docObject);
getToDoCount(); getToDoCount();
}); });
} else { } else {
@ -534,11 +358,8 @@ class _BookConfirmState extends State<BookConfirm> {
}); });
} }
getPatientShare(context, String appointmentNo, int clinicID, int projectID, getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
DoctorList docObject) { widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
widget.service
.getPatientShare(appointmentNo, clinicID, projectID, context)
.then((res) {
print(res); print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
navigateToBookSuccess(context, docObject, widget.patientShareResponse); navigateToBookSuccess(context, docObject, widget.patientShareResponse);
@ -550,12 +371,8 @@ class _BookConfirmState extends State<BookConfirm> {
}); });
} }
getLiveCareAppointmentPatientShare(context, String appointmentNo, getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
int clinicID, int projectID, DoctorList docObject) { widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
widget.service
.getLiveCareAppointmentPatientShare(
appointmentNo, clinicID, projectID, context)
.then((res) {
print(res); print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -578,23 +395,10 @@ class _BookConfirmState extends State<BookConfirm> {
} }
String getDate() { String getDate() {
var dateObj = new DateTime( var dateObj = new DateTime(int.parse(widget.selectedDate.split("-")[0]), int.parse(widget.selectedDate.split("-")[1]), int.parse(widget.selectedDate.split("-")[2]), 0, 0, 0, 0);
int.parse(widget.selectedDate.split("-")[0]),
int.parse(widget.selectedDate.split("-")[1]),
int.parse(widget.selectedDate.split("-")[2]),
0,
0,
0,
0);
setState(() { setState(() {
widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + ", " + dateObj.day.toString() + " " + DateUtil.getMonth(dateObj.month) + " " + dateObj.year.toString();
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString();
}); });
return widget.appoDateFormatted; return widget.appoDateFormatted;
@ -611,8 +415,7 @@ class _BookConfirmState extends State<BookConfirm> {
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);
widget.authUser = data; widget.authUser = data;
@ -624,16 +427,9 @@ class _BookConfirmState extends State<BookConfirm> {
Navigator.of(context).popAndPushNamed(HOME); Navigator.of(context).popAndPushNamed(HOME);
} }
Future navigateToBookSuccess(context, DoctorList docObject, Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async {
PatientShareResponse patientShareResponse) async {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.push( Navigator.push(
context, context, FadePage(page: BookSuccess(docObject: docObject, patientShareResponse: patientShareResponse, appoDateFormatted: widget.appoDateFormatted, appoTimeFormatted: widget.selectedTime)));
FadePage(
page: BookSuccess(
docObject: docObject,
patientShareResponse: patientShareResponse,
appoDateFormatted: widget.appoDateFormatted,
appoTimeFormatted: widget.selectedTime)));
} }
} }

@ -4,8 +4,10 @@ import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -26,8 +28,7 @@ class _DentalComplaintsState extends State<DentalComplaints> {
@override @override
void initState() { void initState() {
WidgetsBinding.instance WidgetsBinding.instance.addPostFrameCallback((_) => getChiefComplaintsList());
.addPostFrameCallback((_) => getChiefComplaintsList());
super.initState(); super.initState();
} }
@ -36,17 +37,24 @@ class _DentalComplaintsState extends State<DentalComplaints> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: "Symptoms", appBarTitle: "Symptoms",
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: Container( body: Container(
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), child: ListView.separated(
child: ListView.builder(
itemCount: complaintsList.length, itemCount: complaintsList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Container( return Container(
margin: EdgeInsets.only(bottom: 10.0), child: DentalComplaintCard(
child: DentalComplaintCard( listDentalChiefComplain: complaintsList[index],
listDentalChiefComplain: complaintsList[index], languageID: languageID,
languageID: languageID, ),
), );
},
separatorBuilder: (BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.only(left: 14,right: 14),
child: mDivider(Colors.grey),
); );
}, },
), ),
@ -62,10 +70,7 @@ class _DentalComplaintsState extends State<DentalComplaints> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
getLanguageID(); getLanguageID();
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context).then((res) {
.getChiefComplaintsList(
widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print(res['List_DentalChiefComplain']); print(res['List_DentalChiefComplain']);

@ -3,15 +3,19 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; 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/pages/BookAppointment/doctor_post_pre_images_page.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/doctor_post_pre_images_page.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';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.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:flutter/material.dart'; import 'package:flutter/material.dart';
@ -28,11 +32,7 @@ class DoctorProfile extends StatefulWidget {
final bool isOpenAppt; final bool isOpenAppt;
bool isLiveCareAppointment; bool isLiveCareAppointment;
DoctorProfile( DoctorProfile({@required this.doctor, @required this.docProfileList, @required this.isLiveCareAppointment, this.isOpenAppt = false});
{@required this.doctor,
@required this.docProfileList,
@required this.isLiveCareAppointment,
this.isOpenAppt = false});
AuthenticatedUser authUser; AuthenticatedUser authUser;
@ -40,8 +40,7 @@ class DoctorProfile extends StatefulWidget {
_DoctorProfileState createState() => _DoctorProfileState(); _DoctorProfileState createState() => _DoctorProfileState();
} }
class _DoctorProfileState extends State<DoctorProfile> class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateMixin {
with TickerProviderStateMixin {
TabController _tabController; TabController _tabController;
bool showFooterButton = false; bool showFooterButton = false;
var event = RobotProvider(); var event = RobotProvider();
@ -52,10 +51,7 @@ class _DoctorProfileState extends State<DoctorProfile>
@override @override
void initState() { void initState() {
_tabController = new TabController( _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.isOpenAppt == true ? 1 : 0);
length: 2,
vsync: this,
initialIndex: widget.isOpenAppt == true ? 1 : 0);
_tabController = new TabController(length: 2, vsync: this); _tabController = new TabController(length: 2, vsync: this);
widget.authUser = new AuthenticatedUser(); widget.authUser = new AuthenticatedUser();
widget.doctor.speciality = widget.docProfileList.specialty; widget.doctor.speciality = widget.docProfileList.specialty;
@ -66,162 +62,99 @@ class _DoctorProfileState extends State<DoctorProfile>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
bottomSheet: showFooterButton bottomSheet: showFooterButton
? Container( ? Container(
width: MediaQuery.of(context).size.width, color: CustomColors.appBackgroudGreyColor,
height: 50.0, child: Container(
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), width: MediaQuery.of(context).size.width,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( color: CustomColors.appBackgroudGreyColor,
color: new Color(0xFF60686b), margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
textColor: Colors.white, child: ButtonTheme(
disabledTextColor: Colors.white, shape: RoundedRectangleBorder(
disabledColor: new Color(0xFFbcc2c4), borderRadius: BorderRadius.circular(10.0),
onPressed: goToBookConfirm, ),
child: Text(TranslationBase.of(context).bookNow, minWidth: MediaQuery.of(context).size.width * 0.7,
style: TextStyle(fontSize: 18.0)), height: 40.0,
child: RaisedButton(
color: CustomColors.accentColor,
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: goToBookConfirm,
child: Text(TranslationBase.of(context).reviewAppointment, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, fontWeight: FontWeight.w600)),
),
), ),
), ),
) )
: null, : null,
body: Container( body: Container(
color: new Color(0xFFf6f6f6), color: new Color(0xFFF8F8F8),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( DoctorHeader(
color: Colors.white, headerModel: HeaderModel(
child: Column( widget.doctor.name,
crossAxisAlignment: CrossAxisAlignment.start, widget.doctor.doctorImageURL,
children: <Widget>[ widget.doctor.speciality,
Row( "",
children: [ widget.doctor.projectName,
Container( null,
margin: EdgeInsets.only(top: 20.0), null,
alignment: Alignment.center, widget.doctor.nationalityFlagURL,
child: ClipRRect( widget.doctor.doctorRate,
borderRadius: BorderRadius.circular(100.0), widget.doctor.actualDoctorRate,
child: Image.network(widget.doctor.doctorImageURL, widget.doctor.noOfPatientsRate,
fit: BoxFit.fill, height: 120.0, width: 120.0), "",
), ),
), onTap: () {},
Container( onRatingAndReviewTap: () {
margin: EdgeInsets.only(top: 20.0), getDoctorRatingsDetails();
alignment: Alignment.center, },
child: ClipRRect( buttonTitle: TranslationBase.of(context).schedule,
borderRadius: BorderRadius.circular(100.0), ),
child: Image.asset('assets/images/drSchedul.png'), mDivider(Colors.grey[300]),
), if (widget.docProfileList.isDoctorHasPrePostImages == true) Container(height: 50, alignment: Alignment.center, child: prePostImagesButton(context)),
) TabBar(
], onTap: (index) {
), setState(() {
Container( index == 1 ? showFooterButton = true : showFooterButton = false;
margin: EdgeInsets.only(top: 10.0), print(showFooterButton);
alignment: Alignment.center, });
child: Text( },
widget.doctor.doctorTitle + " " + widget.doctor.name, tabs: [
textAlign: TextAlign.center, Tab(
style: TextStyle( child: Text(
fontSize: 20.0, TranslationBase.of(context).docInfo,
color: Colors.grey[900], style: TextStyle(
letterSpacing: 1.0)), color: Colors.black,
), fontSize: 12,
Container( letterSpacing: -0.36,
margin: EdgeInsets.only(top: 10.0), fontWeight: FontWeight.w600,
alignment: Alignment.center,
child: Text(widget.doctor.projectName,
style: TextStyle(
fontSize: 15.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text(widget.doctor.clinicName,
style: TextStyle(
fontSize: 13.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: RatingBar.readOnly(
initialRating:
widget.doctor.actualDoctorRate.toDouble(),
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
), ),
), ),
InkWell( ),
onTap: () { Tab(
getDoctorRatingsDetails(); child: Text(
}, TranslationBase.of(context).availableAppo,
child: Container( style: TextStyle(
margin: EdgeInsets.only(top: 5.0), color: Colors.black,
alignment: Alignment.center, fontSize: 12,
child: Text( letterSpacing: -0.36,
"(" + fontWeight: FontWeight.w600,
widget.docProfileList.noOfPatientsRate
.toString() +
" " +
TranslationBase.of(context).reviews +
")",
style: TextStyle(
fontSize: 14.0,
color: Colors.blue[800],
letterSpacing: 1.0,
decoration: TextDecoration.underline,
)),
), ),
), ),
if (widget.docProfileList.isDoctorHasPrePostImages == true) )
Container( ],
height: 50, controller: _tabController,
alignment: Alignment.center,
child: prePostImagesButton(context)),
Container(
child: Divider(
color: Colors.grey[500],
),
),
TabBar(
onTap: (index) {
setState(() {
index == 1
? showFooterButton = true
: showFooterButton = false;
print(showFooterButton);
});
},
tabs: [
Tab(
child: Text(TranslationBase.of(context).docInfo,
style: TextStyle(color: Colors.black))),
Tab(
child: Text(TranslationBase.of(context).availableAppo,
style: TextStyle(color: Colors.black)),
)
],
controller: _tabController,
),
],
),
), ),
Container( Container(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
@ -229,9 +162,7 @@ class _DoctorProfileState extends State<DoctorProfile>
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: [ children: [
DoctorInformation(docProfileList: widget.docProfileList), DoctorInformation(docProfileList: widget.docProfileList),
DocAvailableAppointments( DocAvailableAppointments(doctor: widget.doctor, isLiveCareAppointment: widget.isLiveCareAppointment),
doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment)
], ],
controller: _tabController, controller: _tabController,
), ),
@ -279,9 +210,7 @@ class _DoctorProfileState extends State<DoctorProfile>
getDoctorRatingsDetails() { getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.getDoctorsRatingDetails(widget.doctor.doctorID, context).then((res) {
.getDoctorsRatingDetails(widget.doctor.doctorID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
doctorDetailsList.clear(); doctorDetailsList.clear();
@ -301,9 +230,7 @@ class _DoctorProfileState extends State<DoctorProfile>
openDoctorPrePostImages() { openDoctorPrePostImages() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService() DoctorsListService().getDoctorPrePostImages(widget.docProfileList, context).then((images) {
.getDoctorPrePostImages(widget.docProfileList, context)
.then((images) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
showDialog( showDialog(
context: context, context: context,
@ -349,30 +276,14 @@ class _DoctorProfileState extends State<DoctorProfile>
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
margin: EdgeInsets.only(bottom: 5.0), margin: EdgeInsets.only(bottom: 5.0),
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Text( child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))),
TranslationBase.of(context).doctorRating,
style: TextStyle(
fontSize: 22.0, color: Colors.white))),
Container( Container(
margin: EdgeInsets.only(top: 0.0), margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.doctor.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))),
child: Text(
this
.widget
.doctor
.actualDoctorRate
.ceilToDouble()
.toString(),
style: TextStyle(
fontSize: 32.0, color: Colors.black))),
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center, alignment: Alignment.center,
child: RatingBar.readOnly( child: RatingBar.readOnly(
initialRating: this initialRating: this.widget.doctor.actualDoctorRate.toDouble(),
.widget
.doctor
.actualDoctorRate
.toDouble(),
size: 35.0, size: 35.0,
filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500], emptyColor: Colors.grey[500],
@ -384,34 +295,19 @@ class _DoctorProfileState extends State<DoctorProfile>
), ),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text( child: Text(this.widget.doctor.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black))),
this
.widget
.doctor
.noOfPatientsRate
.toString() +
" " +
TranslationBase.of(context).reviews,
style: TextStyle(
fontSize: 14.0, color: Colors.black))),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Row( child: Row(
children: [ children: [
Container( Container(
width: 100.0, width: 100.0,
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
top: 10.0, left: 15.0, right: 15.0), child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))),
child: Text(
TranslationBase.of(context).excellent,
style: TextStyle(
fontSize: 13.0,
color: Colors.black))),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: SizedBox( child: SizedBox(
width: getRatingWidth( width: getRatingWidth(doctorDetailsList[0].patientNumber),
doctorDetailsList[0].patientNumber),
height: 6.0, height: 6.0,
child: Container( child: Container(
color: Colors.green[700], color: Colors.green[700],
@ -426,18 +322,12 @@ class _DoctorProfileState extends State<DoctorProfile>
children: [ children: [
Container( Container(
width: 100.0, width: 100.0,
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
top: 10.0, left: 15.0, right: 15.0), child: Text(TranslationBase.of(context).v_good, style: TextStyle(fontSize: 13.0, color: Colors.black))),
child: Text(
TranslationBase.of(context).v_good,
style: TextStyle(
fontSize: 13.0,
color: Colors.black))),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: SizedBox( child: SizedBox(
width: getRatingWidth( width: getRatingWidth(doctorDetailsList[1].patientNumber),
doctorDetailsList[1].patientNumber),
height: 6.0, height: 6.0,
child: Container( child: Container(
color: Color(0xffB7B723), color: Color(0xffB7B723),
@ -452,18 +342,12 @@ class _DoctorProfileState extends State<DoctorProfile>
children: [ children: [
Container( Container(
width: 100.0, width: 100.0,
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
top: 10.0, left: 15.0, right: 15.0), child: Text(TranslationBase.of(context).good, style: TextStyle(fontSize: 13.0, color: Colors.black))),
child: Text(
TranslationBase.of(context).good,
style: TextStyle(
fontSize: 13.0,
color: Colors.black))),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: SizedBox( child: SizedBox(
width: getRatingWidth( width: getRatingWidth(doctorDetailsList[2].patientNumber),
doctorDetailsList[2].patientNumber),
height: 6.0, height: 6.0,
child: Container( child: Container(
color: Color(0xffEBA727), color: Color(0xffEBA727),
@ -478,18 +362,12 @@ class _DoctorProfileState extends State<DoctorProfile>
children: [ children: [
Container( Container(
width: 100.0, width: 100.0,
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
top: 10.0, left: 15.0, right: 15.0), child: Text(TranslationBase.of(context).average, style: TextStyle(fontSize: 13.0, color: Colors.black))),
child: Text(
TranslationBase.of(context).average,
style: TextStyle(
fontSize: 13.0,
color: Colors.black))),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: SizedBox( child: SizedBox(
width: getRatingWidth( width: getRatingWidth(doctorDetailsList[3].patientNumber),
doctorDetailsList[3].patientNumber),
height: 6.0, height: 6.0,
child: Container( child: Container(
color: Color(0xffEB7227), color: Color(0xffEB7227),
@ -504,19 +382,12 @@ class _DoctorProfileState extends State<DoctorProfile>
children: [ children: [
Container( Container(
width: 100.0, width: 100.0,
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
top: 10.0, left: 15.0, right: 15.0), child: Text(TranslationBase.of(context).below_average, style: TextStyle(fontSize: 13.0, color: Colors.black))),
child: Text(
TranslationBase.of(context)
.below_average,
style: TextStyle(
fontSize: 13.0,
color: Colors.black))),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: SizedBox( child: SizedBox(
width: getRatingWidth( width: getRatingWidth(doctorDetailsList[4].patientNumber),
doctorDetailsList[4].patientNumber),
height: 6.0, height: 6.0,
child: Container( child: Container(
color: Color(0xffE20C0C), color: Color(0xffE20C0C),
@ -526,9 +397,7 @@ class _DoctorProfileState extends State<DoctorProfile>
], ],
), ),
), ),
Container( Container(margin: EdgeInsets.only(top: 40.0), child: Divider()),
margin: EdgeInsets.only(top: 40.0),
child: Divider()),
Container( Container(
margin: EdgeInsets.only(top: 0.0), margin: EdgeInsets.only(top: 0.0),
child: Align( child: Align(
@ -550,9 +419,7 @@ class _DoctorProfileState extends State<DoctorProfile>
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
child: Text( child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)),
TranslationBase.of(context).cancel,
style: TextStyle(fontSize: 18.0)),
), ),
), ),
), ),
@ -574,15 +441,13 @@ class _DoctorProfileState extends State<DoctorProfile>
} }
double getRatingWidth(int patientNumber) { double getRatingWidth(int patientNumber) {
var width = var width = (patientNumber / this.widget.docProfileList.noOfPatientsRate) * 100;
(patientNumber / this.widget.docProfileList.noOfPatientsRate) * 100;
return width; return width;
} }
getPatientData() async { getPatientData() async {
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);
widget.authUser = data; widget.authUser = data;
@ -620,9 +485,6 @@ class _DoctorProfileState extends State<DoctorProfile>
context, context,
FadePage( FadePage(
page: BookConfirm( page: BookConfirm(
doctor: widget.doctor, doctor: widget.doctor, isLiveCareAppointment: widget.isLiveCareAppointment, selectedDate: DocAvailableAppointments.selectedDate, selectedTime: DocAvailableAppointments.selectedTime)));
isLiveCareAppointment: widget.isLiveCareAppointment,
selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime)));
} }
} }

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
// import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; // import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
@ -11,8 +13,7 @@ class SearchResults extends StatefulWidget {
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital; List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
bool isLiveCareAppointment; bool isLiveCareAppointment;
SearchResults( SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
{@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
@override @override
_SearchResultsState createState() => _SearchResultsState(); _SearchResultsState createState() => _SearchResultsState();
@ -28,39 +29,46 @@ class _SearchResultsState extends State<SearchResults> {
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
body: Container( showNewAppBarTitle: true,
margin: EdgeInsets.all(10.0), showNewAppBar: true,
child: SingleChildScrollView( backgroundColor: CustomColors.appBackgroudGreyColor,
physics: BouncingScrollPhysics(), body: SingleChildScrollView(
child: Column( physics: BouncingScrollPhysics(),
children: <Widget>[ child: Column(
...List.generate( children: <Widget>[
widget.patientDoctorAppointmentListHospital.length, ListView.separated(
(index) => AppExpandableNotifier( physics: NeverScrollableScrollPhysics(),
// isExpand: index == 0 ? true : false, shrinkWrap: true,
title: widget.patientDoctorAppointmentListHospital[index] // padding: EdgeInsets.only(left: 21, right: 21),
.filterName + separatorBuilder: (context, index) {
" - " + return Container(
widget.patientDoctorAppointmentListHospital[index] height: 1,
.distanceInKMs + margin: EdgeInsets.only(left: 21, right: 21),
" " + color: Color(0xffD9D9D9),
TranslationBase.of(context).km, );
bodyWidget: Column( },
crossAxisAlignment: CrossAxisAlignment.start, itemBuilder: (context, index) {
mainAxisAlignment: MainAxisAlignment.spaceBetween, return AppExpandableNotifier(
children: widget title:
.patientDoctorAppointmentListHospital[index] widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km,
.patientDoctorAppointmentList bodyWidget: ListView.separated(
.map((doctor) { shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
//widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null;
return DoctorView( return DoctorView(
doctor: doctor, doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index],
isLiveCareAppointment: widget.isLiveCareAppointment, isLiveCareAppointment: widget.isLiveCareAppointment,
); );
}).toList(), },
)), separatorBuilder: (context, index) => SizedBox(height: 14),
) itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length),
], );
), },
itemCount: widget.patientDoctorAppointmentListHospital.length,
),
],
), ),
), ),
); );

@ -3,9 +3,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -22,16 +24,13 @@ class DocAvailableAppointments extends StatefulWidget {
static String selectedTime; static String selectedTime;
bool isLiveCareAppointment; bool isLiveCareAppointment;
DocAvailableAppointments( DocAvailableAppointments({@required this.doctor, @required this.isLiveCareAppointment});
{@required this.doctor, @required this.isLiveCareAppointment});
@override @override
_DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState();
_DocAvailableAppointmentsState();
} }
class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> with TickerProviderStateMixin {
with TickerProviderStateMixin {
Map<DateTime, List> _events; Map<DateTime, List> _events;
AnimationController _animationController; AnimationController _animationController;
CalendarController _calendarController; CalendarController _calendarController;
@ -93,21 +92,18 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
void _onDaySelected(DateTime day, List events) { void _onDaySelected(DateTime day, List events) {
final DateFormat formatter = DateFormat('yyyy-MM-dd'); final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() { setState(() {
this.selectedDate = this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, language);
DateUtil.getWeekDayMonthDayYearDateFormatted(day, language);
openTimeSlotsPickerForDate(day, docFreeSlots); openTimeSlotsPickerForDate(day, docFreeSlots);
DocAvailableAppointments.selectedDate = formatter.format(day); DocAvailableAppointments.selectedDate = formatter.format(day);
print(DocAvailableAppointments.selectedDate); print(DocAvailableAppointments.selectedDate);
}); });
} }
void _onVisibleDaysChanged( void _onVisibleDaysChanged(DateTime first, DateTime last, CalendarFormat format) {
DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onVisibleDaysChanged'); print('CALLBACK: _onVisibleDaysChanged');
} }
void _onCalendarCreated( void _onCalendarCreated(DateTime first, DateTime last, CalendarFormat format) {
DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onCalendarCreated'); print('CALLBACK: _onCalendarCreated');
} }
@ -115,43 +111,39 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10.0)),
margin: EdgeInsets.all(20.0),
padding: EdgeInsets.only(bottom: 10.0, top: 10.0),
child: Column( child: Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text(selectedDate, _buildTableCalendarWithBuilders(),
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)), Padding(
padding: const EdgeInsets.only(left: 16,right: 16,bottom: 16),
child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
),
Container( Container(
height: 50, height: 40,
margin: EdgeInsets.all(20.0),
child: ListView.builder( child: ListView.builder(
controller: _scrollController, controller: _scrollController,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: dayEvents.length, itemCount: dayEvents.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
margin: EdgeInsets.only(right: 10.0), margin: EdgeInsets.only(right: (index==dayEvents.length-1)?16:5.0,left: index==0?16:5),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
side: BorderSide( side: BorderSide(
color: Color(0xff76cfb7), //Color of the border color:index == selectedButtonIndex ? CustomColors.green:Colors.black, //Color of the border
style: BorderStyle.solid, //Style of the border style: BorderStyle.solid, //Style of the border
width: 1.5, //width of the border width: 1.5, //width of the border
), ),
), ),
minWidth: MediaQuery.of(context).size.width * 0.2, minWidth: MediaQuery.of(context).size.width * 0.18,
child: index == selectedButtonIndex child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
? getSelectedButton(index)
: getNormalButton(index)),
); );
}, },
), ),
), ),
_buildTableCalendarWithBuilders(),
], ],
), ),
), ),
@ -159,101 +151,105 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
} }
Widget _buildTableCalendarWithBuilders() { Widget _buildTableCalendarWithBuilders() {
return TableCalendar( return Card(
locale: language == "en" ? 'en_US' : 'ar_SA', shape: cardRadius(12),
calendarController: _calendarController, margin: EdgeInsets.all(16),
events: _events, clipBehavior: Clip.antiAlias,
initialCalendarFormat: CalendarFormat.month, child: Padding(
startDay: DateTime.now(), padding: const EdgeInsets.only(bottom: 12),
formatAnimation: FormatAnimation.slide, child: TableCalendar(
startingDayOfWeek: StartingDayOfWeek.sunday, locale: language == "en" ? 'en_US' : 'ar_SA',
weekendDays: [DateTime.friday, DateTime.saturday], calendarController: _calendarController,
availableGestures: AvailableGestures.horizontalSwipe, events: _events,
availableCalendarFormats: const { initialCalendarFormat: CalendarFormat.month,
CalendarFormat.month: '', startDay: DateTime.now(),
CalendarFormat.week: '', formatAnimation: FormatAnimation.slide,
}, startingDayOfWeek: StartingDayOfWeek.sunday,
calendarStyle: CalendarStyle( weekendDays: [DateTime.friday, DateTime.saturday],
outsideDaysVisible: false, availableGestures: AvailableGestures.horizontalSwipe,
weekendStyle: TextStyle().copyWith(color: Colors.blue[800]), availableCalendarFormats: const {
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), CalendarFormat.month: '',
), CalendarFormat.week: '',
daysOfWeekStyle: DaysOfWeekStyle( },
weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 14.0), calendarStyle: CalendarStyle(
weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 14.0), outsideDaysVisible: false,
), weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
headerStyle: HeaderStyle( holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
centerHeaderTitle: true, ),
formatButtonVisible: false, daysOfWeekStyle: DaysOfWeekStyle(
), weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
builders: CalendarBuilders( weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
selectedDayBuilder: (context, date, _) { ),
return FadeTransition( headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController), builders: CalendarBuilders(
child: Container( selectedDayBuilder: (context, date, _) {
margin: const EdgeInsets.all(4.0), return FadeTransition(
padding: const EdgeInsets.only(top: 5.0, left: 5.0), opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
color: Colors.transparent, child: Container(
width: 0, margin: const EdgeInsets.all(4.0),
height: 0, padding: const EdgeInsets.only(top: 5.0, left: 5.0),
child: Text( color: Colors.transparent,
'${date.day}', width: 0,
style: TextStyle().copyWith(fontSize: 16.0), height: 0,
), child: Text(
), '${date.day}',
); style: TextStyle().copyWith(fontSize: 14.0),
}, ),
todayDayBuilder: (context, date, _) {
return Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _calendarController.isSelected(date)
? Colors.green[400]
: _calendarController.isToday(date)
? Colors.transparent
: Color(0xff76cfb7),
),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
), ),
), );
), },
); todayDayBuilder: (context, date, _) {
}, return Container(
markersBuilder: (context, date, events, _) { decoration: BoxDecoration(
final children = <Widget>[]; shape: BoxShape.circle,
if (events.isNotEmpty) { color: _calendarController.isSelected(date)
children.add( ? Colors.green[400]
Positioned( : _calendarController.isToday(date)
right: 4, ? Colors.transparent
bottom: 4, : Color(0xff76cfb7),
child: _buildEventsMarker(date, events), ),
), width: 40.0,
); height: 40.0,
} child: Center(
child: Text(
return children; '${date.day}',
}, style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
),
),
),
);
},
markersBuilder: (context, date, events, _) {
final children = <Widget>[];
if (events.isNotEmpty) {
children.add(
Positioned(
right: 4,
bottom: 4,
child: _buildEventsMarker(date, events),
),
);
}
return children;
},
),
onDaySelected: (date, event, _) {
_onDaySelected(date, event);
_animationController.forward(from: 0.0);
},
onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated,
),
), ),
onDaySelected: (date, event, _) {
_onDaySelected(date, event);
_animationController.forward(from: 0.0);
},
onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated,
); );
} }
openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) { openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) {
dayEvents.clear(); dayEvents.clear();
DateTime dateStartObj = new DateTime( DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
freeSlots.forEach((v) { freeSlots.forEach((v) {
if (v.start == dateStartObj) dayEvents.add(v); if (v.start == dateStartObj) dayEvents.add(v);
@ -267,8 +263,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
selectedButtonIndex = 0; selectedButtonIndex = 0;
DocAvailableAppointments.selectedTime = DocAvailableAppointments.selectedTime = dayEvents[selectedButtonIndex].isoTime;
dayEvents[selectedButtonIndex].isoTime;
// _scrollController.animateTo(0.0, duration: new Duration(seconds: 1), curve: Curves.ease); // _scrollController.animateTo(0.0, duration: new Duration(seconds: 1), curve: Curves.ease);
}); });
@ -283,30 +278,23 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
for (var i = 0; i < freeSlotsResponse.length; i++) { for (var i = 0; i < freeSlotsResponse.length; i++) {
date = DateUtil.convertStringToDate(freeSlotsResponse[i]); date = DateUtil.convertStringToDate(freeSlotsResponse[i]);
slotsList.add(FreeSlot(date, ['slot'])); slotsList.add(FreeSlot(date, ['slot']));
docFreeSlots.add(TimeSlot( docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date));
isoTime: formatter.format(date),
start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0),
end: date));
} }
_eventsParsed = _eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() { setState(() {
DocAvailableAppointments.selectedDate = dateFormatter DocAvailableAppointments.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(freeSlotsResponse[0]));
.format(DateUtil.convertStringToDate(freeSlotsResponse[0])); selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(freeSlotsResponse[0]), language);
selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(freeSlotsResponse[0]), language);
selectedDateJSON = freeSlotsResponse[0]; selectedDateJSON = freeSlotsResponse[0];
}); });
openTimeSlotsPickerForDate( openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); _calendarController.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON));
_calendarController
.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON));
return _eventsParsed; return _eventsParsed;
} }
Widget getNormalButton(int index) { Widget getNormalButton(int index) {
return RaisedButton( return RaisedButton(
color: Colors.white, color: Colors.white,
elevation: 0,
textColor: new Color(0xFF60686b), textColor: new Color(0xFF60686b),
onPressed: () { onPressed: () {
setState(() { setState(() {
@ -315,15 +303,15 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
print(DocAvailableAppointments.selectedTime); print(DocAvailableAppointments.selectedTime);
}); });
}, },
child: Text(dayEvents[index].isoTime, child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0)),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
); );
} }
Widget getSelectedButton(int index) { Widget getSelectedButton(int index) {
return RaisedButton( return RaisedButton(
color: Color(0xff76cfb7), //Color of the border color: CustomColors.green, //Color of the border
textColor: Colors.white, textColor: Colors.white,
elevation: 0,
onPressed: () { onPressed: () {
setState(() { setState(() {
selectedButtonIndex = index; selectedButtonIndex = index;
@ -331,18 +319,14 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
print(DocAvailableAppointments.selectedTime); print(DocAvailableAppointments.selectedTime);
}); });
}, },
child: Text(dayEvents[index].isoTime, child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0)),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
); );
} }
getDoctorFreeSlots(context, DoctorList docObject) { getDoctorFreeSlots(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, context).then((res) {
.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID,
docObject.projectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) { if (res['FreeTimeSlots'].length != 0) {
@ -369,10 +353,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
getDoctorScheduledFreeSlots(context, DoctorList docObject) { getDoctorScheduledFreeSlots(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, context).then((res) {
.getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID,
docObject.projectID, docObject.serviceID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['PatientER_DoctorFreeSlots'].length != 0) { if (res['PatientER_DoctorFreeSlots'].length != 0) {
@ -397,8 +378,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
} }
getCurrentLanguage() async { getCurrentLanguage() async {
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
setState(() { setState(() {
this.language = languageID; this.language = languageID;
}); });
@ -406,21 +386,30 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
Widget _buildEventsMarker(DateTime date, List events) { Widget _buildEventsMarker(DateTime date, List events) {
return Container( return Container(
decoration: BoxDecoration( // decoration: BoxDecoration(
shape: BoxShape.circle, // shape: BoxShape.circle,
color: _calendarController.isSelected(date) // color: _calendarController.isSelected(date)
? Color(0xffB8382C) // ? Color(0xffB8382C)
: _calendarController.isToday(date) // : _calendarController.isToday(date)
? Colors.brown[300] // ? Colors.brown[300]
: Color(0xff76cfb7), // : Color(0xff359846),
), // ),
decoration: containerColorRadiusBorderWidth(
_calendarController.isSelected(date)
? CustomColors.green
: _calendarController.isToday(date)
? CustomColors.green.withOpacity(0.5)
: Colors.white,
200,
_calendarController.isSelected(date) ? CustomColors.green : Colors.black,
2),
width: 40.0, width: 40.0,
height: 40.0, height: 40.0,
child: Center( child: Center(
child: Text( child: Text(
'${date.day}', '${date.day}',
style: TextStyle().copyWith( style: TextStyle().copyWith(
color: Colors.white, color: _calendarController.isSelected(date) ? Colors.white : Colors.black,
fontSize: 14.0, fontSize: 14.0,
), ),
), ),

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
@ -16,138 +18,109 @@ class DoctorInformation extends StatelessWidget {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
AppExpandableNotifier( Container(
isExpand: true, width: double.infinity,
headerWidget: Container( child: Card(
margin: EdgeInsets.all(10.0), shape: cardRadius(12),
child: Row( elevation: 0,
mainAxisAlignment: MainAxisAlignment.start, child: Padding(
children: <Widget>[ padding: EdgeInsets.all(16),
SvgPicture.asset( child: Column(
"assets/images/DQ/doctor_information_icon.svg"), crossAxisAlignment: CrossAxisAlignment.start,
Container( children: [
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0), Text(
child: Text(TranslationBase.of(context).docInfo, TranslationBase.of(context).docInfo,
style: TextStyle(fontSize: 16.0, letterSpacing: 0.8)), style: TextStyle(
), fontSize: 16.0,
], letterSpacing: -0.64,
), fontWeight: FontWeight.w600,
), ),
bodyWidget: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, mHeight(10),
mainAxisSize: MainAxisSize.max, Row(
children: <Widget>[ children: [
Container( Text(
padding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0), TranslationBase.of(context).gender + ":",
child: Table( style: TextStyle(
children: [ fontSize: 10,
TableRow(children: [ letterSpacing: -0.4,
TableCell( color: Color(0xFF575757),
child: _getHeadingText( fontWeight: FontWeight.w600,
TranslationBase.of(context).gender)), ),
TableCell( ),
child: _getHeadingText( mWidth(2),
TranslationBase.of(context).nationality)), Text(
]), docProfileList.genderDescription,
TableRow(children: [ style: TextStyle(
TableCell( fontSize: 12,
child: _getNormalText( letterSpacing: -0.48,
docProfileList.genderDescription)), color: Color(0xFF575757),
TableCell( fontWeight: FontWeight.w600,
child: _getNormalTextWithIcon( ),
docProfileList.nationalityName, ),
docProfileList.nationalityFlagURL)), ],
]), ),
], Row(
), children: [
), Text(
Divider( TranslationBase.of(context).nationality + ":",
color: Colors.grey[400], style: TextStyle(
fontSize: 10,
letterSpacing: -0.4,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
),
mWidth(2),
Text(
docProfileList.nationalityName,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
),
],
),
],
), ),
Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_getHeadingText(TranslationBase.of(context).clinic),
_getNormalText(docProfileList.clinicDescription)
],
),
)
],
),
),
// ),
AppExpandableNotifier(
isExpand: true,
headerWidget: Container(
margin: EdgeInsets.all(10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SvgPicture.asset(
"assets/images/DQ/doctor_qualification_icon.svg"),
Container(
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0),
child: Text(TranslationBase.of(context).docQualifications,
style: TextStyle(fontSize: 16.0, letterSpacing: 0.8)),
),
],
), ),
), ),
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 10.0, 5.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
_getNormalText(docProfileList.doctorProfileInfo)
],
),
)
],
),
), ),
], mHeight(8),
),
);
}
_getHeadingText(text) {
return Text(text,
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.bold,
letterSpacing: 0.5,
color: Colors.grey[800]));
}
_getNormalText(text) {
return Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(text,
maxLines: 16,
style: TextStyle(
fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])),
);
}
_getNormalTextWithIcon(String text, icon) {
return Container(
margin: EdgeInsets.only(top: 5.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Text(text.trim(),
style: TextStyle(
fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])),
Container( Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0), width: double.infinity,
child: Image.network(icon, width: 18.0, height: 18.0), child: Card(
shape: cardRadius(12),
elevation: 0,
child: Padding(
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).docQualifications,
style: TextStyle(
fontSize: 16.0,
letterSpacing: -0.64,
fontWeight: FontWeight.w600,
),
),
mHeight(10),
Text(
docProfileList.doctorProfileInfo,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
),
],
),
),
),
), ),
], ],
), ),

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.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';
@ -47,6 +48,11 @@ class _SearchByClinicState extends State<SearchByClinic> {
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
final GlobalKey clinicDropdownKey = GlobalKey();
final GlobalKey projectDropdownKey = GlobalKey();
String radioValue = "Female";
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList()); WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList());
@ -56,125 +62,318 @@ class _SearchByClinicState extends State<SearchByClinic> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.all(10.0), child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Padding(
children: <Widget>[ padding: const EdgeInsets.only(
Checkbox( left: 20,
activeColor: new Color(0xFF40ACC9), right: 20,
value: nearestAppo, top: 20,
onChanged: (bool value) { ),
setState(() { child: Text(
nearestAppo = value; "Doctors will be filtered based on your gender and age",
print(nearestAppo); style: TextStyle(
if (nearestAppo) fontSize: 16,
getProjectsList(); fontWeight: FontWeight.w600,
else letterSpacing: -0.64,
isProjectLoaded = false; ),
});
},
), ),
Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)), ),
], mHeight(30),
), Column(
widget.clnicIds != null && widget.clnicIds.length > 1 && isLoaded == true crossAxisAlignment: CrossAxisAlignment.start,
? Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Padding(
children: clinicsList.map<Widget>((result) { padding: const EdgeInsets.only(left: 20, right: 20),
return RoundedContainer( child: Text(
child: ListTile( "Gender",
onTap: () { style: TextStyle(
// setState(() { fontSize: 12,
dropdownValue = result.clinicID.toString(); letterSpacing: -0.48,
color: Colors.black,
fontWeight: FontWeight.w600,
),
),
),
Container(
padding: EdgeInsets.only(left: 6, right: 6),
child: Row(
children: [
Flexible(
child: Row(
children: [
Radio(
value: TranslationBase.of(context).female,
groupValue: radioValue,
onChanged: (v) {
setState(() { setState(() {
if (!isDentalSelectedAndSupported()) { radioValue = v;
projectDropdownValue = "";
getDoctorsList(context);
} else {}
}); });
}, },
title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0)))); ),
}).toList()) Text(
: Container( TranslationBase.of(context).female,
height: 60.0, style: TextStyle(
decoration: BoxDecoration( fontSize: 12,
color: Colors.white, letterSpacing: -0.48,
border: Border.all( fontWeight: FontWeight.w600,
color: Colors.grey[400], ),
width: 1.0, ),
), ],
borderRadius: BorderRadius.circular(10), )),
Flexible(
child: Row(
children: [
Radio(
value: TranslationBase.of(context).male,
groupValue: radioValue,
onChanged: (v) {
setState(() {
radioValue = v;
});
},
),
Text(
TranslationBase.of(context).male,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
)),
],
), ),
// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0), ),
padding: EdgeInsets.all(8.0), ],
width: MediaQuery.of(context).size.width, ),
child: DropdownButtonHideUnderline( Container(
child: DropdownButton<String>( width: double.infinity,
hint: new Text(TranslationBase.of(context).selectClinic), decoration: containerRadius(Colors.white, 12),
value: dropdownValue, margin: EdgeInsets.only(left: 20, right: 20),
items: clinicsList.map((item) { padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
return new DropdownMenuItem<String>( child: Column(
value: item.clinicID.toString() + "-" + item.isLiveCareClinicAndOnline.toString() + "-" + item.liveCareClinicID.toString() + "-" + item.liveCareServiceID.toString(), crossAxisAlignment: CrossAxisAlignment.start,
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ children: [
Text(item.clinicDescription), Text(
item.isLiveCareClinicAndOnline ? SvgPicture.asset('assets/images/new-design/video_icon_green_right.svg', height: 15, width: 15, fit: BoxFit.cover) : Container(), "Age",
]), style: TextStyle(
); fontSize: 12,
}).toList(), letterSpacing: -0.48,
onChanged: (newValue) { color: Colors.black,
setState(() { fontWeight: FontWeight.w600,
print(newValue);
dropdownValue = newValue;
if (!isDentalSelectedAndSupported() && !nearestAppo) {
projectDropdownValue = "";
getDoctorsList(context);
} else {
print("Dental");
}
});
},
), ),
)), ),
isDentalSelectedAndSupported() == true || (nearestAppo && isProjectLoaded) Text(
? Container( "30",
height: 60.0, style: TextStyle(
decoration: BoxDecoration( fontSize: 15,
color: Colors.white, letterSpacing: -0.59,
border: Border.all( color: Colors.black,
color: Colors.grey[400],
width: 1.0,
), ),
borderRadius: BorderRadius.circular(10),
), ),
padding: EdgeInsets.all(8.0), ],
width: MediaQuery.of(context).size.width, ),
margin: EdgeInsets.only(top: 15.0), ),
child: DropdownButtonHideUnderline( Padding(
child: DropdownButton<String>( padding: const EdgeInsets.only(left: 6, right: 6, top: 16),
hint: new Text("Select Project"), child: Row(
value: projectDropdownValue, children: <Widget>[
items: projectsList.map((item) { Checkbox(
return new DropdownMenuItem<String>( activeColor: new Color(0xFF40ACC9),
value: item.mainProjectID.toString(), value: nearestAppo,
child: new Text(item.name), onChanged: (bool value) {
); setState(() {
}).toList(), nearestAppo = value;
onChanged: (newValue) { print(nearestAppo);
setState(() { if (nearestAppo)
projectDropdownValue = newValue; getProjectsList();
getDoctorsList(context); else
}); isProjectLoaded = false;
}, });
},
),
Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)),
],
),
),
widget.clnicIds != null && widget.clnicIds.length > 1 && isLoaded == true
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: clinicsList.map<Widget>((result) {
return RoundedContainer(
child: ListTile(
onTap: () {
// setState(() {
dropdownValue = result.clinicID.toString();
setState(() {
if (!isDentalSelectedAndSupported()) {
projectDropdownValue = "";
getDoctorsList(context);
} else {}
});
},
title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0))));
}).toList())
: InkWell(
onTap: () {
// dropdownKey.currentState;
openDropdown(clinicDropdownKey);
},
child: Container(
width: double.infinity,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Row(
children: [
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectClinic,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
Container(
height: 18,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
key: clinicDropdownKey,
hint: new Text(TranslationBase.of(context).selectClinic),
value: dropdownValue,
iconSize: 0,
isExpanded: true,
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
items: clinicsList.map((item) {
return new DropdownMenuItem<String>(
value: item.clinicID.toString() +
"-" +
item.isLiveCareClinicAndOnline.toString() +
"-" +
item.liveCareClinicID.toString() +
"-" +
item.liveCareServiceID.toString(),
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text(item.clinicDescription),
]),
);
}).toList(),
onChanged: (newValue) {
setState(() {
print(newValue);
dropdownValue = newValue;
if (!isDentalSelectedAndSupported() && !nearestAppo) {
projectDropdownValue = "";
getDoctorsList(context);
} else {
print("Dental");
}
});
},
),
),
),
],
),
),
Icon(Icons.keyboard_arrow_down),
],
),
), ),
)) ),
: Container(), mHeight(20),
], isDentalSelectedAndSupported() == true || (nearestAppo && isProjectLoaded)
? InkWell(
onTap: () {
openDropdown(projectDropdownKey);
},
child: Container(
width: double.infinity,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Row(
children: [
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Select Project",
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
Container(
height: 18,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
key: projectDropdownKey,
hint: new Text("Select Project"),
value: projectDropdownValue,
iconSize: 0,
isExpanded: true,
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
items: projectsList.map((item) {
return new DropdownMenuItem<String>(
value: item.mainProjectID.toString(),
child: new Text(item.name),
);
}).toList(),
onChanged: (newValue) {
setState(() {
projectDropdownValue = newValue;
getDoctorsList(context);
});
},
),
),
),
],
),
),
Icon(Icons.keyboard_arrow_down),
],
)),
)
: Container(),
],
),
), ),
); );
} }
void openDropdown(GlobalKey key) {
GestureDetector detector;
void searchForGestureDetector(BuildContext element) {
element.visitChildElements((element) {
if (element.widget != null && element.widget is GestureDetector) {
detector = element.widget;
return false;
} else {
searchForGestureDetector(element);
}
return true;
});
}
searchForGestureDetector(key.currentContext);
assert(detector != null);
detector.onTap();
}
bool isDentalSelectedAndSupported() { bool isDentalSelectedAndSupported() {
if (dropdownValue != null) if (dropdownValue != null)
return dropdownValue != "" && (dropdownValue.split("-")[0] == "17") && isMobileAppDentalAllow; return dropdownValue != "" && (dropdownValue.split("-")[0] == "17") && isMobileAppDentalAllow;

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -68,7 +69,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
minWidth: MediaQuery.of(context).size.width, minWidth: MediaQuery.of(context).size.width,
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFF60686b), color: CustomColors.accentColor,
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),

@ -12,8 +12,7 @@ class DentalComplaintCard extends StatefulWidget {
final ListDentalChiefComplain listDentalChiefComplain; final ListDentalChiefComplain listDentalChiefComplain;
var languageID; var languageID;
DentalComplaintCard( DentalComplaintCard({@required this.listDentalChiefComplain, this.languageID});
{@required this.listDentalChiefComplain, this.languageID});
@override @override
_DentalComplaintCardState createState() => _DentalComplaintCardState(); _DentalComplaintCardState createState() => _DentalComplaintCardState();
@ -27,37 +26,15 @@ class _DentalComplaintCardState extends State<DentalComplaintCard> {
onTap: () { onTap: () {
getChiefComplaintsList(); getChiefComplaintsList();
}, },
child: Card( child: Container(
color: Colors.white, width: double.infinity,
shape: RoundedRectangleBorder( padding: EdgeInsets.all(14.0),
borderRadius: BorderRadius.circular(10), child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
child: Row( mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Container(
width: MediaQuery.of(context).size.width * 0.85, child: Text(widget.listDentalChiefComplain.name, style: TextStyle(fontSize: 16.0, color: Colors.black)),
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
child: Text(widget.listDentalChiefComplain.name,
style:
TextStyle(fontSize: 16.0, color: Colors.black)),
),
],
),
),
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Icon(Icons.arrow_forward_ios,
size: 20.0, color: Colors.black54),
],
),
), ),
], ],
), ),
@ -68,15 +45,11 @@ class _DentalComplaintCardState extends State<DentalComplaintCard> {
getChiefComplaintsList() { getChiefComplaintsList() {
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
List();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service service.getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD, widget.listDentalChiefComplain.projectID, context).then((res) {
.getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD,
widget.listDentalChiefComplain.projectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print(res['List_DentalDoctorChiefComplaintMapping']); print(res['List_DentalDoctorChiefComplaintMapping']);
@ -87,31 +60,20 @@ class _DentalComplaintCardState extends State<DentalComplaintCard> {
}); });
doctorsList.forEach((element) { doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
_patientDoctorAppointmentListHospital .where(
.where( (elementClinic) => elementClinic.filterName == element.projectName,
(elementClinic) => )
elementClinic.filterName == element.projectName, .toList();
)
.toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[ _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
_patientDoctorAppointmentListHospital
.indexOf(doctorByHospital[0])]
.patientDoctorAppointmentList
.add(element);
} else { } else {
_patientDoctorAppointmentListHospital.add( _patientDoctorAppointmentListHospital
PatientDoctorAppointmentList( .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
filterName: element.projectName,
distanceInKMs:
element.projectDistanceInKiloMeters.toString(),
patientDoctorAppointment: element));
} }
}); });
navigateToSearchResults( navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
context, doctorsList, _patientDoctorAppointmentListHospital);
}); });
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@ -122,17 +84,7 @@ class _DentalComplaintCardState extends State<DentalComplaintCard> {
}); });
} }
Future navigateToSearchResults( Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async {
context, Navigator.push(context, FadePage(page: SearchResults(doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)));
List<DoctorList> docList,
List<PatientDoctorAppointmentList>
patientDoctorAppointmentListHospital) async {
Navigator.push(
context,
FadePage(
page: SearchResults(
doctorsList: docList,
patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital)));
} }
} }

@ -162,13 +162,15 @@ class DoctorView extends StatelessWidget {
Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async { Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: DoctorProfile( page: DoctorProfile(
doctor: docObject, doctor: docObject,
isLiveCareAppointment: isLiveCareAppointment, isLiveCareAppointment: isLiveCareAppointment,
docProfileList: docProfile, docProfileList: docProfile,
isOpenAppt: isAppo, isOpenAppt: isAppo,
))); ),
),
);
} }
} }

@ -14,4 +14,6 @@ class CustomColors {
static const Color darkGreyColor = Color(0xFFC9C9C9); static const Color darkGreyColor = Color(0xFFC9C9C9);
static const Color pharmacyGreyColor = Color(0xFFDBDBDB); static const Color pharmacyGreyColor = Color(0xFFDBDBDB);
static const Color backgroudGreyColor = Color(0xFFEFEFEF); static const Color backgroudGreyColor = Color(0xFFEFEFEF);
static const Color appBackgroudGreyColor = Color(0xFFF7F7F7);
static const Color green = Color(0xFF359846);
} }

File diff suppressed because it is too large Load Diff

@ -70,24 +70,24 @@ class DoctorHeader extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( if (headerModel.date != null) Text(
DateUtil.formatDateToDate(headerModel.date), DateUtil.formatDateToDate(headerModel.date),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
), ),
Text( if (headerModel.time != null) Text(
headerModel.time ?? DateUtil.formatDateToTime(headerModel.date), headerModel.time ?? DateUtil.formatDateToTime(headerModel.date),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
), ),
// Padding( Padding(
// padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
// child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16), child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16),
// ), ),
], ],
) )
], ],
), ),
), ),
Row( if(headerModel.actualDoctorRate!=null) Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
InkWell( InkWell(

Loading…
Cancel
Save