diff --git a/assets/images/svg/insurance.svg b/assets/images/svg/insurance.svg
new file mode 100644
index 0000000..c8d3c38
--- /dev/null
+++ b/assets/images/svg/insurance.svg
@@ -0,0 +1,4 @@
+
diff --git a/assets/images/svg/more.svg b/assets/images/svg/more.svg
new file mode 100644
index 0000000..4dbe5fd
--- /dev/null
+++ b/assets/images/svg/more.svg
@@ -0,0 +1,4 @@
+
diff --git a/assets/images/svg/requests.svg b/assets/images/svg/requests.svg
new file mode 100644
index 0000000..7d90098
--- /dev/null
+++ b/assets/images/svg/requests.svg
@@ -0,0 +1,5 @@
+
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
deleted file mode 100644
index c62a44f..0000000
--- a/ios/Podfile.lock
+++ /dev/null
@@ -1,457 +0,0 @@
-PODS:
- - audio_session (0.0.1):
- - Flutter
- - connectivity_plus (0.0.1):
- - Flutter
- - device_calendar (0.0.1):
- - Flutter
- - device_info_plus (0.0.1):
- - Flutter
- - DKImagePickerController/Core (4.3.9):
- - DKImagePickerController/ImageDataManager
- - DKImagePickerController/Resource
- - DKImagePickerController/ImageDataManager (4.3.9)
- - DKImagePickerController/PhotoGallery (4.3.9):
- - DKImagePickerController/Core
- - DKPhotoGallery
- - DKImagePickerController/Resource (4.3.9)
- - DKPhotoGallery (0.0.19):
- - DKPhotoGallery/Core (= 0.0.19)
- - DKPhotoGallery/Model (= 0.0.19)
- - DKPhotoGallery/Preview (= 0.0.19)
- - DKPhotoGallery/Resource (= 0.0.19)
- - SDWebImage
- - SwiftyGif
- - DKPhotoGallery/Core (0.0.19):
- - DKPhotoGallery/Model
- - DKPhotoGallery/Preview
- - SDWebImage
- - SwiftyGif
- - DKPhotoGallery/Model (0.0.19):
- - SDWebImage
- - SwiftyGif
- - DKPhotoGallery/Preview (0.0.19):
- - DKPhotoGallery/Model
- - DKPhotoGallery/Resource
- - SDWebImage
- - SwiftyGif
- - DKPhotoGallery/Resource (0.0.19):
- - SDWebImage
- - SwiftyGif
- - file_picker (0.0.1):
- - DKImagePickerController/PhotoGallery
- - Flutter
- - Firebase/Analytics (11.15.0):
- - Firebase/Core
- - Firebase/Core (11.15.0):
- - Firebase/CoreOnly
- - FirebaseAnalytics (~> 11.15.0)
- - Firebase/CoreOnly (11.15.0):
- - FirebaseCore (~> 11.15.0)
- - Firebase/Messaging (11.15.0):
- - Firebase/CoreOnly
- - FirebaseMessaging (~> 11.15.0)
- - firebase_analytics (11.6.0):
- - Firebase/Analytics (= 11.15.0)
- - firebase_core
- - Flutter
- - firebase_core (3.15.2):
- - Firebase/CoreOnly (= 11.15.0)
- - Flutter
- - firebase_messaging (15.2.10):
- - Firebase/Messaging (= 11.15.0)
- - firebase_core
- - Flutter
- - FirebaseAnalytics (11.15.0):
- - FirebaseAnalytics/Default (= 11.15.0)
- - FirebaseCore (~> 11.15.0)
- - FirebaseInstallations (~> 11.0)
- - GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- - GoogleUtilities/MethodSwizzler (~> 8.1)
- - GoogleUtilities/Network (~> 8.1)
- - "GoogleUtilities/NSData+zlib (~> 8.1)"
- - nanopb (~> 3.30910.0)
- - FirebaseAnalytics/Default (11.15.0):
- - FirebaseCore (~> 11.15.0)
- - FirebaseInstallations (~> 11.0)
- - GoogleAppMeasurement/Default (= 11.15.0)
- - GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- - GoogleUtilities/MethodSwizzler (~> 8.1)
- - GoogleUtilities/Network (~> 8.1)
- - "GoogleUtilities/NSData+zlib (~> 8.1)"
- - nanopb (~> 3.30910.0)
- - FirebaseCore (11.15.0):
- - FirebaseCoreInternal (~> 11.15.0)
- - GoogleUtilities/Environment (~> 8.1)
- - GoogleUtilities/Logger (~> 8.1)
- - FirebaseCoreInternal (11.15.0):
- - "GoogleUtilities/NSData+zlib (~> 8.1)"
- - FirebaseInstallations (11.15.0):
- - FirebaseCore (~> 11.15.0)
- - GoogleUtilities/Environment (~> 8.1)
- - GoogleUtilities/UserDefaults (~> 8.1)
- - PromisesObjC (~> 2.4)
- - FirebaseMessaging (11.15.0):
- - FirebaseCore (~> 11.15.0)
- - FirebaseInstallations (~> 11.0)
- - GoogleDataTransport (~> 10.0)
- - GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- - GoogleUtilities/Environment (~> 8.1)
- - GoogleUtilities/Reachability (~> 8.1)
- - GoogleUtilities/UserDefaults (~> 8.1)
- - nanopb (~> 3.30910.0)
- - FLAnimatedImage (1.0.17)
- - Flutter (1.0.0)
- - flutter_inappwebview_ios (0.0.1):
- - Flutter
- - flutter_inappwebview_ios/Core (= 0.0.1)
- - OrderedSet (~> 6.0.3)
- - flutter_inappwebview_ios/Core (0.0.1):
- - Flutter
- - OrderedSet (~> 6.0.3)
- - flutter_ios_voip_kit_karmm (0.8.0):
- - Flutter
- - flutter_local_notifications (0.0.1):
- - Flutter
- - flutter_zoom_videosdk (0.0.1):
- - Flutter
- - ZoomVideoSDK/CptShare (= 2.1.10)
- - ZoomVideoSDK/zm_annoter_dynamic (= 2.1.10)
- - ZoomVideoSDK/zoomcml (= 2.1.10)
- - ZoomVideoSDK/ZoomVideoSDK (= 2.1.10)
- - fluttertoast (0.0.2):
- - Flutter
- - geolocator_apple (1.2.0):
- - Flutter
- - FlutterMacOS
- - Google-Maps-iOS-Utils (5.0.0):
- - GoogleMaps (~> 8.0)
- - google_maps_flutter_ios (0.0.1):
- - Flutter
- - Google-Maps-iOS-Utils (< 7.0, >= 5.0)
- - GoogleMaps (< 10.0, >= 8.4)
- - GoogleAdsOnDeviceConversion (2.1.0):
- - GoogleUtilities/Logger (~> 8.1)
- - GoogleUtilities/Network (~> 8.1)
- - nanopb (~> 3.30910.0)
- - GoogleAppMeasurement/Core (11.15.0):
- - GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- - GoogleUtilities/MethodSwizzler (~> 8.1)
- - GoogleUtilities/Network (~> 8.1)
- - "GoogleUtilities/NSData+zlib (~> 8.1)"
- - nanopb (~> 3.30910.0)
- - GoogleAppMeasurement/Default (11.15.0):
- - GoogleAdsOnDeviceConversion (= 2.1.0)
- - GoogleAppMeasurement/Core (= 11.15.0)
- - GoogleAppMeasurement/IdentitySupport (= 11.15.0)
- - GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- - GoogleUtilities/MethodSwizzler (~> 8.1)
- - GoogleUtilities/Network (~> 8.1)
- - "GoogleUtilities/NSData+zlib (~> 8.1)"
- - nanopb (~> 3.30910.0)
- - GoogleAppMeasurement/IdentitySupport (11.15.0):
- - GoogleAppMeasurement/Core (= 11.15.0)
- - GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- - GoogleUtilities/MethodSwizzler (~> 8.1)
- - GoogleUtilities/Network (~> 8.1)
- - "GoogleUtilities/NSData+zlib (~> 8.1)"
- - nanopb (~> 3.30910.0)
- - GoogleDataTransport (10.1.0):
- - nanopb (~> 3.30910.0)
- - PromisesObjC (~> 2.4)
- - GoogleMaps (8.4.0):
- - GoogleMaps/Maps (= 8.4.0)
- - GoogleMaps/Base (8.4.0)
- - GoogleMaps/Maps (8.4.0):
- - GoogleMaps/Base
- - GoogleUtilities/AppDelegateSwizzler (8.1.0):
- - GoogleUtilities/Environment
- - GoogleUtilities/Logger
- - GoogleUtilities/Network
- - GoogleUtilities/Privacy
- - GoogleUtilities/Environment (8.1.0):
- - GoogleUtilities/Privacy
- - GoogleUtilities/Logger (8.1.0):
- - GoogleUtilities/Environment
- - GoogleUtilities/Privacy
- - GoogleUtilities/MethodSwizzler (8.1.0):
- - GoogleUtilities/Logger
- - GoogleUtilities/Privacy
- - GoogleUtilities/Network (8.1.0):
- - GoogleUtilities/Logger
- - "GoogleUtilities/NSData+zlib"
- - GoogleUtilities/Privacy
- - GoogleUtilities/Reachability
- - "GoogleUtilities/NSData+zlib (8.1.0)":
- - GoogleUtilities/Privacy
- - GoogleUtilities/Privacy (8.1.0)
- - GoogleUtilities/Reachability (8.1.0):
- - GoogleUtilities/Logger
- - GoogleUtilities/Privacy
- - GoogleUtilities/UserDefaults (8.1.0):
- - GoogleUtilities/Logger
- - GoogleUtilities/Privacy
- - health (13.1.3):
- - Flutter
- - image_picker_ios (0.0.1):
- - Flutter
- - just_audio (0.0.1):
- - Flutter
- - FlutterMacOS
- - local_auth_darwin (0.0.1):
- - Flutter
- - FlutterMacOS
- - manage_calendar_events (0.0.1):
- - Flutter
- - MapboxCommon (23.11.0)
- - MapboxCoreMaps (10.19.1):
- - MapboxCommon (~> 23.11)
- - MapboxCoreNavigation (2.19.0):
- - MapboxDirections (~> 2.14)
- - MapboxNavigationNative (< 207.0.0, >= 206.0.1)
- - MapboxDirections (2.14.2):
- - Polyline (~> 5.0)
- - Turf (~> 2.8.0)
- - MapboxMaps (10.19.0):
- - MapboxCommon (= 23.11.0)
- - MapboxCoreMaps (= 10.19.1)
- - MapboxMobileEvents (= 2.0.0)
- - Turf (= 2.8.0)
- - MapboxMobileEvents (2.0.0)
- - MapboxNavigation (2.19.0):
- - MapboxCoreNavigation (= 2.19.0)
- - MapboxMaps (~> 10.18)
- - MapboxSpeech (~> 2.0)
- - Solar-dev (~> 3.0)
- - MapboxNavigationNative (206.2.2):
- - MapboxCommon (~> 23.10)
- - MapboxSpeech (2.1.1)
- - nanopb (3.30910.0):
- - nanopb/decode (= 3.30910.0)
- - nanopb/encode (= 3.30910.0)
- - nanopb/decode (3.30910.0)
- - nanopb/encode (3.30910.0)
- - OrderedSet (6.0.3)
- - package_info_plus (0.4.5):
- - Flutter
- - path_provider_foundation (0.0.1):
- - Flutter
- - FlutterMacOS
- - permission_handler_apple (9.3.0):
- - Flutter
- - Polyline (5.1.0)
- - PromisesObjC (2.4.0)
- - SDWebImage (5.21.2):
- - SDWebImage/Core (= 5.21.2)
- - SDWebImage/Core (5.21.2)
- - share_plus (0.0.1):
- - Flutter
- - shared_preferences_foundation (0.0.1):
- - Flutter
- - FlutterMacOS
- - Solar-dev (3.0.1)
- - sqflite_darwin (0.0.4):
- - Flutter
- - FlutterMacOS
- - SwiftyGif (5.4.5)
- - Turf (2.8.0)
- - url_launcher_ios (0.0.1):
- - Flutter
- - ZoomVideoSDK/CptShare (2.1.10)
- - ZoomVideoSDK/zm_annoter_dynamic (2.1.10)
- - ZoomVideoSDK/zoomcml (2.1.10)
- - ZoomVideoSDK/ZoomVideoSDK (2.1.10)
-
-DEPENDENCIES:
- - audio_session (from `.symlinks/plugins/audio_session/ios`)
- - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- - device_calendar (from `.symlinks/plugins/device_calendar/ios`)
- - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- - file_picker (from `.symlinks/plugins/file_picker/ios`)
- - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)
- - firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
- - FLAnimatedImage
- - Flutter (from `Flutter`)
- - flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
- - flutter_ios_voip_kit_karmm (from `.symlinks/plugins/flutter_ios_voip_kit_karmm/ios`)
- - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- - flutter_zoom_videosdk (from `.symlinks/plugins/flutter_zoom_videosdk/ios`)
- - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- - geolocator_apple (from `.symlinks/plugins/geolocator_apple/darwin`)
- - google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
- - health (from `.symlinks/plugins/health/ios`)
- - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- - just_audio (from `.symlinks/plugins/just_audio/darwin`)
- - local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
- - manage_calendar_events (from `.symlinks/plugins/manage_calendar_events/ios`)
- - MapboxMaps (= 10.19.0)
- - MapboxNavigation (= 2.19.0)
- - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- - share_plus (from `.symlinks/plugins/share_plus/ios`)
- - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- - sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
- - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
-
-SPEC REPOS:
- trunk:
- - DKImagePickerController
- - DKPhotoGallery
- - Firebase
- - FirebaseAnalytics
- - FirebaseCore
- - FirebaseCoreInternal
- - FirebaseInstallations
- - FirebaseMessaging
- - FLAnimatedImage
- - Google-Maps-iOS-Utils
- - GoogleAdsOnDeviceConversion
- - GoogleAppMeasurement
- - GoogleDataTransport
- - GoogleMaps
- - GoogleUtilities
- - MapboxCommon
- - MapboxCoreMaps
- - MapboxCoreNavigation
- - MapboxDirections
- - MapboxMaps
- - MapboxMobileEvents
- - MapboxNavigation
- - MapboxNavigationNative
- - MapboxSpeech
- - nanopb
- - OrderedSet
- - Polyline
- - PromisesObjC
- - SDWebImage
- - Solar-dev
- - SwiftyGif
- - Turf
- - ZoomVideoSDK
-
-EXTERNAL SOURCES:
- audio_session:
- :path: ".symlinks/plugins/audio_session/ios"
- connectivity_plus:
- :path: ".symlinks/plugins/connectivity_plus/ios"
- device_calendar:
- :path: ".symlinks/plugins/device_calendar/ios"
- device_info_plus:
- :path: ".symlinks/plugins/device_info_plus/ios"
- file_picker:
- :path: ".symlinks/plugins/file_picker/ios"
- firebase_analytics:
- :path: ".symlinks/plugins/firebase_analytics/ios"
- firebase_core:
- :path: ".symlinks/plugins/firebase_core/ios"
- firebase_messaging:
- :path: ".symlinks/plugins/firebase_messaging/ios"
- Flutter:
- :path: Flutter
- flutter_inappwebview_ios:
- :path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
- flutter_ios_voip_kit_karmm:
- :path: ".symlinks/plugins/flutter_ios_voip_kit_karmm/ios"
- flutter_local_notifications:
- :path: ".symlinks/plugins/flutter_local_notifications/ios"
- flutter_zoom_videosdk:
- :path: ".symlinks/plugins/flutter_zoom_videosdk/ios"
- fluttertoast:
- :path: ".symlinks/plugins/fluttertoast/ios"
- geolocator_apple:
- :path: ".symlinks/plugins/geolocator_apple/darwin"
- google_maps_flutter_ios:
- :path: ".symlinks/plugins/google_maps_flutter_ios/ios"
- health:
- :path: ".symlinks/plugins/health/ios"
- image_picker_ios:
- :path: ".symlinks/plugins/image_picker_ios/ios"
- just_audio:
- :path: ".symlinks/plugins/just_audio/darwin"
- local_auth_darwin:
- :path: ".symlinks/plugins/local_auth_darwin/darwin"
- manage_calendar_events:
- :path: ".symlinks/plugins/manage_calendar_events/ios"
- package_info_plus:
- :path: ".symlinks/plugins/package_info_plus/ios"
- path_provider_foundation:
- :path: ".symlinks/plugins/path_provider_foundation/darwin"
- permission_handler_apple:
- :path: ".symlinks/plugins/permission_handler_apple/ios"
- share_plus:
- :path: ".symlinks/plugins/share_plus/ios"
- shared_preferences_foundation:
- :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
- sqflite_darwin:
- :path: ".symlinks/plugins/sqflite_darwin/darwin"
- url_launcher_ios:
- :path: ".symlinks/plugins/url_launcher_ios/ios"
-
-SPEC CHECKSUMS:
- audio_session: 19e9480dbdd4e5f6c4543826b2e8b0e4ab6145fe
- connectivity_plus: 2a701ffec2c0ae28a48cf7540e279787e77c447d
- device_calendar: 9cb33f88a02e19652ec7b8b122ca778f751b1f7b
- device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
- DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
- DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
- file_picker: b159e0c068aef54932bb15dc9fd1571818edaf49
- Firebase: d99ac19b909cd2c548339c2241ecd0d1599ab02e
- firebase_analytics: bf93e20703c95030404d6ddbb1adf05bf5c3885b
- firebase_core: 99a37263b3c27536063a7b601d9e2a49400a433c
- firebase_messaging: bf6697c61f31c7cc0f654131212ff04c0115c2c7
- FirebaseAnalytics: 6433dfd311ba78084fc93bdfc145e8cb75740eae
- FirebaseCore: efb3893e5b94f32b86e331e3bd6dadf18b66568e
- FirebaseCoreInternal: 9afa45b1159304c963da48addb78275ef701c6b4
- FirebaseInstallations: 317270fec08a5d418fdbc8429282238cab3ac843
- FirebaseMessaging: 3b26e2cee503815e01c3701236b020aa9b576f09
- FLAnimatedImage: bbf914596368867157cc71b38a8ec834b3eeb32b
- Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
- flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
- flutter_ios_voip_kit_karmm: 7ea37381a8841c92d186edf1f4604df5cc437579
- flutter_local_notifications: ff50f8405aaa0ccdc7dcfb9022ca192e8ad9688f
- flutter_zoom_videosdk: 7ddc97d617b85aeace252165d2b5fc5638678c38
- fluttertoast: 21eecd6935e7064cc1fcb733a4c5a428f3f24f0f
- geolocator_apple: 66b711889fd333205763b83c9dcf0a57a28c7afd
- Google-Maps-iOS-Utils: 66d6de12be1ce6d3742a54661e7a79cb317a9321
- google_maps_flutter_ios: e31555a04d1986ab130f2b9f24b6cdc861acc6d3
- GoogleAdsOnDeviceConversion: 2be6297a4f048459e0ae17fad9bfd2844e10cf64
- GoogleAppMeasurement: 700dce7541804bec33db590a5c496b663fbe2539
- GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
- GoogleMaps: 8939898920281c649150e0af74aa291c60f2e77d
- GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
- health: f1207cccb625fc2e8af263b09c29661bde7b0b7e
- image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
- just_audio: a42c63806f16995daf5b219ae1d679deb76e6a79
- local_auth_darwin: fa4b06454df7df8e97c18d7ee55151c57e7af0de
- manage_calendar_events: 9b2889799340398027b3e3f5c4891d41599ec257
- MapboxCommon: 119f3759f7dc9457f0695848108ab323eb643cb4
- MapboxCoreMaps: ca17f67baced23f8c952166ac6314c35bad3f66c
- MapboxCoreNavigation: 3be9990fae3ed732a101001746d0e3b4234ec023
- MapboxDirections: d4fe7d43cff82aa0c15955d1b4563a5a01e2d4de
- MapboxMaps: b7f29ec7c33f7dc6d2947c1148edce6db81db9a7
- MapboxMobileEvents: d044b9edbe0ec7df60f6c2c9634fe9a7f449266b
- MapboxNavigation: da9cf3d773ed5b0fa0fb388fccdaa117ee681f31
- MapboxNavigationNative: 629e359f3d2590acd1ebbacaaf99e1a80ee57e42
- MapboxSpeech: cd25ef99c3a3d2e0da72620ff558276ea5991a77
- nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
- OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
- package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
- path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
- permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
- Polyline: 2a1f29f87f8d9b7de868940f4f76deb8c678a5b1
- PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
- SDWebImage: 9f177d83116802728e122410fb25ad88f5c7608a
- share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
- shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
- Solar-dev: 4612dc9878b9fed2667d23b327f1d4e54e16e8d0
- sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
- SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
- Turf: aa2ede4298009639d10db36aba1a7ebaad072a5e
- url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
- ZoomVideoSDK: 94e939820e57a075c5e712559f927017da0de06a
-
-PODFILE CHECKSUM: 5df9d8aa8f2c105eacd5ad7a310503d93c68c86b
-
-COCOAPODS: 1.16.2
diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart
index d43ca93..a6f033c 100644
--- a/lib/core/api/api_client.dart
+++ b/lib/core/api/api_client.dart
@@ -1,7 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:developer';
-import 'dart:io' show Platform;
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart';
@@ -9,7 +8,6 @@ import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/services/analytics/analytics_service.dart';
-import 'package:hmg_patient_app_new/services/dialog_service.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart';
import 'package:http/http.dart' as http;
@@ -19,7 +17,7 @@ abstract class ApiClient {
Future post(
String endPoint, {
required Map body,
- required Function(dynamic response, int statusCode, {int? messageStatus}) onSuccess,
+ required Function(dynamic response, int statusCode, {int? messageStatus, String? errorMessage}) onSuccess,
required Function(String error, int statusCode, {int? messageStatus, Failure? failureType}) onFailure,
bool isAllowAny,
bool isExternal,
@@ -77,29 +75,26 @@ abstract class ApiClient {
class ApiClientImp implements ApiClient {
final _analytics = getIt();
-
- final LoggerService loggerService;
- final AppState appState;
- final DialogService dialogService;
+ final LoggerService _loggerService;
+ final AppState _appState;
ApiClientImp({
- required this.loggerService,
- required this.dialogService,
- required this.appState,
- });
+ required LoggerService loggerService,
+ required AppState appState,
+ }) : _appState = appState,
+ _loggerService = loggerService;
@override
post(
String endPoint, {
required Map body,
- required Function(dynamic response, int statusCode, {int? messageStatus}) onSuccess,
+ required Function(dynamic response, int statusCode, {int? messageStatus, String? errorMessage}) onSuccess,
required Function(String error, int statusCode, {int? messageStatus, Failure? failureType}) onFailure,
- bool isAllowAny = false,
+ bool isAllowAny = true,
bool isExternal = false,
bool isRCService = false,
bool bypassConnectionCheck = false,
}) async {
- AppState appState = getIt.get();
String url;
if (isExternal) {
url = endPoint;
@@ -111,39 +106,19 @@ class ApiClientImp implements ApiClient {
}
}
try {
- var user = appState.getAuthenticatedUser;
+ var user = _appState.getAuthenticatedUser;
Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
if (!isExternal) {
- String? token = appState.appAuthToken;
- String? languageID = (appState.postParamsObject?.languageID == 1 ? 'ar' : 'en');
- if (endPoint == ApiConsts.sendActivationCode) {
- languageID = 'en';
- }
+ String? token = _appState.appAuthToken;
+
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] ?? body[''] : SETUP_ID;
} else {}
- if (body.containsKey('LanguageID')) {
- if (body['LanguageID'] != null) {
- body['LanguageID'] = body['LanguageID'] == 'ar'
- ? 1
- : body['LanguageID'] == 'en'
- ? 2
- : body['LanguageID'];
- }
- }
-
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] ?? IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND;
}
- //Todo: I have converted it to string
- body['DeviceTypeID'] = Platform.isIOS
- ? "1"
- : await Utils.isGoogleServicesAvailable()
- ? "2"
- : "3";
-
if (!body.containsKey('IsPublicRequest')) {
// if (!body.containsKey('PatientType')) {
if (user != null && user.patientType != null) {
@@ -158,6 +133,7 @@ class ApiClientImp implements ApiClient {
body['PatientType'] = PATIENT_TYPE_ID.toString();
}
+ // TODO : These should be from the appState
if (user != null) {
body['TokenID'] = body['TokenID'] ?? token;
body['PatientID'] = body['PatientID'] ?? user.patientID;
@@ -175,129 +151,134 @@ class ApiClientImp implements ApiClient {
// request.languageID = (languageID == 'ar' ? 1 : 2);
// request.patientOutSA = (request.zipCode == '966' || request.zipCode == '+966') ? 0 : 1;
- // TODO : we will use all these from appState
- body['LanguageID'] = body['LanguageID'] ?? "2";
- body['VersionID'] = body['VersionID'] ?? "50.0";
- body['Channel'] = body['Channel'] ?? "3";
- body['IPAdress'] = body['IPAdress'] ?? "10.20.10.20";
- body['generalid'] = body['generalid'] ?? "Cs2020@2016\$2958";
- body['Latitude'] = body['Latitude'] ?? "0.0";
- body['Longitude'] = body['Longitude'] ?? "0.0";
- body['DeviceTypeID'] = body['DeviceTypeID'] ??
- (Platform.isIOS
- ? "1"
- : await Utils.isGoogleServicesAvailable()
- ? "2"
- : "3");
- body['TokenID'] = "@dm!n";
+ body['VersionID'] = ApiConsts.appVersionID.toString();
+ body['Channel'] = ApiConsts.appChannelId.toString();
+ body['IPAdress'] = ApiConsts.appIpAddress;
+ body['generalid'] = ApiConsts.appGeneralId;
+
+ body['LanguageID'] = _appState.getLanguageID().toString();
+ body['Latitude'] = _appState.userLat.toString();
+ body['Longitude'] = _appState.userLong.toString();
+ body['DeviceTypeID'] = _appState.deviceTypeID;
+ if (_appState.appLoginTokenID.isNotEmpty) {
+ body['LogInTokenID'] = _appState.appLoginTokenID;
+ }
+
body.removeWhere((key, value) => value == null);
log("body: ${json.encode(body)}");
log("uri: ${Uri.parse(url.trim())}");
- if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
- final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
+ final bool networkStatus = await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck);
- final int statusCode = response.statusCode;
- if (statusCode < 200 || statusCode >= 400) {
- onFailure('Error While Fetching data', statusCode, failureType: StatusCodeFailure("Error While Fetching data"));
- logApiEndpointError(endPoint, 'Error While Fetching data', statusCode);
+ if (!networkStatus) {
+ onFailure(
+ 'Please Check The Internet Connection 1',
+ -1,
+ failureType: ConnectivityFailure("Please Check The Internet Connection 1"),
+ );
+ _analytics.errorTracking.log("internet_connectivity", error: "no internet available");
+ return;
+ }
+
+ final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
+ final int statusCode = response.statusCode;
+ log("response.body: ${response.body}");
+ if (statusCode < 200 || statusCode >= 400) {
+ var parsed = json.decode(utf8.decode(response.bodyBytes));
+ onFailure('Error While Fetching data', statusCode, failureType: StatusCodeFailure("Error While Fetching data"));
+ logApiEndpointError(endPoint, 'Error While Fetching data', statusCode);
+ } else {
+ var parsed = json.decode(utf8.decode(response.bodyBytes));
+ if (isAllowAny) {
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
} else {
- var parsed = json.decode(utf8.decode(response.bodyBytes));
- log("parsed: ${parsed.toString()}");
- if (isAllowAny) {
- onSuccess(parsed, statusCode);
+ if (parsed['Response_Message'] != null) {
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
} else {
- if (parsed['Response_Message'] != null) {
- onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
- } else {
- if (parsed['ErrorType'] == 4) {
- //TODO : handle app update
+ if (parsed['ErrorType'] == 4) {
+ //TODO : handle app update
+ logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
+ }
+ if (parsed['ErrorType'] == 2) {
+ // todo: handle Logout
+ logApiEndpointError(endPoint, "session logged out", statusCode);
+ }
+ if (isAllowAny) {
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
+ } else if (parsed['IsAuthenticated'] == null) {
+ if (parsed['isSMSSent'] == true) {
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
+ } else if (parsed['MessageStatus'] == 1) {
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
+ } else if (parsed['Result'] == 'OK') {
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
+ } else {
+ onFailure(
+ parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
+ statusCode,
+ failureType: MessageStatusFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']),
+ );
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
- if (parsed['ErrorType'] == 2) {
- // todo: handle Logout
- logApiEndpointError(endPoint, "session logged out", statusCode);
- }
- if (isAllowAny) {
- onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
- } else if (parsed['IsAuthenticated'] == null) {
- if (parsed['isSMSSent'] == true) {
- onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
- } else if (parsed['MessageStatus'] == 1) {
- onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
- } else if (parsed['Result'] == 'OK') {
- onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
- } else {
- onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode, failureType: ServerFailure("Error While Fetching data"));
- logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
- }
- } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
- onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
- } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
- if (parsed['SameClinicApptList'] != null) {
- onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
- } else {
- if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
- if (parsed['ErrorSearchMsg'] == null) {
- onFailure(
- "Server Error found with no available message",
- statusCode,
- failureType: ServerFailure("Error While Fetching data"),
- );
- logApiEndpointError(endPoint, "Server Error found with no available message", statusCode);
- } else {
- onFailure(
- parsed['ErrorSearchMsg'],
- statusCode,
- failureType: ServerFailure("Error While Fetching data"),
- );
- logApiEndpointError(endPoint, parsed['ErrorSearchMsg'], statusCode);
- }
- } else {
- onFailure(
- parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
- statusCode,
- failureType: ServerFailure("Error While Fetching data"),
- );
- logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode);
- }
- }
+ } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
+ } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
+ if (parsed['SameClinicApptList'] != null) {
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
} else {
- if (parsed['SameClinicApptList'] != null) {
- onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus']);
- } else {
- if (parsed['message'] != null) {
+ if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
+ if (parsed['ErrorSearchMsg'] == null) {
onFailure(
- parsed['message'] ?? parsed['message'],
+ "Server Error found with no available message",
statusCode,
failureType: ServerFailure("Error While Fetching data"),
);
- logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode);
+ logApiEndpointError(endPoint, "Server Error found with no available message", statusCode);
} else {
onFailure(
- parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
+ parsed['ErrorSearchMsg'],
statusCode,
failureType: ServerFailure("Error While Fetching data"),
);
- logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
+ logApiEndpointError(endPoint, parsed['ErrorSearchMsg'], statusCode);
}
+ } else {
+ onFailure(
+ parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
+ statusCode,
+ failureType: UserIntimationFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']),
+ );
+ logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode);
+ }
+ }
+ } else {
+ if (parsed['SameClinicApptList'] != null) {
+ onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
+ } else {
+ if (parsed['message'] != null) {
+ onFailure(
+ parsed['message'] ?? parsed['message'],
+ statusCode,
+ failureType: ServerFailure("Error While Fetching data"),
+ );
+ logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode);
+ } else {
+ onFailure(
+ parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
+ statusCode,
+ failureType: ServerFailure("Error While Fetching data"),
+ );
+ logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
}
}
}
}
- } else {
- onFailure(
- 'Please Check The Internet Connection 1',
- -1,
- failureType: ConnectivityFailure("Error While Fetching data"),
- );
- _analytics.errorTracking.log("internet_connectivity", error: "no internet available");
}
- } catch (e) {
- loggerService.errorLogs(e.toString());
+ } catch (e, stackTrace) {
+ _loggerService.errorLogs(stackTrace.toString());
if (e.toString().contains("ClientException")) {
- onFailure('Something went wrong, plase try again', -1, failureType: InvalidCredentials('Something went wrong, plase try again'));
+ onFailure('ClientException: Something went wrong, Please try again', -1, failureType: InvalidCredentials('ClientException: Something went wrong, plase try again'));
_analytics.errorTracking.log("internet_connectivity", error: "no internet available");
} else {
onFailure(e.toString(), -1);
diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart
index 11c44ba..5a38342 100644
--- a/lib/core/api_consts.dart
+++ b/lib/core/api_consts.dart
@@ -1,4 +1,4 @@
-import 'dart:io';
+import 'package:hmg_patient_app_new/core/enums.dart';
var MAX_SMALL_SCREEN = 660;
final OPENTOK_API_KEY = '46209962';
@@ -350,7 +350,6 @@ var CAN_PAY_FOR_FOR_WALKIN_APPOINTMENT = 'Services/Doctors.svc/REST/CanPayForWal
var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
-var VERSION_ID = 18.7;
var SETUP_ID = '91877';
var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0;
@@ -702,20 +701,12 @@ var applePayMerchantId = "merchant.com.hmgwebservices";
// var payFortEnvironment = FortEnvironment.test;
// var applePayMerchantId = "merchant.com.hmgwebservices.uat";
-
-
// Auth Provider Consts
-
const String INSERT_DEVICE_IMEI = 'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI';
const String SELECT_DEVICE_IMEI = 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI';
const String CHECK_PATIENT_AUTH = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
const GET_MOBILE_INFO = 'Services/Authentication.svc/REST/GetMobileLoginInfo';
-const SEND_ACTIVATION_CODE = 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType';
-
-const SEND_ACTIVATION_CODE_REGISTER = 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration';
-const CHECK_ACTIVATION_CODE = 'Services/Authentication.svc/REST/CheckActivationCode';
-const CHECK_ACTIVATION_CODE_REGISTER = 'Services/Authentication.svc/REST/CheckActivationCodeForRegistration';
const FORGOT_PASSWORD = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo';
const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration";
@@ -731,34 +722,53 @@ const SAVE_SETTING = 'Services/Patients.svc/REST/UpdatePateintInfo';
const DEACTIVATE_ACCOUNT = 'Services/Patients.svc/REST/PatientAppleActivation_InsertUpdate';
-
-
class ApiConsts {
static const maxSmallScreen = 660;
- static bool isDevelopment = true;
+ static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT
+
static String baseUrl = 'https://hmgwebservices.com/'; // HIS API URL PROD
static String SELECT_DEVICE_IMEI = 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI';
static num VERSION_ID = 18.9;
- static final String selectDeviceImei = 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI';
- static final String sendActivationCode = 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType';
-
-
static setBackendURLs() {
- if (isDevelopment) {
- baseUrl = "https://uat.hmgwebservices.com/";
- } else {
- baseUrl = "https://hmgwebservices.com/";
+ switch (appEnvironmentType) {
+ case AppEnvironmentTypeEnum.prod:
+ baseUrl = "https://hmgwebservices.com/";
+ break;
+ case AppEnvironmentTypeEnum.dev:
+ baseUrl = "https://uat.hmgwebservices.com/";
+ break;
+ case AppEnvironmentTypeEnum.uat:
+ baseUrl = "https://uat.hmgwebservices.com/";
+ break;
+ case AppEnvironmentTypeEnum.preProd:
+ baseUrl = "https://webservices.hmg.com/";
+ break;
+ case AppEnvironmentTypeEnum.qa:
+ baseUrl = "https://uat.hmgwebservices.com/";
+ break;
+ case AppEnvironmentTypeEnum.staging:
+ baseUrl = "https://uat.hmgwebservices.com/";
+ break;
}
}
+ static final String selectDeviceImei = 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI';
+ static final String checkPatientAuth = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
-
- static final Map packagesAuthHeader = {};
-
-}
\ No newline at end of file
+ static final String sendActivationCode = 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType';
+ static final String sendActivationCodeRegister = 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration';
+ static final String checkActivationCode = 'Services/Authentication.svc/REST/CheckActivationCode';
+ static final String checkActivationCodeRegister = 'Services/Authentication.svc/REST/CheckActivationCodeForRegistration';
+
+ // static values for Api
+ static final double appVersionID = 18.7;
+ static final int appChannelId = 3;
+ static final String appIpAddress = "10.20.10.20";
+ static final String appGeneralId = "Cs2020@2016\$2958";
+}
diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart
index 7f1b6d1..ac3cfe6 100644
--- a/lib/core/app_assets.dart
+++ b/lib/core/app_assets.dart
@@ -72,6 +72,9 @@ class AppAssets {
static const String cancel_circle_icon = '$svgBasePath/cancel_circle.svg';
static const String update_insurance_card_icon = '$svgBasePath/update_insurance_card.svg';
static const String close_bottom_sheet_icon = '$svgBasePath/close_bottom_sheet_icon.svg';
+ static const String insurance = '$svgBasePath/insurance.svg';
+ static const String requests = '$svgBasePath/requests.svg';
+ static const String more = '$svgBasePath/more.svg';
//bottom navigation//
static const String homeBottom = '$svgBasePath/home_bottom.svg';
diff --git a/lib/core/app_state.dart b/lib/core/app_state.dart
index eb9315c..008aeb8 100644
--- a/lib/core/app_state.dart
+++ b/lib/core/app_state.dart
@@ -1,59 +1,64 @@
import 'package:easy_localization/easy_localization.dart';
-import 'package:hmg_patient_app_new/core/post_params_model.dart';
import 'package:hmg_patient_app_new/features/authentication/models/resp_models/authenticated_user_resp_model.dart';
+import 'package:hmg_patient_app_new/features/authentication/models/resp_models/select_device_by_imei.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
-import 'api_consts.dart' as ApiConsts;
-
class AppState {
NavigationService navigationService;
AppState({required this.navigationService});
- bool isAuthenticated = true;
+ double userLat = 0.0;
- set setIsAuthenticated(v) => isAuthenticated = v;
+ set setUserLat(v) => userLat = v;
- set setAppAuthToken(v) => appAuthToken = v;
+ double userLong = 0.0;
- String appAuthToken = "";
+ set setUserLong(v) => userLong = v;
- set setUserLat(v) => userLat = v;
+ bool isArabic() => EasyLocalization.of(navigationService.navigatorKey.currentContext!)?.locale.languageCode == "ar";
- set setUserLong(v) => userLong = v;
+ int getLanguageID() => EasyLocalization.of(navigationService.navigatorKey.currentContext!)?.locale.languageCode == "ar" ? 1 : 2;
- final PostParamsModel _postParamsInitConfig =
- PostParamsModel(channel: 3, versionID: ApiConsts.VERSION_ID, ipAddress: '10.20.10.20', generalId: 'Cs2020@2016\$2958', deviceTypeID: "2", sessionID: 'TMRhVmkGhOsvamErw');
+ String? getLanguageCode() => EasyLocalization.of(navigationService.navigatorKey.currentContext!)?.locale.languageCode;
- void setPostParamsInitConfig() {
- isAuthenticated = false;
- _postParams = _postParamsInitConfig;
- }
+ AuthenticatedUser? _authenticatedUser;
- PostParamsModel? _postParams;
+ void setAuthenticatedUser(AuthenticatedUser authenticatedUser) {
+ _authenticatedUser = authenticatedUser;
+ }
- PostParamsModel? get postParamsObject => _postParams;
+ AuthenticatedUser? get getAuthenticatedUser => _authenticatedUser;
- Map get postParamsJson => isAuthenticated ? (_postParams?.toJsonAfterLogin() ?? {}) : (_postParams?.toJson() ?? {});
+ SelectDeviceByImeiRespModelElement? _selectDeviceByImeiRespModelElement;
- void setPostParamsModel(PostParamsModel _postParams) {
- this._postParams = _postParams;
+ void setSelectDeviceByImeiRespModelElement(SelectDeviceByImeiRespModelElement value) {
+ _selectDeviceByImeiRespModelElement = value;
}
- double userLat = 0.0;
- double userLong = 0.0;
+ SelectDeviceByImeiRespModelElement? get getSelectDeviceByImeiRespModelElement => _selectDeviceByImeiRespModelElement;
- bool isArabic() => EasyLocalization.of(navigationService.navigatorKey.currentContext!)?.locale.languageCode == "ar";
+ String appLoginTokenID = "";
- int getLanguageID() => EasyLocalization.of(navigationService.navigatorKey.currentContext!)?.locale.languageCode == "ar" ? 1 : 2;
+ set setAppLoginTokenID(v) => appLoginTokenID = v;
- String? getLanguageCode() => EasyLocalization.of(navigationService.navigatorKey.currentContext!)?.locale.languageCode;
+ String deviceToken = "";
- AuthenticatedUser? _authenticatedUser;
+ set setDeviceToken(v) => deviceToken = v;
- void setAuthenticatedUser(AuthenticatedUser authenticatedUser) {
- _authenticatedUser = authenticatedUser;
- }
+ String appAuthToken = "";
- AuthenticatedUser? get getAuthenticatedUser => _authenticatedUser;
+ set setAppAuthToken(v) => appAuthToken = v;
+
+ String sessionId = "";
+
+ set setSessionId(v) => sessionId = v;
+
+ bool isAuthenticated = true;
+
+ set setIsAuthenticated(v) => isAuthenticated = v;
+
+ String deviceTypeID = "";
+
+ set setDeviceTypeID(v) => deviceTypeID = v;
}
diff --git a/lib/core/cache_consts.dart b/lib/core/cache_consts.dart
new file mode 100644
index 0000000..b793f02
--- /dev/null
+++ b/lib/core/cache_consts.dart
@@ -0,0 +1,75 @@
+class CacheConst {
+ static const String isRememberMe = "remember_me";
+ static const String username = "doctorId";
+ static const String password = "password";
+ static const String logInTokenId = "logInTokenID";
+ static const String vidaAuthTokenId = "vidaAuthTokenID";
+ static const String vidaRefreshTokenId = "vidaRefreshTokenID";
+ static const String authenticationTokenId = "authenticationTokenID";
+ static const String projectId = "projectID";
+ static const String clinicId = "clinicId";
+ static const String lastLoginDate = "lastLoginDate";
+ static const String lastLoginTime = "lastLoginTime";
+ static const String memberModel = "memberModel";
+
+ static const String isShowOnboarding = "is_show_onboarding";
+ static const String appAuthToken = "app_auth_token";
+ static const String appUserId = "app_user_id";
+ static const String loggedInUserObj = "logged_in_user_obj";
+
+ static const String pushToken = "push_token";
+ static const String apnsToken = "apns_token";
+ static const String voipToken = "voip_token";
+ static const String patientMrn = "patient_mrn";
+
+ static const String loggedInUserId = "logged_in_user_id";
+ static const String loggedInUserPassword = "logged_in_user_password";
+
+ static const String userLat = 'user-lat';
+ static const String userLong = 'user-long';
+
+ static const String token = 'token';
+ static const String appLanguage = 'language';
+ static const String userProfile = 'user-profile';
+ static const String oneSignalApnsToken = 'onesignal-apns-token';
+ static const String registerDataForRegister = 'register-data-for-register';
+ static const String loginTokenIdDuplicate = 'register-data-for-register';
+ static const String registerDataForLogin = 'register-data-for-login';
+ static const String lastLogin = 'last-login';
+ static const String erCheckinRiskScore = 'er-checkin-risk-score';
+ static const String onlySms = 'only-sms';
+ static const String authData = 'auth-data';
+ static const String imeiUserData = 'imei-user-data';
+ static const String nhicData = 'nhic-data';
+ static const String familyFile = 'family-file';
+ static const String isGoToParking = 'IS_GO_TO_PARKING';
+ static const String isSearchAppo = 'is-search-appo';
+ static const String isLivecareAppointment = 'is_livecare_appointment';
+ static const String isVibration = 'is_vibration';
+ static const String themeValue = 'is_vibration';
+ static const String mainUser = 'main-user';
+ static const String pharmacyLastVisitedProducts = 'last-visited';
+ static const String pharmacyCustomerId = 'costumer-id';
+ static const String pharmacyCustomerGuid = 'customer-guid';
+ static const String pharmacyCustomerObject = 'pharmacy-customer-object';
+ static const String isRobotVisible = 'robot-visible';
+ static const String isRobotInit = 'robot-init';
+ static const String hmgGeofences = 'hmg-geo-fences';
+ static const String weather = 'weather';
+ static const String bloodType = 'blood-type';
+ static const String notificationCount = 'notification-count';
+ static const String pharmacySelectedAddress = 'selected-address';
+ static const String pharmacyAutorzieToken = 'PHARMACY_AUTORZIE_TOKEN';
+ static const String h2oUnit = 'H2O_UNIT';
+ static const String h2oReminder = 'H2O_REMINDER';
+ static const String livecareClinicData = 'LIVECARE_CLINIC_DATA';
+ static const String doctorScheduleDateSel = 'DOCTOR_SCHEDULE_DATE_SEL';
+ static const String appointmentHistoryMedical = 'APPOINTMENT_HISTORY_MEDICAL';
+ static const String clinicsList = 'CLINICS_LIST';
+ static const String covidQaList = 'COVID_QA_LIST';
+ static const String isCovidConsentShown = 'IS_COVID_CONSENT_SHOWN';
+ static const String registerInfoDubai = 'register-info-dubai';
+ static const String isLastAppointmentRateShown = 'is-last-appointment-rate-shown';
+ static const String patientOccupationList = 'patient-occupation-list';
+ static const String hasEnabledQuickLogin = 'has-enabled-quick-login';
+}
diff --git a/lib/core/consts.dart b/lib/core/consts.dart
deleted file mode 100644
index 216b9a7..0000000
--- a/lib/core/consts.dart
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-class SharedPrefsConsts {
- static String isRememberMe = "remember_me";
- static String username = "doctorId";
- static String password = "password";
- static String logInTokenID = "logInTokenID";
- static String vidaAuthTokenID = "vidaAuthTokenID";
- static String vidaRefreshTokenID = "vidaRefreshTokenID";
- static String authenticationTokenID = "authenticationTokenID";
- static String projectID = "projectID";
- static String clinicId = "clinicId";
- static String lastLoginDate = "lastLoginDate";
- static String lastLoginTime = "lastLoginTime";
- static String memberModel = "memberModel";
-
- static String isShowOnboarding = "is_show_onboarding";
- static String appAuthToken = "app_auth_token";
- static String appUserID = "app_user_id";
- static String loggedInUserObj = "logged_in_user_obj";
-
- static String PUSH_TOKEN = "push_token";
- static String APNS_TOKEN = "apns_token";
- static String VOIP_TOKEN = "voip_token";
- static String PATIENT_MRN = "patient_mrn";
-
- static String loggedInUserID = "logged_in_user_id";
- static String loggedInUserPassword = "logged_in_user_password";
-
- static String user_lat = 'user-lat';
- static String user_long = 'user-long';
-}
diff --git a/lib/core/dependencies.dart b/lib/core/dependencies.dart
index aa32fa6..a900742 100644
--- a/lib/core/dependencies.dart
+++ b/lib/core/dependencies.dart
@@ -1,3 +1,4 @@
+import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:get_it/get_it.dart';
import 'package:hmg_patient_app_new/core/api/api_client.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
@@ -19,6 +20,7 @@ import 'package:hmg_patient_app_new/services/analytics/analytics_service.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart';
import 'package:hmg_patient_app_new/services/error_handler_service.dart';
+import 'package:hmg_patient_app_new/services/firebase_service.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:logger/web.dart';
@@ -32,7 +34,7 @@ class AppDependencies {
printer: PrettyPrinter(
methodCount: 2,
errorMethodCount: 5,
- lineLength: 100,
+ lineLength: 1000,
colors: true,
printEmojis: true,
),
@@ -40,6 +42,12 @@ class AppDependencies {
// Core Services
getIt.registerLazySingleton(() => LoggerServiceImp(logger: logger));
+ getIt.registerLazySingleton(() => FirebaseServiceImpl(
+ loggerService: getIt(),
+ appState: getIt(),
+ firebaseMessaging: FirebaseMessaging.instance,
+ ));
+
getIt.registerLazySingleton(() => NavigationService());
getIt.registerLazySingleton(() => GAnalytics());
getIt.registerLazySingleton(() => AppState(navigationService: getIt()));
@@ -56,8 +64,8 @@ class AppDependencies {
));
final sharedPreferences = await SharedPreferences.getInstance();
- getIt.registerLazySingleton(() => CacheServiceImp(sharedPreferences: sharedPreferences));
- getIt.registerLazySingleton(() => ApiClientImp(loggerService: getIt(), dialogService: getIt(), appState: getIt()));
+ getIt.registerLazySingleton(() => CacheServiceImp(sharedPreferences: sharedPreferences, loggerService: getIt()));
+ getIt.registerLazySingleton(() => ApiClientImp(loggerService: getIt(), appState: getIt()));
// Repositories
getIt.registerLazySingleton(() => CommonRepoImp(loggerService: getIt()));
@@ -103,6 +111,8 @@ class AppDependencies {
getIt.registerLazySingleton(
() => AuthenticationViewModel(
authenticationRepo: getIt(),
+ cacheService: getIt(),
+ navigationService: getIt(),
dialogService: getIt(),
appState: getIt(),
errorHandlerService: getIt(),
diff --git a/lib/core/enums.dart b/lib/core/enums.dart
index 34aa911..ab5cac1 100644
--- a/lib/core/enums.dart
+++ b/lib/core/enums.dart
@@ -22,8 +22,6 @@ enum ViewStateEnum {
errorLocal,
}
-enum OTPTypeEnum { sms, whatsapp }
-
enum CountryEnum { saudiArabia, unitedArabEmirates }
enum SelectionTypeEnum { dropdown, calendar }
@@ -34,8 +32,12 @@ enum MaritalStatusTypeEnum { single, married, divorced, widowed }
enum ChipTypeEnum { success, error, alert, info, warning }
+enum OTPTypeEnum { sms, whatsapp }
+
enum LoginTypeEnum { sms, whatsapp, face, fingerprint }
+enum AppEnvironmentTypeEnum { dev, uat, preProd, qa, staging, prod }
+
extension LoginTypeExtension on LoginTypeEnum {
int get toInt {
switch (this) {
diff --git a/lib/core/exceptions/api_failure.dart b/lib/core/exceptions/api_failure.dart
index 4bc5097..c950195 100644
--- a/lib/core/exceptions/api_failure.dart
+++ b/lib/core/exceptions/api_failure.dart
@@ -13,6 +13,20 @@ class ServerFailure extends Failure {
List