Merge branch 'hussam' into 'development'

get clinic list after changing the language

See merge request Cloud_Solution/doctor_app_flutter!148
merge-requests/149/head^2
Mohammad Aljammal 4 years ago
commit dbef3fa449

@ -16,6 +16,8 @@ const PATIENT_REFER_TO_DOCTOR_URL =
"Services/DoctorApplication.svc/REST/ReferToDoctor";
const PATIENT_GET_DOCTOR_BY_CLINIC_URL =
"Services/DoctorApplication.svc/REST/GetDoctorsByClinicID";
const GET_CLINICS_FOR_DOCTOR =
'Services/DoctorApplication.svc/REST/GetClinicsForDoctor';
const PATIENT_GET_LIST_REFERAL_URL =
"Services/Lists.svc/REST/GetList_STPReferralFrequency";
const PATIENT_GET_CLINIC_BY_PROJECT_URL =
@ -60,6 +62,18 @@ const GET_DOCTOR_WORKING_HOURS_TABLE =
const GET_PATIENT_LAB_RESULTS =
'Services/DoctorApplication.svc/REST/GetPatientLabResults';
const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New';
const INSERT_DEVICE_IMEI =
'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI';
const SELECT_DEVICE_IMEI =
'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI';
const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE =
'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
const MEMBER_CHECK_ACTIVATION_CODE_NEW =
'Services/Sentry.svc/REST/MemberCheckActivationCode_New';
const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles';
var selectedPatientType = 1;

@ -8,6 +8,7 @@ import 'package:http_interceptor/http_interceptor.dart';
import '../providers/auth_provider.dart';
import '../util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/config/config.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
List<String> publicUrls = [
@ -18,10 +19,9 @@ List<String> publicUrls = [
];
class HttpInterceptor extends InterceptorContract {
Client getClient(){
return HttpClientWithInterceptor.build(interceptors: [this]);
}
Client getClient() {
return HttpClientWithInterceptor.build(interceptors: [this]);
}
Future<RequestData> interceptRequest({RequestData data}) async {
print('RequestData ${data.body}');
@ -29,26 +29,26 @@ class HttpInterceptor extends InterceptorContract {
try {
data.headers["Content-Type"] = "application/json";
data.headers["Accept"] = "application/json";
// if (publicUrls.contains(data.url)) {
// var loggedUserInfo = await sharedPref.getObj('loggedUser');
// var token = await sharedPref.getString(TOKEN);
// // print("token"+token);
// // print('loggedUserInfo${loggedUserInfo["LogInTokenID"]}');
// // // the sevices handel the token in differat name so I ask to be change
// // // we must change the imple
// var body = json.decode(data.body);
// body['LogInTokenID']=token;
// data.body = json.encode(body);
// // data.body['LogInTokenID'] = '';
// } else {
// if (data.body['LogInTokenID']) {
// data.body['LogInTokenID'] = '';
// }
// if (data.body['TokenID']) {
// data.body['TokenID'] = '';
// }
// }
// if (publicUrls.contains(data.url)) {
// var loggedUserInfo = await sharedPref.getObj('loggedUser');
// var token = await sharedPref.getString(TOKEN);
// // print("token"+token);
// // print('loggedUserInfo${loggedUserInfo["LogInTokenID"]}');
// // // the sevices handel the token in differat name so I ask to be change
// // // we must change the imple
// var body = json.decode(data.body);
// body['LogInTokenID']=token;
// data.body = json.encode(body);
// // data.body['LogInTokenID'] = '';
// } else {
// if (data.body['LogInTokenID']) {
// data.body['LogInTokenID'] = '';
// }
// if (data.body['TokenID']) {
// data.body['TokenID'] = '';
// }
// }
} catch (e) {
print(e);
}

@ -3,25 +3,10 @@ import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/config/config.dart';
import '../models/doctor/user_model.dart';
const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New';
const INSERT_DEVICE_IMEI =
'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI';
const SELECT_DEVICE_IMEI =
'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI';
const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE =
'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
const MEMBER_CHECK_ACTIVATION_CODE_NEW =
'Services/Sentry.svc/REST/MemberCheckActivationCode_New';
const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles';
const GET_CLINICS_FOR_DOCTOR =
'Services/DoctorApplication.svc/REST/GetClinicsForDoctor';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }

@ -21,7 +21,7 @@ class ProjectProvider with ChangeNotifier {
String currentLanguage = 'ar';
bool _isArabic = false;
bool isInternetConnection = true;
List<ClinicModel> clinicList = [];
List<ClinicModel> doctorClinicsList = [];
bool isLoading = false;
bool isError = false;
String error = '';
@ -78,7 +78,7 @@ class ProjectProvider with ChangeNotifier {
callServicesAfterChangeLang() {
getProfile();
getClinicNames();
getDoctorClinicsList();
}
@override
@ -87,15 +87,15 @@ class ProjectProvider with ChangeNotifier {
super.dispose();
}
Future<dynamic> getClinicNames() async {
Future<dynamic> getDoctorClinicsList() async {
try {
dynamic localRes;
await BaseAppClient.post(GET_CLINICS_FOR_DOCTOR,
onSuccess: (dynamic response, int statusCode) {
clinicList = [];
doctorClinicsList = [];
response['List_DoctorsClinic'].forEach((v) {
clinicList.add(new ClinicModel.fromJson(v));
doctorClinicsList.add(new ClinicModel.fromJson(v));
});
localRes = response;
}, onFailure: (String error, int statusCode) {

@ -57,7 +57,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
super.didChangeDependencies();
if (_isInit) {
projectsProvider = Provider.of<ProjectProvider>(context);
projectsProvider.getClinicNames();
projectsProvider.getDoctorClinicsList();
}
_isInit = false;
}
@ -117,7 +117,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
showCupertinoPicker(
decKey: '',
context: context,
actionList: projectsProvider.clinicList);
actionList:
projectsProvider.doctorClinicsList);
},
child: Container(
margin:
@ -574,7 +575,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
onTap: () =>
changeClinic(e.clinicID, context),
child: Text(
e.clinicName ?? 'asd',
e.clinicName,
style: TextStyle(
fontSize:
SizeConfig.textMultiplier *

Loading…
Cancel
Save