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,300 +61,117 @@ 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(
margin: EdgeInsets.all(20.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( DoctorHeader(
margin: EdgeInsets.only(bottom: 5.0), headerModel: HeaderModel(
alignment: Alignment.center, widget.doctor.name,
child: Text(TranslationBase.of(context).confirmAppoHeading, widget.doctor.doctorImageURL,
widget.doctor.speciality,
"",
widget.doctor.projectName,
null,
null,
widget.doctor.nationalityFlagURL,
widget.doctor.doctorRate,
null,
widget.doctor.noOfPatientsRate,
"",
),
isNeedToShowButton: false,
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).confirmAppoHeading,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 22.0, fontSize: 16.0,
color: new Color(0xFF60686b), letterSpacing: -0.64,
letterSpacing: 0.9))), fontWeight: FontWeight.w600,
Divider( ),
color: Colors.grey[400], ),
), mHeight(20),
Container( Card(
margin: EdgeInsets.only(top: 15.0), shape: cardRadius(12),
child: Text(TranslationBase.of(context).docInfo, margin: EdgeInsets.zero,
style: TextStyle( elevation: 0,
fontSize: 22.0, child: Padding(
color: Colors.black, padding: const EdgeInsets.fromLTRB(16, 20, 16, 20),
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>[
ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(widget.doctor.doctorImageURL,
fit: BoxFit.fill, height: 70.0, width: 70.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.58,
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
Text( Text(
widget.doctor.doctorTitle + TranslationBase.of(context).appoInfo,
"" +
widget.doctor.name,
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( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
color: Colors.grey[600], color: Colors.black,
letterSpacing: 1.0)), letterSpacing: -0.36,
), fontWeight: FontWeight.w600,
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,
),
],
),
],
),
),
],
),
),
), ),
), ),
Container( mHeight(16),
margin: EdgeInsets.only(top: 15.0), Column(
child: Text(TranslationBase.of(context).appoInfo,
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: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
!widget.isLiveCareAppointment ? Row( if (!widget.isLiveCareAppointment) showInfo(TranslationBase.of(context).hospital, widget.doctor.projectName),
mainAxisAlignment: MainAxisAlignment.start, showInfo(TranslationBase.of(context).clinic, widget.doctor.clinicName),
children: <Widget>[ showInfo(TranslationBase.of(context).date, getDate()),
Container( showInfo(TranslationBase.of(context).time, widget.selectedTime)
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)),
),
],
),
Row(
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( mHeight(12),
margin: EdgeInsets.only(top: 15.0), Card(
child: Text(TranslationBase.of(context).patientInfo, shape: cardRadius(12),
style: TextStyle( elevation: 0,
fontSize: 22.0, margin: EdgeInsets.zero,
color: Colors.black, child: Padding(
letterSpacing: 0.9))), padding: const EdgeInsets.fromLTRB(16, 20, 16, 20),
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( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
Text( Text(
widget.authUser.firstName + TranslationBase.of(context).patientInfo,
" " +
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( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
color: Colors.grey[600], color: Colors.black,
letterSpacing: 1.0)), letterSpacing: -0.36,
fontWeight: FontWeight.w600,
), ),
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)),
), ),
mHeight(16),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
showInfo(TranslationBase.of(context).name, widget.authUser.firstName + " " + widget.authUser.lastName),
showInfo(TranslationBase.of(context).gender, widget.authUser.genderDescription),
showInfo(TranslationBase.of(context).age, widget.authUser.age.toString())
], ],
), ),
),
], ],
), ),
), ),
), ),
],
),
), ),
SizedBox( SizedBox(
height: 120.0, height: 120.0,
@ -362,19 +179,20 @@ class _BookConfirmState extends State<BookConfirm> {
], ],
), ),
), ),
),
bottomSheet: Container( bottomSheet: Container(
color: CustomColors.appBackgroudGreyColor,
child: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: 50.0, height: 45.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0), margin: EdgeInsets.all(16),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 40.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFF60686b), color:CustomColors.green,
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
@ -385,16 +203,42 @@ class _BookConfirmState extends State<BookConfirm> {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
} }
}, },
child: Text(TranslationBase.of(context).bookNow, child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0,letterSpacing: -0.48)),
style: TextStyle(fontSize: 18.0)), ),
),
),
),
);
}
Widget showInfo(String title, String des) {
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, cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) {
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,19 +37,26 @@ 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,172 +62,107 @@ 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(
color: CustomColors.appBackgroudGreyColor,
child: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: 50.0, height: 45.0,
color: CustomColors.appBackgroudGreyColor,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 40.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),
onPressed: goToBookConfirm, onPressed: goToBookConfirm,
child: Text(TranslationBase.of(context).bookNow, child: Text(TranslationBase.of(context).reviewAppointment, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, fontWeight: FontWeight.w600)),
style: TextStyle(fontSize: 18.0)), ),
), ),
), ),
) )
: 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),
alignment: Alignment.center,
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.asset('assets/images/drSchedul.png'),
),
)
],
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text(
widget.doctor.doctorTitle + " " + widget.doctor.name,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
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: () {
getDoctorRatingsDetails(); getDoctorRatingsDetails();
}, },
child: Container( buttonTitle: TranslationBase.of(context).schedule,
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: Text(
"(" +
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,
alignment: Alignment.center,
child: prePostImagesButton(context)),
Container(
child: Divider(
color: Colors.grey[500],
),
), ),
mDivider(Colors.grey[300]),
if (widget.docProfileList.isDoctorHasPrePostImages == true) Container(height: 50, alignment: Alignment.center, child: prePostImagesButton(context)),
TabBar( TabBar(
onTap: (index) { onTap: (index) {
setState(() { setState(() {
index == 1 index == 1 ? showFooterButton = true : showFooterButton = false;
? showFooterButton = true
: showFooterButton = false;
print(showFooterButton); print(showFooterButton);
}); });
}, },
tabs: [ tabs: [
Tab( Tab(
child: Text(TranslationBase.of(context).docInfo, child: Text(
style: TextStyle(color: Colors.black))), TranslationBase.of(context).docInfo,
style: TextStyle(
color: Colors.black,
fontSize: 12,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
),
),
),
Tab( Tab(
child: Text(TranslationBase.of(context).availableAppo, child: Text(
style: TextStyle(color: Colors.black)), TranslationBase.of(context).availableAppo,
style: TextStyle(
color: Colors.black,
fontSize: 12,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
),
),
) )
], ],
controller: _tabController, controller: _tabController,
), ),
],
),
),
Container( Container(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
child: TabBarView( child: TabBarView(
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,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
...List.generate( ListView.separated(
widget.patientDoctorAppointmentListHospital.length, physics: NeverScrollableScrollPhysics(),
(index) => AppExpandableNotifier( shrinkWrap: true,
// isExpand: index == 0 ? true : false, // padding: EdgeInsets.only(left: 21, right: 21),
title: widget.patientDoctorAppointmentListHospital[index] separatorBuilder: (context, index) {
.filterName + return Container(
" - " + height: 1,
widget.patientDoctorAppointmentListHospital[index] margin: EdgeInsets.only(left: 21, right: 21),
.distanceInKMs + color: Color(0xffD9D9D9),
" " + );
TranslationBase.of(context).km, },
bodyWidget: Column( itemBuilder: (context, index) {
crossAxisAlignment: CrossAxisAlignment.start, return AppExpandableNotifier(
mainAxisAlignment: MainAxisAlignment.spaceBetween, title:
children: widget widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km,
.patientDoctorAppointmentListHospital[index] bodyWidget: ListView.separated(
.patientDoctorAppointmentList shrinkWrap: true,
.map((doctor) { 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,7 +151,13 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
} }
Widget _buildTableCalendarWithBuilders() { Widget _buildTableCalendarWithBuilders() {
return TableCalendar( return Card(
shape: cardRadius(12),
margin: EdgeInsets.all(16),
clipBehavior: Clip.antiAlias,
child: Padding(
padding: const EdgeInsets.only(bottom: 12),
child: TableCalendar(
locale: language == "en" ? 'en_US' : 'ar_SA', locale: language == "en" ? 'en_US' : 'ar_SA',
calendarController: _calendarController, calendarController: _calendarController,
events: _events, events: _events,
@ -179,13 +177,10 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
), ),
daysOfWeekStyle: DaysOfWeekStyle( daysOfWeekStyle: DaysOfWeekStyle(
weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 14.0), weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 14.0), weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
),
headerStyle: HeaderStyle(
centerHeaderTitle: true,
formatButtonVisible: false,
), ),
headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
builders: CalendarBuilders( builders: CalendarBuilders(
selectedDayBuilder: (context, date, _) { selectedDayBuilder: (context, date, _) {
return FadeTransition( return FadeTransition(
@ -198,7 +193,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
height: 0, height: 0,
child: Text( child: Text(
'${date.day}', '${date.day}',
style: TextStyle().copyWith(fontSize: 16.0), style: TextStyle().copyWith(fontSize: 14.0),
), ),
), ),
); );
@ -247,13 +242,14 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
}, },
onVisibleDaysChanged: _onVisibleDaysChanged, onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated, 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)
// ? Colors.brown[300]
// : Color(0xff359846),
// ),
decoration: containerColorRadiusBorderWidth(
_calendarController.isSelected(date)
? CustomColors.green
: _calendarController.isToday(date) : _calendarController.isToday(date)
? Colors.brown[300] ? CustomColors.green.withOpacity(0.5)
: Color(0xff76cfb7), : 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(
isExpand: true,
headerWidget: Container(
margin: EdgeInsets.all(10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SvgPicture.asset(
"assets/images/DQ/doctor_information_icon.svg"),
Container( Container(
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0), width: double.infinity,
child: Text(TranslationBase.of(context).docInfo, child: Card(
style: TextStyle(fontSize: 16.0, letterSpacing: 0.8)), shape: cardRadius(12),
), elevation: 0,
], child: Padding(
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).docInfo,
style: TextStyle(
fontSize: 16.0,
letterSpacing: -0.64,
fontWeight: FontWeight.w600,
), ),
), ),
bodyWidget: Column( mHeight(10),
crossAxisAlignment: CrossAxisAlignment.start, Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0),
child: Table(
children: [ children: [
TableRow(children: [ Text(
TableCell( TranslationBase.of(context).gender + ":",
child: _getHeadingText( style: TextStyle(
TranslationBase.of(context).gender)), fontSize: 10,
TableCell( letterSpacing: -0.4,
child: _getHeadingText( color: Color(0xFF575757),
TranslationBase.of(context).nationality)), fontWeight: FontWeight.w600,
]),
TableRow(children: [
TableCell(
child: _getNormalText(
docProfileList.genderDescription)),
TableCell(
child: _getNormalTextWithIcon(
docProfileList.nationalityName,
docProfileList.nationalityFlagURL)),
]),
],
), ),
), ),
Divider( mWidth(2),
color: Colors.grey[400], Text(
docProfileList.genderDescription,
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)
],
), ),
)
], ],
), ),
Row(
children: [
Text(
TranslationBase.of(context).nationality + ":",
style: TextStyle(
fontSize: 10,
letterSpacing: -0.4,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
), ),
// ),
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)),
), ),
], mWidth(2),
Text(
docProfileList.nationalityName,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
), ),
), ),
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),
Container(
_getHeadingText(text) { width: double.infinity,
return Text(text, child: Card(
style: TextStyle( shape: cardRadius(12),
fontSize: 13, elevation: 0,
fontWeight: FontWeight.bold, child: Padding(
letterSpacing: 0.5, padding: EdgeInsets.all(16),
color: Colors.grey[800])); child: Column(
} crossAxisAlignment: CrossAxisAlignment.start,
children: [
_getNormalText(text) { Text(
return Container( TranslationBase.of(context).docQualifications,
margin: EdgeInsets.only(top: 5.0),
child: Text(text,
maxLines: 16,
style: TextStyle( style: TextStyle(
fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])), fontSize: 16.0,
); letterSpacing: -0.64,
} fontWeight: FontWeight.w600,
),
_getNormalTextWithIcon(String text, icon) { ),
return Container( mHeight(10),
margin: EdgeInsets.only(top: 5.0), Text(
child: Row( docProfileList.doctorProfileInfo,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Text(text.trim(),
style: TextStyle( style: TextStyle(
fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])), fontSize: 12,
Container( letterSpacing: -0.48,
margin: EdgeInsets.only(left: 5.0, right: 5.0), color: Color(0xFF575757),
child: Image.network(icon, width: 18.0, height: 18.0), 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,11 +62,125 @@ 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(
padding: const EdgeInsets.only(
left: 20,
right: 20,
top: 20,
),
child: Text(
"Doctors will be filtered based on your gender and age",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
),
),
mHeight(30),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Text(
"Gender",
style: TextStyle(
fontSize: 12,
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(() {
radioValue = v;
});
},
),
Text(
TranslationBase.of(context).female,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
)),
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,
),
),
],
)),
],
),
),
],
),
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: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Age",
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
color: Colors.black,
fontWeight: FontWeight.w600,
),
),
Text(
"30",
style: TextStyle(
fontSize: 15,
letterSpacing: -0.59,
color: Colors.black,
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(left: 6, right: 6, top: 16),
child: Row(
children: <Widget>[ children: <Widget>[
Checkbox( Checkbox(
activeColor: new Color(0xFF40ACC9), activeColor: new Color(0xFF40ACC9),
@ -76,9 +196,10 @@ class _SearchByClinicState extends State<SearchByClinic> {
}); });
}, },
), ),
Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)), Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)),
], ],
), ),
),
widget.clnicIds != null && widget.clnicIds.length > 1 && isLoaded == true widget.clnicIds != null && widget.clnicIds.length > 1 && isLoaded == true
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -97,29 +218,51 @@ class _SearchByClinicState extends State<SearchByClinic> {
}, },
title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0)))); title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0))));
}).toList()) }).toList())
: Container( : InkWell(
height: 60.0, onTap: () {
decoration: BoxDecoration( // dropdownKey.currentState;
color: Colors.white, openDropdown(clinicDropdownKey);
border: Border.all( },
color: Colors.grey[400], child: Container(
width: 1.0, width: double.infinity,
), decoration: containerRadius(Colors.white, 12),
borderRadius: BorderRadius.circular(10), margin: EdgeInsets.only(left: 20, right: 20),
), padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0), child: Row(
padding: EdgeInsets.all(8.0), children: [
width: MediaQuery.of(context).size.width, 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: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
key: clinicDropdownKey,
hint: new Text(TranslationBase.of(context).selectClinic), hint: new Text(TranslationBase.of(context).selectClinic),
value: dropdownValue, value: dropdownValue,
iconSize: 0,
isExpanded: true,
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
items: clinicsList.map((item) { items: clinicsList.map((item) {
return new DropdownMenuItem<String>( return new DropdownMenuItem<String>(
value: item.clinicID.toString() + "-" + item.isLiveCareClinicAndOnline.toString() + "-" + item.liveCareClinicID.toString() + "-" + item.liveCareServiceID.toString(), value: item.clinicID.toString() +
"-" +
item.isLiveCareClinicAndOnline.toString() +
"-" +
item.liveCareClinicID.toString() +
"-" +
item.liveCareServiceID.toString(),
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text(item.clinicDescription), Text(item.clinicDescription),
item.isLiveCareClinicAndOnline ? SvgPicture.asset('assets/images/new-design/video_icon_green_right.svg', height: 15, width: 15, fit: BoxFit.cover) : Container(),
]), ]),
); );
}).toList(), }).toList(),
@ -136,25 +279,51 @@ class _SearchByClinicState extends State<SearchByClinic> {
}); });
}, },
), ),
)), ),
),
],
),
),
Icon(Icons.keyboard_arrow_down),
],
),
),
),
mHeight(20),
isDentalSelectedAndSupported() == true || (nearestAppo && isProjectLoaded) isDentalSelectedAndSupported() == true || (nearestAppo && isProjectLoaded)
? Container( ? InkWell(
height: 60.0, onTap: () {
decoration: BoxDecoration( openDropdown(projectDropdownKey);
color: Colors.white, },
border: Border.all( child: Container(
color: Colors.grey[400], width: double.infinity,
width: 1.0, decoration: containerRadius(Colors.white, 12),
), margin: EdgeInsets.only(left: 20, right: 20),
borderRadius: BorderRadius.circular(10), padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
), child: Row(
padding: EdgeInsets.all(8.0), children: [
width: MediaQuery.of(context).size.width, Flexible(
margin: EdgeInsets.only(top: 15.0), 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: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
key: projectDropdownKey,
hint: new Text("Select Project"), hint: new Text("Select Project"),
value: projectDropdownValue, value: projectDropdownValue,
iconSize: 0,
isExpanded: true,
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
items: projectsList.map((item) { items: projectsList.map((item) {
return new DropdownMenuItem<String>( return new DropdownMenuItem<String>(
value: item.mainProjectID.toString(), value: item.mainProjectID.toString(),
@ -168,13 +337,43 @@ class _SearchByClinicState extends State<SearchByClinic> {
}); });
}, },
), ),
)) ),
),
],
),
),
Icon(Icons.keyboard_arrow_down),
],
)),
)
: Container(), : 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: Row(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.85,
padding: EdgeInsets.all(12.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Container(
child: Text(widget.listDentalChiefComplain.name, child: Text(widget.listDentalChiefComplain.name, style: TextStyle(fontSize: 16.0, color: Colors.black)),
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) => elementClinic.filterName == element.projectName,
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)));
} }
} }

@ -169,6 +169,8 @@ class DoctorView extends StatelessWidget {
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