Booking appointment 1.1

merge-requests/390/head
Mirza.Shafique 3 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_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -57,7 +57,7 @@ const Map localizedValues = {
'gender': {'en': 'Gender', 'ar': 'الجنس'},
'nationality': {'en': 'Nationality', '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': 'معلومات المريض'},
'bookSuccess': {'en': 'Book Success', 'ar': 'تم حجز الموعد بنجاح'},
'patientShare': {'en': 'Patient Share', 'ar': 'المبلغ المستحق'},
@ -516,6 +516,7 @@ const Map localizedValues = {
"recommended": {"en": " Recommended For You", "ar": "موصى لك"},
"myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"},
"quantity": {"en": " QTY ", "ar": "الكمية"},
"reviewAppointment": {"en": " Review Appointment ", "ar": "مراجعة الموعد"},
"backMyAccount": {"en": "BACK TO MY ACCOUNT ", "ar": " الرجوع لحسابي الشخصي"},
"reviewSuccessful": {"en": "Review Successful", "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/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.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/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
@ -31,11 +35,7 @@ class BookConfirm extends StatefulWidget {
String appoTimeFormatted = "";
bool isLiveCareAppointment;
BookConfirm(
{@required this.doctor,
@required this.selectedDate,
@required this.isLiveCareAppointment,
@required this.selectedTime});
BookConfirm({@required this.doctor, @required this.selectedDate, @required this.isLiveCareAppointment, @required this.selectedTime});
DoctorsListService service;
PatientShareResponse patientShareResponse;
@ -61,340 +61,184 @@ class _BookConfirmState extends State<BookConfirm> {
Widget build(BuildContext context) {
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name,
isShowDecPage: false,
isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: 5.0),
alignment: Alignment.center,
child: Text(TranslationBase.of(context).confirmAppoHeading,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 22.0,
color: new Color(0xFF60686b),
letterSpacing: 0.9))),
Divider(
color: Colors.grey[400],
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
"",
widget.doctor.projectName,
null,
null,
widget.doctor.nationalityFlagURL,
widget.doctor.doctorRate,
null,
widget.doctor.noOfPatientsRate,
"",
),
Container(
margin: EdgeInsets.only(top: 15.0),
child: Text(TranslationBase.of(context).docInfo,
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>[
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(
isNeedToShowButton: false,
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).confirmAppoHeading,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.0,
letterSpacing: -0.64,
fontWeight: FontWeight.w600,
),
),
mHeight(20),
Card(
shape: cardRadius(12),
margin: EdgeInsets.zero,
elevation: 0,
child: Padding(
padding: const EdgeInsets.fromLTRB(16, 20, 16, 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).appoInfo,
style: TextStyle(
fontSize: 12.0,
color: Colors.black,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
),
),
mHeight(16),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Text(
widget.doctor.doctorTitle +
"" +
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(
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,
),
],
),
if (!widget.isLiveCareAppointment) showInfo(TranslationBase.of(context).hospital, widget.doctor.projectName),
showInfo(TranslationBase.of(context).clinic, widget.doctor.clinicName),
showInfo(TranslationBase.of(context).date, getDate()),
showInfo(TranslationBase.of(context).time, widget.selectedTime)
],
),
),
],
],
),
),
),
),
),
Container(
margin: EdgeInsets.only(top: 15.0),
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,
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(12),
Card(
shape: cardRadius(12),
elevation: 0,
margin: EdgeInsets.zero,
child: Padding(
padding: const EdgeInsets.fromLTRB(16, 20, 16, 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).patientInfo,
style: TextStyle(
fontSize: 12.0,
color: Colors.black,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
),
],
),
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(
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(
),
mHeight(16),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Text(
widget.authUser.firstName +
" " +
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)),
),
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(
height: 120.0,
],
),
],
),
),
SizedBox(
height: 120.0,
),
],
),
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
color: CustomColors.appBackgroudGreyColor,
child: Container(
width: MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
if (!widget.isLiveCareAppointment) {
insertAppointment(context, widget.doctor);
} else {
insertLiveCareScheduledAppointment(context, widget.doctor);
}
},
child: Text(TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 18.0)),
margin: EdgeInsets.all(16),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 40.0,
child: RaisedButton(
color:CustomColors.green,
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
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,
BuildContext context) {
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, BuildContext context) {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
@ -420,23 +264,13 @@ class _BookConfirmState extends State<BookConfirm> {
insertAppointment(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo;
widget.service
.insertAppointment(
docObject.doctorID,
docObject.clinicID,
docObject.projectID,
widget.selectedTime,
widget.selectedDate,
context)
.then((res) {
widget.service.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, context).then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(
message: TranslationBase.of(context).bookedSuccess);
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 500), () {
getPatientShare(context, res['AppointmentNo'], docObject.clinicID,
docObject.projectID, docObject);
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
getToDoCount();
});
} else {
@ -472,23 +306,13 @@ class _BookConfirmState extends State<BookConfirm> {
insertLiveCareScheduledAppointment(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo;
widget.service
.insertLiveCareScheduleAppointment(
docObject.doctorID,
docObject.clinicID,
docObject.projectID,
docObject.serviceID,
widget.selectedTime,
widget.selectedDate,
context)
.then((res) {
widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 500), () {
getLiveCareAppointmentPatientShare(context, res['AppointmentNo'],
docObject.clinicID, docObject.projectID, docObject);
getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
getToDoCount();
});
} else {
@ -534,11 +358,8 @@ class _BookConfirmState extends State<BookConfirm> {
});
}
getPatientShare(context, String appointmentNo, int clinicID, int projectID,
DoctorList docObject) {
widget.service
.getPatientShare(appointmentNo, clinicID, projectID, context)
.then((res) {
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
@ -550,12 +371,8 @@ class _BookConfirmState extends State<BookConfirm> {
});
}
getLiveCareAppointmentPatientShare(context, String appointmentNo,
int clinicID, int projectID, DoctorList docObject) {
widget.service
.getLiveCareAppointmentPatientShare(
appointmentNo, clinicID, projectID, context)
.then((res) {
getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
GifLoaderDialogUtils.hideDialog(context);
@ -578,23 +395,10 @@ class _BookConfirmState extends State<BookConfirm> {
}
String getDate() {
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);
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);
setState(() {
widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString();
widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + ", " + dateObj.day.toString() + " " + DateUtil.getMonth(dateObj.month) + " " + dateObj.year.toString();
});
return widget.appoDateFormatted;
@ -611,8 +415,7 @@ class _BookConfirmState extends State<BookConfirm> {
getPatientData() async {
AppSharedPreferences sharedPref = AppSharedPreferences();
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
setState(() {
print(data);
widget.authUser = data;
@ -624,16 +427,9 @@ class _BookConfirmState extends State<BookConfirm> {
Navigator.of(context).popAndPushNamed(HOME);
}
Future navigateToBookSuccess(context, DoctorList docObject,
PatientShareResponse patientShareResponse) async {
Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async {
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(
context,
FadePage(
page: BookSuccess(
docObject: docObject,
patientShareResponse: patientShareResponse,
appoDateFormatted: widget.appoDateFormatted,
appoTimeFormatted: widget.selectedTime)));
context, 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/livecare/widgets/clinic_card.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
@ -26,8 +28,7 @@ class _DentalComplaintsState extends State<DentalComplaints> {
@override
void initState() {
WidgetsBinding.instance
.addPostFrameCallback((_) => getChiefComplaintsList());
WidgetsBinding.instance.addPostFrameCallback((_) => getChiefComplaintsList());
super.initState();
}
@ -36,17 +37,24 @@ class _DentalComplaintsState extends State<DentalComplaints> {
return AppScaffold(
isShowAppBar: true,
appBarTitle: "Symptoms",
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: Container(
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: ListView.builder(
child: ListView.separated(
itemCount: complaintsList.length,
itemBuilder: (BuildContext context, int index) {
return Container(
margin: EdgeInsets.only(bottom: 10.0),
child: DentalComplaintCard(
listDentalChiefComplain: complaintsList[index],
languageID: languageID,
),
child: DentalComplaintCard(
listDentalChiefComplain: complaintsList[index],
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);
getLanguageID();
ClinicListService service = new ClinicListService();
service
.getChiefComplaintsList(
widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context)
.then((res) {
service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
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/DoctorRateDetails.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/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.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/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
@ -28,11 +32,7 @@ class DoctorProfile extends StatefulWidget {
final bool isOpenAppt;
bool isLiveCareAppointment;
DoctorProfile(
{@required this.doctor,
@required this.docProfileList,
@required this.isLiveCareAppointment,
this.isOpenAppt = false});
DoctorProfile({@required this.doctor, @required this.docProfileList, @required this.isLiveCareAppointment, this.isOpenAppt = false});
AuthenticatedUser authUser;
@ -40,8 +40,7 @@ class DoctorProfile extends StatefulWidget {
_DoctorProfileState createState() => _DoctorProfileState();
}
class _DoctorProfileState extends State<DoctorProfile>
with TickerProviderStateMixin {
class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateMixin {
TabController _tabController;
bool showFooterButton = false;
var event = RobotProvider();
@ -52,10 +51,7 @@ class _DoctorProfileState extends State<DoctorProfile>
@override
void initState() {
_tabController = new TabController(
length: 2,
vsync: this,
initialIndex: widget.isOpenAppt == true ? 1 : 0);
_tabController = new TabController(length: 2, vsync: this, initialIndex: widget.isOpenAppt == true ? 1 : 0);
_tabController = new TabController(length: 2, vsync: this);
widget.authUser = new AuthenticatedUser();
widget.doctor.speciality = widget.docProfileList.specialty;
@ -66,162 +62,99 @@ class _DoctorProfileState extends State<DoctorProfile>
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name,
isShowAppBar: true,
isShowDecPage: false,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
bottomSheet: showFooterButton
? Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
color: CustomColors.appBackgroudGreyColor,
child: Container(
width: MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: goToBookConfirm,
child: Text(TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 18.0)),
color: CustomColors.appBackgroudGreyColor,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
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,
body: Container(
color: new Color(0xFFf6f6f6),
color: new Color(0xFFF8F8F8),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: [
Container(
margin: EdgeInsets.only(top: 20.0),
alignment: Alignment.center,
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(widget.doctor.doctorImageURL,
fit: BoxFit.fill, height: 120.0, width: 120.0),
),
),
Container(
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,
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
"",
widget.doctor.projectName,
null,
null,
widget.doctor.nationalityFlagURL,
widget.doctor.doctorRate,
widget.doctor.actualDoctorRate,
widget.doctor.noOfPatientsRate,
"",
),
onTap: () {},
onRatingAndReviewTap: () {
getDoctorRatingsDetails();
},
buttonTitle: TranslationBase.of(context).schedule,
),
mDivider(Colors.grey[300]),
if (widget.docProfileList.isDoctorHasPrePostImages == true) Container(height: 50, alignment: Alignment.center, child: prePostImagesButton(context)),
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,
fontSize: 12,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
),
),
InkWell(
onTap: () {
getDoctorRatingsDetails();
},
child: Container(
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,
)),
),
Tab(
child: Text(
TranslationBase.of(context).availableAppo,
style: TextStyle(
color: Colors.black,
fontSize: 12,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
),
),
if (widget.docProfileList.isDoctorHasPrePostImages == true)
Container(
height: 50,
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,
),
],
),
)
],
controller: _tabController,
),
Container(
height: MediaQuery.of(context).size.height,
@ -229,9 +162,7 @@ class _DoctorProfileState extends State<DoctorProfile>
physics: NeverScrollableScrollPhysics(),
children: [
DoctorInformation(docProfileList: widget.docProfileList),
DocAvailableAppointments(
doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment)
DocAvailableAppointments(doctor: widget.doctor, isLiveCareAppointment: widget.isLiveCareAppointment),
],
controller: _tabController,
),
@ -279,9 +210,7 @@ class _DoctorProfileState extends State<DoctorProfile>
getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.getDoctorsRatingDetails(widget.doctor.doctorID, context)
.then((res) {
service.getDoctorsRatingDetails(widget.doctor.doctorID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
doctorDetailsList.clear();
@ -301,9 +230,7 @@ class _DoctorProfileState extends State<DoctorProfile>
openDoctorPrePostImages() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService()
.getDoctorPrePostImages(widget.docProfileList, context)
.then((images) {
DoctorsListService().getDoctorPrePostImages(widget.docProfileList, context).then((images) {
GifLoaderDialogUtils.hideDialog(context);
showDialog(
context: context,
@ -349,30 +276,14 @@ class _DoctorProfileState extends State<DoctorProfile>
color: Theme.of(context).primaryColor,
margin: EdgeInsets.only(bottom: 5.0),
padding: EdgeInsets.all(10.0),
child: Text(
TranslationBase.of(context).doctorRating,
style: TextStyle(
fontSize: 22.0, color: Colors.white))),
child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))),
Container(
margin: EdgeInsets.only(top: 0.0),
child: Text(
this
.widget
.doctor
.actualDoctorRate
.ceilToDouble()
.toString(),
style: TextStyle(
fontSize: 32.0, color: Colors.black))),
margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.doctor.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: RatingBar.readOnly(
initialRating: this
.widget
.doctor
.actualDoctorRate
.toDouble(),
initialRating: this.widget.doctor.actualDoctorRate.toDouble(),
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
@ -384,34 +295,19 @@ class _DoctorProfileState extends State<DoctorProfile>
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(
this
.widget
.doctor
.noOfPatientsRate
.toString() +
" " +
TranslationBase.of(context).reviews,
style: TextStyle(
fontSize: 14.0, color: Colors.black))),
child: Text(this.widget.doctor.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(
top: 10.0, left: 15.0, right: 15.0),
child: Text(
TranslationBase.of(context).excellent,
style: TextStyle(
fontSize: 13.0,
color: Colors.black))),
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(
doctorDetailsList[0].patientNumber),
width: getRatingWidth(doctorDetailsList[0].patientNumber),
height: 6.0,
child: Container(
color: Colors.green[700],
@ -426,18 +322,12 @@ class _DoctorProfileState extends State<DoctorProfile>
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(
top: 10.0, left: 15.0, right: 15.0),
child: Text(
TranslationBase.of(context).v_good,
style: TextStyle(
fontSize: 13.0,
color: Colors.black))),
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).v_good, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(
doctorDetailsList[1].patientNumber),
width: getRatingWidth(doctorDetailsList[1].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffB7B723),
@ -452,18 +342,12 @@ class _DoctorProfileState extends State<DoctorProfile>
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(
top: 10.0, left: 15.0, right: 15.0),
child: Text(
TranslationBase.of(context).good,
style: TextStyle(
fontSize: 13.0,
color: Colors.black))),
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).good, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(
doctorDetailsList[2].patientNumber),
width: getRatingWidth(doctorDetailsList[2].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffEBA727),
@ -478,18 +362,12 @@ class _DoctorProfileState extends State<DoctorProfile>
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(
top: 10.0, left: 15.0, right: 15.0),
child: Text(
TranslationBase.of(context).average,
style: TextStyle(
fontSize: 13.0,
color: Colors.black))),
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).average, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(
doctorDetailsList[3].patientNumber),
width: getRatingWidth(doctorDetailsList[3].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffEB7227),
@ -504,19 +382,12 @@ class _DoctorProfileState extends State<DoctorProfile>
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(
top: 10.0, left: 15.0, right: 15.0),
child: Text(
TranslationBase.of(context)
.below_average,
style: TextStyle(
fontSize: 13.0,
color: Colors.black))),
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).below_average, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(
doctorDetailsList[4].patientNumber),
width: getRatingWidth(doctorDetailsList[4].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffE20C0C),
@ -526,9 +397,7 @@ class _DoctorProfileState extends State<DoctorProfile>
],
),
),
Container(
margin: EdgeInsets.only(top: 40.0),
child: Divider()),
Container(margin: EdgeInsets.only(top: 40.0), child: Divider()),
Container(
margin: EdgeInsets.only(top: 0.0),
child: Align(
@ -550,9 +419,7 @@ class _DoctorProfileState extends State<DoctorProfile>
onPressed: () {
Navigator.of(context).pop();
},
child: Text(
TranslationBase.of(context).cancel,
style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)),
),
),
),
@ -574,15 +441,13 @@ class _DoctorProfileState extends State<DoctorProfile>
}
double getRatingWidth(int patientNumber) {
var width =
(patientNumber / this.widget.docProfileList.noOfPatientsRate) * 100;
var width = (patientNumber / this.widget.docProfileList.noOfPatientsRate) * 100;
return width;
}
getPatientData() async {
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
setState(() {
print(data);
widget.authUser = data;
@ -620,9 +485,6 @@ class _DoctorProfileState extends State<DoctorProfile>
context,
FadePage(
page: BookConfirm(
doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime)));
doctor: widget.doctor, isLiveCareAppointment: widget.isLiveCareAppointment, selectedDate: DocAvailableAppointments.selectedDate, selectedTime: DocAvailableAppointments.selectedTime)));
}
}

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
@ -11,8 +13,7 @@ class SearchResults extends StatefulWidget {
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
bool isLiveCareAppointment;
SearchResults(
{@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
@override
_SearchResultsState createState() => _SearchResultsState();
@ -28,39 +29,46 @@ class _SearchResultsState extends State<SearchResults> {
appBarTitle: TranslationBase.of(context).bookAppo,
isShowDecPage: false,
isShowAppBar: true,
body: Container(
margin: EdgeInsets.all(10.0),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: <Widget>[
...List.generate(
widget.patientDoctorAppointmentListHospital.length,
(index) => AppExpandableNotifier(
// isExpand: index == 0 ? true : false,
title: widget.patientDoctorAppointmentListHospital[index]
.filterName +
" - " +
widget.patientDoctorAppointmentListHospital[index]
.distanceInKMs +
" " +
TranslationBase.of(context).km,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget
.patientDoctorAppointmentListHospital[index]
.patientDoctorAppointmentList
.map((doctor) {
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: <Widget>[
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
// padding: EdgeInsets.only(left: 21, right: 21),
separatorBuilder: (context, index) {
return Container(
height: 1,
margin: EdgeInsets.only(left: 21, right: 21),
color: Color(0xffD9D9D9),
);
},
itemBuilder: (context, index) {
return AppExpandableNotifier(
title:
widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km,
bodyWidget: ListView.separated(
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(
doctor: doctor,
doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index],
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/timeSlot.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_toast.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/material.dart';
import 'package:intl/intl.dart';
@ -22,16 +24,13 @@ class DocAvailableAppointments extends StatefulWidget {
static String selectedTime;
bool isLiveCareAppointment;
DocAvailableAppointments(
{@required this.doctor, @required this.isLiveCareAppointment});
DocAvailableAppointments({@required this.doctor, @required this.isLiveCareAppointment});
@override
_DocAvailableAppointmentsState createState() =>
_DocAvailableAppointmentsState();
_DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState();
}
class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
with TickerProviderStateMixin {
class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> with TickerProviderStateMixin {
Map<DateTime, List> _events;
AnimationController _animationController;
CalendarController _calendarController;
@ -93,21 +92,18 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
void _onDaySelected(DateTime day, List events) {
final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() {
this.selectedDate =
DateUtil.getWeekDayMonthDayYearDateFormatted(day, language);
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, language);
openTimeSlotsPickerForDate(day, docFreeSlots);
DocAvailableAppointments.selectedDate = formatter.format(day);
print(DocAvailableAppointments.selectedDate);
});
}
void _onVisibleDaysChanged(
DateTime first, DateTime last, CalendarFormat format) {
void _onVisibleDaysChanged(DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onVisibleDaysChanged');
}
void _onCalendarCreated(
DateTime first, DateTime last, CalendarFormat format) {
void _onCalendarCreated(DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onCalendarCreated');
}
@ -115,43 +111,39 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
Widget build(BuildContext context) {
return SingleChildScrollView(
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(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(selectedDate,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)),
_buildTableCalendarWithBuilders(),
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(
height: 50,
margin: EdgeInsets.all(20.0),
height: 40,
child: ListView.builder(
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: dayEvents.length,
itemBuilder: (context, index) {
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(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
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
width: 1.5, //width of the border
),
),
minWidth: MediaQuery.of(context).size.width * 0.2,
child: index == selectedButtonIndex
? getSelectedButton(index)
: getNormalButton(index)),
minWidth: MediaQuery.of(context).size.width * 0.18,
child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
);
},
),
),
_buildTableCalendarWithBuilders(),
],
),
),
@ -159,101 +151,105 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
}
Widget _buildTableCalendarWithBuilders() {
return TableCalendar(
locale: language == "en" ? 'en_US' : 'ar_SA',
calendarController: _calendarController,
events: _events,
initialCalendarFormat: CalendarFormat.month,
startDay: DateTime.now(),
formatAnimation: FormatAnimation.slide,
startingDayOfWeek: StartingDayOfWeek.sunday,
weekendDays: [DateTime.friday, DateTime.saturday],
availableGestures: AvailableGestures.horizontalSwipe,
availableCalendarFormats: const {
CalendarFormat.month: '',
CalendarFormat.week: '',
},
calendarStyle: CalendarStyle(
outsideDaysVisible: false,
weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
),
daysOfWeekStyle: DaysOfWeekStyle(
weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 14.0),
weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 14.0),
),
headerStyle: HeaderStyle(
centerHeaderTitle: true,
formatButtonVisible: false,
),
builders: CalendarBuilders(
selectedDayBuilder: (context, date, _) {
return FadeTransition(
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
child: Container(
margin: const EdgeInsets.all(4.0),
padding: const EdgeInsets.only(top: 5.0, left: 5.0),
color: Colors.transparent,
width: 0,
height: 0,
child: Text(
'${date.day}',
style: TextStyle().copyWith(fontSize: 16.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,
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',
calendarController: _calendarController,
events: _events,
initialCalendarFormat: CalendarFormat.month,
startDay: DateTime.now(),
formatAnimation: FormatAnimation.slide,
startingDayOfWeek: StartingDayOfWeek.sunday,
weekendDays: [DateTime.friday, DateTime.saturday],
availableGestures: AvailableGestures.horizontalSwipe,
availableCalendarFormats: const {
CalendarFormat.month: '',
CalendarFormat.week: '',
},
calendarStyle: CalendarStyle(
outsideDaysVisible: false,
weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
),
daysOfWeekStyle: DaysOfWeekStyle(
weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
),
headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
builders: CalendarBuilders(
selectedDayBuilder: (context, date, _) {
return FadeTransition(
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
child: Container(
margin: const EdgeInsets.all(4.0),
padding: const EdgeInsets.only(top: 5.0, left: 5.0),
color: Colors.transparent,
width: 0,
height: 0,
child: Text(
'${date.day}',
style: TextStyle().copyWith(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;
},
);
},
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,
),
),
),
);
},
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) {
dayEvents.clear();
DateTime dateStartObj = new DateTime(
dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
freeSlots.forEach((v) {
if (v.start == dateStartObj) dayEvents.add(v);
@ -267,8 +263,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
selectedButtonIndex = 0;
DocAvailableAppointments.selectedTime =
dayEvents[selectedButtonIndex].isoTime;
DocAvailableAppointments.selectedTime = dayEvents[selectedButtonIndex].isoTime;
// _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++) {
date = DateUtil.convertStringToDate(freeSlotsResponse[i]);
slotsList.add(FreeSlot(date, ['slot']));
docFreeSlots.add(TimeSlot(
isoTime: formatter.format(date),
start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0),
end: date));
docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date));
}
_eventsParsed =
Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
_eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() {
DocAvailableAppointments.selectedDate = dateFormatter
.format(DateUtil.convertStringToDate(freeSlotsResponse[0]));
selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(freeSlotsResponse[0]), language);
DocAvailableAppointments.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(freeSlotsResponse[0]));
selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(freeSlotsResponse[0]), language);
selectedDateJSON = freeSlotsResponse[0];
});
openTimeSlotsPickerForDate(
DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController
.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON));
openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON));
return _eventsParsed;
}
Widget getNormalButton(int index) {
return RaisedButton(
color: Colors.white,
elevation: 0,
textColor: new Color(0xFF60686b),
onPressed: () {
setState(() {
@ -315,15 +303,15 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
print(DocAvailableAppointments.selectedTime);
});
},
child: Text(dayEvents[index].isoTime,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0)),
);
}
Widget getSelectedButton(int index) {
return RaisedButton(
color: Color(0xff76cfb7), //Color of the border
color: CustomColors.green, //Color of the border
textColor: Colors.white,
elevation: 0,
onPressed: () {
setState(() {
selectedButtonIndex = index;
@ -331,18 +319,14 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
print(DocAvailableAppointments.selectedTime);
});
},
child: Text(dayEvents[index].isoTime,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0)),
);
}
getDoctorFreeSlots(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID,
docObject.projectID, context)
.then((res) {
service.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) {
@ -369,10 +353,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
getDoctorScheduledFreeSlots(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID,
docObject.projectID, docObject.serviceID, context)
.then((res) {
service.getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['PatientER_DoctorFreeSlots'].length != 0) {
@ -397,8 +378,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
}
getCurrentLanguage() async {
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
setState(() {
this.language = languageID;
});
@ -406,21 +386,30 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
Widget _buildEventsMarker(DateTime date, List events) {
return Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _calendarController.isSelected(date)
? Color(0xffB8382C)
: _calendarController.isToday(date)
? Colors.brown[300]
: Color(0xff76cfb7),
),
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// color: _calendarController.isSelected(date)
// ? Color(0xffB8382C)
// : _calendarController.isToday(date)
// ? Colors.brown[300]
// : 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,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
color: _calendarController.isSelected(date) ? Colors.white : Colors.black,
fontSize: 14.0,
),
),

@ -1,5 +1,7 @@
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/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@ -16,138 +18,109 @@ class DoctorInformation extends StatelessWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
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(
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0),
child: Text(TranslationBase.of(context).docInfo,
style: TextStyle(fontSize: 16.0, letterSpacing: 0.8)),
),
],
),
),
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0),
child: Table(
children: [
TableRow(children: [
TableCell(
child: _getHeadingText(
TranslationBase.of(context).gender)),
TableCell(
child: _getHeadingText(
TranslationBase.of(context).nationality)),
]),
TableRow(children: [
TableCell(
child: _getNormalText(
docProfileList.genderDescription)),
TableCell(
child: _getNormalTextWithIcon(
docProfileList.nationalityName,
docProfileList.nationalityFlagURL)),
]),
],
),
),
Divider(
color: Colors.grey[400],
Container(
width: double.infinity,
child: Card(
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,
),
),
mHeight(10),
Row(
children: [
Text(
TranslationBase.of(context).gender + ":",
style: TextStyle(
fontSize: 10,
letterSpacing: -0.4,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
),
mWidth(2),
Text(
docProfileList.genderDescription,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).nationality + ":",
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)
],
),
)
],
),
),
],
),
);
}
_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])),
mHeight(8),
Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Image.network(icon, width: 18.0, height: 18.0),
width: double.infinity,
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/gif_loader_dialog_utils.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/transitions/fade_page.dart';
import 'package:flutter/material.dart';
@ -47,6 +48,11 @@ class _SearchByClinicState extends State<SearchByClinic> {
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
final GlobalKey clinicDropdownKey = GlobalKey();
final GlobalKey projectDropdownKey = GlobalKey();
String radioValue = "Female";
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList());
@ -56,125 +62,318 @@ class _SearchByClinicState extends State<SearchByClinic> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Checkbox(
activeColor: new Color(0xFF40ACC9),
value: nearestAppo,
onChanged: (bool value) {
setState(() {
nearestAppo = value;
print(nearestAppo);
if (nearestAppo)
getProjectsList();
else
isProjectLoaded = false;
});
},
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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,
),
),
Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
],
),
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();
),
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(() {
if (!isDentalSelectedAndSupported()) {
projectDropdownValue = "";
getDoctorsList(context);
} else {}
radioValue = v;
});
},
title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0))));
}).toList())
: Container(
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey[400],
width: 1.0,
),
borderRadius: BorderRadius.circular(10),
),
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,
),
),
],
)),
],
),
// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
hint: new Text(TranslationBase.of(context).selectClinic),
value: dropdownValue,
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),
item.isLiveCareClinicAndOnline ? SvgPicture.asset('assets/images/new-design/video_icon_green_right.svg', height: 15, width: 15, fit: BoxFit.cover) : Container(),
]),
);
}).toList(),
onChanged: (newValue) {
setState(() {
print(newValue);
dropdownValue = newValue;
if (!isDentalSelectedAndSupported() && !nearestAppo) {
projectDropdownValue = "";
getDoctorsList(context);
} else {
print("Dental");
}
});
},
),
],
),
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,
),
)),
isDentalSelectedAndSupported() == true || (nearestAppo && isProjectLoaded)
? Container(
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey[400],
width: 1.0,
),
Text(
"30",
style: TextStyle(
fontSize: 15,
letterSpacing: -0.59,
color: Colors.black,
),
borderRadius: BorderRadius.circular(10),
),
padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(top: 15.0),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
hint: new Text("Select Project"),
value: projectDropdownValue,
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);
});
},
],
),
),
Padding(
padding: const EdgeInsets.only(left: 6, right: 6, top: 16),
child: Row(
children: <Widget>[
Checkbox(
activeColor: new Color(0xFF40ACC9),
value: nearestAppo,
onChanged: (bool value) {
setState(() {
nearestAppo = value;
print(nearestAppo);
if (nearestAppo)
getProjectsList();
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() {
if (dropdownValue != null)
return dropdownValue != "" && (dropdownValue.split("-")[0] == "17") && isMobileAppDentalAllow;

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

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

@ -14,4 +14,6 @@ class CustomColors {
static const Color darkGreyColor = Color(0xFFC9C9C9);
static const Color pharmacyGreyColor = Color(0xFFDBDBDB);
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,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
if (headerModel.date != null) Text(
DateUtil.formatDateToDate(headerModel.date),
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),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
),
// Padding(
// padding: const EdgeInsets.only(top: 8.0),
// child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16),
// ),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16),
),
],
)
],
),
),
Row(
if(headerModel.actualDoctorRate!=null) Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(

Loading…
Cancel
Save