diff --git a/lib/utils/apicall.dart b/lib/utils/apicall.dart index 7de5740..621b878 100644 --- a/lib/utils/apicall.dart +++ b/lib/utils/apicall.dart @@ -141,7 +141,9 @@ class ApiCall { 'type': type ?? 1, }); // "end": DateTime(2024, 12, 14).toIso8601String(), - + token = await _prefs.then((SharedPreferences prefs) { + return prefs.getString('token') ?? ""; + }); print("SAVED TOKEN :${token}"); //http://192.168.2.130/konectar-staging/apiauths/logout/ @@ -734,9 +736,9 @@ class ApiCall { }); try { response = await dio.post( - 'http://192.168.2.130/konectar-staging/apiauths/getVerificationCode/', + //'http://192.168.2.130/konectar-staging/apiauths/getVerificationCode/', //'https://cardio-staging.konectar.io/apiauths/getVerificationCode/', - //'${url}${EventsConstants.loginmodule}/${EventsConstants.getVerificationCode}', + '${url}${EventsConstants.loginmodule}/${EventsConstants.getVerificationCode}', options: Options(), data: formData); if (response.statusCode == 200) { @@ -773,8 +775,8 @@ class ApiCall { print("LOGIN : API http://192.168.2.130/konectar-staging/apiauths/login"); response = await dio.post( //'http://192.168.2.130/konectar-staging/apiauths/login', - 'http://192.168.2.130/konectar-staging/apiauths/login/', - // '${EventsConstants.loginUrl}${EventsConstants.login}', + //'http://192.168.2.130/konectar-staging/apiauths/login/', + '${EventsConstants.loginUrl}${EventsConstants.login}', options: Options(), data: formData); if (response.statusCode == 200) { @@ -809,8 +811,8 @@ class ApiCall { "device_id": deviceid, }); response = await dio.post( - 'http://192.168.2.130/konectar-staging/apiauths/logout/', - // '${EventsConstants.loginUrl}${EventsConstants.logout}', + //'http://192.168.2.130/konectar-staging/apiauths/logout/', + '${EventsConstants.loginUrl}${EventsConstants.logout}', options: Options( followRedirects: true, validateStatus: (status) => true, diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart index 8be55c7..a2f62eb 100644 --- a/lib/utils/constants.dart +++ b/lib/utils/constants.dart @@ -26,7 +26,7 @@ class EventsConstants { static const String stagingUrl = "https://cardio-staging.konectar.io/$moduleName/"; - static const String url = devUrl; + static const String url = stagingUrl; static const String devUrl = "http://192.168.2.130/konectar-staging/$moduleName/"; diff --git a/lib/view/login.dart b/lib/view/login.dart index d821811..f79cbc4 100644 --- a/lib/view/login.dart +++ b/lib/view/login.dart @@ -94,7 +94,7 @@ class _LoginScreenState extends State { if (!mounted) return; - deviceId = "device123456789hhuuww"; + deviceId = "stagingdevice123456789hhuuww"; print("DEVICE ID########################## :$deviceId"); }