Conflicts:
	lib/config/localized_values.dart
	lib/core/service/client/base_app_client.dart
	lib/models/Appointments/DoctorListResponse.dart
	lib/pages/BookAppointment/widgets/DoctorView.dart
	lib/pages/MyAppointments/MyAppointments.dart
	lib/uitl/translations_delegate_base.dart
	pubspec.yaml
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit 68466c8d03

Binary file not shown.

@ -0,0 +1,16 @@
-----BEGIN CERTIFICATE REQUEST-----
MIICkDCCAXgCAQAwSzEjMCEGCSqGSIb3DQEJARYUaGFyb29uNjEzOEBnbWFpbC5j
b20xFzAVBgNVBAMMDk1vaGFtZWQgTWVrYXd5MQswCQYDVQQGEwJBRTCCASIwDQYJ
KoZIhvcNAQEBBQADggEPADCCAQoCggEBALcPrk09MmhQhRNe8LYdaeN4mYtoKJg3
SndMLgpxnaRqP7a6f4sp118wCFZsTXnwhPVP4DzmXWc2AzZtsusmhdw1tzNFtme0
PtEjDXIPI2lHU3Zhi2zukZdAVxF+uNi3pcp0axina60ZQciIfb/7Fx6hNbqpk90E
O8a2Ob17Wq/ZTYIP4H7ZGydUe2ra9QyDtjmGj9vpEv+xXYWX685sgEylTG14DSOP
ozGsQmaf+QCMbCT3osq7idWc1IQ+3Oed0kUTx1jmRtZwPzQkJJ1Bx3vYSXN/EOlb
u+ei1Nqtc14aVCYvmcuvGDtMyRtw6w+syCw2CpJCPGNkxNz+EH9h+EUCAwEAAaAA
MA0GCSqGSIb3DQEBCwUAA4IBAQBYdu2AaZY6kReuT1Xp8ktlyPfjBRKhPPChuaeR
tFnYMsJtG0aIA/xOu4/RYDgmL92seimULXd9DIPvkJ2DuaB+bdfGTw0qXUlihkm8
ui5O0L2F9OZbQxJogvTmrMsKnkoR27O5vyfCn9VMOLk3x1nyEzAXIj/5GHWw9T6t
r65jPUOfm6ikiZtICBzSaTPBtyfZB8mrbwG2dpOvVNSa1dj3xip4L8CL6TxH+qM3
+N90QFYjvjphJkpn2Kt0ow9IyIyeqJbIYJmsWoV9pXddOHCjKdTWUjq7D2Jn3eUA
DAKjKgVqF4/dU10k7EtSfrw01aHLXjj5FxsD5YhVrgTA5xSq
-----END CERTIFICATE REQUEST-----

Binary file not shown.

@ -0,0 +1,16 @@
-----BEGIN CERTIFICATE REQUEST-----
MIICkDCCAXgCAQAwSzEjMCEGCSqGSIb3DQEJARYUaGFyb29uNjEzOEBnbWFpbC5j
b20xFzAVBgNVBAMMDk1vaGFtZWQgTWVrYXd5MQswCQYDVQQGEwJBRTCCASIwDQYJ
KoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnHqsyE7WfiVcE1Lpa4t4OVO6qlll2q
1djs0XG06R/dlDtIqv4940/XLj+hU93mzAcVvFW4DSIEdD3InM3+T6oMTjPu6meU
69h9ryaVkluQRrT/tdGI1EKO4MWGMe4MDIt7DqMhMfAcxTwekwdxdKaCEhaw3qnA
l/64AelY6URW1pHHJMA0VV7j+pE3jVNai+muMXPrhQ1VrOrV8FftpY3bEeRJR2Cl
T0tv0LhEMu4SfLnVWCzGQQC82hilDw3rH3ZDs8DFxF9agNVdwKlYamarh1dQXwRq
Yx2+sjY1/51r9L4VS+GAh9ECxz0e+43NpzfZ/N+mTeDYKDepaBwPQ6kCAwEAAaAA
MA0GCSqGSIb3DQEBCwUAA4IBAQB89OyLfywKT7ftmpEqCmgsmaJexb580q9w8wOk
1JhJkNV5ec+p1dnge2NZeJ4LGII/5wmPj1vANNW0GZdmJDgnC+2gg9toq1QLCAsF
rW7/LMpgAoEH+P5bhrHV9RRv6BQi0ZmN0apBHjp/pqZfm2Cl5jQPEWjUEf2tIF4l
LSKdok6IPO9n4Fgyk0XdUNSEhgVhsLtZkGiXnkI1YovKDnupTFYPXMLp103bc9zP
xDxwscvOysNDijlzZAkJPg2z8NrJIRDrKvLRHzxQwZ/1LHVB/51bp/1iyks3vOjh
qw5XVsrtGAjCjU9md7q3XkPSyKzhK9UqPdOxdvl1OY0KKIIY
-----END CERTIFICATE REQUEST-----

Binary file not shown.

Binary file not shown.

@ -0,0 +1,17 @@
package io.flutter.plugins.firebasemessaging;
import android.content.Intent;
import com.google.firebase.messaging.RemoteMessage;
public class CustomFlutterFirebaseMessagingService extends FlutterFirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
if (remoteMessage.getData().containsKey("is_call")) {
Intent intent = getPackageManager().getLaunchIntentForPackage(getPackageName());
startActivity(intent);
super.onMessageReceived(remoteMessage);
} else
super.onMessageReceived(remoteMessage);
}
}

@ -0,0 +1,17 @@
package io.flutter.plugins.firebasemessaging;
import android.content.Intent;
import com.google.firebase.messaging.RemoteMessage;
public class CustomFlutterFirebaseMessagingService extends FlutterFirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
if (remoteMessage.getData().containsKey("is_call")) {
Intent intent = getPackageManager().getLaunchIntentForPackage(getPackageName());
startActivity(intent);
super.onMessageReceived(remoteMessage);
} else
super.onMessageReceived(remoteMessage);
}
}

@ -69,9 +69,15 @@ const GET_QR_PARKING = '/Services/SWP.svc/REST/GetQRParkingByID';
//URL to get clinic list
const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
//URL to get projects list
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";

@ -449,4 +449,18 @@ const Map<String, Map<String, String>> localizedValues = {
"OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"},
"VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"},
"MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"},
"textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"},
"locationDialogMessage": {"en": "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", "ar": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."},
"parking":{"en":"Parking","ar":"مواقف"},
"alhabiServices":{"en":"HMG Service","ar":"خدمات الحبيب"},
"parkingTitle":{"en":"Car service, car service, service to save parking information, return to it later, 1- By clicking on (Read the code), save the parking data. 2- By clicking on the button (view my car park), it shows you the cars location in Google Maps. 3- Read another position by pressing the Clear Position Data button.","ar":" خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). "},
"readBarcode":{"en":"Read Barcode","ar":"قراءة الكود"},
"showMyPark":{"en":"Show My Park","ar":"عرض بارك"},
"clearMyData":{"en":"clear My Data","ar":"امسح البيانات"},
"floor":{"en":"Floor:","ar":"الطابق"},
"gate":{"en":"Gate:","ar":"بوابة"},
"building":{"en":"Building:","ar":"المبنى"},
"branch":{"en":"Branch:","ar":"الفرع"},
"emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"},
"km":{"en":"KMs:","ar":"كم"},
};

@ -11,4 +11,6 @@ const AUTH_DATA = 'auth-data';
const IMEI_USER_DATA = 'imei-user-data';
const NHIC_DATA = 'nhic-data';
const FAMILY_FILE = 'family-file';
const USER_LAT = 'user-lat';
const USER_LONG = 'user-long';
const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING';

@ -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'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
@ -44,16 +43,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'] =

@ -1,7 +1,4 @@
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/login/login.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

@ -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,3 @@
import 'package:intl/intl.dart';
class DoctorList {
int clinicID;
String clinicName;
@ -32,7 +30,7 @@ class DoctorList {
int noOfPatientsRate;
int originalClinicID;
int personRate;
int projectDistanceInKiloMeters;
dynamic projectDistanceInKiloMeters;
String qR;
dynamic qRString;
int rateNumber;
@ -170,12 +168,13 @@ class DoctorList {
}
}
class DoctorListAppointmentList {
class PatientDoctorAppointmentList {
String filterName = "";
String distanceInKMs = "";
List<DoctorList> patientDoctorAppointmentList = List();
DoctorListAppointmentList(
{this.filterName, DoctorList patientDoctorAppointment}) {
PatientDoctorAppointmentList(
{this.filterName, this.distanceInKMs, DoctorList patientDoctorAppointment}) {
patientDoctorAppointmentList.add(patientDoctorAppointment);
}
}

@ -0,0 +1,10 @@
class SearchInfo {
int ProjectID;
int ClinicID;
String DoctorName;
String SelectedDate;
String SelectedTime;
String currentLat;
String currentLong;
DateTime date;
}

@ -502,8 +502,6 @@ class _BookConfirmState extends State<BookConfirm> {
Future navigateToBookSuccess(context, DoctorList docObject,
PatientShareResponse patientShareResponse) async {
print(widget.appoDateFormatted);
// print(widget.appoTimeFormatted);
Navigator.push(
context,

@ -1,19 +1,36 @@
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/CardCommon.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../uitl/translations_delegate_base.dart';
class BookingOptions extends StatelessWidget {
class BookingOptions extends StatefulWidget {
final bool isAppbar;
BookingOptions({this.isAppbar = false});
@override
_BookingOptionsState createState() => _BookingOptionsState();
}
class _BookingOptionsState extends State<BookingOptions> {
LocationUtils locationUtils;
@override
void initState() {
locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance
.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
super.initState();
}
@override
Widget build(BuildContext context) {
final searchValue = Provider.of<SearchProvider>(context);
return AppScaffold(
isShowAppBar: isAppbar,
isShowAppBar: widget.isAppbar,
appBarTitle: TranslationBase.of(context).bookAppo,
body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),

@ -0,0 +1,82 @@
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';
class DentalComplaints extends StatefulWidget {
SearchInfo searchInfo;
DentalComplaints({@required this.searchInfo});
@override
_DentalComplaintsState createState() => _DentalComplaintsState();
}
class _DentalComplaintsState extends State<DentalComplaints> {
List<ListDentalChiefComplain> complaintsList = [];
AppSharedPreferences sharedPref = AppSharedPreferences();
bool isDataLoaded = false;
var languageID;
@override
void initState() {
WidgetsBinding.instance
.addPostFrameCallback((_) => getChiefComplaintsList());
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: "Symptoms",
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) {
print(res['List_DentalChiefComplain']);
setState(() {
res['List_DentalChiefComplain'].forEach((v) {
complaintsList.add(new ListDentalChiefComplain.fromJson(v));
});
print(complaintsList.length);
});
} else {}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
}

@ -1,13 +1,17 @@
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
class Search extends StatefulWidget {
final int type;
Search({this.type = 0});
@override
_SearchState createState() => _SearchState();
}

@ -1,15 +1,17 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'widgets/DoctorView.dart';
class SearchResults extends StatefulWidget {
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
SearchResults({@required this.doctorsList});
SearchResults(
{@required this.doctorsList, this.patientDoctorAppointmentListHospital});
@override
_SearchResultsState createState() => _SearchResultsState();
@ -21,23 +23,7 @@ class _SearchResultsState extends State<SearchResults> {
@override
void initState() {
event.controller.stream.listen((p) {
// if (p['project_id'] != null) {
// tempList = [];
// widget.doctorsList.forEach((e) => {
// if (e.projectID == int.parse(p['project_id'])) {tempList.add(e)}
// });
// } else if (p['doctor_id'] != null) {
// tempList = [];
// widget.doctorsList.forEach((e) => {
// if (e.doctorID == int.parse(p['doctor_id'])) {tempList.add(e)}
// });
// DoctorView().getDoctorsProfile(context, tempList[0], isAppo: true);
// }
// setState(() {
// widget.doctorsList = tempList;
// });
});
event.controller.stream.listen((p) {});
super.initState();
}
@ -47,20 +33,31 @@ class _SearchResultsState extends State<SearchResults> {
appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true,
body: Container(
margin: EdgeInsets.only(bottom: 10.0),
margin: EdgeInsets.all(10.0),
child: SingleChildScrollView(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.doctorsList.length,
itemBuilder: (context, index) {
return DoctorView(
//AJ note
doctor: widget.doctorsList[index],
);
},
physics: BouncingScrollPhysics(),
child: Column(
children: <Widget>[
...List.generate(
widget.patientDoctorAppointmentListHospital.length,
(index) => AppExpandableNotifier(
title: widget
.patientDoctorAppointmentListHospital[index].filterName + " - " +widget
.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget
.patientDoctorAppointmentListHospital[index]
.patientDoctorAppointmentList
.map((doctor) {
return DoctorView(
doctor: doctor,
);
}).toList(),
)),
)
],
),
),
),

@ -1,21 +1,19 @@
import 'dart:convert';
import "dart:collection";
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart';
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import '../SearchResults.dart';
import "dart:collection";
class SearchByClinic extends StatefulWidget {
@override
_SearchByClinicState createState() => _SearchByClinicState();
@ -24,20 +22,15 @@ class SearchByClinic extends StatefulWidget {
class _SearchByClinicState extends State<SearchByClinic> {
bool nearestAppo = false;
String dropdownValue;
String projectDropdownValue;
var event = RobotProvider();
List<ListClinicCentralized> clinicsList = [];
List<HospitalsModel> projectsList = [];
bool isMobileAppDentalAllow = false;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList());
// event.controller.stream.listen((p) {
// if (p['clinic_id'] != null) {
// // setState(() {
// dropdownValue = p['clinic_id'].toString();
// //});
// getDoctorsList(context);
// }
// });
super.initState();
}
@ -89,25 +82,91 @@ class _SearchByClinicState extends State<SearchByClinic> {
onChanged: (newValue) {
setState(() {
dropdownValue = newValue;
getDoctorsList(context);
if (!isDentalSelectedAndSupported() && !nearestAppo) {
projectDropdownValue = "";
getDoctorsList(context);
}
});
},
),
)),
isDentalSelectedAndSupported() == true || nearestAppo
? Container(
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey[400],
width: 1.0,
),
borderRadius: BorderRadius.circular(10),
),
padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(top: 15.0),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
hint: new Text("Select Project"),
value: projectDropdownValue,
items: projectsList.map((item) {
return new DropdownMenuItem<String>(
value: item.mainProjectID.toString(),
child: new Text(item.name),
);
}).toList(),
onChanged: (newValue) {
setState(() {
projectDropdownValue = newValue;
getDoctorsList(context);
});
},
),
))
: Container(),
],
),
);
}
bool isDentalSelectedAndSupported() {
return dropdownValue != "" &&
(dropdownValue == "17") &&
isMobileAppDentalAllow;
}
getClinicsList() {
ClinicListService service = new ClinicListService();
service.getClinicsList(context).then((res) {
service
.getClinicsList(context)
.then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
isMobileAppDentalAllow = res['ISMobileAppDentalAllow'];
res['ListClinicCentralized'].forEach((v) {
clinicsList.add(new ListClinicCentralized.fromJson(v));
});
});
} else {}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
getProjectsList();
});
}
getProjectsList() {
ClinicListService service = new ClinicListService();
service.getProjectsList(context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
res['ListClinicCentralized'].forEach((v) {
clinicsList.add(new ListClinicCentralized.fromJson(v));
res['ListProject'].forEach((v) {
projectsList.add(new HospitalsModel.fromJson(v));
});
print(projectsList.length);
});
} else {}
}).catchError((err) {
@ -117,54 +176,81 @@ class _SearchByClinicState extends State<SearchByClinic> {
}
getDoctorsList(BuildContext context) {
List<DoctorList> doctorsList = [];
//========================
SearchInfo searchInfo = new SearchInfo();
if (dropdownValue == "17") {
searchInfo.ProjectID = int.parse(projectDropdownValue);
searchInfo.ClinicID = int.parse(dropdownValue);
searchInfo.date = DateTime.now();
List<String> arr = [];
var distinctIds;
List<String> result;
int numAll;
//=========================
DoctorsListService service = new DoctorsListService();
service.getDoctorsList(int.parse(dropdownValue), 0, context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
navigateToDentalComplaints(context, searchInfo);
} else {
List<DoctorList> doctorsList = [];
List<String> arr = [];
List<String> arrDistance = [];
List<String> result;
int numAll;
DoctorsListService service = new DoctorsListService();
service
.getDoctorsList(
int.parse(dropdownValue),
projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0,
nearestAppo,
context)
.then((res) {
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));
arr.add(new DoctorList.fromJson(v).projectName);
// print(DoctorList.fromJson(v).projectName);
// print(DoctorList.fromJson(v).projectDistanceInKiloMeters);
// distinctIds = result.toSet().toList();
});
} else {}
});
arr.add(new DoctorList.fromJson(v).projectName);
arrDistance.add(new DoctorList.fromJson(v)
.projectDistanceInKiloMeters
.toString());
});
} else {}
});
result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length;
// print(result);
print("numAll=" + numAll.toString());
result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length;
navigateToSearchResults(context, doctorsList, result, numAll);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
navigateToSearchResults(
context, doctorsList, result, numAll, arrDistance);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
}
Future navigateToSearchResults(context, docList, result, numAll) async {
Future navigateToDentalComplaints(
BuildContext context, SearchInfo searchInfo) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
BranchView(doctorsList: docList, result: result, num: numAll),
builder: (context) => DentalComplaints(searchInfo: searchInfo),
),
);
//builder: (context) => SearchResults(doctorsList: docList)));
}
Future navigateToSearchResults(
context, docList, result, numAll, resultDistance) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BranchView(
doctorsList: docList,
result: result,
num: numAll,
resultDistance: resultDistance),
),
).then((value) {
getProjectsList();
});
}
}

@ -84,6 +84,10 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
getDoctorsList(BuildContext context) {
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
List();
service
.getDoctorsListByName(doctorNameController.text, context)
.then((res) {
@ -93,9 +97,35 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
res['DoctorList'].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));
}
});
} else {}
});
navigateToSearchResults(context, doctorsList);
navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
@ -107,7 +137,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
_onDocTextChanged(content) {
print(content);
if (content.length >= 4) {
if (content.length >= 3) {
setState(() {
_isButtonDisabled = false;
});
@ -123,10 +153,17 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
getDoctorsList(context);
}
Future navigateToSearchResults(context, List<DoctorList> docList) async {
Future navigateToSearchResults(
context,
List<DoctorList> docList,
List<PatientDoctorAppointmentList>
patientDoctorAppointmentListHospital) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SearchResults(doctorsList: docList)));
builder: (context) => SearchResults(
doctorsList: docList,
patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital)));
}
}

@ -1,8 +1,6 @@
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 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
@ -12,9 +10,11 @@ class BranchView extends StatefulWidget {
final List<DoctorList> doctorsList;
final List<String> result;
final List<String> resultDistance;
final int num;
const BranchView({Key key, this.doctorsList, this.result, this.num})
const BranchView(
{Key key, this.doctorsList, this.result, this.resultDistance, this.num})
: super(key: key);
@override
@ -30,8 +30,8 @@ class _BranchViewState extends State<BranchView> {
body: new ListView.builder(
itemBuilder: (BuildContext context, int index) {
return new ExpandableListView(
result2: widget.result,
resultDistance: widget.resultDistance,
val: index,
doctorsList2: widget.doctorsList);
},
@ -42,13 +42,13 @@ class _BranchViewState extends State<BranchView> {
}
class ExpandableListView extends StatefulWidget {
final List<String> result2;
final List<String> resultDistance;
final List<DoctorList> doctorsList2;
final val;
const ExpandableListView(
{Key key, this.result2, this.val, this.doctorsList2})
{Key key, this.result2, this.resultDistance, this.val, this.doctorsList2})
: super(key: key);
@override
@ -61,11 +61,9 @@ class _ExpandableListViewState extends State<ExpandableListView> {
@override
Widget build(BuildContext context) {
return new Container(
// margin: new EdgeInsets.symmetric(vertical: 1.0),
width: MediaQuery.of(context).size.width * 0.6,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 0.0),
child: Card(
// margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
@ -77,19 +75,22 @@ class _ExpandableListViewState extends State<ExpandableListView> {
child: new Column(
children: <Widget>[
new Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
color: Colors.white,
// padding: new EdgeInsets.symmetric(horizontal: 5.0),
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
new Text(
widget.result2[widget.val].toString()+" "+ "22 كم",
widget.result2[widget.val].toString() +
" " +
getProjectDistance(
widget.resultDistance[widget.val].toString()),
style: new TextStyle(
fontWeight: FontWeight.bold, color: Colors.black),
),
new IconButton(
icon: new Container(
height: 30.0,
height: 28.0,
width: 30.0,
decoration: new BoxDecoration(
color: Colors.red,
@ -124,13 +125,14 @@ class _ExpandableListViewState extends State<ExpandableListView> {
itemCount: widget.doctorsList2.length,
itemBuilder: (context, index) {
return widget.result2[widget.val].toString() ==
widget.doctorsList2[index].projectName.toString()? DoctorView(
//AJ note
doctor:
widget.doctorsList2[index]
// widget.doctorsList2[index]
):Container();
widget.doctorsList2[index].projectName.toString()
? DoctorView(
//AJ note
doctor: widget.doctorsList2[index]
// widget.doctorsList2[index]
)
: Container();
},
),
)
@ -140,6 +142,14 @@ class _ExpandableListViewState extends State<ExpandableListView> {
),
);
}
String getProjectDistance(String distance) {
if (distance != "0")
return " - " + distance + " " + TranslationBase.of(context).km;
else {
return "";
}
}
}
class ExpandableContainer extends StatelessWidget {
@ -162,7 +172,7 @@ class ExpandableContainer extends StatelessWidget {
duration: new Duration(milliseconds: 500),
curve: Curves.easeInOut,
width: screenWidth,
height: expanded ? expandedHeight : collapsedHeight,
height: expanded ? MediaQuery.of(context).size.height : collapsedHeight,
child: new Container(
child: child,
decoration: new BoxDecoration(

@ -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';
@ -21,7 +22,7 @@ class DoctorView extends StatelessWidget {
getDoctorsProfile(context, doctor);
},
child: Card(
margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0),
margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
@ -44,7 +45,7 @@ class DoctorView extends StatelessWidget {
Expanded(
flex: 4,
child: Container(
width: MediaQuery.of(context).size.width * 0.6,
width: MediaQuery.of(context).size.width * 0.55,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -81,6 +82,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,
@ -144,6 +155,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,15 +131,85 @@ 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;
}
}
@ -164,23 +242,91 @@ class _MyAppointmentsState extends State<MyAppointments>
)),
),
],
margin: EdgeInsets.only(top: 10.0),
child: Container(
child: widget.bookedAppoList.length != 0
? SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: <Widget>[
...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 +352,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,

@ -212,6 +212,11 @@ class _ConferenceButtonBarState extends State<ConferenceButtonBar> with AfterLay
key: Key('microphone-button'),
onPressed: () => _onPressed(widget.onAudioEnabled),
),
CircleButton(
child: const Icon(Icons.switch_camera, color: Colors.white),
key: Key('switch-camera-button'),
onPressed: () => _onPressed(widget.onSwitchCamera),
),
CircleButton(
radius: 35,
child: const RotationTransition(
@ -226,11 +231,6 @@ class _ConferenceButtonBarState extends State<ConferenceButtonBar> with AfterLay
key: Key('hangup-button'),
onPressed: () => _onPressed(widget.onHangup),
),
CircleButton(
child: const Icon(Icons.switch_camera, color: Colors.white),
key: Key('switch-camera-button'),
onPressed: () => _onPressed(widget.onSwitchCamera),
),
],
),
);

@ -217,21 +217,21 @@ class _ConferencePageState extends State<ConferencePage> {
);
}
if (length <= 3) {
buildInCols(true, false, 1);
} else if (length == 5) {
buildInCols(false, true, 2);
} else if (length <= 6 || length == 8) {
buildInCols(false, false, 2);
} else if (length == 7 || length == 9) {
buildInCols(true, false, 2);
} else if (length == 10) {
buildInCols(false, true, 3);
} else if (length == 13 || length == 16) {
buildInCols(true, false, 3);
} else if (length <= 18) {
buildInCols(false, false, 3);
}
// if (length <= 3) {
// buildInCols(true, false, 1);
// } else if (length == 5) {
// buildInCols(false, true, 2);
// } else if (length <= 6 || length == 8) {
// buildInCols(false, false, 2);
// } else if (length == 7 || length == 9) {
// buildInCols(true, false, 2);
// } else if (length == 10) {
// buildInCols(false, true, 3);
// } else if (length == 13 || length == 16) {
// buildInCols(true, false, 3);
// } else if (length <= 18) {
// buildInCols(false, false, 3);
// }
return Column(
children: children,

@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart';
@ -107,6 +108,18 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
});
pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true);
if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions(
// const IosNotificationSettings(
// sound: true,
// badge: true,
// alert: true,
// provisional: true,
// ),
);
}
_firebaseMessaging.getToken().then((String token) {
sharedPref.setString(PUSH_TOKEN, token);
if (token != null) {
@ -118,6 +131,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
//_firebase Background message handler
_firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) async {
showDialog("onMessage: $message");
print("onMessage: $message");
print(message);
print(message['name']);
@ -187,19 +201,68 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
onLaunch: (Map<String, dynamic> message) async {
print("onLaunch: $message");
showDialog("onLaunch: $message");
},
onResume: (Map<String, dynamic> message) async {
print("onResume: $message");
print(message);
print(message['name']);
print(message['appointmentdate']);
showDialog("onResume: $message");
if (Platform.isIOS) {
if (message['is_call'] == "true") {
var route = ModalRoute.of(context);
if (route != null) {
print(route.settings.name);
}
Map<String, dynamic> myMap =
new Map<String, dynamic>.from(message);
print(myMap);
LandingPage.isOpenCallPage = true;
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
if (!isPageNavigated) {
isPageNavigated = true;
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => IncomingCall(
incomingCallData: LandingPage.incomingCallData)))
.then((value) {
isPageNavigated = false;
});
}
} else {
print("Is Call Not Found iOS");
}
} else {
print("Is Call Not Found iOS");
}
},
);
}
showDialog(String message) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: message,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
void requestPermissions() async {
await [
Permission.location,
Permission.storage,
Permission.camera,
Permission.photos,
Permission.notification,
Permission.accessMediaLocation
].request();
}

@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -49,7 +48,7 @@ class _clinic_listState extends State<ClinicList> {
liveCareClinicsListResponse = new LiveCareClinicsListResponse();
WidgetsBinding.instance.addPostFrameCallback((_) {
// Future.delayed(new Duration(milliseconds: 1200), () {
getLiveCareClinicsList();
getLiveCareClinicsList();
// });
});
getLanguageID();
@ -58,79 +57,82 @@ class _clinic_listState extends State<ClinicList> {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
child: isDataLoaded
? Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.all(15.0),
child: Text("Online Clinics: ",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: liveCareClinicsListResponse
.patientERGetClinicsList.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
updateSelectedIndex(liveCareClinicsListResponse
.patientERGetClinicsList[index]);
},
child: ClinicCard(
isSelected: selectedClinicID ==
liveCareClinicsListResponse
.patientERGetClinicsList[index]
.serviceID
? true
: false,
patientERGetClinicsList: liveCareClinicsListResponse
.patientERGetClinicsList[index],
languageID: languageID,
),
);
},
),
Container(
height: 80.0,
),
],
),
)
: Container(),
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: startLiveCare,
child: Text("Start", style: TextStyle(fontSize: 18.0)),
),
),
return SingleChildScrollView(
child: Column(
children: <Widget>[
isDataLoaded
? Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.all(15.0),
child: Text("Online Clinics: ",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: liveCareClinicsListResponse
.patientERGetClinicsList.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
updateSelectedIndex(liveCareClinicsListResponse
.patientERGetClinicsList[index]);
},
child: ClinicCard(
isSelected: selectedClinicID ==
liveCareClinicsListResponse
.patientERGetClinicsList[index]
.serviceID
? true
: false,
patientERGetClinicsList:
liveCareClinicsListResponse
.patientERGetClinicsList[index],
languageID: languageID,
),
);
},
),
Container(
height: 10.0,
),
],
),
)
: Container(),
isDataLoaded ? Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: startLiveCare,
child: Text("Start", style: TextStyle(fontSize: 18.0)),
),
),
) : Container(),
],
),
);
}
void startLiveCare() {
bool isError = false;
LiveCareService service = new LiveCareService();
ERAppointmentFeesResponse erAppointmentFeesResponse =
new ERAppointmentFeesResponse();
@ -141,12 +143,15 @@ class _clinic_listState extends State<ClinicList> {
})
.catchError((err) {
print(err);
isError = true;
AppToast.showErrorToast(message: err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
getERAppointmentTime(
erAppointmentFeesResponse.getERAppointmentFeesList);
if (!isError)
getERAppointmentTime(
erAppointmentFeesResponse.getERAppointmentFeesList);
});
}
@ -158,6 +163,7 @@ class _clinic_listState extends State<ClinicList> {
getERAppointmentFeesList, res['WatingtimeInteger']);
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
@ -339,14 +345,17 @@ class _clinic_listState extends State<ClinicList> {
service
.addNewCallForPatientER(selectedClinicID, clientRequestID, context)
.then((res) {
AppToast.showSuccessToast(
message: "New Call has been added successfully");
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)).then((value) {
widget.getLiveCareHistory();
});
AppToast.showSuccessToast(
message: "New Call has been added successfully");
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
widget.getLiveCareHistory();
});
}
getLanguageID() async {

@ -2,22 +2,17 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -26,7 +21,6 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
class Login extends StatefulWidget {
@override
@ -48,9 +42,16 @@ class _Login extends State<Login> {
@override
void initState() {
// getDeviceToken();
super.initState();
}
getDeviceToken() async {
setState(() async {
nationalIDorFile.text = await sharedPref.getString(PUSH_TOKEN);
});
}
@override
Widget build(BuildContext context) {
return AppScaffold(
@ -196,7 +197,10 @@ class _Login extends State<Login> {
this.sharedPref.setObject(USER_PROFILE, result.list),
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
this.sharedPref.setString(TOKEN, result.authenticationTokenID),
//this.checkIfUserAgreedBefore(result),
Navigator.of(context).pushNamed(
HOME,
),
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {
@ -219,7 +223,6 @@ class _Login extends State<Login> {
)
}
})
// SMSOTP.showLoadingDialog(context, false),
});
}

@ -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 {
@ -20,7 +19,11 @@ class DoctorsListService extends BaseService {
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
Future<Map> getDoctorsList(int clinicID, int projectID, BuildContext context,
double lat;
double long;
Future<Map> getDoctorsList(
int clinicID, int projectID, bool isNearest, BuildContext context,
{doctorId}) async {
//Utils.showProgressDialog(context);
Map<String, dynamic> request;
@ -31,6 +34,12 @@ class DoctorsListService 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 = {
@ -52,8 +61,11 @@ class DoctorsListService extends BaseService {
"gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age != null ? authUser.age : 0,
"IsGetNearAppointment": false,
"Latitude": 0,
"Longitude": 0,
"Latitude": lat.toString(),
"Longitude": long.toString(),
"IsGetNearAppointment": isNearest,
if (isNearest)
"SelectedDate": DateUtil.convertDateToString(DateTime.now()),
"License": true
};
@ -71,12 +83,21 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsListByName(String docName, BuildContext context) async {
Map<String, dynamic> request;
double lat;
double long;
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 = {
@ -98,8 +119,8 @@ class DoctorsListService extends BaseService {
"gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age != null ? authUser.age : 0,
"IsGetNearAppointment": false,
"Latitude": 0,
"Longitude": 0,
"Latitude": lat,
"Longitude": long,
"License": true
};

@ -1,13 +1,22 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
class ClinicListService extends BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
double lat;
double long;
Future<Map> getClinicsList(context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
@ -28,10 +37,128 @@ 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);
}
Future<Map> getProjectsList(context) 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
};
dynamic localRes;
await baseAppClient.post(GET_PROJECTS_LIST,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getChiefComplaintsList(
int clinicID, int projectID, BuildContext context,
{doctorId}) async {
//Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"ClinicID": clinicID,
"ProjectID": projectID,
"SelectedDate": "",
"SelectedTime": "",
"License": true,
"VersionID": 5.6,
"Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958",
"PatientOutSA": 0,
"SessionID": null,
"isDentalAllowedBackend": true,
"DeviceTypeID": 1,
"PatientID": 1,
"ContinueDentalPlan": true,
"IsSearchAppointmnetByClinicID": false
};
dynamic localRes;
await baseAppClient.post(GET_DOCTORS_LIST_URL,
onSuccess: (response, statusCode) async {
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);
}
}

@ -0,0 +1,69 @@
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/dialogs/confirm_dialog.dart';
import 'package:flutter/cupertino.dart';
import 'package:geolocator/geolocator.dart';
class LocationUtils {
AppSharedPreferences sharedPref = new AppSharedPreferences();
bool isShowConfirmDialog;
BuildContext context;
LocationUtils({@required this.isShowConfirmDialog, @required this.context});
void getCurrentLocation() async {
print("current location");
isLocationServiceEnabled().then((value) {
if (value) {
checkPermission().then((permission) {
if (permission == LocationPermission.always ||
permission == LocationPermission.whileInUse) {
getLastKnownPosition().then((value) => setLocation(value));
}
if (permission == LocationPermission.denied ||
permission == LocationPermission.deniedForever) {
setZeroLocation();
if (isShowConfirmDialog) showErrorLocationDialog(false);
}
}).catchError((err) {
print(err);
});
} else {
if (isShowConfirmDialog) showErrorLocationDialog(false);
}
}).catchError((err) {
print(err);
});
}
showErrorLocationDialog(bool isPermissionError) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).locationDialogMessage,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
if (isPermissionError)
openAppSettings()
else
openLocationSettings()
},
cancelFunction: () => {});
return dialog.showAlertDialog(context);
}
void setLocation(Position position) {
print(position);
this.sharedPref.setDouble(USER_LAT, position.latitude);
this.sharedPref.setDouble(USER_LONG, position.longitude);
}
void setZeroLocation() {
this.sharedPref.setDouble(USER_LAT, 0.0);
this.sharedPref.setDouble(USER_LONG, 0.0);
}
}

@ -510,6 +510,10 @@ class TranslationBase {
String get vitalSign => localizedValues['VitalSign'][locale.languageCode];
String get monthlyReports => localizedValues['MonthlyReports'][locale.languageCode];
String get locationDialogMessage =>
localizedValues['locationDialogMessage'][locale.languageCode];
String get km =>
localizedValues['km'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,5 +1,4 @@
import 'package:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

@ -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(() {

@ -11,6 +11,7 @@ dependencies:
flutter:
sdk: flutter
# Localizations
flutter_localizations:
sdk: flutter
@ -61,7 +62,7 @@ dependencies:
# Notification Banner
dropdown_banner: ^1.4.0
flutter_local_notifications:
# flutter_local_notifications:
# charts
charts_flutter: ^0.9.0
@ -107,6 +108,9 @@ dependencies:
#Handle Geolocation
geolocator: ^6.0.0+1
#Dependencies for video call implementation
native_device_orientation: ^0.3.0
enum_to_string: ^1.0.9

Loading…
Cancel
Save