Doctor Free Slots implemented

merge-requests/34/merge
haroon amjad 6 years ago
parent ca7b4534a8
commit e34da6485b

File diff suppressed because it is too large Load Diff

@ -15,6 +15,12 @@ const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
//URL to get doctors list
const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime";
//URL to get doctor profile
const GET_DOCTOR_PROFILE = "Services/Doctors.svc/REST/GetDocProfiles";
//URL to get doctor free slots
const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots";
class AppGlobal {
static var context;
@ -22,9 +28,8 @@ class AppGlobal {
Request getPublicRequest() {
Request request = new Request();
request.VersionID = 5.3; //3.6;
request.VersionID = 5.5; //3.6;
request.Channel = 3;
// request.LanguageID = await sharedPref.getString(APP_LANGUAGE);
request.IPAdress = "10.20.10.20";
request.generalid = 'Cs2020@2016\$2958';
request.PatientOutSA = 0;

@ -14,6 +14,7 @@ const Map<String, Map<String, String>> localizedValues = {
'bookAppo': {'en': 'Book Appointment', 'ar': 'حجز موعد'},
'searchBy': {'en': 'Search By:', 'ar': 'البحث عن طريق:'},
'clinic': {'en': 'Clinic', 'ar': 'العيادة'},
'hospital': {'en': 'Hospital', 'ar': 'المستشفى'},
'name': {'en': 'Name', 'ar': 'الإسم'},
'doctor': {'en': 'Doctor', 'ar': 'الطبيب'},
'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'},
@ -27,7 +28,7 @@ const Map<String, Map<String, String>> localizedValues = {
'appoInfo': {'en': 'Appointment Information', 'ar': 'معلومات الموعد'},
'availableAppo': {'en': 'Available Appointments', 'ar': 'المواعيد المتاحة'},
'gender': {'en': 'Gender', 'ar': 'الجنس'},
'nationality': {'en': 'nationality', 'ar': 'الجنسية'},
'nationality': {'en': 'Nationality', 'ar': 'الجنسية'},
'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'},
'confirmAppoHeading': {'en': 'Kindly confirm your Appointment', 'ar': 'يرجى تأكيد موعدك'},
'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المريض'},
@ -40,6 +41,8 @@ const Map<String, Map<String, String>> localizedValues = {
'confirmLater': {'en': 'Confirm Later', 'ar': 'تأكيد لاحقا'},
'todoList': {'en': 'Todo List', 'ar': 'مهامي'},
'appoActions': {'en': 'Appointment Actions', 'ar': 'إجراءات الموعد'},
'date': {'en': 'Date', 'ar': 'التاريخ'},
'time': {'en': 'Time', 'ar': 'الوقت'},
};

@ -0,0 +1,168 @@
class DoctorList {
int clinicID;
String clinicName;
String doctorTitle;
int iD;
String name;
int projectID;
String projectName;
int actualDoctorRate;
int clinicRoomNo;
Null date;
Null dayName;
int doctorID;
String doctorImageURL;
Null doctorProfile;
Null doctorProfileInfo;
int doctorRate;
int gender;
String genderDescription;
bool isAppointmentAllowed;
bool isDoctorAllowVedioCall;
bool isDoctorDummy;
bool isLiveCare;
String latitude;
String longitude;
String nationalityFlagURL;
String nationalityID;
String nationalityName;
Null nearestFreeSlot;
int noOfPatientsRate;
Null originalClinicID;
int personRate;
int projectDistanceInKiloMeters;
String qR;
Null qRString;
int rateNumber;
Null serviceID;
String setupID;
List<String> speciality;
Null workingHours;
DoctorList(
{this.clinicID,
this.clinicName,
this.doctorTitle,
this.iD,
this.name,
this.projectID,
this.projectName,
this.actualDoctorRate,
this.clinicRoomNo,
this.date,
this.dayName,
this.doctorID,
this.doctorImageURL,
this.doctorProfile,
this.doctorProfileInfo,
this.doctorRate,
this.gender,
this.genderDescription,
this.isAppointmentAllowed,
this.isDoctorAllowVedioCall,
this.isDoctorDummy,
this.isLiveCare,
this.latitude,
this.longitude,
this.nationalityFlagURL,
this.nationalityID,
this.nationalityName,
this.nearestFreeSlot,
this.noOfPatientsRate,
this.originalClinicID,
this.personRate,
this.projectDistanceInKiloMeters,
this.qR,
this.qRString,
this.rateNumber,
this.serviceID,
this.setupID,
this.speciality,
this.workingHours});
DoctorList.fromJson(Map<String, dynamic> json) {
clinicID = json['ClinicID'];
clinicName = json['ClinicName'];
doctorTitle = json['DoctorTitle'];
iD = json['ID'];
name = json['Name'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
actualDoctorRate = json['ActualDoctorRate'];
clinicRoomNo = json['ClinicRoomNo'];
date = json['Date'];
dayName = json['DayName'];
doctorID = json['DoctorID'];
doctorImageURL = json['DoctorImageURL'];
doctorProfile = json['DoctorProfile'];
doctorProfileInfo = json['DoctorProfileInfo'];
doctorRate = json['DoctorRate'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
isAppointmentAllowed = json['IsAppointmentAllowed'];
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
isDoctorDummy = json['IsDoctorDummy'];
isLiveCare = json['IsLiveCare'];
latitude = json['Latitude'];
longitude = json['Longitude'];
nationalityFlagURL = json['NationalityFlagURL'];
nationalityID = json['NationalityID'];
nationalityName = json['NationalityName'];
nearestFreeSlot = json['NearestFreeSlot'];
noOfPatientsRate = json['NoOfPatientsRate'];
originalClinicID = json['OriginalClinicID'];
personRate = json['PersonRate'];
projectDistanceInKiloMeters = json['ProjectDistanceInKiloMeters'];
qR = json['QR'];
qRString = json['QRString'];
rateNumber = json['RateNumber'];
serviceID = json['ServiceID'];
setupID = json['SetupID'];
speciality = json['Speciality'].cast<String>();
workingHours = json['WorkingHours'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ClinicID'] = this.clinicID;
data['ClinicName'] = this.clinicName;
data['DoctorTitle'] = this.doctorTitle;
data['ID'] = this.iD;
data['Name'] = this.name;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['ActualDoctorRate'] = this.actualDoctorRate;
data['ClinicRoomNo'] = this.clinicRoomNo;
data['Date'] = this.date;
data['DayName'] = this.dayName;
data['DoctorID'] = this.doctorID;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorProfile'] = this.doctorProfile;
data['DoctorProfileInfo'] = this.doctorProfileInfo;
data['DoctorRate'] = this.doctorRate;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['IsAppointmentAllowed'] = this.isAppointmentAllowed;
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
data['IsDoctorDummy'] = this.isDoctorDummy;
data['IsLiveCare'] = this.isLiveCare;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
data['NationalityFlagURL'] = this.nationalityFlagURL;
data['NationalityID'] = this.nationalityID;
data['NationalityName'] = this.nationalityName;
data['NearestFreeSlot'] = this.nearestFreeSlot;
data['NoOfPatientsRate'] = this.noOfPatientsRate;
data['OriginalClinicID'] = this.originalClinicID;
data['PersonRate'] = this.personRate;
data['ProjectDistanceInKiloMeters'] = this.projectDistanceInKiloMeters;
data['QR'] = this.qR;
data['QRString'] = this.qRString;
data['RateNumber'] = this.rateNumber;
data['ServiceID'] = this.serviceID;
data['SetupID'] = this.setupID;
data['Speciality'] = this.speciality;
data['WorkingHours'] = this.workingHours;
return data;
}
}

@ -0,0 +1,176 @@
class DoctorProfileList {
int doctorID;
String doctorName;
Null doctorNameN;
int clinicID;
String clinicDescription;
Null clinicDescriptionN;
Null licenseExpiry;
int employmentType;
Null setupID;
int projectID;
String projectName;
String nationalityID;
String nationalityName;
Null nationalityNameN;
int gender;
String genderDescription;
Null genderDescriptionN;
Null doctorTitle;
Null projectNameN;
bool isAllowWaitList;
String titleDescription;
Null titleDescriptionN;
Null isRegistered;
Null isDoctorDummy;
bool isActive;
Null isDoctorAppointmentDisplayed;
bool doctorClinicActive;
Null isbookingAllowed;
String doctorCases;
Null doctorPicture;
String doctorProfileInfo;
List<String> specialty;
int actualDoctorRate;
String doctorImageURL;
int doctorRate;
String doctorTitleForProfile;
bool isAppointmentAllowed;
String nationalityFlagURL;
int noOfPatientsRate;
String qR;
int serviceID;
DoctorProfileList(
{this.doctorID,
this.doctorName,
this.doctorNameN,
this.clinicID,
this.clinicDescription,
this.clinicDescriptionN,
this.licenseExpiry,
this.employmentType,
this.setupID,
this.projectID,
this.projectName,
this.nationalityID,
this.nationalityName,
this.nationalityNameN,
this.gender,
this.genderDescription,
this.genderDescriptionN,
this.doctorTitle,
this.projectNameN,
this.isAllowWaitList,
this.titleDescription,
this.titleDescriptionN,
this.isRegistered,
this.isDoctorDummy,
this.isActive,
this.isDoctorAppointmentDisplayed,
this.doctorClinicActive,
this.isbookingAllowed,
this.doctorCases,
this.doctorPicture,
this.doctorProfileInfo,
this.specialty,
this.actualDoctorRate,
this.doctorImageURL,
this.doctorRate,
this.doctorTitleForProfile,
this.isAppointmentAllowed,
this.nationalityFlagURL,
this.noOfPatientsRate,
this.qR,
this.serviceID});
DoctorProfileList.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
clinicID = json['ClinicID'];
clinicDescription = json['ClinicDescription'];
clinicDescriptionN = json['ClinicDescriptionN'];
licenseExpiry = json['LicenseExpiry'];
employmentType = json['EmploymentType'];
setupID = json['SetupID'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
nationalityID = json['NationalityID'];
nationalityName = json['NationalityName'];
nationalityNameN = json['NationalityNameN'];
gender = json['Gender'];
genderDescription = json['Gender_Description'];
genderDescriptionN = json['Gender_DescriptionN'];
doctorTitle = json['DoctorTitle'];
projectNameN = json['ProjectNameN'];
isAllowWaitList = json['IsAllowWaitList'];
titleDescription = json['Title_Description'];
titleDescriptionN = json['Title_DescriptionN'];
isRegistered = json['IsRegistered'];
isDoctorDummy = json['IsDoctorDummy'];
isActive = json['IsActive'];
isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed'];
doctorClinicActive = json['DoctorClinicActive'];
isbookingAllowed = json['IsbookingAllowed'];
doctorCases = json['DoctorCases'];
doctorPicture = json['DoctorPicture'];
doctorProfileInfo = json['DoctorProfileInfo'];
specialty = json['Specialty'].cast<String>();
actualDoctorRate = json['ActualDoctorRate'];
doctorImageURL = json['DoctorImageURL'];
doctorRate = json['DoctorRate'];
doctorTitleForProfile = json['DoctorTitleForProfile'];
isAppointmentAllowed = json['IsAppointmentAllowed'];
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
qR = json['QR'];
serviceID = json['ServiceID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN;
data['ClinicID'] = this.clinicID;
data['ClinicDescription'] = this.clinicDescription;
data['ClinicDescriptionN'] = this.clinicDescriptionN;
data['LicenseExpiry'] = this.licenseExpiry;
data['EmploymentType'] = this.employmentType;
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['NationalityID'] = this.nationalityID;
data['NationalityName'] = this.nationalityName;
data['NationalityNameN'] = this.nationalityNameN;
data['Gender'] = this.gender;
data['Gender_Description'] = this.genderDescription;
data['Gender_DescriptionN'] = this.genderDescriptionN;
data['DoctorTitle'] = this.doctorTitle;
data['ProjectNameN'] = this.projectNameN;
data['IsAllowWaitList'] = this.isAllowWaitList;
data['Title_Description'] = this.titleDescription;
data['Title_DescriptionN'] = this.titleDescriptionN;
data['IsRegistered'] = this.isRegistered;
data['IsDoctorDummy'] = this.isDoctorDummy;
data['IsActive'] = this.isActive;
data['IsDoctorAppointmentDisplayed'] = this.isDoctorAppointmentDisplayed;
data['DoctorClinicActive'] = this.doctorClinicActive;
data['IsbookingAllowed'] = this.isbookingAllowed;
data['DoctorCases'] = this.doctorCases;
data['DoctorPicture'] = this.doctorPicture;
data['DoctorProfileInfo'] = this.doctorProfileInfo;
data['Specialty'] = this.specialty;
data['ActualDoctorRate'] = this.actualDoctorRate;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorRate'] = this.doctorRate;
data['DoctorTitleForProfile'] = this.doctorTitleForProfile;
data['IsAppointmentAllowed'] = this.isAppointmentAllowed;
data['NationalityFlagURL'] = this.nationalityFlagURL;
data['NoOfPatientsRate'] = this.noOfPatientsRate;
data['QR'] = this.qR;
data['ServiceID'] = this.serviceID;
return data;
}
}

@ -0,0 +1,20 @@
import 'package:diplomaticquarterapp/models/Request.dart';
class InsertAppointmentRequest extends Request {
String AppointmentDate; // ???? "/Date(1577750400000)/"
int DoctorID;
int InitialSlotDuration;
String SelectedTime;
String StartTime;
String EndTime;
String TempValue;
int VisitFor;
int VisitType;
bool IsVirtual;
List<String> GeneralProcedureList;
String DeviceToken;
String DeviceType;
bool IsForLiveCare;
String OriginalClinicID;
String OriginalProjectID;
}

@ -0,0 +1,10 @@
import 'package:flutter/cupertino.dart';
class TimeSlot {
String isoTime;
DateTime start;
DateTime end;
TimeSlot({@required this.isoTime, @required this.start, @required this.end});
}

@ -1,21 +1,38 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:rating_bar/rating_bar.dart';
import 'BookSuccess.dart';
class BookConfirm extends StatefulWidget {
DoctorList doctor;
DateTime selectedDateTime;
String selectedDate;
String selectedTime;
BookConfirm({@required this.doctor, this.selectedDateTime, @required this.selectedDate, @required this.selectedTime});
@override
_BookConfirmState createState() => _BookConfirmState();
}
class _BookConfirmState extends State<BookConfirm> {
@override
void initState() {
print(widget.doctor.toString());
print(widget.selectedDateTime);
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(TranslationBase.of(context).bookAppo),
),
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(20.0),
@ -57,11 +74,8 @@ class _BookConfirmState extends State<BookConfirm> {
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(
"https://hmgwebservices.com/Images/MobileImages/OALAY/2477.png",
fit: BoxFit.fill,
height: 70.0,
width: 70.0),
child: Image.network(widget.doctor.doctorImageURL,
fit: BoxFit.fill, height: 70.0, width: 70.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.6,
@ -69,14 +83,17 @@ class _BookConfirmState extends State<BookConfirm> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Dr. EYAD ISMAIL ABU-JAYAD",
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("INTERNAL MEDICINE CLINIC",
child: Text(widget.doctor.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -84,7 +101,10 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text("General Practioner",
child: Text(
getDoctorSpeciality(
widget.doctor.speciality)
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -96,7 +116,9 @@ class _BookConfirmState extends State<BookConfirm> {
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: 4.0,
initialRating: widget
.doctor.actualDoctorRate
.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
@ -146,7 +168,10 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text("Hospital: Olaya Hospital",
child: Text(
TranslationBase.of(context).hospital +
": " +
widget.doctor.projectName,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
@ -164,7 +189,10 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text("Clinic: INTERNAL MEDICINE CLINIC",
child: Text(
TranslationBase.of(context).clinic +
": " +
widget.doctor.clinicName,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
@ -183,7 +211,9 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text("Date: Olaya Hospital",
child: Text(
TranslationBase.of(context).date +
": " + getDate(),
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
@ -202,7 +232,10 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text("Hospital: Olaya Hospital",
child: Text(
TranslationBase.of(context).time +
": " +
widget.selectedTime,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
@ -300,13 +333,38 @@ class _BookConfirmState extends State<BookConfirm> {
onPressed: () {
navigateToBookSuccess(context);
},
child: Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 18.0)),
),
),
),
);
}
String getTime(DateTime dateTime) {
final DateFormat formatter = DateFormat('HH:mm');
return formatter.format(dateTime);
}
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);
return DateUtil.getWeekDay(dateObj.weekday) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString();
}
String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = "";
docSpecial.forEach((v) {
docSpeciality = docSpeciality + v + "\n";
});
return docSpeciality;
}
Future navigateToBookSuccess(context) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => BookSuccess()));

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/CardCommon.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import '../../uitl/translations_delegate_base.dart';
@ -6,8 +7,9 @@ import '../../uitl/translations_delegate_base.dart';
class BookingOptions extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(TranslationBase.of(context).bookAppo)) ,
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).bookAppo,
body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Column(

@ -1,4 +1,8 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
@ -7,6 +11,11 @@ import 'components/DocAvailableAppointments.dart';
import 'components/DocInfo.dart';
class DoctorProfile extends StatefulWidget {
DoctorList doctor;
DoctorProfileList docProfileList;
DoctorProfile({@required this.doctor, @required this.docProfileList});
@override
_DoctorProfileState createState() => _DoctorProfileState();
}
@ -24,21 +33,8 @@ class _DoctorProfileState extends State<DoctorProfile>
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(TranslationBase.of(context).bookAppo),
actions: <Widget>[
IconButton(
icon: Icon(
Icons.today,
color: Colors.white,
),
onPressed: () {
print('Login');
},
)
],
),
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
bottomSheet: showFooterButton
? Container(
width: MediaQuery.of(context).size.width,
@ -55,11 +51,9 @@ class _DoctorProfileState extends State<DoctorProfile>
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
navigateToBookConfirm(context);
},
child:
Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)),
onPressed: goToBookConfirm,
child: Text(TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 18.0)),
),
),
)
@ -80,17 +74,16 @@ class _DoctorProfileState extends State<DoctorProfile>
alignment: Alignment.center,
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(
"https://hmgwebservices.com/Images/MobileImages/OALAY/2477.png",
fit: BoxFit.fill,
height: 120.0,
width: 120.0),
child: Image.network(widget.doctor.doctorImageURL,
fit: BoxFit.fill, height: 120.0, width: 120.0),
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text("Dr. EYAD ISMAIL ABU-JAYAD",
child: Text(
widget.doctor.doctorTitle + " " + widget.doctor.name,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20.0,
color: Colors.grey[900],
@ -99,9 +92,9 @@ class _DoctorProfileState extends State<DoctorProfile>
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text("INTERNAL MEDICINE CLINIC",
child: Text(widget.doctor.clinicName,
style: TextStyle(
fontSize: 12.0,
fontSize: 13.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
),
@ -109,7 +102,8 @@ class _DoctorProfileState extends State<DoctorProfile>
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: RatingBar.readOnly(
initialRating: 4.0,
initialRating:
widget.doctor.actualDoctorRate.toDouble(),
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
@ -122,7 +116,10 @@ class _DoctorProfileState extends State<DoctorProfile>
Container(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: Text("(2322 Reviews)",
child: Text(
"(" +
widget.doctor.noOfPatientsRate.toString() +
" Reviews)",
style: TextStyle(
fontSize: 14.0,
color: Colors.blue[800],
@ -160,10 +157,13 @@ class _DoctorProfileState extends State<DoctorProfile>
),
),
Container(
height: MediaQuery.of(context).size.height * 0.68,
height: MediaQuery.of(context).size.height,
child: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [DoctorInformation(), DocAvailableAppointments()],
children: [
DoctorInformation(docProfileList: widget.docProfileList),
DocAvailableAppointments(doctor: widget.doctor)
],
controller: _tabController,
),
),
@ -174,8 +174,21 @@ class _DoctorProfileState extends State<DoctorProfile>
);
}
void goToBookConfirm() {
if (DocAvailableAppointments.areSlotsAvailable)
navigateToBookConfirm(context);
else
AppToast.showErrorToast(message: "Please select Time Slot to continue");
}
Future navigateToBookConfirm(context) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => BookConfirm()));
context,
MaterialPageRoute(
builder: (context) => BookConfirm(
doctor: widget.doctor,
selectedDateTime: DocAvailableAppointments.selectedAppoDateTime,
selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime)));
}
}

@ -1,24 +1,45 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'widgets/DoctorView.dart';
class SearchResults extends StatelessWidget {
class SearchResults extends StatefulWidget {
List<DoctorList> doctorsList = [];
SearchResults({@required this.doctorsList});
@override
_SearchResultsState createState() => _SearchResultsState();
}
class _SearchResultsState extends State<SearchResults> {
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(TranslationBase.of(context).bookAppo),
),
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true,
body: Container(
margin: EdgeInsets.only(bottom: 10.0),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
DoctorView(),
DoctorView(),
DoctorView(),
DoctorView(),
],
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.doctorsList.length,
itemBuilder: (context, index) {
return DoctorView(
doctor: widget.doctorsList[index],
);
},
),
),
),

@ -1,12 +1,24 @@
import 'dart:convert';
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/uitl/app_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:table_calendar/table_calendar.dart';
import '../../../uitl/date_uitl.dart';
class DocAvailableAppointments extends StatefulWidget {
DoctorList doctor;
static bool areSlotsAvailable = false;
static DateTime selectedAppoDateTime;
static String selectedDate;
static String selectedTime;
DocAvailableAppointments({@required this.doctor});
@override
_DocAvailableAppointmentsState createState() =>
_DocAvailableAppointmentsState();
@ -19,9 +31,17 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
CalendarController _calendarController;
var selectedDate = "";
var jsonFreeSlots;
dynamic selectedDateJSON;
dynamic jsonFreeSlots;
List<TimeSlot> docFreeSlots = [];
List<TimeSlot> dayEvents = [];
List docFreeSlots = [];
int selectedButtonIndex = 0;
dynamic freeSlotsResponse;
ScrollController _scrollController;
@override
void initState() {
@ -29,22 +49,18 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
super.initState();
final _selectedDay = DateTime.now();
this.selectedDate = DateUtil.getMonthDayYearDateFormatted(DateTime.now());
_scrollController = new ScrollController();
_events = {
_selectedDay: ['Event A0']
};
_getJSONSlots().then((value) => {
setState(() => {_events.clear(), _events = value})
});
getDoctorFreeSlots(context, widget.doctor);
// _selectedEvents = _events[_selectedDay] ?? [];
_calendarController = CalendarController();
_animationController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 400),
duration: const Duration(milliseconds: 50),
);
_animationController.forward();
@ -58,10 +74,12 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
}
void _onDaySelected(DateTime day, List events) {
print('CALLBACK: _onDaySelected');
final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() {
// _selectedEvents = events;
this.selectedDate = DateUtil.getMonthDayYearDateFormatted(day);
this.selectedDate = DateUtil.getMonthDayYearDateFormatted(day);
openTimeSlotsPickerForDate(day, docFreeSlots);
DocAvailableAppointments.selectedDate = formatter.format(day);
print(DocAvailableAppointments.selectedDate);
});
}
@ -80,9 +98,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
return SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20.0)
),
color: Colors.white, borderRadius: BorderRadius.circular(10.0)),
margin: EdgeInsets.all(20.0),
padding: EdgeInsets.only(bottom: 10.0, top: 10.0),
child: Column(
@ -90,6 +106,33 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
children: <Widget>[
Text(selectedDate,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)),
Container(
height: 50,
margin: EdgeInsets.all(20.0),
child: ListView.builder(
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: dayEvents.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(right: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(
color: Colors.blue[400], //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)),
);
},
),
),
_buildTableCalendarWithBuilders(),
],
),
@ -97,28 +140,11 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
);
}
Future<Map<DateTime, List>> _getJSONSlots() async {
Map<DateTime, List> _eventsParsed;
List<FreeSlot> slotsList = [];
String data = await DefaultAssetBundle.of(context)
.loadString("assets/json/freeSlots.json");
jsonFreeSlots = json.decode(data.toString());
for (var i = 0; i < 4000; i++) {
slotsList.add(FreeSlot(
DateUtil.convertStringToDate(jsonFreeSlots['FreeTimeSlots'][i]),
['slot']));
}
_eventsParsed =
Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
return _eventsParsed;
}
Widget _buildTableCalendarWithBuilders() {
return TableCalendar(
locale: 'en_US',
calendarController: _calendarController,
events: _events,
// holidays: _holidays,
initialCalendarFormat: CalendarFormat.month,
startDay: DateTime.now(),
formatAnimation: FormatAnimation.slide,
@ -160,14 +186,24 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
},
todayDayBuilder: (context, date, _) {
return Container(
margin: const EdgeInsets.all(4.0),
padding: const EdgeInsets.only(top: 5.0, left: 6.0),
color: Colors.amber[400],
width: 0,
height: 0,
child: Text(
'${date.day}',
style: TextStyle().copyWith(fontSize: 16.0),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _calendarController.isSelected(date)
? Colors.green[400]
: _calendarController.isToday(date)
? Colors.brown[300]
: Colors.blue[400],
),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
),
),
),
);
},
@ -196,9 +232,115 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
);
}
openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) {
dayEvents.clear();
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);
});
setState(() {
if (dayEvents.length != 0)
DocAvailableAppointments.areSlotsAvailable = true;
else
DocAvailableAppointments.areSlotsAvailable = false;
selectedButtonIndex = 0;
DocAvailableAppointments.selectedTime =
dayEvents[selectedButtonIndex].isoTime;
_scrollController.animateTo(0.0, duration: new Duration(seconds: 1), curve: Curves.ease);
});
}
Future<Map<DateTime, List>> _getJSONSlots() async {
Map<DateTime, List> _eventsParsed;
List<FreeSlot> slotsList = [];
DateTime date;
final DateFormat formatter = DateFormat('HH:mm');
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));
}
_eventsParsed =
Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() {
selectedDate = DateUtil.getMonthDayYearDateFormatted(
DateUtil.convertStringToDate(freeSlotsResponse[0]));
selectedDateJSON = freeSlotsResponse[0];
});
openTimeSlotsPickerForDate(
DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController
.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON));
return _eventsParsed;
}
Widget getNormalButton(int index) {
return RaisedButton(
color: Colors.white,
textColor: new Color(0xFF60686b),
onPressed: () {
setState(() {
selectedButtonIndex = index;
DocAvailableAppointments.selectedTime =
dayEvents[index].isoTime;
print(DocAvailableAppointments.selectedTime);
});
},
child: Text(dayEvents[index].isoTime,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
);
}
Widget getSelectedButton(int index) {
return RaisedButton(
color: Colors.blue[400],
textColor: Colors.white,
onPressed: () {
setState(() {
selectedButtonIndex = index;
DocAvailableAppointments.selectedTime =
dayEvents[index].isoTime;
print(DocAvailableAppointments.selectedTime);
});
},
child: Text(dayEvents[index].isoTime,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
);
}
getDoctorFreeSlots(context, DoctorList docObject) {
DoctorsListService service = new DoctorsListService();
service
.getDoctorFreeSlots(
docObject.doctorID, docObject.clinicID, docObject.projectID)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) {
freeSlotsResponse = res['FreeTimeSlots'];
_getJSONSlots().then((value) => {
setState(() => {_events.clear(), _events = value})
});
} else {}
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
});
}
Widget _buildEventsMarker(DateTime date, List events) {
return Container(
// duration: const Duration(milliseconds: 10),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _calendarController.isSelected(date)

@ -1,7 +1,13 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
class DoctorInformation extends StatelessWidget {
DoctorProfileList docProfileList;
DoctorInformation({@required this.docProfileList});
@override
Widget build(BuildContext context) {
return Container(
@ -41,8 +47,8 @@ class DoctorInformation extends StatelessWidget {
TableCell(child: _getHeadingText(TranslationBase.of(context).nationality)),
]),
TableRow(children: [
TableCell(child: _getNormalText("Male")),
TableCell(child: _getNormalTextWithIcon("Palestinian")),
TableCell(child: _getNormalText(docProfileList.genderDescription)),
TableCell(child: _getNormalTextWithIcon(docProfileList.nationalityName, docProfileList.nationalityFlagURL)),
]),
],
),
@ -56,7 +62,7 @@ class DoctorInformation extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_getHeadingText(TranslationBase.of(context).clinic),
_getNormalText("INTERNAL MEDICINE CLINIC")
_getNormalText(docProfileList.clinicDescription)
],
),
)
@ -88,12 +94,10 @@ class DoctorInformation extends StatelessWidget {
),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0),
margin: EdgeInsets.fromLTRB(20.0, 0.0, 10.0, 5.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_getHeadingText(TranslationBase.of(context).clinic),
_getNormalText("INTERNAL MEDICINE CLINIC")
_getNormalText(docProfileList.doctorProfileInfo)
],
),
)
@ -127,14 +131,14 @@ class DoctorInformation extends StatelessWidget {
);
}
_getNormalTextWithIcon(text) {
_getNormalTextWithIcon(String text, icon) {
return Container(
margin: EdgeInsets.only(top: 5.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Text(text,
Text(text.trim(),
style: TextStyle(
fontSize: 13,
fontFamily: 'Open-Sans',
@ -143,7 +147,7 @@ class DoctorInformation extends StatelessWidget {
Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Image.network(
"https://hmgwebservices.com/Images/flag/PSE.png",
icon,
width: 18.0,
height: 18.0),
),

@ -1,9 +1,13 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import '../SearchResults.dart';
class SearchByClinic extends StatefulWidget {
@override
_SearchByClinicState createState() => _SearchByClinicState();
@ -96,18 +100,31 @@ class _SearchByClinicState extends State<SearchByClinic> {
}
getDoctorsList() {
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
service.getDoctorsList(int.parse(dropdownValue), 0).then((res) {
print(res['DoctorList']);
// if (res['MessageStatus'] == 1) {
// setState(() {
// res['ListClinicCentralized'].forEach((v) {
// clinicsList.add(new ListClinicCentralized.fromJson(v));
// });
// });
// } else {}
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
} else {}
});
navigateToSearchResults(context, doctorsList);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
});
}
Future navigateToSearchResults(context, docList) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SearchResults(doctorsList: docList)));
}
}

@ -1,4 +1,6 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
@ -75,17 +77,21 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
}
getDoctorsList() {
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
service.getDoctorsListByName(doctorNameController.text).then((res) {
print(res['DoctorList']);
if (res['MessageStatus'] == 1) {
// setState(() {
// res['ListClinicCentralized'].forEach((v) {
// clinicsList.add(new ListClinicCentralized.fromJson(v));
// });
// });
navigateToSearchResults(context);
} else {}
setState(() {
if(res['DoctorList'].length != 0) {
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
} else {}
});
navigateToSearchResults(context, doctorsList);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
});
@ -109,8 +115,10 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
getDoctorsList();
}
Future navigateToSearchResults(context) async {
Future navigateToSearchResults(context, List<DoctorList> docList) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => SearchResults()));
context,
MaterialPageRoute(
builder: (context) => SearchResults(doctorsList: docList)));
}
}

@ -1,14 +1,23 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
import '../DoctorProfile.dart';
class DoctorView extends StatelessWidget {
DoctorList doctor;
DoctorView({@required this.doctor});
@override
Widget build(BuildContext context) {
return GestureDetector(
return InkWell(
onTap: () {
navigateToDoctorProfile(context);
// navigateToDoctorProfile(context);
getDoctorsProfile(context, doctor);
},
child: Card(
margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0),
@ -25,11 +34,8 @@ class DoctorView extends StatelessWidget {
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(
"https://hmgwebservices.com/Images/MobileImages/OALAY/2477.png",
fit: BoxFit.fill,
height: 60.0,
width: 60.0),
child: Image.network(this.doctor.doctorImageURL,
fit: BoxFit.fill, height: 60.0, width: 60.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.6,
@ -37,14 +43,14 @@ class DoctorView extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Dr. EYAD ISMAIL ABU-JAYAD",
Text(this.doctor.doctorTitle + " " + this.doctor.name,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text("INTERNAL MEDICINE CLINIC",
child: Text(this.doctor.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -52,7 +58,8 @@ class DoctorView extends StatelessWidget {
),
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text("General Practioner",
child: Text(
getDoctorSpeciality(this.doctor.speciality).trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -63,7 +70,8 @@ class DoctorView extends StatelessWidget {
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: 4.0,
initialRating:
this.doctor.actualDoctorRate.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
@ -73,10 +81,8 @@ class DoctorView extends StatelessWidget {
emptyIcon: Icons.star,
),
Container(
child: Image.network(
"https://hmgwebservices.com/Images/flag/PSE.png",
width: 25.0,
height: 25.0),
child: Image.network(this.doctor.nationalityFlagURL,
width: 25.0, height: 25.0),
),
],
),
@ -90,9 +96,41 @@ class DoctorView extends StatelessWidget {
);
}
Future navigateToDoctorProfile(context) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => DoctorProfile()));
String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = "";
docSpecial.forEach((v) {
docSpeciality = docSpeciality + v + "\n";
});
return docSpeciality;
}
getDoctorsProfile(context, DoctorList docObject) {
List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsProfile(
docObject.doctorID, docObject.clinicID, docObject.projectID)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) {
res['DoctorProfileList'].forEach((v) {
docProfileList.add(new DoctorProfileList.fromJson(v));
});
} else {}
navigateToDoctorProfile(context, docObject, docProfileList[0]);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
});
}
Future navigateToDoctorProfile(context, docObject, docProfile) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
DoctorProfile(doctor: docObject, docProfileList: docProfile)));
}
}

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/upcomingCard.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class ToDo extends StatefulWidget {
@ -10,10 +11,8 @@ class ToDo extends StatefulWidget {
class _ToDoState extends State<ToDo> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(TranslationBase.of(context).todoList),
),
return AppScaffold(
appBarTitle: TranslationBase.of(context).todoList,
body: SingleChildScrollView(
child: Container(
child: Column(

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/client/base_app_client.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/InsertAppointmentRequest.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -19,10 +20,10 @@ class DoctorsListService {
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"TokenID": "",
"TokenID": "@dm!n",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null,
"ClinicID": 21,
"ClinicID": clinicID,
"ProjectID": 0,
"ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": true,
@ -78,11 +79,126 @@ class DoctorsListService {
await BaseAppClient.post(GET_DOCTORS_LIST_URL,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorsProfile(int docID, int clinicID, int projectID) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null,
"doctorID": docID,
"ClinicID": clinicID,
"PatientID": 0,
"License": true,
"IsRegistered": true,
"ProjectID": projectID,
"isDentalAllowedBackend": false
};
dynamic localRes;
await BaseAppClient.post(GET_DOCTOR_PROFILE,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorFreeSlots(int docID, int clinicID, int projectID) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"DoctorID": docID,
"IsBookingForLiveCare": 0,
"ClinicID": clinicID,
"ProjectID": projectID,
"OriginalClinicID": clinicID,
"days": 0,
"isReschadual": false,
"VersionID": req.VersionID,
"Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958",
"PatientOutSA": 0,
"SessionID": null,
"isDentalAllowedBackend": false,
"DeviceTypeID": 1
};
dynamic localRes;
await BaseAppClient.post(GET_DOCTOR_FREE_SLOTS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
InsertAppointmentRequest insertAppointmentRequest =
new InsertAppointmentRequest();
insertAppointmentRequest.VersionID = req.VersionID;
insertAppointmentRequest.Channel = "3";
insertAppointmentRequest.LanguageID = languageID == 'ar' ? 1 : 2;
insertAppointmentRequest.IPAdress = "10.20.10.20";
insertAppointmentRequest.generalid = "Cs2020@2016\$2958";
insertAppointmentRequest.PatientOutSA = 0;
insertAppointmentRequest.SessionID = "";
insertAppointmentRequest.isDentalAllowedBackend = false;
insertAppointmentRequest.DeviceTypeID = 1;
insertAppointmentRequest.DeviceType = "Android";
insertAppointmentRequest.DoctorID = docID;
insertAppointmentRequest.ClinicID = clinicID;
insertAppointmentRequest.ProjectID = projectID;
insertAppointmentRequest.IsForLiveCare = false;
insertAppointmentRequest.BookedBy = 102;
insertAppointmentRequest.IsVirtual = false;
insertAppointmentRequest.PatientID = "1231755";
insertAppointmentRequest.VisitFor = 1;
insertAppointmentRequest.VisitType = 1;
insertAppointmentRequest.PatientType = 1;
insertAppointmentRequest.PatientTypeID = 1;
insertAppointmentRequest.InitialSlotDuration = 0;
insertAppointmentRequest.EndTime = selectedTime;
insertAppointmentRequest.StartTime = selectedTime;
insertAppointmentRequest.SelectedTime = selectedTime;
insertAppointmentRequest.StrAppointmentDate = selectedDate;
dynamic localRes;
await BaseAppClient.post(GET_DOCTOR_FREE_SLOTS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
}

@ -95,6 +95,12 @@ class TranslationBase {
String get appoActions => localizedValues['appoActions'][locale.languageCode];
String get appointment => localizedValues['appointment'][locale.languageCode];
String get hospital => localizedValues['hospital'][locale.languageCode];
String get date => localizedValues['date'][locale.languageCode];
String get time => localizedValues['time'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,23 +1,26 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/providers/project_provider.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import '../progress_indicator/app_loader_widget.dart';
import 'arrow_back.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import '../progress_indicator/app_loader_widget.dart';
import 'arrow_back.dart';
class AppScaffold extends StatelessWidget {
final String appBarTitle;
final Widget body;
final bool isLoading;
final bool isShowAppBar;
final Widget bottomSheet;
AppScaffold(
{@required this.body,
this.appBarTitle = '',
this.isLoading = false,
this.isShowAppBar = true});
this.isShowAppBar = true,
this.bottomSheet});
@override
Widget build(BuildContext context) {
@ -66,6 +69,7 @@ class AppScaffold extends StatelessWidget {
],
),
),
bottomSheet: bottomSheet,
);
}

Loading…
Cancel
Save