diff --git a/assets/images/discount_ar.png b/assets/images/discount_ar.png
new file mode 100644
index 00000000..854d1c1f
Binary files /dev/null and b/assets/images/discount_ar.png differ
diff --git a/assets/images/discount_en.png b/assets/images/discount_en.png
new file mode 100644
index 00000000..2af52865
Binary files /dev/null and b/assets/images/discount_en.png differ
diff --git a/assets/images/svg/discount_ar.svg b/assets/images/svg/discount_ar.svg
new file mode 100644
index 00000000..d9d6ec27
--- /dev/null
+++ b/assets/images/svg/discount_ar.svg
@@ -0,0 +1,37 @@
+
diff --git a/assets/images/svg/discount_en.svg b/assets/images/svg/discount_en.svg
new file mode 100644
index 00000000..294cf19c
--- /dev/null
+++ b/assets/images/svg/discount_en.svg
@@ -0,0 +1,43 @@
+
+
+
diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id
index b8024672..3b4ea73f 100644
--- a/ios/Flutter/.last_build_id
+++ b/ios/Flutter/.last_build_id
@@ -1 +1 @@
-59a6c452ee075b50114918f17f1ad8f5
\ No newline at end of file
+45a7d43b55124e1b314759554f9a14d3
\ No newline at end of file
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 1df50aa4..0d6f024b 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -1,25 +1,809 @@
PODS:
+ - abseil/algorithm (0.20200225.0):
+ - abseil/algorithm/algorithm (= 0.20200225.0)
+ - abseil/algorithm/container (= 0.20200225.0)
+ - abseil/algorithm/algorithm (0.20200225.0):
+ - abseil/base/config
+ - abseil/algorithm/container (0.20200225.0):
+ - abseil/algorithm/algorithm
+ - abseil/base/core_headers
+ - abseil/meta/type_traits
+ - abseil/base (0.20200225.0):
+ - abseil/base/atomic_hook (= 0.20200225.0)
+ - abseil/base/base (= 0.20200225.0)
+ - abseil/base/base_internal (= 0.20200225.0)
+ - abseil/base/bits (= 0.20200225.0)
+ - abseil/base/config (= 0.20200225.0)
+ - abseil/base/core_headers (= 0.20200225.0)
+ - abseil/base/dynamic_annotations (= 0.20200225.0)
+ - abseil/base/endian (= 0.20200225.0)
+ - abseil/base/errno_saver (= 0.20200225.0)
+ - abseil/base/exponential_biased (= 0.20200225.0)
+ - abseil/base/log_severity (= 0.20200225.0)
+ - abseil/base/malloc_internal (= 0.20200225.0)
+ - abseil/base/periodic_sampler (= 0.20200225.0)
+ - abseil/base/pretty_function (= 0.20200225.0)
+ - abseil/base/raw_logging_internal (= 0.20200225.0)
+ - abseil/base/spinlock_wait (= 0.20200225.0)
+ - abseil/base/throw_delegate (= 0.20200225.0)
+ - abseil/base/atomic_hook (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/base/base (0.20200225.0):
+ - abseil/base/atomic_hook
+ - abseil/base/base_internal
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/base/dynamic_annotations
+ - abseil/base/log_severity
+ - abseil/base/raw_logging_internal
+ - abseil/base/spinlock_wait
+ - abseil/meta/type_traits
+ - abseil/base/base_internal (0.20200225.0):
+ - abseil/base/config
+ - abseil/meta/type_traits
+ - abseil/base/bits (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/base/config (0.20200225.0)
+ - abseil/base/core_headers (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/dynamic_annotations (0.20200225.0)
+ - abseil/base/endian (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/base/errno_saver (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/exponential_biased (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/base/log_severity (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/base/malloc_internal (0.20200225.0):
+ - abseil/base/base
+ - abseil/base/base_internal
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/base/dynamic_annotations
+ - abseil/base/raw_logging_internal
+ - abseil/base/periodic_sampler (0.20200225.0):
+ - abseil/base/core_headers
+ - abseil/base/exponential_biased
+ - abseil/base/pretty_function (0.20200225.0)
+ - abseil/base/raw_logging_internal (0.20200225.0):
+ - abseil/base/atomic_hook
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/base/log_severity
+ - abseil/base/spinlock_wait (0.20200225.0):
+ - abseil/base/base_internal
+ - abseil/base/core_headers
+ - abseil/base/errno_saver
+ - abseil/base/throw_delegate (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/raw_logging_internal
+ - abseil/container/compressed_tuple (0.20200225.0):
+ - abseil/utility/utility
+ - abseil/container/inlined_vector (0.20200225.0):
+ - abseil/algorithm/algorithm
+ - abseil/base/core_headers
+ - abseil/base/throw_delegate
+ - abseil/container/inlined_vector_internal
+ - abseil/memory/memory
+ - abseil/container/inlined_vector_internal (0.20200225.0):
+ - abseil/base/core_headers
+ - abseil/container/compressed_tuple
+ - abseil/memory/memory
+ - abseil/meta/type_traits
+ - abseil/types/span
+ - abseil/memory (0.20200225.0):
+ - abseil/memory/memory (= 0.20200225.0)
+ - abseil/memory/memory (0.20200225.0):
+ - abseil/base/core_headers
+ - abseil/meta/type_traits
+ - abseil/meta (0.20200225.0):
+ - abseil/meta/type_traits (= 0.20200225.0)
+ - abseil/meta/type_traits (0.20200225.0):
+ - abseil/base/config
+ - abseil/numeric/int128 (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/strings/internal (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/base/endian
+ - abseil/base/raw_logging_internal
+ - abseil/meta/type_traits
+ - abseil/strings/str_format (0.20200225.0):
+ - abseil/strings/str_format_internal
+ - abseil/strings/str_format_internal (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/meta/type_traits
+ - abseil/numeric/int128
+ - abseil/strings/strings
+ - abseil/types/span
+ - abseil/strings/strings (0.20200225.0):
+ - abseil/base/base
+ - abseil/base/bits
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/base/endian
+ - abseil/base/raw_logging_internal
+ - abseil/base/throw_delegate
+ - abseil/memory/memory
+ - abseil/meta/type_traits
+ - abseil/numeric/int128
+ - abseil/strings/internal
+ - abseil/time (0.20200225.0):
+ - abseil/time/internal (= 0.20200225.0)
+ - abseil/time/time (= 0.20200225.0)
+ - abseil/time/internal (0.20200225.0):
+ - abseil/time/internal/cctz (= 0.20200225.0)
+ - abseil/time/internal/cctz (0.20200225.0):
+ - abseil/time/internal/cctz/civil_time (= 0.20200225.0)
+ - abseil/time/internal/cctz/time_zone (= 0.20200225.0)
+ - abseil/time/internal/cctz/civil_time (0.20200225.0):
+ - abseil/base/config
+ - abseil/time/internal/cctz/time_zone (0.20200225.0):
+ - abseil/base/config
+ - abseil/time/internal/cctz/civil_time
+ - abseil/time/time (0.20200225.0):
+ - abseil/base/base
+ - abseil/base/core_headers
+ - abseil/base/raw_logging_internal
+ - abseil/numeric/int128
+ - abseil/strings/strings
+ - abseil/time/internal/cctz/civil_time
+ - abseil/time/internal/cctz/time_zone
+ - abseil/types (0.20200225.0):
+ - abseil/types/any (= 0.20200225.0)
+ - abseil/types/bad_any_cast (= 0.20200225.0)
+ - abseil/types/bad_any_cast_impl (= 0.20200225.0)
+ - abseil/types/bad_optional_access (= 0.20200225.0)
+ - abseil/types/bad_variant_access (= 0.20200225.0)
+ - abseil/types/compare (= 0.20200225.0)
+ - abseil/types/optional (= 0.20200225.0)
+ - abseil/types/span (= 0.20200225.0)
+ - abseil/types/variant (= 0.20200225.0)
+ - abseil/types/any (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/meta/type_traits
+ - abseil/types/bad_any_cast
+ - abseil/utility/utility
+ - abseil/types/bad_any_cast (0.20200225.0):
+ - abseil/base/config
+ - abseil/types/bad_any_cast_impl
+ - abseil/types/bad_any_cast_impl (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/raw_logging_internal
+ - abseil/types/bad_optional_access (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/raw_logging_internal
+ - abseil/types/bad_variant_access (0.20200225.0):
+ - abseil/base/config
+ - abseil/base/raw_logging_internal
+ - abseil/types/compare (0.20200225.0):
+ - abseil/base/core_headers
+ - abseil/meta/type_traits
+ - abseil/types/optional (0.20200225.0):
+ - abseil/base/base_internal
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/memory/memory
+ - abseil/meta/type_traits
+ - abseil/types/bad_optional_access
+ - abseil/utility/utility
+ - abseil/types/span (0.20200225.0):
+ - abseil/algorithm/algorithm
+ - abseil/base/core_headers
+ - abseil/base/throw_delegate
+ - abseil/meta/type_traits
+ - abseil/types/variant (0.20200225.0):
+ - abseil/base/base_internal
+ - abseil/base/config
+ - abseil/base/core_headers
+ - abseil/meta/type_traits
+ - abseil/types/bad_variant_access
+ - abseil/utility/utility
+ - abseil/utility/utility (0.20200225.0):
+ - abseil/base/base_internal
+ - abseil/base/config
+ - abseil/meta/type_traits
+ - android_intent (0.0.1):
+ - Flutter
+ - barcode_scan_fix (0.0.1):
+ - Flutter
+ - MTBBarcodeScanner
+ - BoringSSL-GRPC (0.0.7):
+ - BoringSSL-GRPC/Implementation (= 0.0.7)
+ - BoringSSL-GRPC/Interface (= 0.0.7)
+ - BoringSSL-GRPC/Implementation (0.0.7):
+ - BoringSSL-GRPC/Interface (= 0.0.7)
+ - BoringSSL-GRPC/Interface (0.0.7)
+ - cloud_firestore (0.14.4):
+ - Firebase/CoreOnly (~> 6.33.0)
+ - Firebase/Firestore (~> 6.33.0)
+ - firebase_core
+ - Flutter
+ - cloud_firestore_web (0.1.0):
+ - Flutter
+ - connectivity (0.0.1):
+ - Flutter
+ - Reachability
+ - connectivity_for_web (0.1.0):
+ - Flutter
+ - connectivity_macos (0.0.1):
+ - Flutter
+ - device_calendar (0.0.1):
+ - Flutter
+ - device_info (0.0.1):
+ - Flutter
+ - DKImagePickerController/Core (4.3.2):
+ - DKImagePickerController/ImageDataManager
+ - DKImagePickerController/Resource
+ - DKImagePickerController/ImageDataManager (4.3.2)
+ - DKImagePickerController/PhotoGallery (4.3.2):
+ - DKImagePickerController/Core
+ - DKPhotoGallery
+ - DKImagePickerController/Resource (4.3.2)
+ - DKPhotoGallery (0.0.17):
+ - DKPhotoGallery/Core (= 0.0.17)
+ - DKPhotoGallery/Model (= 0.0.17)
+ - DKPhotoGallery/Preview (= 0.0.17)
+ - DKPhotoGallery/Resource (= 0.0.17)
+ - SDWebImage
+ - SwiftyGif
+ - DKPhotoGallery/Core (0.0.17):
+ - DKPhotoGallery/Model
+ - DKPhotoGallery/Preview
+ - SDWebImage
+ - SwiftyGif
+ - DKPhotoGallery/Model (0.0.17):
+ - SDWebImage
+ - SwiftyGif
+ - DKPhotoGallery/Preview (0.0.17):
+ - DKPhotoGallery/Model
+ - DKPhotoGallery/Resource
+ - SDWebImage
+ - SwiftyGif
+ - DKPhotoGallery/Resource (0.0.17):
+ - SDWebImage
+ - SwiftyGif
+ - file_picker (0.0.1):
+ - DKImagePickerController/PhotoGallery
+ - Flutter
+ - file_picker_web (0.0.1):
+ - Flutter
+ - Firebase/CoreOnly (6.33.0):
+ - FirebaseCore (= 6.10.3)
+ - Firebase/Firestore (6.33.0):
+ - Firebase/CoreOnly
+ - FirebaseFirestore (~> 1.18.0)
+ - Firebase/Messaging (6.33.0):
+ - Firebase/CoreOnly
+ - FirebaseMessaging (~> 4.7.0)
+ - firebase_core (0.5.3):
+ - Firebase/CoreOnly (~> 6.33.0)
+ - Flutter
+ - firebase_core_web (0.1.0):
+ - Flutter
+ - firebase_messaging (7.0.3):
+ - Firebase/CoreOnly (~> 6.33.0)
+ - Firebase/Messaging (~> 6.33.0)
+ - firebase_core
+ - Flutter
+ - FirebaseCore (6.10.3):
+ - FirebaseCoreDiagnostics (~> 1.6)
+ - GoogleUtilities/Environment (~> 6.7)
+ - GoogleUtilities/Logger (~> 6.7)
+ - FirebaseCoreDiagnostics (1.7.0):
+ - GoogleDataTransport (~> 7.4)
+ - GoogleUtilities/Environment (~> 6.7)
+ - GoogleUtilities/Logger (~> 6.7)
+ - nanopb (~> 1.30906.0)
+ - FirebaseFirestore (1.18.0):
+ - abseil/algorithm (= 0.20200225.0)
+ - abseil/base (= 0.20200225.0)
+ - abseil/memory (= 0.20200225.0)
+ - abseil/meta (= 0.20200225.0)
+ - abseil/strings/strings (= 0.20200225.0)
+ - abseil/time (= 0.20200225.0)
+ - abseil/types (= 0.20200225.0)
+ - FirebaseCore (~> 6.10)
+ - "gRPC-C++ (~> 1.28.0)"
+ - leveldb-library (~> 1.22)
+ - nanopb (~> 1.30906.0)
+ - FirebaseInstallations (1.7.0):
+ - FirebaseCore (~> 6.10)
+ - GoogleUtilities/Environment (~> 6.7)
+ - GoogleUtilities/UserDefaults (~> 6.7)
+ - PromisesObjC (~> 1.2)
+ - FirebaseInstanceID (4.8.0):
+ - FirebaseCore (~> 6.10)
+ - FirebaseInstallations (~> 1.6)
+ - GoogleUtilities/Environment (~> 6.7)
+ - GoogleUtilities/UserDefaults (~> 6.7)
+ - FirebaseMessaging (4.7.1):
+ - FirebaseCore (~> 6.10)
+ - FirebaseInstanceID (~> 4.7)
+ - GoogleUtilities/AppDelegateSwizzler (~> 6.7)
+ - GoogleUtilities/Environment (~> 6.7)
+ - GoogleUtilities/Reachability (~> 6.7)
+ - GoogleUtilities/UserDefaults (~> 6.7)
+ - Protobuf (>= 3.9.2, ~> 3.9)
- Flutter (1.0.0)
+ - flutter_email_sender (0.0.1):
+ - Flutter
+ - flutter_flexible_toast (0.0.1):
+ - Flutter
+ - flutter_inappwebview (0.0.1):
+ - Flutter
+ - flutter_local_notifications (0.0.1):
+ - Flutter
+ - flutter_plugin_android_lifecycle (0.0.1):
+ - Flutter
+ - flutter_tts (0.0.1):
+ - Flutter
+ - FMDB (2.7.5):
+ - FMDB/standard (= 2.7.5)
+ - FMDB/standard (2.7.5)
+ - geolocator (6.2.0):
+ - Flutter
+ - google_maps_flutter (0.0.1):
+ - Flutter
+ - GoogleMaps (< 3.10)
+ - GoogleDataTransport (7.5.1):
+ - nanopb (~> 1.30906.0)
+ - GoogleMaps (3.9.0):
+ - GoogleMaps/Maps (= 3.9.0)
+ - GoogleMaps/Base (3.9.0)
+ - GoogleMaps/Maps (3.9.0):
+ - GoogleMaps/Base
+ - GoogleUtilities/AppDelegateSwizzler (6.7.2):
+ - GoogleUtilities/Environment
+ - GoogleUtilities/Logger
+ - GoogleUtilities/Network
+ - GoogleUtilities/Environment (6.7.2):
+ - PromisesObjC (~> 1.2)
+ - GoogleUtilities/Logger (6.7.2):
+ - GoogleUtilities/Environment
+ - GoogleUtilities/Network (6.7.2):
+ - GoogleUtilities/Logger
+ - "GoogleUtilities/NSData+zlib"
+ - GoogleUtilities/Reachability
+ - "GoogleUtilities/NSData+zlib (6.7.2)"
+ - GoogleUtilities/Reachability (6.7.2):
+ - GoogleUtilities/Logger
+ - GoogleUtilities/UserDefaults (6.7.2):
+ - GoogleUtilities/Logger
+ - "gRPC-C++ (1.28.2)":
+ - "gRPC-C++/Implementation (= 1.28.2)"
+ - "gRPC-C++/Interface (= 1.28.2)"
+ - "gRPC-C++/Implementation (1.28.2)":
+ - abseil/container/inlined_vector (= 0.20200225.0)
+ - abseil/memory/memory (= 0.20200225.0)
+ - abseil/strings/str_format (= 0.20200225.0)
+ - abseil/strings/strings (= 0.20200225.0)
+ - abseil/types/optional (= 0.20200225.0)
+ - "gRPC-C++/Interface (= 1.28.2)"
+ - gRPC-Core (= 1.28.2)
+ - "gRPC-C++/Interface (1.28.2)"
+ - gRPC-Core (1.28.2):
+ - gRPC-Core/Implementation (= 1.28.2)
+ - gRPC-Core/Interface (= 1.28.2)
+ - gRPC-Core/Implementation (1.28.2):
+ - abseil/container/inlined_vector (= 0.20200225.0)
+ - abseil/memory/memory (= 0.20200225.0)
+ - abseil/strings/str_format (= 0.20200225.0)
+ - abseil/strings/strings (= 0.20200225.0)
+ - abseil/types/optional (= 0.20200225.0)
+ - BoringSSL-GRPC (= 0.0.7)
+ - gRPC-Core/Interface (= 1.28.2)
+ - gRPC-Core/Interface (1.28.2)
+ - hexcolor (0.0.1):
+ - Flutter
+ - image_cropper (0.0.3):
+ - Flutter
+ - TOCropViewController (~> 2.5.4)
+ - image_picker (0.0.1):
+ - Flutter
+ - just_audio (0.0.1):
+ - Flutter
+ - leveldb-library (1.22)
+ - local_auth (0.0.1):
+ - Flutter
+ - location (0.0.1):
+ - Flutter
+ - manage_calendar_events (0.0.1):
+ - Flutter
+ - map_launcher (0.0.1):
+ - Flutter
+ - maps_launcher (0.0.1):
+ - Flutter
+ - MTBBarcodeScanner (5.0.11)
+ - nanopb (1.30906.0):
+ - nanopb/decode (= 1.30906.0)
+ - nanopb/encode (= 1.30906.0)
+ - nanopb/decode (1.30906.0)
+ - nanopb/encode (1.30906.0)
+ - native_device_orientation (0.0.1):
+ - Flutter
- NVActivityIndicatorView (5.1.1):
- NVActivityIndicatorView/Base (= 5.1.1)
- NVActivityIndicatorView/Base (5.1.1)
+ - path_provider (0.0.1):
+ - Flutter
+ - path_provider_linux (0.0.1):
+ - Flutter
+ - path_provider_macos (0.0.1):
+ - Flutter
+ - path_provider_windows (0.0.1):
+ - Flutter
+ - "permission_handler (5.1.0+2)":
+ - Flutter
+ - PromisesObjC (1.2.12)
+ - Protobuf (3.14.0)
+ - Reachability (3.2)
+ - screen (0.0.1):
+ - Flutter
+ - SDWebImage (5.10.4):
+ - SDWebImage/Core (= 5.10.4)
+ - SDWebImage/Core (5.10.4)
+ - shared_preferences (0.0.1):
+ - Flutter
+ - shared_preferences_linux (0.0.1):
+ - Flutter
+ - shared_preferences_macos (0.0.1):
+ - Flutter
+ - shared_preferences_web (0.0.1):
+ - Flutter
+ - shared_preferences_windows (0.0.1):
+ - Flutter
+ - speech_to_text (0.0.1):
+ - Flutter
+ - Try
+ - sqflite (0.0.2):
+ - Flutter
+ - FMDB (>= 2.7.5)
+ - SwiftyGif (5.4.0)
+ - TOCropViewController (2.5.5)
+ - Try (2.1.1)
+ - "twilio_programmable_video (0.5.0+4)":
+ - Flutter
+ - TwilioVideo (~> 3.4)
+ - TwilioVideo (3.8.0)
+ - url_launcher (0.0.1):
+ - Flutter
+ - url_launcher_linux (0.0.1):
+ - Flutter
+ - url_launcher_macos (0.0.1):
+ - Flutter
+ - url_launcher_web (0.0.1):
+ - Flutter
+ - url_launcher_windows (0.0.1):
+ - Flutter
+ - vibration (1.7.3):
+ - Flutter
+ - vibration_web (1.6.2):
+ - Flutter
+ - video_player (0.0.1):
+ - Flutter
+ - video_player_web (0.0.1):
+ - Flutter
+ - wakelock (0.0.1):
+ - Flutter
+ - webview_flutter (0.0.1):
+ - Flutter
+ - wifi (0.0.1):
+ - Flutter
DEPENDENCIES:
+ - android_intent (from `.symlinks/plugins/android_intent/ios`)
+ - barcode_scan_fix (from `.symlinks/plugins/barcode_scan_fix/ios`)
+ - cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)
+ - cloud_firestore_web (from `.symlinks/plugins/cloud_firestore_web/ios`)
+ - connectivity (from `.symlinks/plugins/connectivity/ios`)
+ - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`)
+ - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`)
+ - device_calendar (from `.symlinks/plugins/device_calendar/ios`)
+ - device_info (from `.symlinks/plugins/device_info/ios`)
+ - file_picker (from `.symlinks/plugins/file_picker/ios`)
+ - file_picker_web (from `.symlinks/plugins/file_picker_web/ios`)
+ - firebase_core (from `.symlinks/plugins/firebase_core/ios`)
+ - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`)
+ - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
- Flutter (from `Flutter`)
+ - flutter_email_sender (from `.symlinks/plugins/flutter_email_sender/ios`)
+ - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`)
+ - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
+ - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
+ - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`)
+ - flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
+ - geolocator (from `.symlinks/plugins/geolocator/ios`)
+ - google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`)
+ - hexcolor (from `.symlinks/plugins/hexcolor/ios`)
+ - image_cropper (from `.symlinks/plugins/image_cropper/ios`)
+ - image_picker (from `.symlinks/plugins/image_picker/ios`)
+ - just_audio (from `.symlinks/plugins/just_audio/ios`)
+ - local_auth (from `.symlinks/plugins/local_auth/ios`)
+ - location (from `.symlinks/plugins/location/ios`)
+ - manage_calendar_events (from `.symlinks/plugins/manage_calendar_events/ios`)
+ - map_launcher (from `.symlinks/plugins/map_launcher/ios`)
+ - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`)
+ - native_device_orientation (from `.symlinks/plugins/native_device_orientation/ios`)
- NVActivityIndicatorView
+ - path_provider (from `.symlinks/plugins/path_provider/ios`)
+ - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
+ - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
+ - path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`)
+ - permission_handler (from `.symlinks/plugins/permission_handler/ios`)
+ - screen (from `.symlinks/plugins/screen/ios`)
+ - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
+ - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
+ - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
+ - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
+ - shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`)
+ - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`)
+ - sqflite (from `.symlinks/plugins/sqflite/ios`)
+ - twilio_programmable_video (from `.symlinks/plugins/twilio_programmable_video/ios`)
+ - url_launcher (from `.symlinks/plugins/url_launcher/ios`)
+ - url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
+ - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
+ - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
+ - url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
+ - vibration (from `.symlinks/plugins/vibration/ios`)
+ - vibration_web (from `.symlinks/plugins/vibration_web/ios`)
+ - video_player (from `.symlinks/plugins/video_player/ios`)
+ - video_player_web (from `.symlinks/plugins/video_player_web/ios`)
+ - wakelock (from `.symlinks/plugins/wakelock/ios`)
+ - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
+ - wifi (from `.symlinks/plugins/wifi/ios`)
SPEC REPOS:
trunk:
+ - abseil
+ - BoringSSL-GRPC
+ - DKImagePickerController
+ - DKPhotoGallery
+ - Firebase
+ - FirebaseCore
+ - FirebaseCoreDiagnostics
+ - FirebaseFirestore
+ - FirebaseInstallations
+ - FirebaseInstanceID
+ - FirebaseMessaging
+ - FMDB
+ - GoogleDataTransport
+ - GoogleMaps
+ - GoogleUtilities
+ - "gRPC-C++"
+ - gRPC-Core
+ - leveldb-library
+ - MTBBarcodeScanner
+ - nanopb
- NVActivityIndicatorView
+ - PromisesObjC
+ - Protobuf
+ - Reachability
+ - SDWebImage
+ - SwiftyGif
+ - TOCropViewController
+ - Try
+ - TwilioVideo
EXTERNAL SOURCES:
+ android_intent:
+ :path: ".symlinks/plugins/android_intent/ios"
+ barcode_scan_fix:
+ :path: ".symlinks/plugins/barcode_scan_fix/ios"
+ cloud_firestore:
+ :path: ".symlinks/plugins/cloud_firestore/ios"
+ cloud_firestore_web:
+ :path: ".symlinks/plugins/cloud_firestore_web/ios"
+ connectivity:
+ :path: ".symlinks/plugins/connectivity/ios"
+ connectivity_for_web:
+ :path: ".symlinks/plugins/connectivity_for_web/ios"
+ connectivity_macos:
+ :path: ".symlinks/plugins/connectivity_macos/ios"
+ device_calendar:
+ :path: ".symlinks/plugins/device_calendar/ios"
+ device_info:
+ :path: ".symlinks/plugins/device_info/ios"
+ file_picker:
+ :path: ".symlinks/plugins/file_picker/ios"
+ file_picker_web:
+ :path: ".symlinks/plugins/file_picker_web/ios"
+ firebase_core:
+ :path: ".symlinks/plugins/firebase_core/ios"
+ firebase_core_web:
+ :path: ".symlinks/plugins/firebase_core_web/ios"
+ firebase_messaging:
+ :path: ".symlinks/plugins/firebase_messaging/ios"
Flutter:
:path: Flutter
+ flutter_email_sender:
+ :path: ".symlinks/plugins/flutter_email_sender/ios"
+ flutter_flexible_toast:
+ :path: ".symlinks/plugins/flutter_flexible_toast/ios"
+ flutter_inappwebview:
+ :path: ".symlinks/plugins/flutter_inappwebview/ios"
+ flutter_local_notifications:
+ :path: ".symlinks/plugins/flutter_local_notifications/ios"
+ flutter_plugin_android_lifecycle:
+ :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios"
+ flutter_tts:
+ :path: ".symlinks/plugins/flutter_tts/ios"
+ geolocator:
+ :path: ".symlinks/plugins/geolocator/ios"
+ google_maps_flutter:
+ :path: ".symlinks/plugins/google_maps_flutter/ios"
+ hexcolor:
+ :path: ".symlinks/plugins/hexcolor/ios"
+ image_cropper:
+ :path: ".symlinks/plugins/image_cropper/ios"
+ image_picker:
+ :path: ".symlinks/plugins/image_picker/ios"
+ just_audio:
+ :path: ".symlinks/plugins/just_audio/ios"
+ local_auth:
+ :path: ".symlinks/plugins/local_auth/ios"
+ location:
+ :path: ".symlinks/plugins/location/ios"
+ manage_calendar_events:
+ :path: ".symlinks/plugins/manage_calendar_events/ios"
+ map_launcher:
+ :path: ".symlinks/plugins/map_launcher/ios"
+ maps_launcher:
+ :path: ".symlinks/plugins/maps_launcher/ios"
+ native_device_orientation:
+ :path: ".symlinks/plugins/native_device_orientation/ios"
+ path_provider:
+ :path: ".symlinks/plugins/path_provider/ios"
+ path_provider_linux:
+ :path: ".symlinks/plugins/path_provider_linux/ios"
+ path_provider_macos:
+ :path: ".symlinks/plugins/path_provider_macos/ios"
+ path_provider_windows:
+ :path: ".symlinks/plugins/path_provider_windows/ios"
+ permission_handler:
+ :path: ".symlinks/plugins/permission_handler/ios"
+ screen:
+ :path: ".symlinks/plugins/screen/ios"
+ shared_preferences:
+ :path: ".symlinks/plugins/shared_preferences/ios"
+ shared_preferences_linux:
+ :path: ".symlinks/plugins/shared_preferences_linux/ios"
+ shared_preferences_macos:
+ :path: ".symlinks/plugins/shared_preferences_macos/ios"
+ shared_preferences_web:
+ :path: ".symlinks/plugins/shared_preferences_web/ios"
+ shared_preferences_windows:
+ :path: ".symlinks/plugins/shared_preferences_windows/ios"
+ speech_to_text:
+ :path: ".symlinks/plugins/speech_to_text/ios"
+ sqflite:
+ :path: ".symlinks/plugins/sqflite/ios"
+ twilio_programmable_video:
+ :path: ".symlinks/plugins/twilio_programmable_video/ios"
+ url_launcher:
+ :path: ".symlinks/plugins/url_launcher/ios"
+ url_launcher_linux:
+ :path: ".symlinks/plugins/url_launcher_linux/ios"
+ url_launcher_macos:
+ :path: ".symlinks/plugins/url_launcher_macos/ios"
+ url_launcher_web:
+ :path: ".symlinks/plugins/url_launcher_web/ios"
+ url_launcher_windows:
+ :path: ".symlinks/plugins/url_launcher_windows/ios"
+ vibration:
+ :path: ".symlinks/plugins/vibration/ios"
+ vibration_web:
+ :path: ".symlinks/plugins/vibration_web/ios"
+ video_player:
+ :path: ".symlinks/plugins/video_player/ios"
+ video_player_web:
+ :path: ".symlinks/plugins/video_player_web/ios"
+ wakelock:
+ :path: ".symlinks/plugins/wakelock/ios"
+ webview_flutter:
+ :path: ".symlinks/plugins/webview_flutter/ios"
+ wifi:
+ :path: ".symlinks/plugins/wifi/ios"
SPEC CHECKSUMS:
+ abseil: 6c8eb7892aefa08d929b39f9bb108e5367e3228f
+ android_intent: 367df2f1277a74e4a90e14a8ab3df3112d087052
+ barcode_scan_fix: 80dd65de55f27eec6591dd077c8b85f2b79e31f1
+ BoringSSL-GRPC: 8edf627ee524575e2f8d19d56f068b448eea3879
+ cloud_firestore: b8c0e15fa49dfff87c2817d288b577e5dca2df13
+ cloud_firestore_web: 9ec3dc7f5f98de5129339802d491c1204462bfec
+ connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
+ connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
+ connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
+ device_calendar: 23b28a5f1ab3bf77e34542fb1167e1b8b29a98f5
+ device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
+ DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d
+ DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
+ file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1
+ file_picker_web: 37b10786e88885124fac99dc899866e78a132ef3
+ Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
+ firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659
+ firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1
+ firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75
+ FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd
+ FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1
+ FirebaseFirestore: adff4877869ca91a11250cc0989a6cd56bad163f
+ FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2
+ FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1
+ FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
+ flutter_email_sender: f787522d0e82f50e5766c1213dbffff22fdcf009
+ flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143
+ flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189
+ flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186
+ flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35
+ flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
+ FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
+ geolocator: f5e3de65e241caba7ce3e8a618803387bda73384
+ google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619
+ GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
+ GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac
+ GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
+ "gRPC-C++": 13d8ccef97d5c3c441b7e3c529ef28ebee86fad2
+ gRPC-Core: 4afa11bfbedf7cdecd04de535a9e046893404ed5
+ hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89
+ image_cropper: c8f9b4157933c7bb965a66d1c5e6c8fd408c6eb4
+ image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
+ just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
+ leveldb-library: 55d93ee664b4007aac644a782d11da33fba316f7
+ local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd
+ location: 3a2eed4dd2fab25e7b7baf2a9efefe82b512d740
+ manage_calendar_events: 0338d505ea26cdfd20cd883279bc28afa11eca34
+ map_launcher: e325db1261d029ff33e08e03baccffe09593ffea
+ maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92
+ MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
+ nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
+ native_device_orientation: e24d00be281de72996640885d80e706142707660
NVActivityIndicatorView: 1f6c5687f1171810aa27a3296814dc2d7dec3667
+ path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
+ path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
+ path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
+ path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
+ permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
+ PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
+ Protobuf: 0cde852566359049847168e51bd1c690e0f70056
+ Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
+ screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0
+ SDWebImage: c666b97e1fa9c64b4909816a903322018f0a9c84
+ shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
+ shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
+ shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
+ shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
+ shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae
+ speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe
+ sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
+ SwiftyGif: 5d4af95df24caf1c570dbbcb32a3b8a0763bc6d7
+ TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe
+ Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
+ twilio_programmable_video: 6a41593640f3d86af60b22541fd457b22deaae7f
+ TwilioVideo: c13a51ceca375e91620eb7578d2573c90cf53b46
+ url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
+ url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
+ url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
+ url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
+ url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5
+ vibration: b5a33e764c3f609a975b9dca73dce20fdde627dc
+ vibration_web: 0ba303d92469ba34d71c612a228b315908d7fcd9
+ video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
+ video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7
+ wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4
+ webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
+ wifi: d7d77c94109e36c4175d845f0a5964eadba71060
-PODFILE CHECKSUM: d94bd40f28772938199c67fcced06ffe96096c14
+PODFILE CHECKSUM: 5a17be3f8af73a757fa4439c77cf6ab2db29a6e7
COCOAPODS: 1.10.1
diff --git a/lib/config/config.dart b/lib/config/config.dart
index cf1836ac..a167e1b5 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -8,9 +8,11 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
const MAX_SMALL_SCREEN = 660;
// PACKAGES and OFFERS
-const EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/exacartapi';
+const EXA_CART_API_BASE_URL = 'http://10.200.101.75:9000';
const PACKAGES_CATEGORIES = '/api/categories';
const PACKAGES_PRODUCTS = '/api/products';
+const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
+const PACKAGES_CUSTOMER = '/api/customers';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart
index 6ab1a723..fa4d06f7 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -578,6 +578,7 @@ const Map localizedValues = {
"bestSellers": {"en": "Best Sellers", "ar": "أفضل البائعين"},
"deleteAllItems": {"en": "Delete All Items", "ar": "حذف كافة العناصر"},
"total": {"en": "Total", "ar": "المجموع"},
+ "totalWithColonRight": {"en": "Total:", "ar": ":المجموع"},
"selectAddress": {"en": "Select Address", "ar": "حدد العنوان"},
"shippingAddress": {"en": "SHIPPING ADDRESS", "ar": "عنوان الشحن"},
"changeAddress": {"en": "Change Address", "ar": "تغيير العنوان"},
diff --git a/lib/core/model/packages_offers/requests/AddProductToCartRequestModel.dart b/lib/core/model/packages_offers/requests/AddProductToCartRequestModel.dart
new file mode 100644
index 00000000..69e56ad7
--- /dev/null
+++ b/lib/core/model/packages_offers/requests/AddProductToCartRequestModel.dart
@@ -0,0 +1,26 @@
+import 'package:flutter/cupertino.dart';
+
+class AddProductToCartRequestModel {
+ int quantity;
+ int product_id;
+ String shopping_cart_type;
+ int customer_id;
+
+ AddProductToCartRequestModel({@required this.product_id, this.customer_id, this.shopping_cart_type = "ShoppingCart", this.quantity = 1});
+
+ Map json() {
+ return {
+ "shopping_cart_item" : {
+ "quantity": quantity,
+ "product_id": product_id,
+ "shopping_cart_type": shopping_cart_type,
+ "customer_id": customer_id
+ }
+ };
+ }
+}
+
+class UpdateProductToCartRequestModel extends AddProductToCartRequestModel{
+ UpdateProductToCartRequestModel({@required int product_id, @required int customer_id, String shopping_cart_type = "ShoppingCart", int quantity = 1})
+ : super(customer_id: customer_id, product_id: product_id, quantity: quantity, shopping_cart_type: shopping_cart_type);
+}
diff --git a/lib/core/model/packages_offers/requests/CreateCustomerRequestModel.dart b/lib/core/model/packages_offers/requests/CreateCustomerRequestModel.dart
new file mode 100644
index 00000000..116545bd
--- /dev/null
+++ b/lib/core/model/packages_offers/requests/CreateCustomerRequestModel.dart
@@ -0,0 +1,21 @@
+import 'package:flutter/cupertino.dart';
+
+class PackagesCustomerRequestModel {
+
+ String email;
+ String phoneNumber;
+
+ PackagesCustomerRequestModel({@required this.email, @required this.phoneNumber});
+
+ Map json() {
+ return {
+ "customer" : {
+ "email": email,
+ "addresses": [{
+ "email": email,
+ "phone_number": phoneNumber
+ }]
+ }
+ };
+ }
+}
\ No newline at end of file
diff --git a/lib/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart b/lib/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart
index f2f4af11..13dba945 100644
--- a/lib/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart
+++ b/lib/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart
@@ -6,6 +6,12 @@ class OffersCategoriesRequestModel {
OffersCategoriesRequestModel({this.limit, this.page, this.sinceId});
Map toFlatMap() {
- return {"limit": limit.toString(), "page": page.toString(), "sinceId": sinceId.toString()};
+ return {
+ if(limit != null && limit > 0)
+ "limit": limit.toString(),
+
+ if(page != null && page > 0)
+ "page": page.toString(),
+ };
}
}
diff --git a/lib/core/model/packages_offers/requests/OffersProductsRequestModel.dart b/lib/core/model/packages_offers/requests/OffersProductsRequestModel.dart
index 84862568..583932bb 100644
--- a/lib/core/model/packages_offers/requests/OffersProductsRequestModel.dart
+++ b/lib/core/model/packages_offers/requests/OffersProductsRequestModel.dart
@@ -1,12 +1,24 @@
class OffersProductsRequestModel {
final int categoryId;
final int limit;
- final int page;
- final int sinceId;
+ // final int page;
+ int sinceId;
- OffersProductsRequestModel({this.categoryId, this.limit, this.page, this.sinceId});
+ OffersProductsRequestModel({this.categoryId, this.limit = 50});
Map toFlatMap() {
- return {"limit": limit.toString(), "page": page.toString(), "sinceId": sinceId.toString(), "categoryId": categoryId.toString()};
+ return {
+
+ if(limit != null && limit > 0)
+ "limit": limit.toString(),
+
+ // if(page != null && page > 0)
+ // "page": page.toString(),
+
+ if(categoryId != null && categoryId > 0)
+ "categoryId": categoryId.toString(),
+
+ "sinceId": sinceId != null ? sinceId.toString() : "0",
+ };
}
}
diff --git a/lib/core/model/packages_offers/responses/PackagesCartItemsResponseModel.dart b/lib/core/model/packages_offers/responses/PackagesCartItemsResponseModel.dart
new file mode 100644
index 00000000..9514976f
--- /dev/null
+++ b/lib/core/model/packages_offers/responses/PackagesCartItemsResponseModel.dart
@@ -0,0 +1,132 @@
+
+import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesResponseModel.dart';
+
+class CartProductResponseModel {
+ int _quantity;
+
+ set quantity(int value) {
+ _quantity = value;
+ }
+
+ String _shoppingCartType;
+ int _productId;
+ PackagesResponseModel _product;
+ int _id;
+
+ int get quantity => _quantity;
+ String get shoppingCartType => _shoppingCartType;
+ int get productId => _productId;
+ PackagesResponseModel get product => _product;
+ int get id => _id;
+
+ CartProductResponseModel({
+ int quantity,
+ String shoppingCartType,
+ int productId,
+ PackagesResponseModel product,
+ int id}){
+ _quantity = quantity;
+ _shoppingCartType = shoppingCartType;
+ _productId = productId;
+ _product = product;
+ _id = id;
+}
+
+ CartProductResponseModel.fromJson(dynamic json) {
+ _quantity = json["quantity"];
+ _shoppingCartType = json["shopping_cart_type"];
+ _productId = json["product_id"];
+ _product = json["product"] != null ? PackagesResponseModel().fromJson(json["product"]) : null;
+ _id = json["id"];
+ }
+
+ Map toJson() {
+ var map = {};
+ map["quantity"] = _quantity;
+ map["shopping_cart_type"] = _shoppingCartType;
+ map["product_id"] = _productId;
+ if (_product != null) {
+ map["product"] = _product.toJson();
+ }
+ map["id"] = _id;
+ return map;
+ }
+
+}
+
+class Images {
+ int _id;
+ int _pictureId;
+ int _position;
+ String _src;
+ dynamic _attachment;
+
+ int get id => _id;
+ int get pictureId => _pictureId;
+ int get position => _position;
+ String get src => _src;
+ dynamic get attachment => _attachment;
+
+ Images({
+ int id,
+ int pictureId,
+ int position,
+ String src,
+ dynamic attachment}){
+ _id = id;
+ _pictureId = pictureId;
+ _position = position;
+ _src = src;
+ _attachment = attachment;
+}
+
+ Images.fromJson(dynamic json) {
+ _id = json["id"];
+ _pictureId = json["picture_id"];
+ _position = json["position"];
+ _src = json["src"];
+ _attachment = json["attachment"];
+ }
+
+ Map toJson() {
+ var map = {};
+ map["id"] = _id;
+ map["picture_id"] = _pictureId;
+ map["position"] = _position;
+ map["src"] = _src;
+ map["attachment"] = _attachment;
+ return map;
+ }
+
+}
+
+/// language_id : 1
+/// localized_name : "Dermatology testing"
+
+class Localized_names {
+ int _languageId;
+ String _localizedName;
+
+ int get languageId => _languageId;
+ String get localizedName => _localizedName;
+
+ Localized_names({
+ int languageId,
+ String localizedName}){
+ _languageId = languageId;
+ _localizedName = localizedName;
+}
+
+ Localized_names.fromJson(dynamic json) {
+ _languageId = json["language_id"];
+ _localizedName = json["localized_name"];
+ }
+
+ Map toJson() {
+ var map = {};
+ map["language_id"] = _languageId;
+ map["localized_name"] = _localizedName;
+ return map;
+ }
+
+}
\ No newline at end of file
diff --git a/lib/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart b/lib/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart
similarity index 82%
rename from lib/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart
rename to lib/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart
index 087f1961..292022c0 100644
--- a/lib/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart
+++ b/lib/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart
@@ -1,8 +1,8 @@
import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart';
import 'package:diplomaticquarterapp/generated/json/base/json_field.dart';
-class OfferCategoriesResponseModel with JsonConvert {
- String id;
+class PackagesCategoriesResponseModel with JsonConvert {
+ int id;
String name;
String namen;
@JSONField(name: "localized_names")
@@ -49,6 +49,18 @@ class OfferCategoriesResponseModel with JsonConvert {
diff --git a/lib/core/model/packages_offers/responses/PackagesCustomerResponseModel.dart b/lib/core/model/packages_offers/responses/PackagesCustomerResponseModel.dart
new file mode 100644
index 00000000..314b0ad3
--- /dev/null
+++ b/lib/core/model/packages_offers/responses/PackagesCustomerResponseModel.dart
@@ -0,0 +1,199 @@
+class PackagesCustomerResponseModel {
+ List _shoppingCartItems;
+ dynamic _billingAddress;
+ dynamic _shippingAddress;
+ List _addresses;
+ String _customerGuid;
+ dynamic _username;
+ String _email;
+ dynamic _firstName;
+ dynamic _lastName;
+ dynamic _languageId;
+ dynamic _dateOfBirth;
+ dynamic _gender;
+ dynamic _adminComment;
+ bool _isTaxExempt;
+ bool _hasShoppingCartItems;
+ bool _active;
+ bool _deleted;
+ bool _isSystemAccount;
+ dynamic _systemName;
+ dynamic _lastIpAddress;
+ String _createdOnUtc;
+ dynamic _lastLoginDateUtc;
+ String _lastActivityDateUtc;
+ int _registeredInStoreId;
+ bool _subscribedToNewsletter;
+ List _roleIds;
+ int _id;
+
+ List get shoppingCartItems => _shoppingCartItems;
+ dynamic get billingAddress => _billingAddress;
+ dynamic get shippingAddress => _shippingAddress;
+ List get addresses => _addresses;
+ String get customerGuid => _customerGuid;
+ dynamic get username => _username;
+ String get email => _email;
+ dynamic get firstName => _firstName;
+ dynamic get lastName => _lastName;
+ dynamic get languageId => _languageId;
+ dynamic get dateOfBirth => _dateOfBirth;
+ dynamic get gender => _gender;
+ dynamic get adminComment => _adminComment;
+ bool get isTaxExempt => _isTaxExempt;
+ bool get hasShoppingCartItems => _hasShoppingCartItems;
+ bool get active => _active;
+ bool get deleted => _deleted;
+ bool get isSystemAccount => _isSystemAccount;
+ dynamic get systemName => _systemName;
+ dynamic get lastIpAddress => _lastIpAddress;
+ String get createdOnUtc => _createdOnUtc;
+ dynamic get lastLoginDateUtc => _lastLoginDateUtc;
+ String get lastActivityDateUtc => _lastActivityDateUtc;
+ int get registeredInStoreId => _registeredInStoreId;
+ bool get subscribedToNewsletter => _subscribedToNewsletter;
+ List get roleIds => _roleIds;
+ int get id => _id;
+
+ PackagesCustomerResponseModel({
+ List shoppingCartItems,
+ dynamic billingAddress,
+ dynamic shippingAddress,
+ List addresses,
+ String customerGuid,
+ dynamic username,
+ String email,
+ dynamic firstName,
+ dynamic lastName,
+ dynamic languageId,
+ dynamic dateOfBirth,
+ dynamic gender,
+ dynamic adminComment,
+ bool isTaxExempt,
+ bool hasShoppingCartItems,
+ bool active,
+ bool deleted,
+ bool isSystemAccount,
+ dynamic systemName,
+ dynamic lastIpAddress,
+ String createdOnUtc,
+ dynamic lastLoginDateUtc,
+ String lastActivityDateUtc,
+ int registeredInStoreId,
+ bool subscribedToNewsletter,
+ List roleIds,
+ int id}){
+ _shoppingCartItems = shoppingCartItems;
+ _billingAddress = billingAddress;
+ _shippingAddress = shippingAddress;
+ _addresses = addresses;
+ _customerGuid = customerGuid;
+ _username = username;
+ _email = email;
+ _firstName = firstName;
+ _lastName = lastName;
+ _languageId = languageId;
+ _dateOfBirth = dateOfBirth;
+ _gender = gender;
+ _adminComment = adminComment;
+ _isTaxExempt = isTaxExempt;
+ _hasShoppingCartItems = hasShoppingCartItems;
+ _active = active;
+ _deleted = deleted;
+ _isSystemAccount = isSystemAccount;
+ _systemName = systemName;
+ _lastIpAddress = lastIpAddress;
+ _createdOnUtc = createdOnUtc;
+ _lastLoginDateUtc = lastLoginDateUtc;
+ _lastActivityDateUtc = lastActivityDateUtc;
+ _registeredInStoreId = registeredInStoreId;
+ _subscribedToNewsletter = subscribedToNewsletter;
+ _roleIds = roleIds;
+ _id = id;
+}
+
+ PackagesCustomerResponseModel.fromJson(dynamic json) {
+ _billingAddress = json["billing_address"];
+ _shippingAddress = json["shipping_address"];
+ _customerGuid = json["customer_guid"];
+ _username = json["username"];
+ _email = json["email"];
+ _firstName = json["first_name"];
+ _lastName = json["last_name"];
+ _languageId = json["language_id"];
+ _dateOfBirth = json["date_of_birth"];
+ _gender = json["gender"];
+ _adminComment = json["admin_comment"];
+ _isTaxExempt = json["is_tax_exempt"];
+ _hasShoppingCartItems = json["has_shopping_cart_items"];
+ _active = json["active"];
+ _deleted = json["deleted"];
+ _isSystemAccount = json["is_system_account"];
+ _systemName = json["system_name"];
+ _lastIpAddress = json["last_ip_address"];
+ _createdOnUtc = json["created_on_utc"];
+ _lastLoginDateUtc = json["last_login_date_utc"];
+ _lastActivityDateUtc = json["last_activity_date_utc"];
+ _registeredInStoreId = json["registered_in_store_id"];
+ _subscribedToNewsletter = json["subscribed_to_newsletter"];
+ _id = json["id"];
+
+ // if (json["role_ids"] != null) {
+ // _roleIds = [];
+ // json["role_ids"].forEach((v) {
+ // _roleIds.add(dynamic.fromJson(v));
+ // });
+ // }
+ // if (json["addresses"] != null) {
+ // _addresses = [];
+ // json["addresses"].forEach((v) {
+ // _addresses.add(dynamic.fromJson(v));
+ // });
+ // }
+ // if (json["shopping_cart_items"] != null) {
+ // _shoppingCartItems = [];
+ // json["shopping_cart_items"].forEach((v) {
+ // _shoppingCartItems.add(dynamic.fromJson(v));
+ // });
+ // }
+ }
+
+ Map toJson() {
+ var map = {};
+ if (_shoppingCartItems != null) {
+ map["shopping_cart_items"] = _shoppingCartItems.map((v) => v.toJson()).toList();
+ }
+ map["billing_address"] = _billingAddress;
+ map["shipping_address"] = _shippingAddress;
+ if (_addresses != null) {
+ map["addresses"] = _addresses.map((v) => v.toJson()).toList();
+ }
+ map["customer_guid"] = _customerGuid;
+ map["username"] = _username;
+ map["email"] = _email;
+ map["first_name"] = _firstName;
+ map["last_name"] = _lastName;
+ map["language_id"] = _languageId;
+ map["date_of_birth"] = _dateOfBirth;
+ map["gender"] = _gender;
+ map["admin_comment"] = _adminComment;
+ map["is_tax_exempt"] = _isTaxExempt;
+ map["has_shopping_cart_items"] = _hasShoppingCartItems;
+ map["active"] = _active;
+ map["deleted"] = _deleted;
+ map["is_system_account"] = _isSystemAccount;
+ map["system_name"] = _systemName;
+ map["last_ip_address"] = _lastIpAddress;
+ map["created_on_utc"] = _createdOnUtc;
+ map["last_login_date_utc"] = _lastLoginDateUtc;
+ map["last_activity_date_utc"] = _lastActivityDateUtc;
+ map["registered_in_store_id"] = _registeredInStoreId;
+ map["subscribed_to_newsletter"] = _subscribedToNewsletter;
+ if (_roleIds != null) {
+ map["role_ids"] = _roleIds.map((v) => v.toJson()).toList();
+ }
+ map["id"] = _id;
+ return map;
+ }
+
+}
\ No newline at end of file
diff --git a/lib/core/model/packages_offers/responses/OfferProductsResponseModel.dart b/lib/core/model/packages_offers/responses/PackagesResponseModel.dart
similarity index 95%
rename from lib/core/model/packages_offers/responses/OfferProductsResponseModel.dart
rename to lib/core/model/packages_offers/responses/PackagesResponseModel.dart
index 58481a8b..7297a20a 100644
--- a/lib/core/model/packages_offers/responses/OfferProductsResponseModel.dart
+++ b/lib/core/model/packages_offers/responses/PackagesResponseModel.dart
@@ -1,8 +1,8 @@
import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart';
import 'package:diplomaticquarterapp/generated/json/base/json_field.dart';
-class OfferProductsResponseModel with JsonConvert {
- String id;
+class PackagesResponseModel with JsonConvert {
+ int id;
@JSONField(name: "visible_individually")
bool visibleIndividually;
String name;
@@ -205,6 +205,17 @@ class OfferProductsResponseModel with JsonConvert {
int vendorId;
@JSONField(name: "se_name")
String seName;
+
+ String getName() {
+ if(localizedNames.length == 2){
+ if(localizedNames.first.languageId == 2)
+ return localizedNames.first.localizedName ?? name;
+
+ else if(localizedNames.first.languageId == 1)
+ return localizedNames.last.localizedName ?? name;
+ }
+ return name;
+ }
}
class OfferProductsResponseModelLocalizedName with JsonConvert {
diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart
index 429303bd..24fd202f 100644
--- a/lib/core/service/client/base_app_client.dart
+++ b/lib/core/service/client/base_app_client.dart
@@ -300,11 +300,45 @@ class BaseAppClient {
}
}
+ simplePost(String fullUrl,
+ { Map body,
+ Function(dynamic response, int statusCode) onSuccess,
+ Function(String error, int statusCode) onFailure,}) async {
+
+ String url = fullUrl;
+ print("URL Query String: $url");
+
+ if (await Utils.checkConnection()) {
+ final response = await http.post(
+ url.trim(),
+ body: json.encode(body),
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Accept': 'application/json'
+ },
+ );
+
+ final int statusCode = response.statusCode;
+ print("statusCode :$statusCode");
+
+ if (statusCode < 200 || statusCode >= 400 || json == null) {
+ onFailure('Error While Fetching data', statusCode);
+ } else {
+ onSuccess(response.body.toString(), statusCode);
+ }
+ } else {
+ onFailure('Please Check The Internet Connection', -1);
+ }
+ }
+
simpleGet(String fullUrl,
{Function(dynamic response, int statusCode) onSuccess,
- Function(String error, int statusCode) onFailure,
- Map queryParams}) async {
+ Function(String error, int statusCode) onFailure,
+ Map queryParams}) async {
+
String url = fullUrl;
+ print("URL Query String: $url");
+
var haveParams = (queryParams != null);
if (haveParams) {
String queryString = Uri(queryParameters: queryParams).query;
@@ -334,6 +368,75 @@ class BaseAppClient {
}
}
+
+ simplePut(String fullUrl,
+ { Map body,
+ Function(dynamic response, int statusCode) onSuccess,
+ Function(String error, int statusCode) onFailure}) async {
+
+ String url = fullUrl;
+ print("URL Query String: $url");
+
+ if (await Utils.checkConnection()) {
+ final response = await http.put(
+ url.trim(),
+ body: json.encode(body),
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Accept': 'application/json'
+ },
+ );
+
+ final int statusCode = response.statusCode;
+ print("statusCode :$statusCode");
+
+ if (statusCode < 200 || statusCode >= 400 || json == null) {
+ onFailure('Error While Fetching data', statusCode);
+ } else {
+ onSuccess(response.body.toString(), statusCode);
+ }
+ } else {
+ onFailure('Please Check The Internet Connection', -1);
+ }
+ }
+
+ simpleDelete(String fullUrl,
+ {Function(dynamic response, int statusCode) onSuccess,
+ Function(String error, int statusCode) onFailure,
+ Map queryParams}) async {
+
+ String url = fullUrl;
+ print("URL Query String: $url");
+
+ var haveParams = (queryParams != null);
+ if (haveParams) {
+ String queryString = Uri(queryParameters: queryParams).query;
+ url += '?' + queryString;
+ print("URL Query String: $url");
+ }
+
+ if (await Utils.checkConnection()) {
+ final response = await http.delete(
+ url.trim(),
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Accept': 'application/json'
+ },
+ );
+
+ final int statusCode = response.statusCode;
+ print("statusCode :$statusCode");
+
+ if (statusCode < 200 || statusCode >= 400 || json == null) {
+ onFailure('Error While Fetching data', statusCode);
+ } else {
+ onSuccess(response.body.toString(), statusCode);
+ }
+ } else {
+ onFailure('Please Check The Internet Connection', -1);
+ }
+ }
+
logout() async {
await sharedPref.remove(LOGIN_TOKEN_ID);
await sharedPref.remove(PHARMACY_CUSTOMER_ID);
diff --git a/lib/core/service/packages_offers/PackagesOffersServices.dart b/lib/core/service/packages_offers/PackagesOffersServices.dart
index e58c3fa3..c0c7bc94 100644
--- a/lib/core/service/packages_offers/PackagesOffersServices.dart
+++ b/lib/core/service/packages_offers/PackagesOffersServices.dart
@@ -1,27 +1,42 @@
import 'dart:convert';
import 'dart:developer';
+import 'dart:ui';
import 'package:diplomaticquarterapp/config/config.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/requests/AddProductToCartRequestModel.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/requests/CreateCustomerRequestModel.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/requests/OffersProductsRequestModel.dart';
-import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart';
-import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferProductsResponseModel.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCartItemsResponseModel.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesResponseModel.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCustomerResponseModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
+import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
+import 'package:flutter/cupertino.dart';
import '../../../locator.dart';
class OffersAndPackagesServices extends BaseService {
- List categoryList = List();
+ List categoryList = List();
+ List productList = List();
+ List latestOffersList = List();
+ List bestSellerList = List();
+ List bannersList = List();
+ List cartItemList = List();
+
+ PackagesCustomerResponseModel customer;
+
+ Future> getAllCategories(OffersCategoriesRequestModel request) async {
+ Future errorThrow;
- Future> getAllCategories(OffersCategoriesRequestModel request) async {
- hasError = false;
var url = EXA_CART_API_BASE_URL + PACKAGES_CATEGORIES;
await baseAppClient.simpleGet(url, onSuccess: (dynamic stringResponse, int statusCode) {
if (statusCode == 200) {
var jsonResponse = json.decode(stringResponse);
jsonResponse['categories'].forEach((json) {
- categoryList.add(OfferCategoriesResponseModel().fromJson(json));
+ categoryList.add(PackagesCategoriesResponseModel().fromJson(json));
});
}
}, onFailure: (String error, int statusCode) {
@@ -31,15 +46,18 @@ class OffersAndPackagesServices extends BaseService {
return categoryList;
}
- List productList = List();
- Future> getAllProducts(OffersProductsRequestModel request) async {
- hasError = false;
+ Future> getAllProducts({@required OffersProductsRequestModel request, @required BuildContext context, @required bool showLoading = true}) async {
+ Future errorThrow;
+
+ request.sinceId = (productList.isNotEmpty) ? productList.last.id : 0;
+
+ productList = List();
var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS;
await baseAppClient.simpleGet(url, onSuccess: (dynamic stringResponse, int statusCode) {
if (statusCode == 200) {
var jsonResponse = json.decode(stringResponse);
jsonResponse['products'].forEach((json) {
- productList.add(OfferProductsResponseModel().fromJson(json));
+ productList.add(PackagesResponseModel().fromJson(json));
});
}
}, onFailure: (String error, int statusCode) {
@@ -48,4 +66,241 @@ class OffersAndPackagesServices extends BaseService {
return productList;
}
+
+ Future> getLatestOffers({@required OffersProductsRequestModel request, @required BuildContext context, @required bool showLoading = true}) async {
+
+ var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS;
+ await baseAppClient.simpleGet(url, onSuccess: (dynamic stringResponse, int statusCode) {
+ if (statusCode == 200) {
+ var jsonResponse = json.decode(stringResponse);
+ jsonResponse['products'].forEach((json) {
+ latestOffersList.add(PackagesResponseModel().fromJson(json));
+ });
+ }
+ }, onFailure: (String error, int statusCode) {
+ log(error);
+ }, queryParams: request.toFlatMap());
+
+ return latestOffersList;
+ }
+
+ Future> getBestSellers({@required OffersProductsRequestModel request, @required BuildContext context, @required bool showLoading = true}) async {
+
+ var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS;
+ await baseAppClient.simpleGet(url, onSuccess: (dynamic stringResponse, int statusCode) {
+ if (statusCode == 200) {
+ var jsonResponse = json.decode(stringResponse);
+ jsonResponse['products'].forEach((json) {
+ bestSellerList.add(PackagesResponseModel().fromJson(json));
+ });
+ }
+ }, onFailure: (String error, int statusCode) {
+ log(error);
+ }, queryParams: request.toFlatMap());
+
+ return bestSellerList;
+ }
+
+
+ Future> getBanners({@required OffersProductsRequestModel request, @required BuildContext context, @required bool showLoading = true}) async {
+ var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS;
+ await baseAppClient.simpleGet(url, onSuccess: (dynamic stringResponse, int statusCode) {
+ if (statusCode == 200) {
+ var jsonResponse = json.decode(stringResponse);
+ jsonResponse['products'].forEach((json) {
+ bannersList.add(PackagesResponseModel().fromJson(json));
+ });
+ }
+ }, onFailure: (String error, int statusCode) {
+ log(error);
+ }, queryParams: request.toFlatMap());
+
+ return bannersList;
+ }
+
+ Future loadOffersPackagesDataForMainPage({@required BuildContext context, bool showLoading = true, Function completion }) async {
+ var finished = 0;
+ var totalCalls = 3;
+
+ completedAll(){
+
+ finished++;
+ if(completion != null && finished == totalCalls) {
+ _hideLoading(context, showLoading);
+ completion();
+ }
+ }
+
+ _showLoading(context, showLoading);
+
+ // Performing Parallel Request on same time
+ // # 1
+ getBestSellers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){
+ completedAll();
+ });
+
+ // # 2
+ getLatestOffers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){
+ completedAll();
+ });
+
+ // # 3
+ getBanners(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){
+ completedAll();
+ });
+
+ }
+
+ // --------------------
+ // Create Customer
+ // --------------------
+ Future createCustomer(PackagesCustomerRequestModel request, {@required BuildContext context, bool showLoading = true, Function(bool) completion }) async{
+ if(customer != null)
+ return Future.value(customer);
+
+ hasError = false;
+ var url = EXA_CART_API_BASE_URL + PACKAGES_CUSTOMER;
+
+ customer = null;
+ _showLoading(context, showLoading);
+ await baseAppClient.simplePost(url, body: request.json(), onSuccess: (dynamic stringResponse, int statusCode){
+ _hideLoading(context, showLoading);
+
+ var jsonResponse = json.decode(stringResponse);
+ var customerJson = jsonResponse['customers'].first;
+ customer = PackagesCustomerResponseModel.fromJson(customerJson);
+
+ }, onFailure: (String error, int statusCode){
+ _hideLoading(context, showLoading);
+ log(error);
+ });
+
+ return customer;
+ }
+
+
+
+ // --------------------
+ // Shopping Cart
+ // --------------------
+ Future> cartItems({@required BuildContext context, bool showLoading = true}) async{
+ Future errorThrow;
+
+ cartItemList.clear();
+ _showLoading(context, showLoading);
+ var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART + '/${customer.id}';
+ await baseAppClient.simpleGet(url, onSuccess: (dynamic stringResponse, int statusCode) {
+ _hideLoading(context, showLoading);
+
+ var jsonResponse = json.decode(stringResponse);
+ jsonResponse['shopping_carts'].forEach((json) {
+ cartItemList.add(CartProductResponseModel.fromJson(json));
+ });
+
+ }, onFailure: (String error, int statusCode) {
+ _hideLoading(context, showLoading);
+ log(error);
+ errorThrow = Future.error({"error":error, "statusCode":statusCode});
+ }, queryParams: null);
+
+ return errorThrow ?? cartItemList;
+ }
+
+ Future addProductToCart(AddProductToCartRequestModel request, {@required BuildContext context, bool showLoading = true}) async{
+ Future errorThrow;
+
+ request.customer_id = customer.id;
+
+ _showLoading(context, showLoading);
+ var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART;
+ await baseAppClient.simplePost(url, body: request.json(), onSuccess: (dynamic stringResponse, int statusCode){
+ _hideLoading(context, showLoading);
+
+ var jsonResponse = json.decode(stringResponse);
+
+ }, onFailure: (String error, int statusCode){
+ _hideLoading(context, showLoading);
+ log(error);
+ errorThrow = Future.error(error);
+ });
+
+ return errorThrow ?? true;
+ }
+
+ Future updateProductToCart(int cartItemID, {UpdateProductToCartRequestModel request, @required BuildContext context, bool showLoading = true}) async{
+ Future errorThrow;
+
+ _showLoading(context, showLoading);
+ var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART + '/$cartItemID';
+ await baseAppClient.simplePut(url, body: request.json(), onSuccess: (dynamic stringResponse, int statusCode){
+ _hideLoading(context, showLoading);
+
+ var jsonResponse = json.decode(stringResponse);
+
+ }, onFailure: (String error, int statusCode){
+ _hideLoading(context, showLoading);
+ log(error);
+ errorThrow = Future.error({"error":error, "statusCode":statusCode});
+ });
+
+ return errorThrow ?? bannersList;
+ }
+
+
+ Future deleteProductFromCart(int cartItemID, {@required BuildContext context, bool showLoading = true}) async{
+ Future errorThrow;
+
+ _showLoading(context, showLoading);
+ var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART + '/$cartItemID';
+ await baseAppClient.simpleDelete(url, onSuccess: (dynamic stringResponse, int statusCode){
+ _hideLoading(context, showLoading);
+ // var jsonResponse = json.decode(stringResponse);
+
+ }, onFailure: (String error, int statusCode){
+ _hideLoading(context, showLoading);
+ log(error);
+ errorThrow = Future.error({"error":error, "statusCode":statusCode});
+ });
+
+ return errorThrow ?? true;
+ }
+
+ // --------------------
+ // Place Order
+ // --------------------
+ Future placeOrder({@required BuildContext context, bool showLoading = true}) async{
+ Future errorThrow;
+
+ var jsonBody = {
+ "order": {
+ "customer_id" : customer.id
+ }
+ };
+
+ _showLoading(context, showLoading);
+ var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART;
+ await baseAppClient.simplePost(url, body: jsonBody, onSuccess: (dynamic stringResponse, int statusCode){
+ _hideLoading(context, showLoading);
+
+ var jsonResponse = json.decode(stringResponse);
+
+ }, onFailure: (String error, int statusCode){
+ _hideLoading(context, showLoading);
+ log(error);
+ errorThrow = Future.error(error);
+ });
+
+ return errorThrow ?? true;
+ }
+
}
+
+_showLoading(BuildContext context, bool flag){
+ if(flag)
+ GifLoaderDialogUtils.showMyDialog(context);
+}
+
+_hideLoading(BuildContext context, bool flag){
+ if(flag)
+ GifLoaderDialogUtils.hideDialog(context);
+}
\ No newline at end of file
diff --git a/lib/core/viewModels/packages_offers/PackagesOffersViewModel.dart b/lib/core/viewModels/packages_offers/PackagesOffersViewModel.dart
index 21df52bc..83e104dc 100644
--- a/lib/core/viewModels/packages_offers/PackagesOffersViewModel.dart
+++ b/lib/core/viewModels/packages_offers/PackagesOffersViewModel.dart
@@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
-import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart';
-import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferProductsResponseModel.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCartItemsResponseModel.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesResponseModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/service/packages_offers/PackagesOffersServices.dart';
@@ -10,10 +11,16 @@ import 'package:diplomaticquarterapp/locator.dart';
class OfferCategoriesViewModel extends BaseViewModel {
OffersAndPackagesServices service = locator();
- List get list => service.categoryList;
+ get categoryList => service.categoryList;
+ get productList => service.categoryList;
}
-class OfferProductsViewModel extends BaseViewModel {
+class PackagesViewModel extends BaseViewModel {
OffersAndPackagesServices service = locator();
- List get list => service.productList;
+ List get categoryList => service.categoryList;
+ List get productList => service.productList;
+ List get latestOffersList => service.latestOffersList;
+ List get bestSellerList => service.bestSellerList;
+ List get bannersList => service.bannersList;
+ List get cartItemList => service.cartItemList;
}
diff --git a/lib/generated/json/OfferCategoriesResponseModel_helper.dart b/lib/generated/json/OfferCategoriesResponseModel_helper.dart
index e5ebc914..1a28d179 100644
--- a/lib/generated/json/OfferCategoriesResponseModel_helper.dart
+++ b/lib/generated/json/OfferCategoriesResponseModel_helper.dart
@@ -1,8 +1,8 @@
-import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart';
-offerCategoriesResponseModelFromJson(OfferCategoriesResponseModel data, Map json) {
+offerCategoriesResponseModelFromJson(PackagesCategoriesResponseModel data, Map json) {
if (json['id'] != null) {
- data.id = json['id']?.toString();
+ data.id = json['id'];
}
if (json['name'] != null) {
data.name = json['name']?.toString();
@@ -91,7 +91,7 @@ offerCategoriesResponseModelFromJson(OfferCategoriesResponseModel data, Map offerCategoriesResponseModelToJson(OfferCategoriesResponseModel entity) {
+Map offerCategoriesResponseModelToJson(PackagesCategoriesResponseModel entity) {
final Map data = new Map();
data['id'] = entity.id;
data['name'] = entity.name;
diff --git a/lib/generated/json/OfferProductsResponseModel_helper.dart b/lib/generated/json/OfferProductsResponseModel_helper.dart
index dc0edeca..d180af67 100644
--- a/lib/generated/json/OfferProductsResponseModel_helper.dart
+++ b/lib/generated/json/OfferProductsResponseModel_helper.dart
@@ -1,8 +1,8 @@
-import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferProductsResponseModel.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesResponseModel.dart';
-offerProductsResponseModelFromJson(OfferProductsResponseModel data, Map json) {
+offerProductsResponseModelFromJson(PackagesResponseModel data, Map json) {
if (json['id'] != null) {
- data.id = json['id']?.toString();
+ data.id = json['id'];
}
if (json['visible_individually'] != null) {
data.visibleIndividually = json['visible_individually'];
@@ -353,7 +353,7 @@ offerProductsResponseModelFromJson(OfferProductsResponseModel data, Map offerProductsResponseModelToJson(OfferProductsResponseModel entity) {
+Map offerProductsResponseModelToJson(PackagesResponseModel entity) {
final Map data = new Map();
data['id'] = entity.id;
data['visible_individually'] = entity.visibleIndividually;
diff --git a/lib/generated/json/base/json_convert_content.dart b/lib/generated/json/base/json_convert_content.dart
index 9fab946e..ae4eadeb 100644
--- a/lib/generated/json/base/json_convert_content.dart
+++ b/lib/generated/json/base/json_convert_content.dart
@@ -3,11 +3,11 @@
// ignore_for_file: prefer_single_quotes
// This file is automatically generated. DO NOT EDIT, all your changes would be lost.
-import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart';
import 'package:diplomaticquarterapp/generated/json/OfferCategoriesResponseModel_helper.dart';
import 'package:diplomaticquarterapp/core/model/geofencing/responses/LogGeoZoneResponseModel.dart';
import 'package:diplomaticquarterapp/generated/json/log_geo_zone_response_model_entity_helper.dart';
-import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferProductsResponseModel.dart';
+import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesResponseModel.dart';
import 'package:diplomaticquarterapp/generated/json/OfferProductsResponseModel_helper.dart';
import 'package:diplomaticquarterapp/core/model/geofencing/responses/GeoZonesResponseModel.dart';
import 'package:diplomaticquarterapp/generated/json/GeoZonesResponseModel_helper.dart';
@@ -23,16 +23,16 @@ class JsonConvert {
static _getFromJson(Type type, data, json) {
switch (type) {
- case OfferCategoriesResponseModel:
- return offerCategoriesResponseModelFromJson(data as OfferCategoriesResponseModel, json) as T;
+ case PackagesCategoriesResponseModel:
+ return offerCategoriesResponseModelFromJson(data as PackagesCategoriesResponseModel, json) as T;
case OfferCategoriesResponseModelLocalizedName:
return offerCategoriesResponseModelLocalizedNameFromJson(data as OfferCategoriesResponseModelLocalizedName, json) as T;
case OfferCategoriesResponseModelImage:
return offerCategoriesResponseModelImageFromJson(data as OfferCategoriesResponseModelImage, json) as T;
case LogGeoZoneResponseModel:
return logGeoZoneResponseModelEntityFromJson(data as LogGeoZoneResponseModel, json) as T;
- case OfferProductsResponseModel:
- return offerProductsResponseModelFromJson(data as OfferProductsResponseModel, json) as T;
+ case PackagesResponseModel:
+ return offerProductsResponseModelFromJson(data as PackagesResponseModel, json) as T;
case OfferProductsResponseModelLocalizedName:
return offerProductsResponseModelLocalizedNameFromJson(data as OfferProductsResponseModelLocalizedName, json) as T;
case OfferProductsResponseModelImage:
@@ -47,16 +47,16 @@ class JsonConvert {
static _getToJson(Type type, data) {
switch (type) {
- case OfferCategoriesResponseModel:
- return offerCategoriesResponseModelToJson(data as OfferCategoriesResponseModel);
+ case PackagesCategoriesResponseModel:
+ return offerCategoriesResponseModelToJson(data as PackagesCategoriesResponseModel);
case OfferCategoriesResponseModelLocalizedName:
return offerCategoriesResponseModelLocalizedNameToJson(data as OfferCategoriesResponseModelLocalizedName);
case OfferCategoriesResponseModelImage:
return offerCategoriesResponseModelImageToJson(data as OfferCategoriesResponseModelImage);
case LogGeoZoneResponseModel:
return logGeoZoneResponseModelEntityToJson(data as LogGeoZoneResponseModel);
- case OfferProductsResponseModel:
- return offerProductsResponseModelToJson(data as OfferProductsResponseModel);
+ case PackagesResponseModel:
+ return offerProductsResponseModelToJson(data as PackagesResponseModel);
case OfferProductsResponseModelLocalizedName:
return offerProductsResponseModelLocalizedNameToJson(data as OfferProductsResponseModelLocalizedName);
case OfferProductsResponseModelImage:
@@ -72,16 +72,16 @@ class JsonConvert {
//Go back to a single instance by type
static _fromJsonSingle(json) {
String type = M.toString();
- if (type == (OfferCategoriesResponseModel).toString()) {
- return OfferCategoriesResponseModel().fromJson(json);
+ if (type == (PackagesCategoriesResponseModel).toString()) {
+ return PackagesCategoriesResponseModel().fromJson(json);
} else if (type == (OfferCategoriesResponseModelLocalizedName).toString()) {
return OfferCategoriesResponseModelLocalizedName().fromJson(json);
} else if (type == (OfferCategoriesResponseModelImage).toString()) {
return OfferCategoriesResponseModelImage().fromJson(json);
} else if (type == (LogGeoZoneResponseModel).toString()) {
return LogGeoZoneResponseModel().fromJson(json);
- } else if (type == (OfferProductsResponseModel).toString()) {
- return OfferProductsResponseModel().fromJson(json);
+ } else if (type == (PackagesResponseModel).toString()) {
+ return PackagesResponseModel().fromJson(json);
} else if (type == (OfferProductsResponseModelLocalizedName).toString()) {
return OfferProductsResponseModelLocalizedName().fromJson(json);
} else if (type == (OfferProductsResponseModelImage).toString()) {
@@ -96,16 +96,16 @@ class JsonConvert {
//list is returned by type
static M _getListChildType(List