Merge branch 'Haroon' into 'master'

Haroon

See merge request Cloud_Solution/diplomatic-quarter!38
find_us
Mohammad Aljammal 4 years ago
commit a75adae281

@ -75,6 +75,9 @@ const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
//URL to get doctors list
const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime";
//URL to dental doctors list
const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping";
//URL to get doctor free slots
const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots";

@ -374,5 +374,6 @@ const Map<String, Map<String, String>> localizedValues = {
"gate":{"en":"Gate:","ar":"بوابة"},
"building":{"en":"Building:","ar":"المبنى"},
"branch":{"en":"Branch:","ar":"الفرع"},
"emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}
"emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"},
"km":{"en":"KMs:","ar":"كم"},
};

@ -2,14 +2,11 @@ import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http;
import '../../../locator.dart';
import '../../../routes.dart';
AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -33,9 +30,11 @@ class BaseAppClient {
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en');
var user = await sharedPref.getObject(USER_PROFILE);
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] : SETUP_ID
: SETUP_ID;
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] : SETUP_ID
: SETUP_ID;
}
body['VersionID'] = body.containsKey('VersionID')
? body['VersionID'] != null ? body['VersionID'] : VERSION_ID
: VERSION_ID;
@ -46,16 +45,29 @@ class BaseAppClient {
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null ? body['PatientOutSA'] : PATIENT_OUT_SA
: PATIENT_OUT_SA;
body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = DeviceTypeID;
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE
: PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
if (body.containsKey('PatientType')) {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE
: PATIENT_TYPE;
}
if (body.containsKey('PatientTypeID')) {
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
}
if (user != null) {
body['TokenID'] = token;
body['PatientID'] =

@ -272,3 +272,13 @@ class AppoitmentAllHistoryResultList {
return data;
}
}
class PatientAppointmentList {
String filterName = "";
List<AppoitmentAllHistoryResultList> patientDoctorAppointmentList = List();
PatientAppointmentList(
{this.filterName, AppoitmentAllHistoryResultList patientDoctorAppointment}) {
patientDoctorAppointmentList.add(patientDoctorAppointment);
}
}

@ -0,0 +1,48 @@
class DentalChiefComplaintsModel {
List<ListDentalChiefComplain> listDentalChiefComplain;
DentalChiefComplaintsModel({this.listDentalChiefComplain});
DentalChiefComplaintsModel.fromJson(Map<String, dynamic> json) {
if (json['List_DentalChiefComplain'] != null) {
listDentalChiefComplain = new List<ListDentalChiefComplain>();
json['List_DentalChiefComplain'].forEach((v) {
listDentalChiefComplain.add(new ListDentalChiefComplain.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.listDentalChiefComplain != null) {
data['List_DentalChiefComplain'] =
this.listDentalChiefComplain.map((v) => v.toJson()).toList();
}
return data;
}
}
class ListDentalChiefComplain {
int projectID;
int iD;
String name;
String nameN;
ListDentalChiefComplain({this.projectID, this.iD, this.name, this.nameN});
ListDentalChiefComplain.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
iD = json['ID'];
name = json['Name'];
nameN = json['NameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
data['ID'] = this.iD;
data['Name'] = this.name;
data['NameN'] = this.nameN;
return data;
}
}

@ -1,5 +1,10 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart';
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/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -14,6 +19,11 @@ class DentalComplaints extends StatefulWidget {
}
class _DentalComplaintsState extends State<DentalComplaints> {
List<ListDentalChiefComplain> complaintsList = [];
AppSharedPreferences sharedPref = AppSharedPreferences();
bool isDataLoaded = false;
var languageID;
@override
void initState() {
WidgetsBinding.instance
@ -26,20 +36,43 @@ class _DentalComplaintsState extends State<DentalComplaints> {
return AppScaffold(
isShowAppBar: true,
appBarTitle: "Symptoms",
body: Container(),
body: Container(
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: ListView.builder(
itemCount: complaintsList.length,
itemBuilder: (BuildContext context, int index) {
return Container(
margin: EdgeInsets.only(bottom: 10.0),
child: DentalComplaintCard(
listDentalChiefComplain: complaintsList[index],
languageID: languageID,
),
);
},
),
),
);
}
getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
getChiefComplaintsList() {
getLanguageID();
ClinicListService service = new ClinicListService();
service
.getChiefComplaintsList(
widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
// setState(() {
// res['List_DentalChiefComplain'].forEach((v) {});
// });
print(res['List_DentalChiefComplain']);
setState(() {
res['List_DentalChiefComplain'].forEach((v) {
complaintsList.add(new ListDentalChiefComplain.fromJson(v));
});
print(complaintsList.length);
});
} else {}
}).catchError((err) {
print(err);

@ -43,7 +43,7 @@ class _SearchResultsState extends State<SearchResults> {
(index) => AppExpandableNotifier(
title: widget
.patientDoctorAppointmentListHospital[index].filterName + " - " +widget
.patientDoctorAppointmentListHospital[index].distanceInKMs + " KMs" ,
.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,

@ -82,7 +82,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
onChanged: (newValue) {
setState(() {
dropdownValue = newValue;
if (!isDentalSelectedAndSupported()) {
if (!isDentalSelectedAndSupported() && !nearestAppo) {
projectDropdownValue = "";
getDoctorsList(context);
}
@ -194,6 +194,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
.getDoctorsList(
int.parse(dropdownValue),
projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0,
nearestAppo,
context)
.then((res) {
if (res['MessageStatus'] == 1) {
@ -248,6 +249,8 @@ class _SearchByClinicState extends State<SearchByClinic> {
num: numAll,
resultDistance: resultDistance),
),
);
).then((value) {
getProjectsList();
});
}
}

@ -145,7 +145,7 @@ class _ExpandableListViewState extends State<ExpandableListView> {
String getProjectDistance(String distance) {
if (distance != "0")
return " - " + distance + " KMs";
return " - " + distance + " " + TranslationBase.of(context).km;
else {
return "";
}

@ -0,0 +1,135 @@
import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
// ignore: must_be_immutable
class DentalComplaintCard extends StatefulWidget {
final ListDentalChiefComplain listDentalChiefComplain;
var languageID;
DentalComplaintCard(
{@required this.listDentalChiefComplain, this.languageID});
@override
_DentalComplaintCardState createState() => _DentalComplaintCardState();
}
class _DentalComplaintCardState extends State<DentalComplaintCard> {
@override
Widget build(BuildContext context) {
return Container(
child: InkWell(
onTap: () {
getChiefComplaintsList();
},
child: Card(
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Row(
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),
],
),
),
],
),
),
),
);
}
getChiefComplaintsList() {
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
List();
ClinicListService service = new ClinicListService();
service
.getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD,
widget.listDentalChiefComplain.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
print(res['List_DentalDoctorChiefComplaintMapping']);
setState(() {
doctorsList.clear();
res['List_DentalDoctorChiefComplaintMapping'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital =
_patientDoctorAppointmentListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[
_patientDoctorAppointmentListHospital
.indexOf(doctorByHospital[0])]
.patientDoctorAppointmentList
.add(element);
} else {
_patientDoctorAppointmentListHospital.add(
PatientDoctorAppointmentList(
filterName: element.projectName,
distanceInKMs:
element.projectDistanceInKiloMeters.toString(),
patientDoctorAppointment: element));
}
});
navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital);
});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Future navigateToSearchResults(
context,
List<DoctorList> docList,
List<PatientDoctorAppointmentList>
patientDoctorAppointmentListHospital) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SearchResults(
doctorsList: docList,
patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital)));
}
}

@ -2,6 +2,7 @@ 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:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -39,7 +40,7 @@ class DoctorView extends StatelessWidget {
fit: BoxFit.fill, height: 60.0, width: 60.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.5,
width: MediaQuery.of(context).size.width * 0.55,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -74,6 +75,16 @@ class DoctorView extends StatelessWidget {
color: Colors.grey[600],
letterSpacing: 1.0)),
),
this.doctor.nearestFreeSlot != null ? Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text(
getDate(this.doctor.nearestFreeSlot),
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.bold,
color: Colors.green[600],
letterSpacing: 1.0)),
) : Container(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
@ -136,6 +147,29 @@ class DoctorView extends StatelessWidget {
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
String getDate(String date) {
DateTime dateObj = DateUtil.convertStringToDate(date);
return DateUtil.getWeekDay(dateObj.weekday) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString() +
" " +
dateObj.hour.toString() +
":" +
getMinute(dateObj);
}
String getMinute(DateTime dateObj) {
if(dateObj.minute == 0) {
return dateObj.minute.toString() + "0";
} else {
return dateObj.minute.toString();
}
}
Future navigateToDoctorProfile(context, docObject, docProfile,
{isAppo}) async {
Navigator.push(

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCar
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:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -15,6 +16,13 @@ class MyAppointments extends StatefulWidget {
List<AppoitmentAllHistoryResultList> confirmedAppoList = [];
List<AppoitmentAllHistoryResultList> arrivedAppoList = [];
List<PatientAppointmentList> _patientBookedAppointmentListHospital = List();
List<PatientAppointmentList> _patientConfirmedAppointmentListHospital =
List();
List<PatientAppointmentList> _patientArrivedAppointmentListHospital = List();
@override
_MyAppointmentsState createState() => _MyAppointmentsState();
}
@ -40,7 +48,6 @@ class _MyAppointmentsState extends State<MyAppointments>
isShowAppBar: true,
body: Container(
child: Column(children: [
/// this is will not colored with theme data
TabBar(
tabs: [
Tab(text: TranslationBase.of(context).booked),
@ -94,7 +101,8 @@ class _MyAppointmentsState extends State<MyAppointments>
}
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
bool isConfirmed(AppoitmentAllHistoryResultList appo) {
@ -123,64 +131,176 @@ class _MyAppointmentsState extends State<MyAppointments>
widget.arrivedAppoList.add(v);
}
});
widget.bookedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByHospital =
widget._patientBookedAppointmentListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.clinicName,
)
.toList();
if (doctorByHospital.length != 0) {
widget
._patientBookedAppointmentListHospital[widget
._patientBookedAppointmentListHospital
.indexOf(doctorByHospital[0])]
.patientDoctorAppointmentList
.add(element);
} else {
widget._patientBookedAppointmentListHospital.add(PatientAppointmentList(
filterName: element.clinicName, patientDoctorAppointment: element));
}
});
widget.confirmedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByHospital =
widget._patientConfirmedAppointmentListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.clinicName,
)
.toList();
if (doctorByHospital.length != 0) {
widget
._patientConfirmedAppointmentListHospital[widget
._patientConfirmedAppointmentListHospital
.indexOf(doctorByHospital[0])]
.patientDoctorAppointmentList
.add(element);
} else {
widget._patientConfirmedAppointmentListHospital.add(
PatientAppointmentList(
filterName: element.clinicName,
patientDoctorAppointment: element));
}
});
widget.arrivedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByHospital =
widget._patientArrivedAppointmentListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.clinicName,
)
.toList();
if (doctorByHospital.length != 0) {
widget
._patientArrivedAppointmentListHospital[widget
._patientArrivedAppointmentListHospital
.indexOf(doctorByHospital[0])]
.patientDoctorAppointmentList
.add(element);
} else {
widget._patientArrivedAppointmentListHospital.add(
PatientAppointmentList(
filterName: element.clinicName,
patientDoctorAppointment: element));
}
});
}
openAppointmentsTab() {
if (widget.bookedAppoList.length != 0) {
_tabController.animateTo((_tabController.index + 1) % 1);
_tabController.index = 0;
} else if (widget.confirmedAppoList.length != 0) {
_tabController.animateTo((_tabController.index + 1) % 2);
_tabController.index = 1;
} else if (widget.arrivedAppoList.length != 0) {
_tabController.animateTo((_tabController.index + 1) % 3);
_tabController.index = 2;
return;
}
}
Widget getBookedAppointments() {
return Container(
child: widget.bookedAppoList.length != 0
? new ListView.builder(
itemCount: widget.bookedAppoList.length,
itemBuilder: (context, i) {
return AppointmentCard(
appo: widget.bookedAppoList[i],
onReloadAppointmentHistory: getPatientAppointmentHistory,
);
},
)
: Container(
child: Center(
margin: EdgeInsets.only(top: 10.0),
child: Container(
child: widget.bookedAppoList.length != 0
? SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
"assets/images/new-design/noAppointmentIcon.png"),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("No Booked Appointments",
style: TextStyle(
fontSize: 16.0,
...List.generate(
widget._patientBookedAppointmentListHospital.length,
(index) => AppExpandableNotifier(
title: widget
._patientBookedAppointmentListHospital[index]
.filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget
._patientBookedAppointmentListHospital[index]
.patientDoctorAppointmentList
.map((doctor) {
return AppointmentCard(
appo: doctor,
onReloadAppointmentHistory:
getPatientAppointmentHistory,
);
}).toList(),
)),
),
)
],
),
)
: Container(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
"assets/images/new-design/noAppointmentIcon.png"),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("No Booked Appointments",
style: TextStyle(
fontSize: 16.0,
)),
),
],
),
),
),
),
),
);
}
Widget getConfirmedAppointments() {
return widget.confirmedAppoList.length != 0
? Container(
child: new ListView.builder(
itemCount: widget.confirmedAppoList.length,
itemBuilder: (context, i) {
return AppointmentCard(
appo: widget.confirmedAppoList[i],
onReloadAppointmentHistory: getPatientAppointmentHistory,
);
},
margin: EdgeInsets.only(top: 10.0),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: <Widget>[
...List.generate(
widget._patientConfirmedAppointmentListHospital.length,
(index) => AppExpandableNotifier(
title: widget
._patientConfirmedAppointmentListHospital[index]
.filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget
._patientConfirmedAppointmentListHospital[index]
.patientDoctorAppointmentList
.map((doctor) {
return AppointmentCard(
appo: doctor,
onReloadAppointmentHistory:
getPatientAppointmentHistory,
);
}).toList(),
)),
)
],
),
),
)
: Container(
@ -206,16 +326,47 @@ class _MyAppointmentsState extends State<MyAppointments>
Widget getArrivedAppointments() {
return widget.arrivedAppoList.length != 0
? Container(
child: new ListView.builder(
itemCount: widget.arrivedAppoList.length,
itemBuilder: (context, i) {
return AppointmentCard(
appo: widget.arrivedAppoList[i],
onReloadAppointmentHistory: getPatientAppointmentHistory,
);
},
margin: EdgeInsets.only(top: 10.0),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: <Widget>[
...List.generate(
widget._patientArrivedAppointmentListHospital.length,
(index) => AppExpandableNotifier(
title: widget
._patientArrivedAppointmentListHospital[index]
.filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget
._patientArrivedAppointmentListHospital[index]
.patientDoctorAppointmentList
.map((doctor) {
return AppointmentCard(
appo: doctor,
onReloadAppointmentHistory:
getPatientAppointmentHistory,
);
}).toList(),
)),
)
],
),
),
)
// Container(
// child: new ListView.builder(
// itemCount: widget.arrivedAppoList.length,
// itemBuilder: (context, i) {
// return AppointmentCard(
// appo: widget.arrivedAppoList[i],
// onReloadAppointmentHistory: getPatientAppointmentHistory,
// );
// },
// ),
// )
: Container(
child: Center(
child: Column(

@ -42,7 +42,7 @@ class _ApointmentCardState extends State<AppointmentCard> {
fit: BoxFit.fill, height: 60.0, width: 60.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.6,
width: MediaQuery.of(context).size.width * 0.57,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -95,7 +95,7 @@ class _ApointmentCardState extends State<AppointmentCard> {
emptyIcon: Icons.star,
),
Container(
transform: Matrix4.translationValues(0.0, -40.0, 0.0),
transform: Matrix4.translationValues(15.0, -40.0, 0.0),
child: Image.asset(
"assets/images/new-design/arrow.png",
width: 25.0,

@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
class DoctorsListService extends BaseService {
@ -23,7 +22,8 @@ class DoctorsListService extends BaseService {
double lat;
double long;
Future<Map> getDoctorsList(int clinicID, int projectID, BuildContext context,
Future<Map> getDoctorsList(
int clinicID, int projectID, bool isNearest, BuildContext context,
{doctorId}) async {
//Utils.showProgressDialog(context);
Map<String, dynamic> request;
@ -34,7 +34,8 @@ class DoctorsListService extends BaseService {
authUser = data;
}
if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
if (await this.sharedPref.getDouble(USER_LAT) != null &&
await this.sharedPref.getDouble(USER_LONG) != null) {
lat = await this.sharedPref.getDouble(USER_LAT);
long = await this.sharedPref.getDouble(USER_LONG);
}
@ -62,6 +63,9 @@ class DoctorsListService extends BaseService {
"IsGetNearAppointment": false,
"Latitude": lat.toString(),
"Longitude": long.toString(),
"IsGetNearAppointment": isNearest,
if (isNearest)
"SelectedDate": DateUtil.convertDateToString(DateTime.now()),
"License": true
};
@ -88,7 +92,8 @@ class DoctorsListService extends BaseService {
authUser = data;
}
if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
if (await this.sharedPref.getDouble(USER_LAT) != null &&
await this.sharedPref.getDouble(USER_LONG) != null) {
lat = await this.sharedPref.getDouble(USER_LAT);
long = await this.sharedPref.getDouble(USER_LONG);
}

@ -37,10 +37,10 @@ class ClinicListService extends BaseService {
await baseAppClient.post(GET_CLINICS_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);
}
@ -64,14 +64,15 @@ class ClinicListService extends BaseService {
await baseAppClient.post(GET_PROJECTS_LIST,
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> getChiefComplaintsList(int clinicID, int projectID, BuildContext context,
Future<Map> getChiefComplaintsList(
int clinicID, int projectID, BuildContext context,
{doctorId}) async {
//Utils.showProgressDialog(context);
Map<String, dynamic> request;
@ -82,12 +83,6 @@ class ClinicListService extends BaseService {
authUser = data;
}
if (await this.sharedPref.getDouble(USER_LAT) != null &&
await this.sharedPref.getDouble(USER_LONG) != null) {
lat = await this.sharedPref.getDouble(USER_LAT);
long = await this.sharedPref.getDouble(USER_LONG);
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
@ -114,11 +109,56 @@ class ClinicListService extends BaseService {
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> getChiefComplaintDoctorList(
int chiefComplaintID, int projectID, BuildContext context,
{doctorId}) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
if (await this.sharedPref.getDouble(USER_LAT) != null &&
await this.sharedPref.getDouble(USER_LONG) != null) {
lat = await this.sharedPref.getDouble(USER_LAT);
long = await this.sharedPref.getDouble(USER_LONG);
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"ChiefComplaintID": chiefComplaintID,
"ProjectID": projectID,
"VersionID": 5.6,
"Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": 0,
"SessionID": null,
"isDentalAllowedBackend": true,
"Latitude": lat.toString(),
"Longitude": long.toString(),
"DeviceTypeID": 1
};
dynamic localRes;
await baseAppClient.post(GET_DENTAL_DOCTORS_LIST_URL,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
}

@ -452,6 +452,8 @@ class TranslationBase {
localizedValues['textToSpeech'][locale.languageCode];
String get locationDialogMessage =>
localizedValues['locationDialogMessage'][locale.languageCode];
String get km =>
localizedValues['km'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -312,7 +312,7 @@ class _SearchBot extends State<BottomBarSearch> {
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsList(clinicId, projectId, context, doctorId: doctorName)
.getDoctorsList(clinicId, projectId, false, context, doctorId: doctorName)
.then((res) {
if (res['MessageStatus'] == 1) {
setState(() {

Loading…
Cancel
Save