diff --git a/lib/config/config.dart b/lib/config/config.dart index 1ca691d2..e17c98cf 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -1 +1,2 @@ -const MAX_SMALL_SCREEN = 660; \ No newline at end of file +const MAX_SMALL_SCREEN = 660; +const BASE_URL = 'https://hmgwebservices.com/Services/'; \ No newline at end of file diff --git a/lib/providers/auth_provider.dart b/lib/providers/auth_provider.dart index 7af750ca..8dc10319 100644 --- a/lib/providers/auth_provider.dart +++ b/lib/providers/auth_provider.dart @@ -1,23 +1,25 @@ import 'dart:convert'; -import 'package:doctor_app_flutter/interceptor/http_interceptor.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; +import '../config/config.dart'; +import '../interceptor/http_interceptor.dart'; import '../models/user_model.dart'; -const LOGIN_URL = - 'https://hmgwebservices.com/Services/Sentry.svc/REST/MemberLogIN_New'; +const LOGIN_URL = BASE_URL + 'Sentry.svc/REST/MemberLogIN_New'; const INSERT_DEVICE_IMEI = - 'https://hmgwebservices.com/Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; + BASE_URL + 'Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; const SELECT_DEVICE_IMEI = - 'https://hmgwebservices.com/Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; + BASE_URL + 'Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; -const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = - 'https://hmgwebservices.com/Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; +const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = BASE_URL + + 'Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; + +const MEMBER_CHECK_ACTIVATION_CODE_NEW = + BASE_URL + 'Sentry.svc/REST/MemberCheckActivationCode_New'; -const MEMBER_CHECK_ACTIVATION_CODE_NEW ='https://hmgwebservices.com/Services/Sentry.svc/REST/MemberCheckActivationCode_New'; class AuthProvider with ChangeNotifier { Client client = HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); @@ -68,11 +70,13 @@ class AuthProvider with ChangeNotifier { } } - Future sendActivationCodeByOtpNotificationType(activationCodeModel) async{ + Future sendActivationCodeByOtpNotificationType( + activationCodeModel) async { const url = SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE; try { - final response = await client.post(url, body: json.encode(activationCodeModel)); + final response = + await client.post(url, body: json.encode(activationCodeModel)); return Future.value(json.decode(response.body)); } catch (error) { print(error); @@ -80,11 +84,12 @@ class AuthProvider with ChangeNotifier { } } - Future memberCheckActivationCodeNew(activationCodeModel) async{ + Future memberCheckActivationCodeNew(activationCodeModel) async { const url = MEMBER_CHECK_ACTIVATION_CODE_NEW; try { - final response = await client.post(url, body: json.encode(activationCodeModel)); + final response = + await client.post(url, body: json.encode(activationCodeModel)); return Future.value(json.decode(response.body)); } catch (error) { print(error); diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index b922847a..4c20758e 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; @@ -12,7 +13,8 @@ class PatientsProvider with ChangeNotifier { HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); Future getPatientList(PatientModel patient, patientType) async { const url = - 'https://hmgwebservices.com/Services/DoctorApplication.svc/REST/GetMyInPatient'; + BASE_URL+'DoctorApplication.svc/REST/GetMyInPatient'; + try { final response = await client.post(url, body: json.encode({ diff --git a/lib/providers/projects_provider.dart b/lib/providers/projects_provider.dart index 28d75509..62debed6 100644 --- a/lib/providers/projects_provider.dart +++ b/lib/providers/projects_provider.dart @@ -1,12 +1,14 @@ import 'dart:convert'; +import 'package:doctor_app_flutter/config/config.dart'; + import '../interceptor/http_interceptor.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; const GET_PROJECTS = - 'https://hmgwebservices.com/Services/Lists.svc/REST/GetProjectForDoctorAPP'; + BASE_URL+'Lists.svc/REST/GetProjectForDoctorAPP'; class ProjectsProvider with ChangeNotifier { Client client = diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 53c671e4..4c8ac7e9 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -180,11 +180,11 @@ class _VerificationMethodsState extends State { Map model = { "LogInTokenID": _loggedUser['LogInTokenID'], "Channel": 9, - "MobileNumber": _loggedUser['MobileNumber'],//785228065, + "MobileNumber": 785228065,//_loggedUser['MobileNumber'], "IPAdress": "11.11.11.11", "LanguageID": 2, "ProjectID": 15, //TODO : this should become daynamci - "ZipCode": _loggedUser['ZipCode'],//962, //_loggedUser['ZipCode'], + "ZipCode": 962, //_loggedUser['ZipCode'], "UserName": _loggedUser['List_MemberInformation'][0]['MemberID'], "OTP_SendType": oTPSendType };