LiveCare Flow from book appointment flow implemented

merge-requests/364/head
haroon amjad 3 years ago
parent cbbef80bd5
commit 0121337d1b

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -1447,12 +1447,13 @@ const Map localizedValues = {
},
"verification_message_code": {"en": "Please enter verification code", "ar": "الرجاء إدخال رمز التحقق"},
"select-location": {"en": "Select Location", "ar": "اختر موقعا"},
"result-header": {"en": "Get The Result During 8 Hours", "ar": "احصل على النتيجة خلال 8 ساعة"},
"result-header": {
"en": "Get the result in Few Hours",
"ar": "احصل على النتيجة خلال عدة ساعات"
},
"covid-info": {
"en":
"We are using the advance technology to test COVID-19, The sample for examination is taking between the nose and mouth (nasopharyngeal swab), the examination is done by ELITE In Genius of the company ELITECH GROUP MOLECULAR DIAGNOSTICS, Note that the device belongs to an Italian company and is manufactured in Japan with RC- PCR",
"ar":
"يتوفر لدينا أحدث جهاز خاص بفحص مرض الكورونا (COVID-19) طريقة الفحص تؤخذ مسحة من البلعوم الأنفي ( عن طريف الأنف) ويتم الفحص بواسطة جهاز ELITE In Genius التابع لشركة ELITECH GROUP MOLECULAR DIAGNOSTICS علما بأن الجهاز تابع لشركة إيطالية ومصنع في اليابان بتقينة RC-PCR"
"en": "Dr. Sulaiman Al Habib hospitals are conducting a test for the emerging corona virus and issuing travel certificates 24/7 in a short time and with high accuracy. Those wishing to benefit from this service can visit one of Dr. Sulaiman Al Habib branches to conduct a corona test within few minutes, and obtain the result within several hours. Corona Virus Covid 19 testing service with PCR technology to detect the virus according to the highest international standards and with the latest high-precision RT-PCR devices (American GeneXpert and others), That is approved by the Food and Drug Authority as well as by the Saudi Center for Infectious Diseases Prevention.",
"ar": "تجري مستشفيات د. سليمان الحبيب فحص فيروس كورونا المستجد وتصدر شهادات السفر على مدار الساعة، طوال أيام الأسبوع، وبسرعة ودقة عالية. يمكن للراغبين في الاستفادة من هذه الخدمة زيارة أحد فروع مستشفيات د. سليمان الحبيب وإجراء فحص كورونا خلال بضع دقائق والحصول على النتائج خلال عدة ساعات خدمة فحص فيروس كورونا Covid 19 بتقنية PCR للكشف عن الفيروس وفقاً لأعلى المعايير العالمية وبأحدث أجهزة RT-PCR عالية الدقة (GeneXpert الأمريكي وغيره)، وهي طرق معتمدة من قبل هيئة الغذاء والدواء وكذلك من قبل المركز السعودي للوقاية من الأمراض المُعدية"
},
"select-appo": {
"en": "Kindly select one of the available appointments from below:",
@ -1597,7 +1598,39 @@ const Map localizedValues = {
"ar": "لا داعي للانتظار او الحضور يمكنك الان الحصول على الاستشارة عن طريق مكالمة الفيديو ( خدمة لايف كير) في العيادة وسوف يقوم الطبيب بالتواصل معك فورا"
},
"livecareModal-top": {
"en": "This Clinic is Accepting livecare services",
"en": "This Clinic is accepting LiveCare services",
"ar": "هذه العيادة تقدم خدمة لايف كير"
},
"livecare-point-2": {
"en": "A Specialized doctor will contact you",
"ar": "سوف يقوم بخدمتك طبيب متخصص"
},
"livecare-point-3": {
"en": "A Doctor will be able to see your full medical file history",
"ar": "سوف يتمكن الطبيب من الاطلاع على ملفك الطبي كاملا"
},
"livecare-point-4": {
"en": "Free Medicine delivery Available",
"ar": "خدمة توصيل الادوية مجانا"
},
"livecare-point-5": {
"en": "No need to visit the service is in your place",
"ar": "لا داعي للحضور سوف تحصل على الخدمة في مكانك"
},
"book-immediate-livecare": {
"en": "I accept to get the service immediately",
"ar": "موافق اريد الحصول على الخدمة فورا"
},
"book-video-livecare-2": {
"en": "I don't need to visit the clinic",
"ar": "اتصال فيديو لا احتاج الحضور الى العيادة"
},
"no-thankyou": {
"en": "No Thanks",
"ar": "لا شكرا"
},
"visit-clinic": {
"en": "Schedule appointment with the doctor",
"ar": "ارغب في حجز موعد مجدول مع الطبيب"
},
};

@ -31,3 +31,4 @@ const PHARMACY_SELECTED_ADDRESS = 'selected-address';
const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN';
const H2O_UNIT = 'H2O_UNIT';
const H2O_REMINDER = 'H2O_REMINDER';
const LIVECARE_CLINIC_DATA = 'LIVECARE_CLINIC_DATA';

@ -1,14 +1,26 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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:flutter_svg/flutter_svg.dart';
class LiveCareBookAppointment extends StatefulWidget {
final dynamic clinicName;
final dynamic liveCareClinicID;
final dynamic liveCareServiceID;
LiveCareBookAppointment(
{this.clinicName, this.liveCareClinicID, this.liveCareServiceID});
@override
_LiveCareBookAppointmentState createState() =>
_LiveCareBookAppointmentState();
}
class _LiveCareBookAppointmentState extends State<LiveCareBookAppointment> {
AppSharedPreferences sharedPref = AppSharedPreferences();
@override
Widget build(BuildContext context) {
return AppScaffold(
@ -34,7 +46,7 @@ class _LiveCareBookAppointmentState extends State<LiveCareBookAppointment> {
margin: EdgeInsets.all(15.0),
padding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
decoration: BoxDecoration(
color: Colors.green,
color: Color(0xff20bc44),
borderRadius: BorderRadius.all(Radius.circular(8.0))),
child: Text(TranslationBase.of(context).livecareModalTop,
textAlign: TextAlign.center,
@ -44,6 +56,297 @@ class _LiveCareBookAppointmentState extends State<LiveCareBookAppointment> {
fontWeight: FontWeight.w600,
letterSpacing: 0.5)),
),
Container(
margin: EdgeInsets.all(15.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: SvgPicture.asset(
"assets/images/new-design/liveCare_mobile_care.svg",
width: 150.0),
),
Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(bottom: 7.0),
child: Text(
TranslationBase.of(context).whyLivecare,
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w600,
letterSpacing: 1.0,
color: Colors.black)),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: SvgPicture.asset(
"assets/images/new-design/ionic-ios-checkmark-circle.svg"),
),
Container(
width:
MediaQuery.of(context).size.width * 0.4,
margin: EdgeInsets.only(
left: 5.0, right: 5.0, bottom: 10.0),
child: Text(
TranslationBase.of(context)
.livecarePoint1,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0,
letterSpacing: 0.5,
color: Colors.black)),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: SvgPicture.asset(
"assets/images/new-design/ionic-ios-checkmark-circle.svg"),
),
Container(
width:
MediaQuery.of(context).size.width * 0.4,
margin: EdgeInsets.only(
left: 5.0, right: 5.0, bottom: 10.0),
child: Text(
TranslationBase.of(context)
.livecarePoint5,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0,
letterSpacing: 0.5,
color: Colors.black)),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: SvgPicture.asset(
"assets/images/new-design/ionic-ios-checkmark-circle.svg"),
),
Container(
width:
MediaQuery.of(context).size.width * 0.4,
margin: EdgeInsets.only(
left: 5.0, right: 5.0, bottom: 10.0),
child: Text(
TranslationBase.of(context)
.livecarePoint2,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0,
letterSpacing: 0.5,
color: Colors.black)),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: SvgPicture.asset(
"assets/images/new-design/ionic-ios-checkmark-circle.svg"),
),
Container(
width:
MediaQuery.of(context).size.width * 0.4,
margin: EdgeInsets.only(
left: 5.0, right: 5.0, bottom: 10.0),
child: Text(
TranslationBase.of(context)
.livecarePoint3,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0,
letterSpacing: 0.5,
color: Colors.black)),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: SvgPicture.asset(
"assets/images/new-design/ionic-ios-checkmark-circle.svg"),
),
Container(
width:
MediaQuery.of(context).size.width * 0.4,
margin:
EdgeInsets.only(left: 5.0, right: 5.0),
child: Text(
TranslationBase.of(context)
.livecarePoint4,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0,
letterSpacing: 0.5,
color: Colors.black)),
),
],
),
],
),
)
],
),
),
Container(
child: Text(TranslationBase.of(context).livecareSummary,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0,
letterSpacing: 0.5,
color: Colors.black)),
),
Container(
child: InkWell(
onTap: () {
sharedPref.setString(
LIVECARE_CLINIC_DATA,
widget.clinicName +
"-" +
widget.liveCareClinicID +
"-" +
widget.liveCareServiceID);
Navigator.pop(context, "livecare");
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[700],
borderRadius:
BorderRadius.all(Radius.circular(10.0))),
margin: EdgeInsets.only(top: 10.0),
padding: EdgeInsets.all(10.0),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: SvgPicture.asset(
"assets/images/new-design/liveCare_logo_icon_white.svg",
width: 70),
),
Container(
width: MediaQuery.of(context).size.width * 0.58,
margin: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(
10.0, 0.0, 10.0, 0.0),
child: Text(
TranslationBase.of(context)
.bookImmediateLivecare,
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 16.0,
letterSpacing: 0.7,
color: Colors.white)),
),
Container(
margin:
EdgeInsets.only(top: 5.0, left: 10.0),
child: Text(
TranslationBase.of(context)
.bookVideoLivecare2,
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 13.0,
color: Colors.white)),
)
],
),
),
],
)),
),
),
Container(
child: InkWell(
onTap: () {
Navigator.pop(context, "schedule");
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[700],
borderRadius:
BorderRadius.all(Radius.circular(10.0))),
margin: EdgeInsets.only(top: 10.0),
padding: EdgeInsets.all(10.0),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: Image.asset(
"assets/images/new-design/doctor_white.png",
width: 50),
),
Container(
width: MediaQuery.of(context).size.width * 0.58,
margin: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(
28.0, 0.0, 28.0, 0.0),
child: Text(
TranslationBase.of(context).noThankyou,
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 16.0,
letterSpacing: 0.7,
color: Colors.white)),
),
Container(
margin: EdgeInsets.only(
top: 5.0, left: 28.0, right: 28.0),
child: Text(
TranslationBase.of(context).visitClinic,
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 13.0,
color: Colors.white)),
)
],
),
),
],
)),
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: InkWell(
onTap: () {
Navigator.pop(context, "false");
},
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(TranslationBase.of(context).cancel,
style: TextStyle(
fontSize: 16.0,
letterSpacing: 0.5,
color: Color(0xffc5272d))),
],
),
),
),
],
),
),

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
@ -243,92 +244,105 @@ class _SearchByClinicState extends State<SearchByClinic> {
// TODO Mosa_REMARk to come back later
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
SearchInfo searchInfo = new SearchInfo();
if (dropdownValue == "17") {
searchInfo.ProjectID = int.parse(projectDropdownValue);
searchInfo.ClinicID = int.parse(dropdownValue);
searchInfo.date = DateTime.now();
GifLoaderDialogUtils.hideDialog(context);
navigateToDentalComplaints(context, searchInfo);
} else if (dropdownValue.split("-")[1] == "true"
// &&
// authProvider.isLogin &&
// && authProvider.isLogin &&
// authUser.patientType == 1
) {
) {
Navigator.push(
context,
FadePage(
page: LiveCareBookAppointment(),
page: LiveCareBookAppointment(
clinicName: "Family Medicine",
liveCareClinicID: dropdownValue.split("-")[2],
liveCareServiceID: dropdownValue.split("-")[3]),
),
);
).then((value) {
print(value);
if (value == "false") dropdownValue = "";
if (value == "livecare") {
Navigator.push(context, FadePage(page: LiveCareHome()));
}
if (value == "schedule") {
callDoctorsSearchAPI();
}
});
} else {
List<DoctorList> doctorsList = [];
List<String> arr = [];
List<String> arrDistance = [];
List<String> result;
int numAll;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
List();
callDoctorsSearchAPI();
}
}
DoctorsListService service = new DoctorsListService();
service
.getDoctorsList(
int.parse(dropdownValue.split("-")[0]),
projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0,
nearestAppo,
context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
// print(res['DoctorList']);
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital =
_patientDoctorAppointmentListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.projectName,
)
.toList();
callDoctorsSearchAPI() {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
List<String> arr = [];
List<String> arrDistance = [];
List<String> result;
int numAll;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
List();
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));
}
});
} else {}
});
DoctorsListService service = new DoctorsListService();
service
.getDoctorsList(
int.parse(dropdownValue.split("-")[0]),
projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0,
nearestAppo,
context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital =
_patientDoctorAppointmentListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.projectName,
)
.toList();
result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length;
navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
});
}
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));
}
});
} else {}
});
result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length;
navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
});
}
Future navigateToDentalComplaints(

@ -57,6 +57,8 @@ class _clinic_listState extends State<ClinicList> {
bool isLiveCareTypeSelected = false;
String liveCareClinicIDs;
@override
void initState() {
liveCareClinicsListResponse = new LiveCareClinicsListResponse();
@ -64,7 +66,9 @@ class _clinic_listState extends State<ClinicList> {
new LiveCareScheduleClinicsListResponse();
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!isLiveCareTypeSelected) openLiveCareSelectionDialog();
if (!isLiveCareTypeSelected) {
openLiveCareSelectionDialog();
}
});
getLanguageID();
@ -420,33 +424,43 @@ class _clinic_listState extends State<ClinicList> {
});
}
openLiveCareSelectionDialog() {
Navigator.of(context)
.push(new MaterialPageRoute<String>(
builder: (BuildContext context) {
return LiveCareTypeSelect();
},
fullscreenDialog: true))
.then((value) {
if (value == null) {
Navigator.pop(context);
} else {
print(value);
isLiveCareTypeSelected = true;
if (value == "immediate") {
setState(() {
currentSelectedLiveCareType = "immediate";
});
getLiveCareClinicsList();
}
if (value == "schedule") {
setState(() {
currentSelectedLiveCareType = "schedule";
});
getLiveCareScheduleClinicsList();
openLiveCareSelectionDialog() async {
liveCareClinicIDs = await sharedPref.getString(LIVECARE_CLINIC_DATA);
if (liveCareClinicIDs != null) {
selectedClinicID = int.parse(liveCareClinicIDs.split("-")[2]);
setState(() {
currentSelectedLiveCareType = "immediate";
});
getLiveCareClinicsList();
startLiveCare();
} else {
Navigator.of(context)
.push(new MaterialPageRoute<String>(
builder: (BuildContext context) {
return LiveCareTypeSelect();
},
fullscreenDialog: true))
.then((value) {
if (value == null) {
Navigator.pop(context);
} else {
print(value);
isLiveCareTypeSelected = true;
if (value == "immediate") {
setState(() {
currentSelectedLiveCareType = "immediate";
});
getLiveCareClinicsList();
}
if (value == "schedule") {
setState(() {
currentSelectedLiveCareType = "schedule";
});
getLiveCareScheduleClinicsList();
}
}
}
});
});
}
}
Widget getLiveCareScheduleClinicList() {
@ -555,12 +569,14 @@ class _clinic_listState extends State<ClinicList> {
itemBuilder: (context, index) {
return InkWell(
onTap: () {
if(liveCareClinicsListResponse
.patientERGetClinicsList[index].isOnline == 1) {
if (liveCareClinicsListResponse
.patientERGetClinicsList[index].isOnline ==
1) {
updateSelectedIndex(liveCareClinicsListResponse
.patientERGetClinicsList[index]);
} else {
AppToast.showErrorToast(message: "Clinic is offline");
AppToast.showErrorToast(
message: "Clinic is offline");
}
},
child: ClinicCard(

@ -1206,6 +1206,16 @@ class TranslationBase {
String get livecareModalTop =>
localizedValues["livecareModal-top"][locale.languageCode];
String get livecarePoint2 => localizedValues["livecare-point-2"][locale.languageCode];
String get livecarePoint3 => localizedValues["livecare-point-3"][locale.languageCode];
String get livecarePoint4 => localizedValues["livecare-point-4"][locale.languageCode];
String get livecarePoint5 => localizedValues["livecare-point-5"][locale.languageCode];
String get bookImmediateLivecare => localizedValues["book-immediate-livecare"][locale.languageCode];
String get bookVideoLivecare2 => localizedValues["book-video-livecare-2"][locale.languageCode];
String get noThankyou => localizedValues["no-thankyou"][locale.languageCode];
String get visitClinic => localizedValues["visit-clinic"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save