|
|
|
|
@ -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<Map> sendActivationCodeByOtpNotificationType(activationCodeModel) async{
|
|
|
|
|
Future<Map> 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<Map> memberCheckActivationCodeNew(activationCodeModel) async{
|
|
|
|
|
Future<Map> 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);
|
|
|
|
|
|