Merge branch 'development' into pharmacy-Fatima

# Conflicts:
#	lib/pages/pharmacy_categorise.dart
merge-update-with-lab-changes
Fatimah Alshammari 5 years ago
commit bb622f248c

1
.gitignore vendored

@ -25,6 +25,7 @@
.dart_tool/
.flutter-plugins
pubspec.lock
/ios/Podfile.lock
.flutter-plugins-dependencies
.packages
.pub-cache/

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r</string>
<key>API_KEY</key>
<string>AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs</string>
<key>GCM_SENDER_ID</key>
<string>864393916058</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.cloud.diplomaticquarterapp</string>
<key>PROJECT_ID</key>
<string>diplomaticquarter-d2385</string>
<key>STORAGE_BUCKET</key>
<string>diplomaticquarter-d2385.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:864393916058:ios:13f787bbfe6051f8b97923</string>
<key>DATABASE_URL</key>
<string>https://diplomaticquarter-d2385.firebaseio.com</string>
</dict>
</plist>

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt</string>
<key>ANDROID_CLIENT_ID</key>
<string>815750722565-m14h8mkosm7cnq6uh6rhqr54dn02d705.apps.googleusercontent.com</string>
<key>API_KEY</key>
<string>AIzaSyDiXnCO00li4V7Ioa2YZ_M4ECxRsu_P9tA</string>
<key>GCM_SENDER_ID</key>
<string>815750722565</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.HMG.Smartphone</string>
<key>PROJECT_ID</key>
<string>api-project-815750722565</string>
<key>STORAGE_BUCKET</key>
<string>api-project-815750722565.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:815750722565:ios:328ec247a81a2ca23c186c</string>
<key>DATABASE_URL</key>
<string>https://api-project-815750722565.firebaseio.com</string>
</dict>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

@ -0,0 +1,37 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 299.19 299.19">
<defs>
<style>
.cls-1 {
fill: #a02228;
}
.cls-2 {
fill: #c42829;
}
.cls-3, .cls-4 {
fill: #fff;
}
.cls-4 {
font-size: 63.99px;
font-family: GESSTwoMedium-Medium, GE SS Two;
font-weight: 500;
}
</style>
</defs>
<g id="Layer_2" data-name="Layer 2">
<g id="Layer_1-2" data-name="Layer 1">
<g>
<rect class="cls-1" x="154.78" width="144.13" height="42.56"/>
<rect class="cls-1" y="154.77" width="42.56" height="144.13"/>
<polygon class="cls-2" points="0 154.31 154.31 0 299.19 0 0 299.19 0 154.31"/>
<g>
<polygon class="cls-2" points="14.51 160.32 160.32 14.51 264.16 14.51 14.51 264.16 14.51 160.32"/>
<path class="cls-3" d="M259.49,16.44l-243,243.05V161.12L161.12,16.44Zm9.34-3.86H159.52L12.58,159.52V268.83L268.83,12.58Z"/>
</g>
<text class="cls-4" transform="translate(64.37 181.67) rotate(-45)">مصخ</text>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 312.6 292.7" style="enable-background:new 0 0 312.6 292.7;" xml:space="preserve">
<style type="text/css">
.st0{fill:#A02228;}
.st1{fill:#C42829;}
.st2{fill:#FFFFFF;}
</style>
<g id="Layer_2_1_">
<g id="Layer_1-2">
<g>
<rect x="152.5" y="1" class="st0" width="141.2" height="41.7"/>
<rect x="0.9" y="152.6" class="st0" width="41.7" height="141.2"/>
<polygon class="st1" points="0.9,152.2 152.1,1 294,1 0.9,294.1 "/>
<g>
<polygon class="st1" points="15.1,158.1 158,15.2 259.7,15.2 15.1,259.8 "/>
<path class="st2" d="M255.1,17.1l-238,238.1v-96.4L158.7,17.1H255.1z M264.3,13.3H157.2L13.2,157.3v107.1
C13.2,264.4,264.3,13.3,264.3,13.3z"/>
</g>
<g>
<path class="st2" d="M30.9,176.1l7.3-7.3c6.3-6.3,13.6-6.2,19.3-0.5c5.3,5.3,5.4,12.8-0.7,18.9l-7.4,7.4L30.9,176.1z
M49.9,186.6l3-3c3.8-3.8,3.6-7.8,0.4-11c-3.5-3.5-7.5-3.6-11.4,0.3l-2.9,2.9L49.9,186.6z"/>
<path class="st2" d="M50.8,156.2L55,152l18.5,18.5l-4.2,4.2L50.8,156.2z"/>
<path class="st2" d="M67.9,149.1c1.4,1.4,3.5,0.6,6.3-1.4c5.6-3.8,8.9-4.5,12.4-1c3.3,3.3,2.8,8.5-1.9,13.2
c-1.8,1.8-4,3.2-6.5,3.9c-2.6,0.7-5.4,0.4-7.8-0.8l1.3-5.8c3,1.9,7,1.4,9.4-1.2c2-1.9,2.5-3.8,1.4-5c-1.1-1.1-2.7-1.1-6.5,1.7
c-4.5,3.4-8.9,4.1-12.4,0.6c-2.9-2.9-2.6-7.9,1.6-12.1c3.5-3.5,7.7-4.5,11.8-2.5l-1.5,5.4c-2.8-1.4-4.9-1.2-6.9,0.8
C67.2,146.4,67,148.2,67.9,149.1z"/>
<path class="st2" d="M99.9,137c3.1-3.1,3-7,0.5-10.8l5.4-2.3c3.5,5.6,2.9,11.9-2.2,16.9c-5.9,5.9-13.8,5.6-19.2,0.2
c-5.3-5.1-5.4-13.6-0.2-18.8c0.1-0.1,0.3-0.3,0.4-0.4c4.9-4.9,10.7-5.3,14.9-2.6l-2.1,5.6c-2.8-2-6.7-1.6-9.1,0.9
c-2.9,2.9-3.1,7.6,0.3,11.1c2.8,3.1,7.7,3.4,10.8,0.6C99.7,137.2,99.8,137.1,99.9,137z"/>
<path class="st2" d="M125.2,100.4c5.3,5.1,5.2,14.1-0.3,19.3c-5.2,5.4-14.3,5.5-19.3,0.3c-5.3-5.1-5.2-14.1,0.3-19.3
C111.1,95.2,120.1,95.1,125.2,100.4z M120.9,104.6c-3.1-3.1-8-3-11.1,0c-3.1,3.1-3,8,0,11.1c3.1,3,8,3,11,0
c3.2-2.6,4-7.1,1.3-10.3C121.9,105,121.6,104.6,120.9,104.6z"/>
<path class="st2" d="M122.7,84.3l11,11c2.4,2.4,5.2,2.7,7.5,0.4c2.3-2.3,2-5.1-0.4-7.5l-11-11L134,73l11,11
c4.8,4.8,4.8,10.8,0,15.6c-4.8,4.8-10.9,4.8-15.6,0l-11-11L122.7,84.3z"/>
<path class="st2" d="M160,84l-4.2,4.2l-18.5-18.5l7.2-7.2l22.5,8.9l-15.7-15.7l4.2-4.2L174.1,70l-7.2,7.2l-22.5-8.9L160,84z"/>
<path class="st2" d="M178.6,36.1l-6.3,6.3l14.7,14.7l-4.2,4.2L168,46.7l-6.4,6.4l-3.8-3.8l16.9-16.9L178.6,36.1z"/>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -1,3 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="312.602" height="292.689" viewBox="0 0 312.602 292.689">
<defs>
<radialGradient id="radial-gradient" cx="0.236" cy="0.508" r="0.361" gradientTransform="matrix(4.725, 0.181, -0.871, 0.983, -15.148, -0.89)" gradientUnits="objectBoundingBox">

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

@ -1 +1 @@
59a6c452ee075b50114918f17f1ad8f5
45a7d43b55124e1b314759554f9a14d3

@ -1,9 +1,235 @@
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
@ -15,8 +241,47 @@ PODS:
- 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)
@ -39,6 +304,18 @@ PODS:
- 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)
@ -70,7 +347,10 @@ PODS:
- Flutter
- flutter_tts (0.0.1):
- Flutter
- geolocator (6.1.9):
- 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
@ -99,6 +379,30 @@ PODS:
- 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):
@ -108,6 +412,7 @@ PODS:
- Flutter
- just_audio (0.0.1):
- Flutter
- leveldb-library (1.22)
- local_auth (0.0.1):
- Flutter
- location (0.0.1):
@ -126,8 +431,6 @@ PODS:
- nanopb/encode (1.30906.0)
- native_device_orientation (0.0.1):
- Flutter
- native_progress_hud (0.0.1):
- Flutter
- NVActivityIndicatorView (5.1.1):
- NVActivityIndicatorView/Base (= 5.1.1)
- NVActivityIndicatorView/Base (5.1.1)
@ -139,13 +442,16 @@ PODS:
- Flutter
- path_provider_windows (0.0.1):
- Flutter
- "permission_handler (5.0.1+1)":
- "permission_handler (5.1.0+2)":
- Flutter
- PromisesObjC (1.2.11)
- Protobuf (3.13.0)
- 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):
@ -156,9 +462,15 @@ PODS:
- Flutter
- shared_preferences_windows (0.0.1):
- Flutter
- sms_otp_auto_verify (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)":
@ -193,11 +505,15 @@ PODS:
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`)
@ -220,7 +536,6 @@ DEPENDENCIES:
- 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`)
- native_progress_hud (from `.symlinks/plugins/native_progress_hud/ios`)
- NVActivityIndicatorView
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
@ -233,7 +548,9 @@ DEPENDENCIES:
- 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`)
- sms_otp_auto_verify (from `.symlinks/plugins/sms_otp_auto_verify/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`)
@ -250,21 +567,32 @@ DEPENDENCIES:
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
@ -274,6 +602,10 @@ EXTERNAL SOURCES:
: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:
@ -284,6 +616,10 @@ EXTERNAL SOURCES:
: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:
@ -328,8 +664,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/maps_launcher/ios"
native_device_orientation:
:path: ".symlinks/plugins/native_device_orientation/ios"
native_progress_hud:
:path: ".symlinks/plugins/native_progress_hud/ios"
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
path_provider_linux:
@ -352,8 +686,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/shared_preferences_web/ios"
shared_preferences_windows:
:path: ".symlinks/plugins/shared_preferences_windows/ios"
sms_otp_auto_verify:
:path: ".symlinks/plugins/sms_otp_auto_verify/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:
@ -382,19 +720,28 @@ EXTERNAL SOURCES:
: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
@ -405,15 +752,19 @@ SPEC CHECKSUMS:
flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186
flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
geolocator: 057a0c63a43e9c5296d8ad845a3ac8e6df23d899
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
@ -422,23 +773,26 @@ SPEC CHECKSUMS:
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
native_device_orientation: e24d00be281de72996640885d80e706142707660
native_progress_hud: f95f5529742b36a3c7fdecfa88dc018319e39bf9
NVActivityIndicatorView: 1f6c5687f1171810aa27a3296814dc2d7dec3667
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6
PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f
Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748
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
sms_otp_auto_verify: 201803ac25e13feedaae96eda8b70b10c55b3338
speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
SwiftyGif: 5d4af95df24caf1c570dbbcb32a3b8a0763bc6d7
TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
twilio_programmable_video: 6a41593640f3d86af60b22541fd457b22deaae7f
@ -456,6 +810,6 @@ SPEC CHECKSUMS:
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
wifi: d7d77c94109e36c4175d845f0a5964eadba71060
PODFILE CHECKSUM: 5a17be3f8af73a757fa4439c77cf6ab2db29a6e7
PODFILE CHECKSUM: ac5efa1ac3c9555d0008dc18004313c84746da62
COCOAPODS: 1.10.0
COCOAPODS: 1.10.1

@ -220,6 +220,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
EFDAD5E1235DCA1DB6187148 /* [CP] Embed Pods Frameworks */,
A22727229BC544AD6D5B2B5F /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@ -333,6 +334,23 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
A22727229BC544AD6D5B2B5F /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
EFDAD5E1235DCA1DB6187148 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;

@ -11,7 +11,7 @@ var userNotificationCenterDelegate:UNUserNotificationCenterDelegate? = nil
override func application( _ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8")
GMSServices.provideAPIKey("AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw")
GeneratedPluginRegistrant.register(with: self)
initializePlatformChannel()

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt</string>
<key>ANDROID_CLIENT_ID</key>
<string>815750722565-m14h8mkosm7cnq6uh6rhqr54dn02d705.apps.googleusercontent.com</string>
<key>API_KEY</key>
<string>AIzaSyDiXnCO00li4V7Ioa2YZ_M4ECxRsu_P9tA</string>
<key>GCM_SENDER_ID</key>
<string>815750722565</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.HMG.HMG-Smartphone</string>
<key>PROJECT_ID</key>
<string>api-project-815750722565</string>
<key>STORAGE_BUCKET</key>
<string>api-project-815750722565.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:815750722565:ios:328ec247a81a2ca23c186c</string>
<key>DATABASE_URL</key>
<string>https://api-project-815750722565.firebaseio.com</string>
</dict>
</plist>

BIN
key

Binary file not shown.

@ -1,23 +1,29 @@
import 'dart:io';
import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
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_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/';
//const BASE_URL = 'https://.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
//const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/';
// Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// Pharmacy Production URLs
// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
@ -25,6 +31,10 @@ const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
///Geofencing
const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints';
const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo';
// Delivery Driver
const DRIVER_LOCATION = 'Services/Patients.svc/REST/PatientER_GetDriverLocation';
//weather
const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
@ -92,9 +102,12 @@ const GET_NEAREST_HOSPITAL =
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///ED Online
const ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions";
const ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation";
const ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic";
const ER_GET_VISUAL_TRIAGE_QUESTIONS =
"services/Doctors.svc/REST/ER_GetVisualTriageQuestions";
const ER_SAVE_TRIAGE_INFORMATION =
"services/Doctors.svc/REST/ER_SaveTriageInformation";
const ER_GetPatientPaymentInformationForERClinic =
"services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic";
///Er Nearest
const GET_AMBULANCE_REQUEST =
@ -207,6 +220,10 @@ const GET_PATIENT_SHARE =
const GET_PATIENT_APPOINTMENT_HISTORY =
"Services/Doctors.svc/REST/PateintHasAppoimentHistory";
const SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail";
const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail";
//URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
"Services/Doctors.svc/REST/AppoimentHistoryForCurfew";
@ -309,7 +326,7 @@ var DEVICE_TOKEN = "";
var IS_VOICE_COMMAND_CLOSED = false;
var IS_TEXT_COMPLETED = false;
var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 1;
const LANGUAGE_ID = 2;
const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region";
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
const GET_PAtIENTS_INSURANCE =
@ -445,11 +462,14 @@ const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
const GET_ANCILLARY_ORDERS =
'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList';
const GET_ANCILLARY_ORDERS_DETAILS =
'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList';
//Pharmacy wishlist
// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
// pharmacy
const PHARMACY_AUTORZIE_CUSTOMER = "epharmacy/api/AutorizeCustomer";
const PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer";
const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer";
const PHARMACY_GET_COUNTRY = "countries";
const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer";
@ -470,9 +490,9 @@ const GET_Cancel_ORDER = "cancelorder/";
const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8";
const GET_SHOPPING_CART = "shopping_cart_items/";
const GET_SHIPPING_OPTIONS = "get_shipping_option/";
const DELETE_SHOPPING_CART = "epharmacy/api/delete_shopping_cart_items/";
const DELETE_SHOPPING_CART = "delete_shopping_cart_items/";
const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/";
const ORDER_SHOPPING_CART = "epharmacy/api/orders";
const ORDER_SHOPPING_CART = "orders";
const GET_LACUM_ACCOUNT_INFORMATION =
"Services/Patients.svc/REST/GetLakumAccountInformation";
const GET_LACUM_GROUP_INFORMATION =
@ -489,6 +509,8 @@ const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
const GET_MOST_VIEWED_PRODUCTS ="mostview?";
const GET_NEW_PRODUCTS = "newproducts?";
// Home Health Care
const HHC_GET_ALL_SERVICES =
@ -528,12 +550,9 @@ const GET_SPECIFICATION = "productspecification/";
const GET_BRAND_ITEMS = "products";
// External API
const ADD_ADDRESS_INFO =
"https://mdlaboratories.com/exacartapi/api/addcustomeraddress";
const GET_CUSTOMER_ADDRESSES =
"https://mdlaboratories.com/exacartapi/api/Customers/";
const GET_CUSTOMER_INFO =
"https://mdlaboratories.com/exacartapi/api/VerifyCustomer";
const ADD_ADDRESS_INFO = "addcustomeraddress";
const GET_CUSTOMER_ADDRESSES = "Customers/";
const GET_CUSTOMER_INFO = "VerifyCustomer";
//Pharmacy

@ -365,7 +365,7 @@ const Map localizedValues = {
'painScale': {'en': 'Pain Scale', 'ar': 'مقياس الألم'},
'weight': {'en': 'Weight', 'ar': 'الوزن'},
'height': {'en': 'Height', 'ar': 'الطول'},
'heart': {'en': 'Heart', 'ar': 'قلب'},
'heart': {'en': 'Heart Rate', 'ar': 'معدل النبض'},
"heightUnit": {"en": "height unit", "ar": "وحدة الطول"},
"weightUnit": {"en": "Weight Unit", "ar": "وحدة الوزن"},
"request": {"en": "Request", "ar": "طلبات الاضافة"},
@ -546,6 +546,9 @@ const Map localizedValues = {
"History": {"en": "History", "ar": "السجلات"},
"OrderNo": {"en": "Order No", "ar": "رقم الطلب"},
"OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"},
"DeliveryDriverTrack": {"en": "Driver Tracking", "ar": "تتبع السائق"},
"DeliveryLocation": {"en": "Delivery Location", "ar": "موقع التسليم"},
"Driver": {"en": "Driver", "ar": "السائق"},
"VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"},
"MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"},
"km": {"en": "KMs:", "ar": "كم"},
@ -643,8 +646,8 @@ const Map localizedValues = {
"Remarks": {"en": "Remarks", "ar": "ملاحضات"},
"ActiveMedications": {"en": "Active Medications", "ar": "ادويتي النشطة"},
"ExpDate": {"en": "Active Exp Date :", "VA": "تاريخ الإنتهاء"},
"Route": {"en": "Route :", "ar": "الطريقة"},
"Frequency": {"en": "Frequency :", "ar": "المعدل"},
"Route": {"en": "Route", "ar": "الطريقة"},
"Frequency": {"en": "Frequency", "ar": "المعدل"},
"DailyQuantity": {"en": "Daily Quantity :", "ar": "جرعات يومية"},
"AddReminder": {"en": "Add Reminder", "ar": "إضافة تذكير"},
"reminderDes": {
@ -836,6 +839,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": "تغيير العنوان"},
@ -1084,6 +1088,7 @@ const Map localizedValues = {
"Average": {"en": "Average", "ar": "المعدل"},
"DailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"},
"Period": {"en": "Period", "ar": "الفترة"},
"duration": {"en": "Duration", "ar": "المدة"},
"cm": {"en": "CM", "ar": "سم"},
"ft": {"en": "ft", "ar": "قدم"},
"kg": {"en": "kg", "ar": "كجم"},
@ -1159,7 +1164,7 @@ const Map localizedValues = {
"ar": "Connected with HMG Network,\n\nBut failed to access HMG services"
},
"offerAndPackages": {"en": "Offers And Packages", "ar": "العروض والباقات"},
"InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"},
"InvoiceNo": {"en": "Invoice No", "ar": "رقم الفاتورة"},
"SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"},
"GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"},
"show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"},
@ -1652,7 +1657,10 @@ const Map localizedValues = {
"enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"},
"result": {"en": "Result", "ar": "النتيجة"},
"sort": {"en": "Sort", "ar": "فرز"},
"bloodSugarConversion": {"en": "Blood Sugar Conversion", "ar": "السكر في الدم"},
"bloodSugarConversion": {
"en": "Blood Sugar Conversion",
"ar": "السكر في الدم"
},
"convertBloodSugarStatement": {
"en":
"Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.",
@ -1954,13 +1962,38 @@ const Map localizedValues = {
},
"order-overview": {"en": "Order Overview", "ar": "ملخص الطلب"},
"shipping-address": {"en": "Delivery Address", "ar": "عنوان التوصيل"},
"ancillary-orders": {"en": "Ancillary Orders", "ar": "الأوامر التبعية"},
"pharmacy-relogin": {
"en": "Your session has timed out, Please try again",
"ar": "انتهت مهلة جلسة الخاص بها. يرجى المحاولة مرة أخرى"
},
"ancillary-orders": {"en": "Ancillary Orders", "ar": "الأوامر التبعية"},
"onlineCheckInAgreement": {"en": "The online check-in is for non-life threatening situationCall the red crescent (number) or go to the nearest emergency department if there are:signs of stroke or heart attack history of seizure or syncope there is limb or life threatening injury picture of severe injuries",
"ar": "تسجيل الذهاب الى الطوارئ عبر الإنترنت هو فقط للحالات  التي لا تهدد الحياة يجب الاتصل بالهلال الأحمر (رقم) أو الذهاب إلى أقرب قسم طوارئ إذا كان هناك علامات السكتة الدماغية أو النوبة القلبية او هناك نوبة تشنج او حالة فقدان الوعي او وجود إصابة تهدد أحد الأطراف او تهدد الحياة او وجود إصابات خطيرة"},
"onlineCheckInAgreement": {
"en":
"The online check-in is for non-life threatening situationCall the red crescent (number) or go to the nearest emergency department if there are:signs of stroke or heart attack history of seizure or syncope there is limb or life threatening injury picture of severe injuries",
"ar":
"تسجيل الذهاب الى الطوارئ عبر الإنترنت هو فقط للحالات  التي لا تهدد الحياة يجب الاتصل بالهلال الأحمر (رقم) أو الذهاب إلى أقرب قسم طوارئ إذا كان هناك علامات السكتة الدماغية أو النوبة القلبية او هناك نوبة تشنج او حالة فقدان الوعي او وجود إصابة تهدد أحد الأطراف او تهدد الحياة او وجود إصابات خطيرة"
},
"MRN": {"en": "MRN", "ar": "ایم آر این"},
"appointment-date": {"en": "Appointment Date", "ar": "تقرری کی تاریخ"},
"appointment-no": {"en": "Appointment No", "ar": "تقرری نمبر"},
"insurance-id": {"en": "Insurance ID", "ar": "انشورنس ID"},
"chiefComplaints": {"en": "Chief Complaints", "ar": "الشكوى الرئيسة"},
"errorChiefComplaints": {"en": "Please Chief Complaints", "ar": "يرجى ادخال الشكوى الرئيسة"},
"errorExpectedArrivalTimes": {"en": "Please Expected arrival time", "ar": "يرجى ادخال الوقت المتوقع للوصول"},
"expectedArrivalTime": {"en": "Expected arrival time", "ar": "الوقت المتوقع للوصول"},
"errorChiefComplaints": {
"en": "Please Chief Complaints",
"ar": "يرجى ادخال الشكوى الرئيسة"
},
"errorExpectedArrivalTimes": {
"en": "Please Expected arrival time",
"ar": "يرجى ادخال الوقت المتوقع للوصول"
},
"expectedArrivalTime": {
"en": "Expected arrival time",
"ar": "الوقت المتوقع للوصول"
},
"add-address": {"en": "Add new address", "ar": "اضف عنوان جديد"},
"enter-file": {
"en": "Please enter the mobile number and the medical file number",
"ar": "الرجاء إدخال رقم الجوال ورقم الملف الطبي"
}
};

@ -0,0 +1,34 @@
enum PaymentOptions {
VISA,
MASTERCARD,
MADA,
INSTALLMENT,
APPLEPAY
}
extension PaymentOptions_ on PaymentOptions{
String value(){
switch(this){
case PaymentOptions.VISA:
return "VISA";
break;
case PaymentOptions.MASTERCARD:
return "MASTERCARD";
break;
case PaymentOptions.MADA:
return "MADA";
break;
case PaymentOptions.INSTALLMENT:
return "INSTALLMENT";
break;
case PaymentOptions.APPLEPAY:
return "APPLEPAY";
break;
}
return null;
}
}

@ -0,0 +1,7 @@
class ResponseModel<T>{
final bool status;
final String error;
final T data;
ResponseModel({this.status, this.data, this.error});
}

@ -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<String, dynamic> 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);
}

@ -0,0 +1,21 @@
import 'package:flutter/cupertino.dart';
class PackagesCustomerRequestModel {
String email;
String phoneNumber;
PackagesCustomerRequestModel({@required this.email, @required this.phoneNumber});
Map<String, dynamic> json() {
return {
"customer" : {
"email": email,
"addresses": [{
"email": email,
"phone_number": phoneNumber
}]
}
};
}
}

@ -6,6 +6,12 @@ class OffersCategoriesRequestModel {
OffersCategoriesRequestModel({this.limit, this.page, this.sinceId});
Map<String, String> 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(),
};
}
}

@ -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<String, String> 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",
};
}
}

@ -0,0 +1,132 @@
import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesResponseModel.dart';
class PackagesCartItemsResponseModel {
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;
PackagesCartItemsResponseModel({
int quantity,
String shoppingCartType,
int productId,
PackagesResponseModel product,
int id}){
_quantity = quantity;
_shoppingCartType = shoppingCartType;
_productId = productId;
_product = product;
_id = id;
}
PackagesCartItemsResponseModel.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<String, dynamic> toJson() {
var map = <String, dynamic>{};
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<String, dynamic> toJson() {
var map = <String, dynamic>{};
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<String, dynamic> toJson() {
var map = <String, dynamic>{};
map["language_id"] = _languageId;
map["localized_name"] = _localizedName;
return map;
}
}

@ -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<OfferCategoriesResponseModel> {
String id;
class PackagesCategoriesResponseModel with JsonConvert<PackagesCategoriesResponseModel> {
int id;
String name;
String namen;
@JSONField(name: "localized_names")
@ -49,6 +49,18 @@ class OfferCategoriesResponseModel with JsonConvert<OfferCategoriesResponseModel
String seName;
@JSONField(name: "is_leaf")
bool isLeaf;
@override
String toString() {
if(localizedNames.length == 2){
if(localizedNames.first.languageId == 1)
return localizedNames.first.localizedName ?? name;
else if(localizedNames.first.languageId == 2)
return localizedNames.last.localizedName ?? name;
}
return name;
}
}
class OfferCategoriesResponseModelLocalizedName with JsonConvert<OfferCategoriesResponseModelLocalizedName> {

@ -0,0 +1,367 @@
import 'PackagesCartItemsResponseModel.dart';
/// shopping_cart_items : []
/// billing_address : null
/// shipping_address : null
/// addresses : [{"first_name":null,"last_name":null,"email":"a2zzuhaib@gmil.com","company":null,"country_id":null,"country":null,"state_province_id":null,"city":null,"address1":null,"address2":null,"zip_postal_code":null,"phone_number":"0500409598","fax_number":null,"customer_attributes":null,"created_on_utc":"2021-03-11T09:40:23.8091261Z","province":null,"id":0}]
/// customer_guid : "1367e5c7-be3b-43cc-ad81-ff1fc8d3b130"
/// username : null
/// email : "a2zzuhaib@gmil.com"
/// first_name : null
/// last_name : null
/// language_id : null
/// date_of_birth : null
/// gender : null
/// admin_comment : null
/// is_tax_exempt : false
/// has_shopping_cart_items : false
/// active : true
/// deleted : false
/// is_system_account : false
/// system_name : null
/// last_ip_address : null
/// created_on_utc : "2021-03-11T09:40:23.7535859Z"
/// last_login_date_utc : null
/// last_activity_date_utc : "2021-03-11T09:40:23.7535892Z"
/// registered_in_store_id : 0
/// subscribed_to_newsletter : false
/// role_ids : []
/// id : 76823
class PackagesCustomerResponseModel {
List<PackagesCartItemsResponseModel> _shoppingCartItems;
dynamic _billingAddress;
dynamic _shippingAddress;
List<Addresses> _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<int> _roleIds;
int _id;
List<dynamic> get shoppingCartItems => _shoppingCartItems;
dynamic get billingAddress => _billingAddress;
dynamic get shippingAddress => _shippingAddress;
List<Addresses> 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<dynamic> get roleIds => _roleIds;
int get id => _id;
PackagesCustomerResponseModel({
List<dynamic> shoppingCartItems,
dynamic billingAddress,
dynamic shippingAddress,
List<Addresses> 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<dynamic> 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"];
if (json["addresses"] != null) {
_addresses = [];
json["addresses"].forEach((v) {
_addresses.add(Addresses.fromJson(v));
});
}
_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"];
if (json["role_ids"] != null) {
_roleIds = [];
json["role_ids"].forEach((v) {
_roleIds.add(v);
});
}
if (json["shopping_cart_items"] != null) {
_shoppingCartItems = [];
json["shopping_cart_items"].forEach((v) {
_shoppingCartItems.add(PackagesCartItemsResponseModel.fromJson(v));
});
}
_id = json["id"];
}
Map<String, dynamic> toJson() {
var map = <String, dynamic>{};
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).toList();
}
map["id"] = _id;
return map;
}
}
/// first_name : null
/// last_name : null
/// email : "a2zzuhaib@gmil.com"
/// company : null
/// country_id : null
/// country : null
/// state_province_id : null
/// city : null
/// address1 : null
/// address2 : null
/// zip_postal_code : null
/// phone_number : "0500409598"
/// fax_number : null
/// customer_attributes : null
/// created_on_utc : "2021-03-11T09:40:23.8091261Z"
/// province : null
/// id : 0
class Addresses {
dynamic _firstName;
dynamic _lastName;
String _email;
dynamic _company;
dynamic _countryId;
dynamic _country;
dynamic _stateProvinceId;
dynamic _city;
dynamic _address1;
dynamic _address2;
dynamic _zipPostalCode;
String _phoneNumber;
dynamic _faxNumber;
dynamic _customerAttributes;
String _createdOnUtc;
dynamic _province;
int _id;
dynamic get firstName => _firstName;
dynamic get lastName => _lastName;
String get email => _email;
dynamic get company => _company;
dynamic get countryId => _countryId;
dynamic get country => _country;
dynamic get stateProvinceId => _stateProvinceId;
dynamic get city => _city;
dynamic get address1 => _address1;
dynamic get address2 => _address2;
dynamic get zipPostalCode => _zipPostalCode;
String get phoneNumber => _phoneNumber;
dynamic get faxNumber => _faxNumber;
dynamic get customerAttributes => _customerAttributes;
String get createdOnUtc => _createdOnUtc;
dynamic get province => _province;
int get id => _id;
Addresses({
dynamic firstName,
dynamic lastName,
String email,
dynamic company,
dynamic countryId,
dynamic country,
dynamic stateProvinceId,
dynamic city,
dynamic address1,
dynamic address2,
dynamic zipPostalCode,
String phoneNumber,
dynamic faxNumber,
dynamic customerAttributes,
String createdOnUtc,
dynamic province,
int id}){
_firstName = firstName;
_lastName = lastName;
_email = email;
_company = company;
_countryId = countryId;
_country = country;
_stateProvinceId = stateProvinceId;
_city = city;
_address1 = address1;
_address2 = address2;
_zipPostalCode = zipPostalCode;
_phoneNumber = phoneNumber;
_faxNumber = faxNumber;
_customerAttributes = customerAttributes;
_createdOnUtc = createdOnUtc;
_province = province;
_id = id;
}
Addresses.fromJson(dynamic json) {
_firstName = json["first_name"];
_lastName = json["last_name"];
_email = json["email"];
_company = json["company"];
_countryId = json["country_id"];
_country = json["country"];
_stateProvinceId = json["state_province_id"];
_city = json["city"];
_address1 = json["address1"];
_address2 = json["address2"];
_zipPostalCode = json["zip_postal_code"];
_phoneNumber = json["phone_number"];
_faxNumber = json["fax_number"];
_customerAttributes = json["customer_attributes"];
_createdOnUtc = json["created_on_utc"];
_province = json["province"];
_id = json["id"];
}
Map<String, dynamic> toJson() {
var map = <String, dynamic>{};
map["first_name"] = _firstName;
map["last_name"] = _lastName;
map["email"] = _email;
map["company"] = _company;
map["country_id"] = _countryId;
map["country"] = _country;
map["state_province_id"] = _stateProvinceId;
map["city"] = _city;
map["address1"] = _address1;
map["address2"] = _address2;
map["zip_postal_code"] = _zipPostalCode;
map["phone_number"] = _phoneNumber;
map["fax_number"] = _faxNumber;
map["customer_attributes"] = _customerAttributes;
map["created_on_utc"] = _createdOnUtc;
map["province"] = _province;
map["id"] = _id;
return map;
}
}

@ -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<OfferProductsResponseModel> {
String id;
class PackagesResponseModel with JsonConvert<PackagesResponseModel> {
int id;
@JSONField(name: "visible_individually")
bool visibleIndividually;
String name;
@ -205,6 +205,17 @@ class OfferProductsResponseModel with JsonConvert<OfferProductsResponseModel> {
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<OfferProductsResponseModelLocalizedName> {

@ -0,0 +1,323 @@
import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCustomerResponseModel.dart';
import 'PackagesCartItemsResponseModel.dart';
class PackagesOrderResponseModel {
String _customOrderNumber;
int _storeId;
dynamic _pickUpInStore;
String _paymentMethodSystemName;
String _customerCurrencyCode;
double _currencyRate;
int _customerTaxDisplayTypeId;
dynamic _vatNumber;
double _orderSubtotalInclTax;
double _orderSubtotalExclTax;
double _orderSubTotalDiscountInclTax;
double _orderSubTotalDiscountExclTax;
double _orderShippingInclTax;
double _orderShippingExclTax;
double _paymentMethodAdditionalFeeInclTax;
double _paymentMethodAdditionalFeeExclTax;
String _taxRates;
double _orderTax;
double _orderDiscount;
double _orderTotal;
double _refundedAmount;
dynamic _rewardPointsWereAdded;
String _checkoutAttributeDescription;
int _customerLanguageId;
int _affiliateId;
String _customerIp;
dynamic _authorizationTransactionId;
dynamic _authorizationTransactionCode;
dynamic _authorizationTransactionResult;
dynamic _captureTransactionId;
dynamic _captureTransactionResult;
dynamic _subscriptionTransactionId;
dynamic _paidDateUtc;
dynamic _shippingMethod;
dynamic _shippingRateComputationMethodSystemName;
String _customValuesXml;
dynamic _paymentOption;
bool _deleted;
String _createdOnUtc;
PackagesCustomerResponseModel _customer;
int _customerId;
dynamic _billingAddress;
dynamic _shippingAddress;
List<PackagesCartItemsResponseModel> _orderItems;
String _orderStatus;
String _paymentStatus;
String _shippingStatus;
String _customerTaxDisplayType;
int _id;
String get customOrderNumber => _customOrderNumber;
int get storeId => _storeId;
dynamic get pickUpInStore => _pickUpInStore;
String get paymentMethodSystemName => _paymentMethodSystemName;
String get customerCurrencyCode => _customerCurrencyCode;
double get currencyRate => _currencyRate;
int get customerTaxDisplayTypeId => _customerTaxDisplayTypeId;
dynamic get vatNumber => _vatNumber;
double get orderSubtotalInclTax => _orderSubtotalInclTax;
double get orderSubtotalExclTax => _orderSubtotalExclTax;
double get orderSubTotalDiscountInclTax => _orderSubTotalDiscountInclTax;
double get orderSubTotalDiscountExclTax => _orderSubTotalDiscountExclTax;
double get orderShippingInclTax => _orderShippingInclTax;
double get orderShippingExclTax => _orderShippingExclTax;
double get paymentMethodAdditionalFeeInclTax => _paymentMethodAdditionalFeeInclTax;
double get paymentMethodAdditionalFeeExclTax => _paymentMethodAdditionalFeeExclTax;
String get taxRates => _taxRates;
double get orderTax => _orderTax;
double get orderDiscount => _orderDiscount;
double get orderTotal => _orderTotal;
double get refundedAmount => _refundedAmount;
dynamic get rewardPointsWereAdded => _rewardPointsWereAdded;
String get checkoutAttributeDescription => _checkoutAttributeDescription;
int get customerLanguageId => _customerLanguageId;
int get affiliateId => _affiliateId;
String get customerIp => _customerIp;
dynamic get authorizationTransactionId => _authorizationTransactionId;
dynamic get authorizationTransactionCode => _authorizationTransactionCode;
dynamic get authorizationTransactionResult => _authorizationTransactionResult;
dynamic get captureTransactionId => _captureTransactionId;
dynamic get captureTransactionResult => _captureTransactionResult;
dynamic get subscriptionTransactionId => _subscriptionTransactionId;
dynamic get paidDateUtc => _paidDateUtc;
dynamic get shippingMethod => _shippingMethod;
dynamic get shippingRateComputationMethodSystemName => _shippingRateComputationMethodSystemName;
String get customValuesXml => _customValuesXml;
dynamic get paymentOption => _paymentOption;
bool get deleted => _deleted;
String get createdOnUtc => _createdOnUtc;
PackagesCustomerResponseModel get customer => _customer;
int get customerId => _customerId;
dynamic get billingAddress => _billingAddress;
dynamic get shippingAddress => _shippingAddress;
List<PackagesCartItemsResponseModel> get orderItems => _orderItems;
String get orderStatus => _orderStatus;
String get paymentStatus => _paymentStatus;
String get shippingStatus => _shippingStatus;
String get customerTaxDisplayType => _customerTaxDisplayType;
int get id => _id;
OrderResponseModel({
String customOrderNumber,
int storeId,
dynamic pickUpInStore,
String paymentMethodSystemName,
String customerCurrencyCode,
double currencyRate,
int customerTaxDisplayTypeId,
dynamic vatNumber,
double orderSubtotalInclTax,
double orderSubtotalExclTax,
double orderSubTotalDiscountInclTax,
double orderSubTotalDiscountExclTax,
double orderShippingInclTax,
double orderShippingExclTax,
double paymentMethodAdditionalFeeInclTax,
double paymentMethodAdditionalFeeExclTax,
String taxRates,
double orderTax,
double orderDiscount,
double orderTotal,
double refundedAmount,
dynamic rewardPointsWereAdded,
String checkoutAttributeDescription,
int customerLanguageId,
int affiliateId,
String customerIp,
dynamic authorizationTransactionId,
dynamic authorizationTransactionCode,
dynamic authorizationTransactionResult,
dynamic captureTransactionId,
dynamic captureTransactionResult,
dynamic subscriptionTransactionId,
dynamic paidDateUtc,
dynamic shippingMethod,
dynamic shippingRateComputationMethodSystemName,
String customValuesXml,
dynamic paymentOption,
bool deleted,
String createdOnUtc,
PackagesCustomerResponseModel customer,
int customerId,
dynamic billingAddress,
dynamic shippingAddress,
List<PackagesCartItemsResponseModel> orderItems,
String orderStatus,
String paymentStatus,
String shippingStatus,
String customerTaxDisplayType,
int id}){
_customOrderNumber = customOrderNumber;
_storeId = storeId;
_pickUpInStore = pickUpInStore;
_paymentMethodSystemName = paymentMethodSystemName;
_customerCurrencyCode = customerCurrencyCode;
_currencyRate = currencyRate;
_customerTaxDisplayTypeId = customerTaxDisplayTypeId;
_vatNumber = vatNumber;
_orderSubtotalInclTax = orderSubtotalInclTax;
_orderSubtotalExclTax = orderSubtotalExclTax;
_orderSubTotalDiscountInclTax = orderSubTotalDiscountInclTax;
_orderSubTotalDiscountExclTax = orderSubTotalDiscountExclTax;
_orderShippingInclTax = orderShippingInclTax;
_orderShippingExclTax = orderShippingExclTax;
_paymentMethodAdditionalFeeInclTax = paymentMethodAdditionalFeeInclTax;
_paymentMethodAdditionalFeeExclTax = paymentMethodAdditionalFeeExclTax;
_taxRates = taxRates;
_orderTax = orderTax;
_orderDiscount = orderDiscount;
_orderTotal = orderTotal;
_refundedAmount = refundedAmount;
_rewardPointsWereAdded = rewardPointsWereAdded;
_checkoutAttributeDescription = checkoutAttributeDescription;
_customerLanguageId = customerLanguageId;
_affiliateId = affiliateId;
_customerIp = customerIp;
_authorizationTransactionId = authorizationTransactionId;
_authorizationTransactionCode = authorizationTransactionCode;
_authorizationTransactionResult = authorizationTransactionResult;
_captureTransactionId = captureTransactionId;
_captureTransactionResult = captureTransactionResult;
_subscriptionTransactionId = subscriptionTransactionId;
_paidDateUtc = paidDateUtc;
_shippingMethod = shippingMethod;
_shippingRateComputationMethodSystemName = shippingRateComputationMethodSystemName;
_customValuesXml = customValuesXml;
_paymentOption = paymentOption;
_deleted = deleted;
_createdOnUtc = createdOnUtc;
_customer = customer;
_customerId = customerId;
_billingAddress = billingAddress;
_shippingAddress = shippingAddress;
_orderItems = orderItems;
_orderStatus = orderStatus;
_paymentStatus = paymentStatus;
_shippingStatus = shippingStatus;
_customerTaxDisplayType = customerTaxDisplayType;
_id = id;
}
PackagesOrderResponseModel.fromJson(dynamic json) {
_customOrderNumber = json["custom_order_number"];
_storeId = json["store_id"];
_pickUpInStore = json["pick_up_in_store"];
_paymentMethodSystemName = json["payment_method_system_name"];
_customerCurrencyCode = json["customer_currency_code"];
_currencyRate = json["currency_rate"];
_customerTaxDisplayTypeId = json["customer_tax_display_type_id"];
_vatNumber = json["vat_number"];
_orderSubtotalInclTax = json["order_subtotal_incl_tax"];
_orderSubtotalExclTax = json["order_subtotal_excl_tax"];
_orderSubTotalDiscountInclTax = json["order_sub_total_discount_incl_tax"];
_orderSubTotalDiscountExclTax = json["order_sub_total_discount_excl_tax"];
_orderShippingInclTax = json["order_shipping_incl_tax"];
_orderShippingExclTax = json["order_shipping_excl_tax"];
_paymentMethodAdditionalFeeInclTax = json["payment_method_additional_fee_incl_tax"];
_paymentMethodAdditionalFeeExclTax = json["payment_method_additional_fee_excl_tax"];
_taxRates = json["tax_rates"];
_orderTax = json["order_tax"];
_orderDiscount = json["order_discount"];
_orderTotal = json["order_total"];
_refundedAmount = json["refunded_amount"];
_rewardPointsWereAdded = json["reward_points_were_added"];
_checkoutAttributeDescription = json["checkout_attribute_description"];
_customerLanguageId = json["customer_language_id"];
_affiliateId = json["affiliate_id"];
_customerIp = json["customer_ip"];
_authorizationTransactionId = json["authorization_transaction_id"];
_authorizationTransactionCode = json["authorization_transaction_code"];
_authorizationTransactionResult = json["authorization_transaction_result"];
_captureTransactionId = json["capture_transaction_id"];
_captureTransactionResult = json["capture_transaction_result"];
_subscriptionTransactionId = json["subscription_transaction_id"];
_paidDateUtc = json["paid_date_utc"];
_shippingMethod = json["shipping_method"];
_shippingRateComputationMethodSystemName = json["shipping_rate_computation_method_system_name"];
_customValuesXml = json["custom_values_xml"];
_paymentOption = json["payment_option"];
_deleted = json["deleted"];
_createdOnUtc = json["created_on_utc"];
_customer = json["customer"] != null ? PackagesCustomerResponseModel.fromJson(json["customer"]) : null;
_customerId = json["customer_id"];
_billingAddress = json["billing_address"];
_shippingAddress = json["shipping_address"];
if (json["order_items"] != null) {
_orderItems = [];
json["order_items"].forEach((v) {
_orderItems.add(PackagesCartItemsResponseModel.fromJson(v));
});
}
_orderStatus = json["order_status"];
_paymentStatus = json["payment_status"];
_shippingStatus = json["shipping_status"];
_customerTaxDisplayType = json["customer_tax_display_type"];
_id = json["id"];
}
Map<String, dynamic> toJson() {
var map = <String, dynamic>{};
map["custom_order_number"] = _customOrderNumber;
map["store_id"] = _storeId;
map["pick_up_in_store"] = _pickUpInStore;
map["payment_method_system_name"] = _paymentMethodSystemName;
map["customer_currency_code"] = _customerCurrencyCode;
map["currency_rate"] = _currencyRate;
map["customer_tax_display_type_id"] = _customerTaxDisplayTypeId;
map["vat_number"] = _vatNumber;
map["order_subtotal_incl_tax"] = _orderSubtotalInclTax;
map["order_subtotal_excl_tax"] = _orderSubtotalExclTax;
map["order_sub_total_discount_incl_tax"] = _orderSubTotalDiscountInclTax;
map["order_sub_total_discount_excl_tax"] = _orderSubTotalDiscountExclTax;
map["order_shipping_incl_tax"] = _orderShippingInclTax;
map["order_shipping_excl_tax"] = _orderShippingExclTax;
map["payment_method_additional_fee_incl_tax"] = _paymentMethodAdditionalFeeInclTax;
map["payment_method_additional_fee_excl_tax"] = _paymentMethodAdditionalFeeExclTax;
map["tax_rates"] = _taxRates;
map["order_tax"] = _orderTax;
map["order_discount"] = _orderDiscount;
map["order_total"] = _orderTotal;
map["refunded_amount"] = _refundedAmount;
map["reward_points_were_added"] = _rewardPointsWereAdded;
map["checkout_attribute_description"] = _checkoutAttributeDescription;
map["customer_language_id"] = _customerLanguageId;
map["affiliate_id"] = _affiliateId;
map["customer_ip"] = _customerIp;
map["authorization_transaction_id"] = _authorizationTransactionId;
map["authorization_transaction_code"] = _authorizationTransactionCode;
map["authorization_transaction_result"] = _authorizationTransactionResult;
map["capture_transaction_id"] = _captureTransactionId;
map["capture_transaction_result"] = _captureTransactionResult;
map["subscription_transaction_id"] = _subscriptionTransactionId;
map["paid_date_utc"] = _paidDateUtc;
map["shipping_method"] = _shippingMethod;
map["shipping_rate_computation_method_system_name"] = _shippingRateComputationMethodSystemName;
map["custom_values_xml"] = _customValuesXml;
map["payment_option"] = _paymentOption;
map["deleted"] = _deleted;
map["created_on_utc"] = _createdOnUtc;
if (_customer != null) {
map["customer"] = _customer.toJson();
}
map["customer_id"] = _customerId;
map["billing_address"] = _billingAddress;
map["shipping_address"] = _shippingAddress;
if (_orderItems != null) {
map["order_items"] = _orderItems.map((v) => v.toJson()).toList();
}
map["order_status"] = _orderStatus;
map["payment_status"] = _paymentStatus;
map["shipping_status"] = _shippingStatus;
map["customer_tax_display_type"] = _customerTaxDisplayType;
map["id"] = _id;
return map;
}
}

@ -66,6 +66,8 @@ class OrderDetailModel {
String preferDeliveryDate;
String preferDeliveryTime;
String preferDeliveryTimen;
String driverOTP;
String driverID;
OrderDetailModel(
{this.id,
@ -130,7 +132,9 @@ class OrderDetailModel {
this.lakumAmount,
this.preferDeliveryDate,
this.preferDeliveryTime,
this.preferDeliveryTimen});
this.preferDeliveryTimen,
this.driverID,
this.driverOTP,});
OrderDetailModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
@ -210,6 +214,10 @@ class OrderDetailModel {
preferDeliveryDate = json['prefer_delivery_date'];
preferDeliveryTime = json['prefer_delivery_time'];
preferDeliveryTimen = json['prefer_delivery_timen'];
// Driver Detail
driverID: json["DriverID"];
driverOTP: json["DriverOTP"];
}
Map<String, dynamic> toJson() {

@ -73,6 +73,8 @@ class OrderModel {
DateTime preferDeliveryDate;
PreferDeliveryTime preferDeliveryTime;
PreferDeliveryTimen preferDeliveryTimen;
String driverOTP;
String driverID;
OrderModel({
this.id,
@ -138,6 +140,8 @@ class OrderModel {
this.preferDeliveryDate,
this.preferDeliveryTime,
this.preferDeliveryTimen,
this.driverID,
this.driverOTP,
});
factory OrderModel.fromJson(Map<String, dynamic> json) => OrderModel(
@ -204,6 +208,11 @@ class OrderModel {
preferDeliveryDate: json["prefer_delivery_date"] == null ? null : DateTime.parse(json["prefer_delivery_date"]),
preferDeliveryTime: json["prefer_delivery_time"] == null ? null : preferDeliveryTimeValues.map[json["prefer_delivery_time"]],
preferDeliveryTimen: json["prefer_delivery_timen"] == null ? null : preferDeliveryTimenValues.map[json["prefer_delivery_timen"]],
// Driver Detail
driverID: json["DriverID"],
driverOTP: json["DriverOTP"],
);
Map<String, dynamic> toJson() => {
@ -1366,7 +1375,7 @@ final titleValues = EnumValues({
"ممتاز": Title.TITLE
});
enum OrderStatus { ORDER_SUBMITTED, PENDING, ORDER_IN_PROGRESS, ORDER_COMPLETED, CANCELLED, PROCESSING, ORDER_REFUNDED, COMPLETE }
enum OrderStatus { ORDER_SUBMITTED, PENDING, ORDER_IN_PROGRESS,ORDER_SENT_FOR_DELIVERY, ORDER_COMPLETED, CANCELLED, PROCESSING, ORDER_REFUNDED, COMPLETE }
final orderStatusValues = EnumValues({
"Cancelled": OrderStatus.CANCELLED,
@ -1376,7 +1385,8 @@ final orderStatusValues = EnumValues({
"OrderRefunded": OrderStatus.ORDER_REFUNDED,
"OrderSubmitted": OrderStatus.ORDER_SUBMITTED,
"Pending": OrderStatus.PENDING,
"Processing": OrderStatus.PROCESSING
"Processing": OrderStatus.PROCESSING,
"orderSentForDelivery": OrderStatus.ORDER_SENT_FOR_DELIVERY
});
enum OrderStatusn { ORDER_SUBMITTED, EMPTY, ORDER_IN_PROGRESS, ORDER_COMPLETED, ORDER_STATUSN, PURPLE, FLUFFY, TENTACLED }
@ -1389,6 +1399,7 @@ final orderStatusnValues = EnumValues({
"ملغي": OrderStatusn.ORDER_STATUSN,
"Order Submitted": OrderStatusn.ORDER_SUBMITTED,
"قيد التنفيذ": OrderStatusn.PURPLE,
"مكتمل": OrderStatusn.TENTACLED,
"مكتمل": OrderStatusn.TENTACLED
});

@ -1,127 +1,193 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class PrescriptionReport {
String address;
int appointmentNo;
String clinic;
String companyName;
int days;
String doctorName;
var doseDailyQuantity;
String frequency;
int frequencyNumber;
String image;
String imageExtension;
String imageSRCUrl;
String imageString;
String imageThumbUrl;
String isCovered;
String itemDescription;
int itemID;
String orderDate;
int patientID;
String patientName;
String phoneOffice1;
String prescriptionQR;
int prescriptionTimes;
String productImage;
String productImageBase64;
String productImageString;
int projectID;
String projectName;
String remarks;
String route;
String sKU;
int scaleOffset;
String startDate;
String patientAge;
String patientGender;
String address;
String phoneOffice;
String itemDescription;
int doseTimingID;
int frequencyID;
int routeID;
String clinic;
String doctorName;
String route;
String frequency;
String remarks;
String name;
int days;
String startDate;
String orderDate;
int doseDailyQuantity;
int itemID;
Null productImage;
String sKU;
String itemDescriptionN;
String routeN;
String frequencyN;
String imageSRCUrl;
String imageThumbUrl;
PrescriptionReport(
{this.patientID,
this.patientName,
this.patientAge,
this.patientGender,
this.address,
this.phoneOffice,
this.itemDescription,
this.doseTimingID,
this.frequencyID,
this.routeID,
this.clinic,
this.doctorName,
this.route,
this.frequency,
this.remarks,
this.name,
this.days,
this.startDate,
this.orderDate,
this.doseDailyQuantity,
this.itemID,
this.productImage,
this.sKU,
this.itemDescriptionN,
this.routeN,
this.frequencyN,
this.imageSRCUrl,
this.imageThumbUrl});
PrescriptionReport({
this.address,
this.appointmentNo,
this.clinic,
this.companyName,
this.days,
this.doctorName,
this.doseDailyQuantity,
this.frequency,
this.frequencyNumber,
this.image,
this.imageExtension,
this.imageSRCUrl,
this.imageString,
this.imageThumbUrl,
this.isCovered,
this.itemDescription,
this.itemID,
this.orderDate,
this.patientID,
this.patientName,
this.phoneOffice1,
this.prescriptionQR,
this.prescriptionTimes,
this.productImage,
this.productImageBase64,
this.productImageString,
this.projectID,
this.projectName,
this.remarks,
this.route,
this.sKU,
this.scaleOffset,
this.startDate,
this.patientAge,
this.patientGender,
this.phoneOffice,
this.doseTimingID,
this.frequencyID,
this.routeID,
this.name,
this.itemDescriptionN,
this.routeN,
this.frequencyN,
});
PrescriptionReport.fromJson(Map<String, dynamic> json) {
patientID = json['PatientID'];
patientName = json['PatientName'];
patientAge = json['PatientAge'];
patientGender = json['PatientGender'];
address = json['Address'];
phoneOffice = json['PhoneOffice'];
itemDescription = json['ItemDescription'];
doseTimingID = json['DoseTimingID'];
frequencyID = json['FrequencyID'];
routeID = json['RouteID'];
appointmentNo = json['AppointmentNo'];
clinic = json['Clinic'];
doctorName = json['DoctorName'];
route = json['Route'];
frequency = json['Frequency'];
remarks = json['Remarks'];
name = json['Name'];
companyName = json['CompanyName'];
days = json['Days'];
startDate = json['StartDate'];
orderDate = json['OrderDate'];
doctorName = json['DoctorName'];
doseDailyQuantity = json['DoseDailyQuantity'];
frequency = json['Frequency'];
frequencyNumber = json['FrequencyNumber'];
image = json['Image'];
imageExtension = json['ImageExtension'];
imageSRCUrl = json['ImageSRCUrl'];
imageString = json['ImageString'];
imageThumbUrl = json['ImageThumbUrl'];
isCovered = json['IsCovered'];
itemDescription = json['ItemDescription'];
itemID = json['ItemID'];
orderDate = json['OrderDate'];
patientID = json['PatientID'];
patientName = json['PatientName'];
phoneOffice1 = json['PhoneOffice1'];
prescriptionQR = json['PrescriptionQR'];
prescriptionTimes = json['PrescriptionTimes'];
productImage = json['ProductImage'];
productImageBase64 = json['ProductImageBase64'];
productImageString = json['ProductImageString'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
remarks = json['Remarks'];
route = json['Route'];
sKU = json['SKU'];
itemDescriptionN = json['ItemDescriptionN'];
routeN = json['RouteN'];
frequencyN = json['FrequencyN'];
imageSRCUrl = json['ImageSRCUrl'];
imageThumbUrl = json['ImageThumbUrl'];
scaleOffset = json['ScaleOffset'];
startDate = json['StartDate'];
patientAge = json['patientAge'];
patientGender = json['patientGender'];
phoneOffice = json['phoneOffice'];
doseTimingID = json['doseTimingID'];
frequencyID = json['frequencyID'];
routeID = json['routeID'];
name = json['name'];
itemDescriptionN = json['itemDescriptionN'];
routeN = json['routeN'];
frequencyN = json['frequencyN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Address'] = this.address;
data['AppointmentNo'] = this.appointmentNo;
data['Clinic'] = this.clinic;
data['CompanyName'] = this.companyName;
data['Days'] = this.days;
data['DoctorName'] = this.doctorName;
data['DoseDailyQuantity'] = this.doseDailyQuantity;
data['Frequency'] = this.frequency;
data['FrequencyNumber'] = this.frequencyNumber;
data['Image'] = this.image;
data['ImageExtension'] = this.imageExtension;
data['ImageSRCUrl'] = this.imageSRCUrl;
data['ImageString'] = this.imageString;
data['ImageThumbUrl'] = this.imageThumbUrl;
data['IsCovered'] = this.isCovered;
data['ItemDescription'] = this.itemDescription;
data['ItemID'] = this.itemID;
data['OrderDate'] = this.orderDate;
data['PatientID'] = this.patientID;
data['PatientName'] = this.patientName;
data['PhoneOffice1'] = this.phoneOffice1;
data['PrescriptionQR'] = this.prescriptionQR;
data['PrescriptionTimes'] = this.prescriptionTimes;
data['ProductImage'] = this.productImage;
data['ProductImageBase64'] = this.productImageBase64;
data['ProductImageString'] = this.productImageString;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['Remarks'] = this.remarks;
data['Route'] = this.route;
data['SKU'] = this.sKU;
data['ScaleOffset'] = this.scaleOffset;
data['StartDate'] = this.startDate;
data['PatientAge'] = this.patientAge;
data['PatientGender'] = this.patientGender;
data['Address'] = this.address;
data['PhoneOffice'] = this.phoneOffice;
data['ItemDescription'] = this.itemDescription;
data['DoseTimingID'] = this.doseTimingID;
data['FrequencyID'] = this.frequencyID;
data['RouteID'] = this.routeID;
data['Clinic'] = this.clinic;
data['DoctorName'] = this.doctorName;
data['Route'] = this.route;
data['Frequency'] = this.frequency;
data['Remarks'] = this.remarks;
data['Name'] = this.name;
data['Days'] = this.days;
data['StartDate'] = this.startDate;
data['OrderDate'] = this.orderDate;
data['DoseDailyQuantity'] = this.doseDailyQuantity;
data['ItemID'] = this.itemID;
data['ProductImage'] = this.productImage;
data['SKU'] = this.sKU;
data['ItemDescriptionN'] = this.itemDescriptionN;
data['RouteN'] = this.routeN;
data['FrequencyN'] = this.frequencyN;
data['ImageSRCUrl'] = this.imageSRCUrl;
data['ImageThumbUrl'] = this.imageThumbUrl;
data['hasPlan'] = false;
return data;
}
}

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:intl/intl.dart';
import '../../../locator.dart';
import '../base_service.dart';
class CustomerAddressesService extends BaseService {
@ -9,6 +11,7 @@ class CustomerAddressesService extends BaseService {
List<AddressInfo> addressesList = List();
CustomerInfo customerInfo;
Future addAddressInfo({ AddNewAddressRequestModel
addNewAddressRequestModel }) async {
@ -25,7 +28,7 @@ class CustomerAddressesService extends BaseService {
var date = f.format(DateTime.now().toUtc()) + " GMT";
addNewAddressRequestModel.customer.addresses[0].createdOnUtc = date;
hasError = false;
await baseAppClient.post(BASE_PHARMACY_URL+ADD_ADDRESS_INFO,
await baseAppClient.post(ADD_CUSTOMER_ADDRESS,
onSuccess: (dynamic response, int statusCode) {
addressesList.clear();
response["customers"][0]["addresses"].forEach((data) {
@ -35,7 +38,7 @@ class CustomerAddressesService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: addNewAddressRequestModel.toJson(), isExternal: true, isAllowAny: true);
}, body: addNewAddressRequestModel.toJson(), isAllowAny: true);
}
Future getCustomerAddresses() async {

@ -1,10 +1,14 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart';
class AncillaryOrdersService extends BaseService {
List<AncillaryOrdersListModel> _ancillaryLists = List();
List<AncillaryOrdersListModel> get ancillaryLists => _ancillaryLists;
List<AncillaryOrdersListProcListModel> _ancillaryProcLists = List();
List<AncillaryOrdersListProcListModel> get ancillaryProcLists =>
_ancillaryProcLists;
Future getOrders() async {
Map<String, dynamic> body = Map();
@ -13,6 +17,7 @@ class AncillaryOrdersService extends BaseService {
await baseAppClient.post(GET_ANCILLARY_ORDERS,
onSuccess: (dynamic response, int statusCode) {
_ancillaryLists = [];
response['AncillaryOrderList'].forEach((item) {
ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
});
@ -21,4 +26,179 @@ class AncillaryOrdersService extends BaseService {
super.error = error;
}, body: body);
}
Future getOrdersDetails(appointmentNo, orderNo) async {
Map<String, dynamic> body = Map();
hasError = false;
await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS,
onSuccess: (dynamic response, int statusCode) {
_ancillaryProcLists = [];
response['AncillaryOrderProcList'] = [
{
"AncillaryOrderProcList": [
{
"ApprovalLineItemNo": 0,
"ApprovalNo": 0,
"ApprovalStatus": "",
"ApprovalStatusID": 0,
"CompanyShare": 501.3,
"CompanyShareWithTax": 576.5,
"CompanyTaxAmount": 75.19,
"DiscountAmount": 55.7,
"DiscountCategory": 1,
"DiscountType": "P",
"DiscountTypeValue": 10,
"IsApprovalCreated": false,
"IsApprovalRequired": false,
"IsCovered": false,
"OrderDate": "/Date(1601758800000+0300)/",
"OrderLineItemNo": 1,
"OrderNo": 2020000001,
"PartnerID": 0,
"PartnerShare": 0,
"PartnerShareType": "P",
"PatientShare": 0,
"PatientShareWithTax": 0,
"PatientTaxAmount": 0,
"ProcPrice": 557,
"ProcedureCategoryID": 2,
"ProcedureCategoryName": "LABORATORY",
"ProcedureID": "02013001",
"ProcedureName": "11-DESOXYCORTISOL (COMPOUND S) - S.O",
"TaxAmount": 75.19,
"TaxPct": 15
},
{
"ApprovalLineItemNo": 0,
"ApprovalNo": 0,
"ApprovalStatus": "",
"ApprovalStatusID": 0,
"CompanyShare": 90,
"CompanyShareWithTax": 103.5,
"CompanyTaxAmount": 13.5,
"DiscountAmount": 10,
"DiscountCategory": 1,
"DiscountType": "P",
"DiscountTypeValue": 10,
"IsApprovalCreated": false,
"IsApprovalRequired": true,
"IsCovered": false,
"OrderDate": "/Date(1601758800000+0300)/",
"OrderLineItemNo": 4,
"OrderNo": 2020000001,
"PartnerID": 0,
"PartnerShare": 0,
"PartnerShareType": "P",
"PatientShare": 0,
"PatientShareWithTax": 0,
"PatientTaxAmount": 0,
"ProcPrice": 100,
"ProcedureCategoryID": 2,
"ProcedureCategoryName": "LABORATORY",
"ProcedureID": "02014011",
"ProcedureName": "CBC (COMPLETE BLOOD COUNT PROFILE)",
"TaxAmount": 13.5,
"TaxPct": 15
},
{
"ApprovalLineItemNo": 0,
"ApprovalNo": 0,
"ApprovalStatus": "",
"ApprovalStatusID": 0,
"CompanyShare": 347.76,
"CompanyShareWithTax": 399.92,
"CompanyTaxAmount": 52.16,
"DiscountAmount": 38.64,
"DiscountCategory": 1,
"DiscountType": "P",
"DiscountTypeValue": 10,
"IsApprovalCreated": false,
"IsApprovalRequired": false,
"IsCovered": false,
"OrderDate": "/Date(1601758800000+0300)/",
"OrderLineItemNo": 3,
"OrderNo": 2020000001,
"PartnerID": 0,
"PartnerShare": 0,
"PartnerShareType": "P",
"PatientShare": 0,
"PatientShareWithTax": 0,
"PatientTaxAmount": 0,
"ProcPrice": 386.4,
"ProcedureCategoryID": 2,
"ProcedureCategoryName": "LABORATORY",
"ProcedureID": "02019302",
"ProcedureName": "21-HYDROXYLASE ABS - S.O",
"TaxAmount": 52.16,
"TaxPct": 15
},
{
"ApprovalLineItemNo": 0,
"ApprovalNo": 0,
"ApprovalStatus": "",
"ApprovalStatusID": 0,
"CompanyShare": 1323,
"CompanyShareWithTax": 1521.45,
"CompanyTaxAmount": 198.45,
"DiscountAmount": 147,
"DiscountCategory": 1,
"DiscountType": "P",
"DiscountTypeValue": 10,
"IsApprovalCreated": false,
"IsApprovalRequired": true,
"IsCovered": false,
"OrderDate": "/Date(1601758800000+0300)/",
"OrderLineItemNo": 5,
"OrderNo": 2020000001,
"PartnerID": 0,
"PartnerShare": 0,
"PartnerShareType": "P",
"PatientShare": 0,
"PatientShareWithTax": 0,
"PatientTaxAmount": 0,
"ProcPrice": 1470,
"ProcedureCategoryID": 3,
"ProcedureCategoryName": "RADIOLOGY",
"ProcedureID": "03033065",
"ProcedureName": "CT SCAN - ABDOMEN (WITH CONTRAST)",
"TaxAmount": 198.45,
"TaxPct": 15
}
],
"AppointmentDate": "/Date(1601499600000+0300)/",
"AppointmentNo": 2016053756,
"ClinicID": 1,
"ClinicName": "INTERNAL MEDICINE CLINIC",
"CompanyID": 0,
"CompanyName": "Blood Donation Investigation",
"DoctorID": 1485,
"DoctorName": "ANAS ABDULLAH",
"ErrCode": null,
"GroupID": 2,
"InsurancePolicyNo": "45976500",
"Message": "Success",
"PatientCardID": "232332323",
"PatientID": 3072055,
"PatientName": "MAYA KHALED SADDIQ",
"PatientType": 1,
"PolicyID": 2,
"PolicyName": "Test",
"ProjectID": 15,
"SetupID": "010266",
"StatusCode": 1,
"SubCategoryID": 2,
"SubPolicyNo": "234234"
}
];
response['AncillaryOrderProcList'].forEach((item) {
ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -7,6 +7,8 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
@ -86,6 +88,197 @@ class BaseAppClient {
body['DeviceTypeID'] = DeviceTypeID;
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE
: PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSe
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': pharmacyToken,
'Mobilenumber': user != null
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(),
};
}
}
}
print("URL : $url");
print("Body : ${json.encode(body)}");
if (await Utils.checkConnection()) {
final response = await http.post(url.trim(),
body: json.encode(body), headers: headers);
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
// var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes));
if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode);
} else {
if (parsed['ErrorType'] == 4) {
navigateToAppUpdate(
AppGlobal.context, parsed['ErrorEndUserMessage']);
}
if (isAllowAny) {
onSuccess(parsed, statusCode);
} else if (parsed['IsAuthenticated'] == null) {
if (parsed['isSMSSent'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode);
} else if (parsed['Result'] == 'OK') {
onSuccess(parsed, statusCode);
} else {
if (parsed != null) {
onSuccess(parsed, statusCode);
} else {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logout();
}
}
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 &&
parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode);
} else {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message",
statusCode);
} else {
onFailure(parsed['ErrorSearchMsg'], statusCode);
}
} else {
onFailure(
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
}
}
} else if (!parsed['IsAuthenticated']) {
await logout();
//helpers.showErrorToast('Your session expired Please login agian');
} else {
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode);
} else {
if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
}
}
}
}
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
} catch (e) {
print(e);
onFailure(e.toString(), -1);
}
}
postPharmacy(String endPoint,
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isExternal = false}) async {
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
String url;
if (isExternal) {
url = endPoint;
} else {
url = PHARMACY_BASE_URL + endPoint;
}
try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
var pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
Map<String, String> headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': token ?? '',
'Mobilenumber': user != null
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "",
};
if (!isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = DeviceTypeID;
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
@ -132,7 +325,8 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
// var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes));
if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode);
} else {
@ -248,7 +442,8 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
// var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes));
onSuccess(parsed, statusCode);
}
} else {
@ -280,11 +475,11 @@ class BaseAppClient {
if (await Utils.checkConnection()) {
final response = await http.get(url.trim(), headers: {
'Content-Type': 'application/json',
'Content-Type': 'text/html; charset=utf-8',
'Accept': 'application/json',
'Authorization': token ?? '',
'Mobilenumber': user != null
? getPhoneNumberWithoutZero(user['MobileNumber'].toString())
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "",
@ -293,29 +488,61 @@ class BaseAppClient {
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
if (statusCode == 401) {
AppToast.showErrorToast(
message: TranslationBase.of(AppGlobal.context).pharmacyRelogin);
Navigator.of(AppGlobal.context).pushNamed(HOME);
} else {
onFailure('Error While Fetching data', statusCode);
}
} else {
var parsed = json.decode(response.body.toString());
onSuccess(parsed, statusCode);
// var parsed = json.decode(response.body.toString());
var bodyUtf = json.decode(utf8.decode(response.bodyBytes));
onSuccess(bodyUtf, statusCode);
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
}
getPhoneNumberWithoutZero(String number) {
String newNumber = number;
if (number.startsWith('0')) {
newNumber = number.substring(1);
simplePost(String fullUrl,
{ Map<String, dynamic> 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);
}
return newNumber;
}
simpleGet(String fullUrl,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async {
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async {
String url = fullUrl;
print("URL Query String: $url");
var haveParams = (queryParams != null);
if (haveParams) {
String queryString = Uri(queryParameters: queryParams).query;
@ -345,6 +572,75 @@ class BaseAppClient {
}
}
simplePut(String fullUrl,
{ Map<String, dynamic> 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<String, String> 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);
@ -386,13 +682,14 @@ class BaseAppClient {
return params;
}
pharmacyPost(String endPoint,
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isExternal = false}) async {
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isExternal = false}) async {
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
String url;
if (isExternal) {
url = endPoint;
@ -400,17 +697,16 @@ class BaseAppClient {
url = BASE_PHARMACY_URL + endPoint;
}
try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (!isExternal) {
if (isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
@ -422,17 +718,17 @@ class BaseAppClient {
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = DeviceTypeID;
@ -440,18 +736,18 @@ class BaseAppClient {
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE
? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE
: PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE_ID
? body['PatientTypeID']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token;
@ -469,19 +765,27 @@ class BaseAppClient {
var ss = json.encode(body);
if (await Utils.checkConnection()) {
final response = await http.post(url.trim(),
body: json.encode(body),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
});
final response =
await http.post(url.trim(), body: json.encode(body), headers: {
// 'Content-Type': 'application/json',
// 'Accept': 'application/json',
// 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': token ?? '',
'Mobilenumber': user != null
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "",
});
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
// var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes));
if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode);
} else {
@ -515,12 +819,11 @@ class BaseAppClient {
parsed['IsAuthenticated']) {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if(parsed['ErrorSearchMsg'] == null ){
if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message",
statusCode);
}else {
onFailure(parsed['ErrorSearchMsg'],
statusCode);
} else {
onFailure(parsed['ErrorSearchMsg'], statusCode);
}
} else {
onFailure(

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class EyeService extends BaseService {
List<AppoimentAllHistoryResultList> appoimentAllHistoryResultList = List();
@ -23,4 +24,53 @@ class EyeService extends BaseService {
super.error = error;
}, body: body);
}
sendGlassesPrescriptionEmail({int appointmentNo,String projectName,int projectID}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['PatientIditificationNum'] = user.patientIdentificationNo;
body['PatientName'] = user.firstName+" "+user.lastName;
body['To'] = user.emailAddress;
body['SetupID'] = user.setupID;
body['DateofBirth'] = user.dateofBirth;
body['ProjectID'] = projectID;
body['AppointmentNo'] = appointmentNo;
body['ProjectName'] = projectName;
body['PatientID'] = user.patientID;
body['PatientMobileNumber'] = Utils.getPhoneNumberWithoutZero(user.mobileNumber);
await baseAppClient.post(SEND_REPORT_EYE_EMAIL,
onSuccess: (response, statusCode) async {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
sendContactLensPrescriptionEmail({int appointmentNo,String projectName,int projectID}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['AppointmentNo'] = appointmentNo;
body['PatientIditificationNum'] = user.patientIdentificationNo;
body['PatientName'] = user.firstName+" "+user.lastName;
body['To'] = user.emailAddress;
body['SetupID'] = user.setupID;
body['DateofBirth'] = user.dateofBirth;
body['ProjectID'] = projectID;
body['AppointmentNo'] = appointmentNo;
body['ProjectName'] = projectName;
body['PatientID'] = user.patientID;
body['PatientMobileNumber'] = Utils.getPhoneNumberWithoutZero(user.mobileNumber);
await baseAppClient.post(SEND_CONTACT_LENS_PRESCRIPTION_EMAIL,
onSuccess: (response, statusCode) async {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -11,7 +11,7 @@ class RadiologyService extends BaseService {
hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = invoiceNo;
body['LineItemNo'] = lineItem;
body['LineIt emNo'] = lineItem;
body['ProjectID'] = projectId;
await baseAppClient.post(GET_RAD_IMAGE_URL,

@ -1,27 +1,46 @@
import 'dart:convert';
import 'dart:developer';
import 'dart:ui';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/PaymentOptions.dart';
import 'package:diplomaticquarterapp/core/model/ResponseModel.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/model/packages_offers/responses/order_response_model.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<OfferCategoriesResponseModel> categoryList = List();
List<PackagesCategoriesResponseModel> categoryList = List();
List<PackagesResponseModel> productList = List();
List<PackagesResponseModel> latestOffersList = List();
List<PackagesResponseModel> bestSellerList = List();
List<PackagesResponseModel> bannersList = List();
List<PackagesCartItemsResponseModel> cartItemList = List();
String cartItemCount = "";
PackagesCustomerResponseModel customer;
Future<List<PackagesCategoriesResponseModel>> getAllCategories(OffersCategoriesRequestModel request) async {
Future errorThrow;
Future<List<OfferCategoriesResponseModel>> 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 +50,18 @@ class OffersAndPackagesServices extends BaseService {
return categoryList;
}
List<OfferProductsResponseModel> productList = List();
Future<List<OfferProductsResponseModel>> getAllProducts(OffersProductsRequestModel request) async {
hasError = false;
Future<List<PackagesResponseModel>> 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 +70,276 @@ class OffersAndPackagesServices extends BaseService {
return productList;
}
Future<List<PackagesResponseModel>> 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<List<PackagesResponseModel>> 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<List<PackagesResponseModel>> 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);
customer = null;
Future errorThrow;
_showLoading(context, showLoading);
var url = EXA_CART_API_BASE_URL + PACKAGES_CUSTOMER;
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);
errorThrow = Future.error(error);
log(error);
});
await Future.delayed(Duration(seconds: 1));
return errorThrow ?? customer;
}
// --------------------
// Shopping Cart
// --------------------
Future<List<PackagesCartItemsResponseModel>> 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(PackagesCartItemsResponseModel.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<ResponseModel<PackagesCartItemsResponseModel>> addProductToCart(AddProductToCartRequestModel request, {@required BuildContext context, bool showLoading = true}) async{
Future errorThrow;
ResponseModel<PackagesCartItemsResponseModel> response;
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);
var jsonCartItem = jsonResponse["shopping_carts"][0];
response = ResponseModel(status: true, data: PackagesCartItemsResponseModel.fromJson(jsonCartItem), error: null);
cartItemCount = response.data.quantity.toString();
}, onFailure: (String error, int statusCode){
_hideLoading(context, showLoading);
errorThrow = Future.error(ResponseModel(status: true, data: null, error: error));
});
return errorThrow ?? response;
}
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<bool> 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 String paymentOption, @required BuildContext context, bool showLoading = true}) async{
Future errorThrow;
var jsonBody = {
"order": {
"customer_id" : customer.id,
"billing_address": {
"email": customer.email,
"phone_number": customer.addresses.first.phoneNumber
},
"payment_method_system_name": "Payments.PayFort",
"payment_option": paymentOption
}
};
int order_id;
_showLoading(context, showLoading);
var url = EXA_CART_API_BASE_URL + PACKAGES_ORDERS;
await baseAppClient.simplePost(url, body: jsonBody, onSuccess: (dynamic stringResponse, int statusCode){
_hideLoading(context, showLoading);
var jsonResponse = json.decode(stringResponse);
order_id = jsonResponse['orders'][0]['id'];
}, onFailure: (String error, int statusCode){
_hideLoading(context, showLoading);
log(error);
errorThrow = Future.error(error);
});
return errorThrow ?? order_id;
}
Future<ResponseModel<PackagesOrderResponseModel>> getOrderById(int id, {@required BuildContext context, bool showLoading = true}) async{
Future errorThrow;
ResponseModel<PackagesOrderResponseModel> response;
_showLoading(context, showLoading);
var url = EXA_CART_API_BASE_URL + PACKAGES_ORDERS + '/$id';
await baseAppClient.simpleGet(url, onSuccess: (dynamic stringResponse, int statusCode) {
_hideLoading(context, showLoading);
var jsonResponse = json.decode(stringResponse);
var jsonOrder = jsonResponse['orders'][0];
response = ResponseModel(status: true, data: PackagesOrderResponseModel.fromJson(jsonOrder));
}, onFailure: (String error, int statusCode) {
_hideLoading(context, showLoading);
errorThrow = Future.error(ResponseModel(status: false,error: error));
}, queryParams: null);
return errorThrow ?? response;
}
}
_showLoading(BuildContext context, bool flag){
if(flag)
GifLoaderDialogUtils.showMyDialog(context);
}
_hideLoading(BuildContext context, bool flag){
if(flag)
GifLoaderDialogUtils.hideDialog(context);
}

@ -3,9 +3,12 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:flutter/cupertino.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class OrderPreviewService extends BaseService {
bool isFinished = true;
@ -15,6 +18,7 @@ class OrderPreviewService extends BaseService {
List<Addresses> addresses = List();
LacumAccountInformation lacumInformation;
LacumAccountInformation lacumGroupInformation;
List<OrderDetailModel> orderList = List();
Future getAddresses() async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
@ -42,13 +46,14 @@ class OrderPreviewService extends BaseService {
dynamic localRes;
hasError = false;
try {
await baseAppClient.getPharmacy("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}",
onSuccess: (dynamic response, int statusCode) {
localRes = response['shipping_option'][0];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
await baseAppClient
.getPharmacy("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}",
onSuccess: (dynamic response, int statusCode) {
localRes = response['shipping_option'][0];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
} catch (error) {
throw error;
}
@ -89,7 +94,7 @@ class OrderPreviewService extends BaseService {
Map<String, dynamic> body = Map();
body["shopping_cart_item"] = choppingCartObject;
await baseAppClient.post("$GET_SHOPPING_CART$productId",
await baseAppClient.pharmacyPost("$GET_SHOPPING_CART$productId", isExternal: false,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
@ -107,7 +112,7 @@ class OrderPreviewService extends BaseService {
Map<String, dynamic> body = Map();
await baseAppClient.post("$DELETE_SHOPPING_CART$productId",
await baseAppClient.pharmacyPost("$DELETE_SHOPPING_CART$productId", isExternal: false,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
@ -125,8 +130,9 @@ class OrderPreviewService extends BaseService {
super.error = "";
dynamic localRes;
await baseAppClient.getPharmacy("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart",
onSuccess: (response, statusCode) async {
await baseAppClient
.getPharmacy("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart",
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -167,23 +173,24 @@ class OrderPreviewService extends BaseService {
try {
await baseAppClient.post(GET_LACUM_GROUP_INFORMATION,
onSuccess: (response, statusCode) async {
lacumGroupInformation = LacumAccountInformation.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
lacumGroupInformation = LacumAccountInformation.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
} catch (error) {
throw error;
}
}
Future makeOrder(PaymentCheckoutData paymentCheckoutData, List<ShoppingCart> shoppingCarts) async {
Future makeOrder(PaymentCheckoutData paymentCheckoutData,
List<ShoppingCart> shoppingCarts) async {
paymentCheckoutData.address.isChecked = true;
hasError = false;
super.error = "";
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en');
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
Map<String, dynamic> orderBody = Map();
@ -192,10 +199,15 @@ class OrderPreviewService extends BaseService {
orderBody['billing_address'] = paymentCheckoutData.address;
orderBody['pick_up_in_store'] = false;
orderBody['payment_method_system_name'] = "Payments.PayFort";
orderBody['shipping_method'] = languageID == 'ar' ? paymentCheckoutData.shippingOption.namen : paymentCheckoutData.shippingOption.name ;
orderBody['shipping_rate_computation_method_system_name'] = paymentCheckoutData.shippingOption.shippingRateComputationMethodSystemName;
orderBody['customer_id'] = customerId;
orderBody['custom_values_xml'] = "PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}";
orderBody['shipping_method'] = languageID == 'ar'
? paymentCheckoutData.shippingOption.namen
: paymentCheckoutData.shippingOption.name;
orderBody['shipping_rate_computation_method_system_name'] =
paymentCheckoutData
.shippingOption.shippingRateComputationMethodSystemName;
orderBody['customer_id'] = int.parse(customerId);
orderBody['custom_values_xml'] =
"PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}";
orderBody['shippingOption'] = paymentCheckoutData.shippingOption;
orderBody['shipping_address'] = paymentCheckoutData.address;
orderBody['lakum_amount'] = paymentCheckoutData.usedLakumPoints;
@ -213,12 +225,17 @@ class OrderPreviewService extends BaseService {
body['order'] = orderBody;
try {
await baseAppClient.post(ORDER_SHOPPING_CART,
await baseAppClient.pharmacyPost(ORDER_SHOPPING_CART, isExternal: false, isAllowAny: true,
onSuccess: (response, statusCode) async {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
orderList.clear();
response['orders'].forEach((item) {
orderList.add(OrderDetailModel.fromJson(item));
print(response);
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
} catch (error) {
throw error;
}
@ -245,4 +262,26 @@ class OrderPreviewService extends BaseService {
return "";
}
}
Future<LatLng> getDriverLocation(dynamic driverId) async{
Map<String, dynamic> jsonBody = Map();
jsonBody['DriverID'] = driverId;
LatLng coordinates;
await baseAppClient.post(DRIVER_LOCATION,
onSuccess: (response, statusCode) async {
if(statusCode == 200){
dynamic locationObject = response['PatientER_GetDriverLocationList'][0];
double lat = locationObject['Latitude'];
double lon = locationObject['Longitude'];
if(lat != null && lon != null){
coordinates = LatLng(lat,lon);
}
}
}, onFailure: (String error, int statusCode) {
}, body: jsonBody);
return coordinates;
}
}

@ -80,7 +80,7 @@ class PharmacyModuleService extends BaseService {
};
hasError = false;
try {
await baseAppClient.get(PHARMACY_AUTORZIE_CUSTOMER,
await baseAppClient.getPharmacy(PHARMACY_AUTORZIE_CUSTOMER,
onSuccess: (dynamic response, int statusCode) async {
if (response['Status'] == 200) {
await sharedPref.setString(

@ -316,4 +316,50 @@ class PharmacyCategoriseService extends BaseService {
},
);
}
Future getMostViewedProducts() async {
Map<String, String> queryParams = {
'fields':
'id,discount_ids,name,reviews,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage',
};
try {
await baseAppClient.getPharmacy(GET_MOST_VIEWED_PRODUCTS,
onSuccess: (dynamic response, int statusCode) {
_finalProducts.clear();
response['products'].forEach((item) {
_finalProducts.add(PharmacyProduct.fromJson(item));
});
print("most viewed products ---------");
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
} catch (error) {
throw error;
}
}
Future getNewProducts() async {
Map<String, String> queryParams = {
'fields':
'Id,name,namen,localized_names,price,images,sku,stock_availability,published',
};
try {
await baseAppClient.getPharmacy(GET_NEW_PRODUCTS,
onSuccess: (dynamic response, int statusCode) {
_finalProducts.clear();
response['products'].forEach((item) {
_finalProducts.add(PharmacyProduct.fromJson(item));
});
print("new products ---------");
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
} catch (error) {
throw error;
}
}
}

@ -18,10 +18,9 @@ class WeatherService extends BaseService {
var long = await sharedPref.getDouble(USER_LONG);
body['Latitude'] = lat ?? 0;
body['Longitude'] = long ?? 0;
weatherIndicatorData = [];
await baseAppClient.post(WEATHER_INDICATOR,
onSuccess: (dynamic response, int statusCode) {
weatherIndicatorData = [];
response['GetCityInfo_List'].forEach((data) {
weatherIndicatorData.add(GetCityInfoList.fromJson(data));
});

@ -55,7 +55,7 @@ class Addresses {
String firstName;
String lastName;
String email;
Null company;
dynamic company;
int countryId;
String country;
Null stateProvinceId;
@ -64,7 +64,7 @@ class Addresses {
String address2;
String zipPostalCode;
String phoneNumber;
Null faxNumber;
dynamic faxNumber;
String customerAttributes;
String createdOnUtc;
Null province;

@ -40,6 +40,8 @@ class HomeHealthCareViewModel extends BaseViewModel {
PharmacyModuleService _pharmacyModuleService = locator<PharmacyModuleService>();
bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated;
GetHHCAllPresOrdersResponseModel pendingOrder;
@ -136,9 +138,13 @@ class HomeHealthCareViewModel extends BaseViewModel {
{AddNewAddressRequestModel addNewAddressRequestModel}) async {
setState(ViewState.Busy);
await _customerAddressesService.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel
);
await _pharmacyModuleService.generatePharmacyToken().then((value) async{
await _customerAddressesService.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel
);
});
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);

@ -1,4 +1,6 @@
import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart';
import 'base_view_model.dart';
import '../../locator.dart';
@ -8,7 +10,10 @@ class AnciallryOrdersViewModel extends BaseViewModel {
bool hasError = false;
AncillaryOrdersService _ancillaryService = locator<AncillaryOrdersService>();
List<AncillaryOrdersListModel> get ancillaryLists =>
_ancillaryService.ancillaryLists;
List<AncillaryOrdersListProcListModel> get ancillaryListsDetails =>
_ancillaryService.ancillaryProcLists;
Future getOrders() async {
hasError = false;
setState(ViewState.Busy);
@ -19,4 +24,15 @@ class AnciallryOrdersViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
Future getOrdersDetails(appointmentNo, orderNo) async {
hasError = false;
setState(ViewState.Busy);
await _ancillaryService.getOrdersDetails(appointmentNo, orderNo);
if (_ancillaryService.hasError) {
error = _ancillaryService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -43,4 +43,34 @@ class EyeViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
sendGlassesPrescriptionEmail({int appointmentNo, String projectName, int projectID}) async {
setState(ViewState.Busy);
await _eyeService.sendGlassesPrescriptionEmail(
appointmentNo: appointmentNo,
projectID: projectID,
projectName: projectName);
if (_eyeService.hasError) {
error = _eyeService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
sendContactLensPrescriptionEmail({int appointmentNo, String projectName, int projectID}) async {
setState(ViewState.Busy);
await _eyeService.sendContactLensPrescriptionEmail(
appointmentNo: appointmentNo,
projectID: projectID,
projectName: projectName);
if (_eyeService.hasError) {
error = _eyeService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}

@ -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';
@ -8,12 +9,29 @@ import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:diplomaticquarterapp/locator.dart';
class OfferCategoriesViewModel extends BaseViewModel {
class OfferCategoriesViewModel extends BaseViewModel{
OffersAndPackagesServices service = locator<OffersAndPackagesServices>();
List<OfferCategoriesResponseModel> get list => service.categoryList;
get categoryList => service.categoryList;
get productList => service.categoryList;
}
class OfferProductsViewModel extends BaseViewModel {
class PackagesViewModel extends BaseViewModel {
OffersAndPackagesServices service = locator<OffersAndPackagesServices>();
List<OfferProductsResponseModel> get list => service.productList;
List<PackagesCategoriesResponseModel> get categoryList => service.categoryList;
List<PackagesResponseModel> get productList => service.productList;
List<PackagesResponseModel> get latestOffersList => service.latestOffersList;
List<PackagesResponseModel> get bestSellerList => service.bestSellerList;
List<PackagesResponseModel> get bannersList => service.bannersList;
List<PackagesCartItemsResponseModel> get cartItemList => service.cartItemList;
String _cartItemCount = "";
String get cartItemCount => _cartItemCount;
set cartItemCount(String value) {
_cartItemCount = value;
notifyListeners();
}
}

@ -5,8 +5,10 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformati
import 'package:diplomaticquarterapp/core/model/pharmacies/ShippingOption.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
@ -17,6 +19,11 @@ class OrderPreviewViewModel extends BaseViewModel {
List<Addresses> get addresses => _orderService.addresses;
LacumAccountInformation get lacumInformation =>
_orderService.lacumInformation;
List<OrderDetailModel> get orderListModel => _orderService.orderList;
PharmacyModuleViewModel pharmacyModuleViewModel =
locator<PharmacyModuleViewModel>();
ShoppingCartResponse cartResponse = ShoppingCartResponse();
PaymentCheckoutData paymentCheckoutData = PaymentCheckoutData();
double totalAdditionalShippingCharge = 0;
@ -32,7 +39,7 @@ class OrderPreviewViewModel extends BaseViewModel {
}
}
getShoppingCart() async {
Future getShoppingCart() async {
setState(ViewState.Busy);
await _orderService.getShoppingCart().then((res) {
_handleGetShoppingCartResponse(res);
@ -48,20 +55,20 @@ class OrderPreviewViewModel extends BaseViewModel {
}
}
changeProductQuantity(ShoppingCart product) async {
Future changeProductQuantity(ShoppingCart product) async {
setState(ViewState.Busy);
await _orderService.changeProductQuantity(product.id, product).then((res) {
_handleGetShoppingCartResponse(res);
});
if (_orderService.hasError) {
error = _orderService.error;
setState(ViewState.Error);
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
deleteProduct(ShoppingCart product) async {
Future deleteProduct(ShoppingCart product) async {
setState(ViewState.Busy);
await _orderService.deleteProduct(product.id).then((res) {
_handleGetShoppingCartResponse(res);
@ -74,7 +81,7 @@ class OrderPreviewViewModel extends BaseViewModel {
}
}
deleteShoppingCart() async {
Future deleteShoppingCart() async {
setState(ViewState.Busy);
await _orderService.deleteShoppingCart().then((res) {
_handleGetShoppingCartResponse(res);
@ -182,6 +189,8 @@ class OrderPreviewViewModel extends BaseViewModel {
Future makeOrder() async {
setState(ViewState.Busy);
await pharmacyModuleViewModel.generatePharmacyToken();
await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts);
if (_orderService.hasError) {
error = _orderService.error;

@ -49,7 +49,7 @@ class OrderModelViewModel extends BaseViewModel {
}
}
Future getOrderDetails(OrderId) async {
Future<OrderDetailModel> getOrderDetails(OrderId) async {
setState(ViewState.Busy);
await _orderDetailsService.getOrderDetails(OrderId);
if (_orderDetailsService.hasError) {
@ -58,6 +58,7 @@ class OrderModelViewModel extends BaseViewModel {
} else {
setState(ViewState.Idle);
}
return _orderDetailsService.orderList.first;
}
Future getProductReview() async {
@ -110,15 +111,16 @@ class OrderModelViewModel extends BaseViewModel {
message: "Your review has been Submitted successfully");
}
}
Future makeOrder() async {
setState(ViewState.Busy);
/* setState(ViewState.Busy);
await _orderServices.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts);
if (_orderServices.hasError) {
error = _orderServices.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}*/
}
}

@ -44,13 +44,15 @@ class PharmacyModuleViewModel extends BaseViewModel {
// List<PharmacyProduct> get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ;
Future getPharmacyHomeData() async {
setState(ViewState.Busy);
if(authenticatedUserObject.isLogin)
await generatePharmacyToken();
var data = await sharedPref.getObject(USER_PROFILE);
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
setState(ViewState.Busy);
if (authenticatedUserObject.isLogin && data != null && customerId == null) {
await _pharmacyService.makeVerifyCustomer(data);
// here must call getShoppingCard()
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);

@ -203,4 +203,26 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
Future getMostViewedProducts() async {
setState(ViewState.Busy);
await _pharmacyCategoriseService.getMostViewedProducts();
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future getNewProducts() async {
setState(ViewState.Busy);
await _pharmacyCategoriseService.getNewProducts();
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}

@ -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<String, dynamic> json) {
offerCategoriesResponseModelFromJson(PackagesCategoriesResponseModel data, Map<String, dynamic> 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<Stri
return data;
}
Map<String, dynamic> offerCategoriesResponseModelToJson(OfferCategoriesResponseModel entity) {
Map<String, dynamic> offerCategoriesResponseModelToJson(PackagesCategoriesResponseModel entity) {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = entity.id;
data['name'] = entity.name;

@ -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<String, dynamic> json) {
offerProductsResponseModelFromJson(PackagesResponseModel data, Map<String, dynamic> 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<String,
return data;
}
Map<String, dynamic> offerProductsResponseModelToJson(OfferProductsResponseModel entity) {
Map<String, dynamic> offerProductsResponseModelToJson(PackagesResponseModel entity) {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = entity.id;
data['visible_individually'] = entity.visibleIndividually;

@ -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<T> {
static _getFromJson<T>(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<T> {
static _getToJson<T>(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<T> {
//Go back to a single instance by type
static _fromJsonSingle<M>(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<T> {
//list is returned by type
static M _getListChildType<M>(List<Map> data) {
if (List<OfferCategoriesResponseModel>() is M) {
return data.map((e) => OfferCategoriesResponseModel().fromJson(e)).toList() as M;
if (List<PackagesCategoriesResponseModel>() is M) {
return data.map((e) => PackagesCategoriesResponseModel().fromJson(e)).toList() as M;
} else if (List<OfferCategoriesResponseModelLocalizedName>() is M) {
return data.map((e) => OfferCategoriesResponseModelLocalizedName().fromJson(e)).toList() as M;
} else if (List<OfferCategoriesResponseModelImage>() is M) {
return data.map((e) => OfferCategoriesResponseModelImage().fromJson(e)).toList() as M;
} else if (List<LogGeoZoneResponseModel>() is M) {
return data.map((e) => LogGeoZoneResponseModel().fromJson(e)).toList() as M;
} else if (List<OfferProductsResponseModel>() is M) {
return data.map((e) => OfferProductsResponseModel().fromJson(e)).toList() as M;
} else if (List<PackagesResponseModel>() is M) {
return data.map((e) => PackagesResponseModel().fromJson(e)).toList() as M;
} else if (List<OfferProductsResponseModelLocalizedName>() is M) {
return data.map((e) => OfferProductsResponseModelLocalizedName().fromJson(e)).toList() as M;
} else if (List<OfferProductsResponseModelImage>() is M) {

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart';
import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/service/qr_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
@ -194,6 +196,7 @@ void setupLocator() {
locator.registerLazySingleton(() => DeleteBabyService());
locator.registerLazySingleton(() => VaccinationTableService());
locator.registerLazySingleton(() => AncillaryOrdersService());
locator.registerLazySingleton(() => EdOnlineServices());
//pharmacy
@ -223,7 +226,6 @@ void setupLocator() {
locator.registerLazySingleton(() => PrescriptionService());
locator.registerLazySingleton(() => RecommendedProductService());
locator.registerLazySingleton(() => PrivilegeService());
locator.registerLazySingleton(() => WeatherService());
locator.registerLazySingleton(() => TermsConditionsService());
@ -298,12 +300,9 @@ void setupLocator() {
// Offer And Packages
//----------------------
locator.registerLazySingleton(
() => OffersAndPackagesServices()); // offerPackagesServices Service
locator.registerFactory(
() => OfferCategoriesViewModel()); // Categories View Model
locator
.registerFactory(() => OfferProductsViewModel()); // Products View Model
locator.registerLazySingleton(() => OffersAndPackagesServices()); // offerPackagesServices Service
locator.registerFactory(() => OfferCategoriesViewModel()); // Categories View Model
locator.registerFactory(() => PackagesViewModel()); // Products View Model
//pharmacy
// locator.registerFactory(() => PharmacyCategoriseViewModel());
@ -313,4 +312,5 @@ void setupLocator() {
locator.registerLazySingleton(
() => GeofencingServices()); // Geofencing Services
locator.registerFactory(() => TermsConditionsViewModel());
locator.registerFactory(() => AnciallryOrdersViewModel());
}

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/HMG_Geofence.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -15,6 +16,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'Constants.dart';
import 'config/shared_pref_kay.dart';
import 'config/size_config.dart';
import 'core/model/geofencing/requests/GeoZonesRequestModel.dart';
import 'core/service/geofencing/GeofencingServices.dart';
@ -34,7 +36,7 @@ class MyApp extends StatefulWidget {
class _MyApp extends State<MyApp> {
@override
void initState() {
void initState(){
// ProjectViewModel projectProvider;
// projectProvider = Provider.of(context);
// var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans';
@ -70,7 +72,10 @@ class _MyApp extends State<MyApp> {
value: SearchProvider(),
),
ChangeNotifierProvider<ThemeNotifier>(
create: (context) => ThemeNotifier(defaultTheme())),
create: (context) => ThemeNotifier(
defaultTheme()
)
),
StreamProvider.value(
value: RobotProvider().intStream(),
initialData: RobotProvider().setValue({}),
@ -138,6 +143,8 @@ class _MyApp extends State<MyApp> {
// ),
// ),
initialRoute: SPLASH,
// initialRoute: PACKAGES_OFFERS,
// initialRoute: PACKAGES_ORDER_COMPLETED,
routes: routes,
debugShowCheckedModeBanner: false,
),

@ -0,0 +1,249 @@
class AncillaryOrdersListProcListModel {
List<AncillaryOrderProcList> ancillaryOrderProcList;
String appointmentDate;
dynamic appointmentNo;
dynamic clinicID;
String clinicName;
dynamic companyID;
String companyName;
dynamic doctorID;
String doctorName;
Null errCode;
dynamic groupID;
String insurancePolicyNo;
String message;
String patientCardID;
dynamic patientID;
String patientName;
dynamic patientType;
dynamic policyID;
String policyName;
dynamic projectID;
String setupID;
dynamic statusCode;
dynamic subCategoryID;
String subPolicyNo;
AncillaryOrdersListProcListModel(
{this.ancillaryOrderProcList,
this.appointmentDate,
this.appointmentNo,
this.clinicID,
this.clinicName,
this.companyID,
this.companyName,
this.doctorID,
this.doctorName,
this.errCode,
this.groupID,
this.insurancePolicyNo,
this.message,
this.patientCardID,
this.patientID,
this.patientName,
this.patientType,
this.policyID,
this.policyName,
this.projectID,
this.setupID,
this.statusCode,
this.subCategoryID,
this.subPolicyNo});
AncillaryOrdersListProcListModel.fromJson(Map<String, dynamic> json) {
if (json['AncillaryOrderProcList'] != null) {
ancillaryOrderProcList = new List<AncillaryOrderProcList>();
json['AncillaryOrderProcList'].forEach((v) {
ancillaryOrderProcList.add(new AncillaryOrderProcList.fromJson(v));
});
}
appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo'];
clinicID = json['ClinicID'];
clinicName = json['ClinicName'];
companyID = json['CompanyID'];
companyName = json['CompanyName'];
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
errCode = json['ErrCode'];
groupID = json['GroupID'];
insurancePolicyNo = json['InsurancePolicyNo'];
message = json['Message'];
patientCardID = json['PatientCardID'];
patientID = json['PatientID'];
patientName = json['PatientName'];
patientType = json['PatientType'];
policyID = json['PolicyID'];
policyName = json['PolicyName'];
projectID = json['ProjectID'];
setupID = json['SetupID'];
statusCode = json['StatusCode'];
subCategoryID = json['SubCategoryID'];
subPolicyNo = json['SubPolicyNo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.ancillaryOrderProcList != null) {
data['AncillaryOrderProcList'] =
this.ancillaryOrderProcList.map((v) => v.toJson()).toList();
}
data['AppointmentDate'] = this.appointmentDate;
data['AppointmentNo'] = this.appointmentNo;
data['ClinicID'] = this.clinicID;
data['ClinicName'] = this.clinicName;
data['CompanyID'] = this.companyID;
data['CompanyName'] = this.companyName;
data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName;
data['ErrCode'] = this.errCode;
data['GroupID'] = this.groupID;
data['InsurancePolicyNo'] = this.insurancePolicyNo;
data['Message'] = this.message;
data['PatientCardID'] = this.patientCardID;
data['PatientID'] = this.patientID;
data['PatientName'] = this.patientName;
data['PatientType'] = this.patientType;
data['PolicyID'] = this.policyID;
data['PolicyName'] = this.policyName;
data['ProjectID'] = this.projectID;
data['SetupID'] = this.setupID;
data['StatusCode'] = this.statusCode;
data['SubCategoryID'] = this.subCategoryID;
data['SubPolicyNo'] = this.subPolicyNo;
return data;
}
}
class AncillaryOrderProcList {
dynamic approvalLineItemNo;
dynamic approvalNo;
String approvalStatus;
dynamic approvalStatusID;
dynamic companyShare;
dynamic companyShareWithTax;
dynamic companyTaxAmount;
dynamic discountAmount;
dynamic discountCategory;
String discountType;
dynamic discountTypeValue;
bool isApprovalCreated;
bool isApprovalRequired;
bool isCovered;
String orderDate;
dynamic orderLineItemNo;
dynamic orderNo;
dynamic partnerID;
dynamic partnerShare;
String partnerShareType;
dynamic patientShare;
dynamic patientShareWithTax;
dynamic patientTaxAmount;
dynamic procPrice;
dynamic procedureCategoryID;
String procedureCategoryName;
String procedureID;
String procedureName;
dynamic taxAmount;
dynamic taxPct;
AncillaryOrderProcList(
{this.approvalLineItemNo,
this.approvalNo,
this.approvalStatus,
this.approvalStatusID,
this.companyShare,
this.companyShareWithTax,
this.companyTaxAmount,
this.discountAmount,
this.discountCategory,
this.discountType,
this.discountTypeValue,
this.isApprovalCreated,
this.isApprovalRequired,
this.isCovered,
this.orderDate,
this.orderLineItemNo,
this.orderNo,
this.partnerID,
this.partnerShare,
this.partnerShareType,
this.patientShare,
this.patientShareWithTax,
this.patientTaxAmount,
this.procPrice,
this.procedureCategoryID,
this.procedureCategoryName,
this.procedureID,
this.procedureName,
this.taxAmount,
this.taxPct});
AncillaryOrderProcList.fromJson(Map<String, dynamic> json) {
approvalLineItemNo = json['ApprovalLineItemNo'];
approvalNo = json['ApprovalNo'];
approvalStatus = json['ApprovalStatus'];
approvalStatusID = json['ApprovalStatusID'];
companyShare = json['CompanyShare'];
companyShareWithTax = json['CompanyShareWithTax'];
companyTaxAmount = json['CompanyTaxAmount'];
discountAmount = json['DiscountAmount'];
discountCategory = json['DiscountCategory'];
discountType = json['DiscountType'];
discountTypeValue = json['DiscountTypeValue'];
isApprovalCreated = json['IsApprovalCreated'];
isApprovalRequired = json['IsApprovalRequired'];
isCovered = json['IsCovered'];
orderDate = json['OrderDate'];
orderLineItemNo = json['OrderLineItemNo'];
orderNo = json['OrderNo'];
partnerID = json['PartnerID'];
partnerShare = json['PartnerShare'];
partnerShareType = json['PartnerShareType'];
patientShare = json['PatientShare'];
patientShareWithTax = json['PatientShareWithTax'];
patientTaxAmount = json['PatientTaxAmount'];
procPrice = json['ProcPrice'];
procedureCategoryID = json['ProcedureCategoryID'];
procedureCategoryName = json['ProcedureCategoryName'];
procedureID = json['ProcedureID'];
procedureName = json['ProcedureName'];
taxAmount = json['TaxAmount'];
taxPct = json['TaxPct'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ApprovalLineItemNo'] = this.approvalLineItemNo;
data['ApprovalNo'] = this.approvalNo;
data['ApprovalStatus'] = this.approvalStatus;
data['ApprovalStatusID'] = this.approvalStatusID;
data['CompanyShare'] = this.companyShare;
data['CompanyShareWithTax'] = this.companyShareWithTax;
data['CompanyTaxAmount'] = this.companyTaxAmount;
data['DiscountAmount'] = this.discountAmount;
data['DiscountCategory'] = this.discountCategory;
data['DiscountType'] = this.discountType;
data['DiscountTypeValue'] = this.discountTypeValue;
data['IsApprovalCreated'] = this.isApprovalCreated;
data['IsApprovalRequired'] = this.isApprovalRequired;
data['IsCovered'] = this.isCovered;
data['OrderDate'] = this.orderDate;
data['OrderLineItemNo'] = this.orderLineItemNo;
data['OrderNo'] = this.orderNo;
data['PartnerID'] = this.partnerID;
data['PartnerShare'] = this.partnerShare;
data['PartnerShareType'] = this.partnerShareType;
data['PatientShare'] = this.patientShare;
data['PatientShareWithTax'] = this.patientShareWithTax;
data['PatientTaxAmount'] = this.patientTaxAmount;
data['ProcPrice'] = this.procPrice;
data['ProcedureCategoryID'] = this.procedureCategoryID;
data['ProcedureCategoryName'] = this.procedureCategoryName;
data['ProcedureID'] = this.procedureID;
data['ProcedureName'] = this.procedureName;
data['TaxAmount'] = this.taxAmount;
data['TaxPct'] = this.taxPct;
return data;
}
}

@ -49,6 +49,7 @@ class _LocationPageState
return BaseView<HomeHealthCareViewModel>(
onModelReady: (model) {},
builder: (_, model, widget) => AppScaffold(
appBarTitle: TranslationBase.of(context).addAddress,
isShowDecPage: false,
isShowAppBar: true,
baseViewModel: model,
@ -121,6 +122,7 @@ class _LocationPageState
}
});
await model.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel);
if (model.state == ViewState.ErrorLocal) {
@ -129,7 +131,7 @@ class _LocationPageState
AppToast.showSuccessToast(
message: "Address Added Successfully");
}
Navigator.of(context).pop();
Navigator.of(context).pop(addNewAddressRequestModel);
},
label: TranslationBase.of(context).addNewAddress,
),

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart';
@ -203,7 +204,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
onTap: () => Navigator.push(
context,
FadePage(
page: PaymentService(),
page: AnicllaryOrders(),
),
),
imageLocation:

@ -1,16 +1,13 @@
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class AnicllaryOrders extends StatefulWidget {
@override
@ -36,8 +33,145 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders>
onModelReady: (model) => model.getOrders(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).parking,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).anicllaryOrders,
body: SingleChildScrollView(
padding: EdgeInsets.all(12), child: Container())));
padding: EdgeInsets.all(12),
child: model.ancillaryLists.length > 0
? Column(children: [
getPatientInfo(model),
getAncillaryOrdersList(model)
])
: SizedBox())));
}
Widget getPatientInfo(AnciallryOrdersViewModel model) {
print(model.ancillaryLists);
return Padding(
child: Column(
children: [
Row(
children: [
Texts(
TranslationBase.of(context).mrn,
fontWeight: FontWeight.bold,
fontSize: 22,
),
Texts(
" : ",
fontSize: 20,
),
Texts(
model.ancillaryLists[0].patientID.toString(),
)
],
),
Row(
children: [
Texts(
TranslationBase.of(context).patientName,
fontWeight: FontWeight.bold,
fontSize: 20,
),
Texts(
" : ",
fontSize: 20,
),
Texts(
model.ancillaryLists[0].patientName,
)
],
),
Divider()
],
),
padding: EdgeInsets.only(top: 5.0, bottom: 10.0),
);
}
Widget getAncillaryOrdersList(AnciallryOrdersViewModel model) {
return Column(
children: model.ancillaryLists[0].ancillaryOrderList
.map(
(item) => InkWell(
onTap: () {
ancillaryOrdersDetails(item);
},
child: Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
))),
padding: EdgeInsets.all(15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(3),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.appointmentNo +
' : ',
fontWeight: FontWeight.bold,
),
Texts(item.appointmentNo.toString())
],
)),
Padding(
padding: EdgeInsets.all(3),
child: Row(
children: [
Texts(
TranslationBase.of(context)
.appointmentDate +
' : ',
fontWeight: FontWeight.bold),
Texts(DateUtil.getFormattedDate(
DateUtil.convertStringToDate(
item.appointmentDate),
"MMM dd,yyyy"))
],
)),
Padding(
padding: EdgeInsets.all(3),
child: Row(
children: [
Texts(
TranslationBase.of(context)
.doctorName +
' : ',
fontWeight: FontWeight.bold),
Texts(item.doctorName.toString())
],
)),
Divider(
color: Colors.black12,
height: 1,
)
]),
Icon(
Icons.arrow_right,
size: 25,
)
]))),
)
.toList());
}
ancillaryOrdersDetails(item) {
Navigator.push(
context,
FadePage(
page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo),
),
);
}
}

@ -0,0 +1,280 @@
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import "package:collection/collection.dart";
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic appoNo;
final dynamic orderNo;
AnicllaryOrdersDetails(this.appoNo, this.orderNo);
@override
_AnicllaryOrdersState createState() => _AnicllaryOrdersState();
}
class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
with SingleTickerProviderStateMixin {
void initState() {
super.initState();
}
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) =>
model.getOrdersDetails(widget.appoNo, widget.orderNo),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).anicllaryOrders,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: model.ancillaryListsDetails.length > 0
? Column(children: [
getPatientInfo(model),
getInvoiceDetails(model),
getInsuranceDetails(model),
getAncillaryDetails(model),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 20,
fontWeight: FontWeight.bold,
),
Texts(
getTotalValue(model),
fontSize: 20,
fontWeight: FontWeight.bold,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Button(
label: TranslationBase.of(context).payNow,
onTap: () {},
)
],
)
])
: SizedBox())));
}
Widget getPatientInfo(AnciallryOrdersViewModel model) {
print(model.ancillaryListsDetails);
return Padding(
child: Column(
children: [
Row(
children: [
Texts(
TranslationBase.of(context).mrn,
fontWeight: FontWeight.bold,
fontSize: 22,
),
Texts(
" : ",
fontSize: 20,
),
Texts(
model.ancillaryListsDetails[0].patientID.toString(),
)
],
),
Row(
children: [
Texts(
TranslationBase.of(context).patientName,
fontWeight: FontWeight.bold,
fontSize: 20,
),
Texts(
" : ",
fontSize: 20,
),
Texts(
model.ancillaryLists[0].patientName,
)
],
),
Divider(
color: Colors.black26,
)
],
),
padding: EdgeInsets.only(top: 5.0, bottom: 5.0),
);
}
Widget getInvoiceDetails(model) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Texts(
TranslationBase.of(context).invoiceNo,
fontWeight: FontWeight.bold,
),
Texts(" : "),
Texts(
model.ancillaryListsDetails[0].appointmentNo.toString(),
)
],
),
Row(
children: [
Texts(
TranslationBase.of(context).date,
fontWeight: FontWeight.bold,
),
Texts(" : "),
Texts(
DateUtil.getFormattedDate(
DateUtil.convertStringToDate(
model.ancillaryListsDetails[0].appointmentDate),
"MMM dd,yyyy"),
)
],
),
Row(
children: [
Texts(
TranslationBase.of(context).date,
fontWeight: FontWeight.bold,
),
Texts(" : "),
Texts(
model.ancillaryListsDetails[0].doctorName,
),
],
),
SizedBox(
height: 10,
),
Divider(
color: Colors.black26,
)
],
);
}
Widget getInsuranceDetails(model) {
return Padding(
padding: EdgeInsets.only(top: 10, bottom: 10),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Texts(
TranslationBase.of(context).insurance,
fontWeight: FontWeight.bold,
),
Texts(
TranslationBase.of(context).insuranceID,
fontWeight: FontWeight.bold,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Texts(
model.ancillaryListsDetails[0].policyName,
),
Texts(
model.ancillaryListsDetails[0].insurancePolicyNo,
)
],
),
SizedBox(
height: 15,
),
Divider(
color: Colors.red[800],
thickness: 3,
)
],
));
}
Widget getAncillaryDetails(model) {
Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcList,
(obj) => obj.procedureCategoryName);
print(newMap);
return Padding(
padding: EdgeInsets.only(top: 10, bottom: 10),
child: getHeaderDetails(newMap));
}
Widget getHeaderDetails(newMap) {
List<Widget> list = new List<Widget>();
newMap.forEach((key, value) {
list.add(
Texts(
key,
fontWeight: FontWeight.bold,
),
);
list.add(Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
getLabDetails(value),
],
));
});
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: list,
);
}
String getTotalValue(value) {
double total = 0.0;
value.ancillaryListsDetails[0].ancillaryOrderProcList
.forEach((result) => {total += result.companyShareWithTax});
return total.toStringAsFixed(2);
}
getLabDetails(value) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: value.map<Widget>((result) {
return Container(
width: MediaQuery.of(context).size.width * .9,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
flex: 3,
child: Text(result.procedureName.toString(),
overflow: TextOverflow.ellipsis)),
Expanded(child: AppText(result.companyShare.toString())),
Expanded(child: AppText(result.companyTaxAmount.toString())),
Expanded(
child: AppText(
result.companyShareWithTax.toString(),
))
],
));
}).toList(),
);
}
}

@ -57,7 +57,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
ProjectViewModel projectViewModel;
AuthenticatedUser user;
VitalSignService _vitalSignService = locator<VitalSignService>();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
PharmacyModuleViewModel pharmacyModuleViewModel =
locator<PharmacyModuleViewModel>();
var isVaiable = false;
@override
@ -659,14 +660,15 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
removeFamily(family, context),
ConfirmDialog.closeAlertDialog(context)
ConfirmDialog.closeAlertDialog(context),
removeFamily(family, context)
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
removeFamily(GetAllSharedRecordsByStatusList family, context) {
GifLoaderDialogUtils.showMyDialog(context);
this.userID = family.iD;
Map<String, dynamic> request = {};
request['ID'] = this.userID;
@ -678,7 +680,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
}
refreshFamily(context) {
//sharedPref.remove(FAMILY_FILE);
GifLoaderDialogUtils.hideDialog(context);
setState(() {
sharedPref.remove(FAMILY_FILE);
});
@ -707,10 +709,11 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
loginAfter(result, context) async {
GifLoaderDialogUtils.hideDialog(context);
var currentLang = await sharedPref.getString(APP_LANGUAGE);
result = list.CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE);
Provider.of<ProjectViewModel>(context, listen: false)
.setPrivilege(privilegeList: result, isLoginChild: true);
result = list.CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE);
result = list.CheckActivationCode.fromJson(result);
var mainUser = await sharedPref.getObject(MAIN_USER);
var bloodType = await sharedPref.getString(BLOOD_TYPE);
@ -731,8 +734,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Provider.of<ProjectViewModel>(context, listen: false)
.setUser(authenticatedUserObject.user);
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if(pharmacyModuleViewModel.error.isNotEmpty)
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if (pharmacyModuleViewModel.error.isNotEmpty)
await pharmacyModuleViewModel.createUser();
});

@ -124,7 +124,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
: Column(
children: [
SizedBox(
height: 80,
height: 20,
),
Container(
margin: EdgeInsets.only(left: 12, right: 12),

@ -210,71 +210,77 @@ class _SelectTransportationMethodState
SizedBox(
height: 5,
),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_way = Way.OneWay;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title:
Texts(TranslationBase.of(context).oneDirec),
leading: Radio(
value: Way.OneWay,
groupValue: _way,
onChanged: (value) {
setState(() {
_way = value;
});
},
Container(
margin: EdgeInsets.only(bottom:65 ),
child: Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_way = Way.OneWay;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title:
Texts(TranslationBase.of(context).oneDirec),
leading: Radio(
value: Way.OneWay,
groupValue: _way,
onChanged: (value) {
setState(() {
_way = value;
});
},
),
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_way = Way.TwoWays;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title:
Texts(TranslationBase.of(context).twoDirec),
leading: Radio(
value: Way.TwoWays,
groupValue: _way,
onChanged: (value) {
setState(() {
_way = value;
});
},
Expanded(
child: InkWell(
onTap: () {
setState(() {
_way = Way.TwoWays;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title:
Texts(TranslationBase.of(context).twoDirec),
leading: Radio(
value: Way.TwoWays,
groupValue: _way,
onChanged: (value) {
setState(() {
_way = value;
});
},
),
),
),
),
),
),
],
],
),
),
SizedBox(
height: 30,
),
],
),

@ -73,6 +73,7 @@ class _SummaryState extends State<Summary> {
Texts(TranslationBase.of(context).billAmount,textAlign: TextAlign.start,),
SizedBox(height: 5,),
Container(
height: 55,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
@ -87,8 +88,8 @@ class _SummaryState extends State<Summary> {
],
),
),
SizedBox(height: 250),
SizedBox(height: 45,),
],
),

@ -509,8 +509,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
Navigator.push(
context,
FadePage(
page:
LaboratoryResultPage(patientLabOrders: patientLabOrders)))
page: LaboratoryResultPage(patientLabOrders: patientLabOrders)))
.then((value) {});
}
@ -518,8 +517,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
Navigator.push(
context,
FadePage(
page:
RadiologyDetailsPage(finalRadiology: finalRadiology)))
page: RadiologyDetailsPage(finalRadiology: finalRadiology)))
.then((value) {});
}
@ -542,7 +540,17 @@ class _AppointmentActionsState extends State<AppointmentActions> {
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: ReminderDialog(appo: appo),
child: ReminderDialog(
eventId: appo.appointmentNo.toString(),
title: "Doctor Appointment",
description: "You have an appointment with " +
appo.doctorTitle +
" " +
appo.doctorNameObj,
startDate: appo.appointmentDate,
endDate: appo.appointmentDate,
location: appo.projectName,
),
),
);
},
@ -668,7 +676,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
context,
FadePage(
page: VitalSignDetailsScreen(
appointmentNo: appoNo, projectID: projectID,isNotOneAppointment: false,)));
appointmentNo: appoNo,
projectID: projectID,
isNotOneAppointment: false,
)));
}
navigateToInsertComplaint() {

@ -9,9 +9,14 @@ import 'package:manage_calendar_events/manage_calendar_events.dart';
class ReminderDialog extends StatefulWidget {
static var selectedDuration;
AppoitmentAllHistoryResultList appo;
final String eventId;
final String title;
final String description;
final String startDate;
final String endDate;
final String location;
ReminderDialog({@required this.appo});
ReminderDialog({@required this.eventId, @required this.title, @required this.description, @required this.startDate, @required this.endDate, @required this.location});
@override
_ReminderDialogState createState() => _ReminderDialogState();
@ -98,17 +103,14 @@ class _ReminderDialogState extends State<ReminderDialog> {
});
CalendarEvent calendarEvent = new CalendarEvent(
eventId: widget.appo.appointmentNo.toString(),
title: "Doctor Appointment",
description: "You have an appointment with " +
widget.appo.doctorTitle +
" " +
widget.appo.doctorNameObj,
startDate: DateUtil.convertStringToDate(widget.appo.appointmentDate)
eventId: widget.eventId,
title: widget.title,
description: widget.description,
startDate: DateUtil.convertStringToDate(widget.startDate)
.subtract(
new Duration(microseconds: ReminderDialog.selectedDuration)),
endDate: DateUtil.convertStringToDate(widget.appo.appointmentDate),
location: widget.appo.projectName,
endDate: DateUtil.convertStringToDate(widget.endDate),
location: widget.location,
duration: new Duration(minutes: 15).inMinutes,
isAllDay: false,
hasAlarm: true);
@ -118,7 +120,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
.then((value) {
print("Cal event");
print(value);
if (int.parse(value) == widget.appo.appointmentNo) {
if (int.parse(value) == int.parse(widget.eventId)) {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
}
Navigator.of(context).pop();

@ -41,6 +41,10 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
model.getManufacturerProducts(id);
} else if (widget.productType == 3) {
model.getLastVisitedProducts();
} else if (widget.productType == 4){
model.getMostViewedProducts();
} else if (widget.productType == 5){
model.getNewProducts();
} else {
model.getBestSellerProducts();
}

@ -109,58 +109,92 @@ class _InsuranceCardState extends State<InsuranceCard> {
),
Column(
crossAxisAlignment:
CrossAxisAlignment.stretch,
CrossAxisAlignment.start,
children: <Widget>[
Texts(
TranslationBase.of(context).category +": "+
model.insurance[index]
.subCategoryDesc,
fontSize: 18.5,
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context)
.category,
fontSize: 18.5),
Texts(
model.insurance[index]
.subCategoryDesc,
fontSize: 18.5)
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context)
.expirationDate +": "+
convertDateFormat(model
.insurance[index].cardValidTo),
fontSize: 18.5,
),
Expanded(
child: Column(
children: <Widget>[
model.insurance[index].isActive == true
? Texts(
TranslationBase.of(context)
.activeInsurence,
color: Colors.green,
fontWeight: FontWeight.w900,
fontSize: 17.9)
: Texts(
TranslationBase.of(context)
.notActive,
color: Colors.red,
fontWeight: FontWeight.w900,
fontSize: 17.9)
],
),
),
TranslationBase.of(context)
.expirationDate,
fontSize: 18.5),
Texts(
convertDateFormat(
model.insurance[index]
.cardValidTo,
),
fontSize: 18.5),
],
),
Texts(
TranslationBase.of(context)
.patientCard +": "+
model
.insurance[index].patientCardID,
fontSize: 18.5,
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context)
.status +
": ",
fontSize: 18.5),
model.insurance[index].isActive ==
true
? Texts(
TranslationBase.of(context)
.activeInsurence,
color: Colors.green,
fontWeight: FontWeight.w900,
fontSize: 17.9)
: Texts(
TranslationBase.of(context)
.notActive,
color: Colors.red,
fontWeight: FontWeight.w900,
fontSize: 17.9)
],
),
Texts(
TranslationBase.of(context)
.policyNumber +" "+
model.insurance[index]
.insurancePolicyNumber,
fontSize: 18.5,
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context)
.patientCard,
fontSize: 18.5),
Texts(
model.insurance[index]
.patientCardID,
fontSize: 18.5)
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context)
.policyNumber,
fontSize: 18.5,
),
Texts(
model.insurance[index]
.insurancePolicyNumber,
fontSize: 18.5,
)
]),
],
),
SizedBox(

@ -16,7 +16,7 @@ class InsurancePage extends StatelessWidget {
final InsuranceViewModel model;
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
InsurancePage({Key key, this.model}) : super(key: key);
InsurancePage({Key key, this.model}) : super(key: key);
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
@ -31,24 +31,20 @@ class InsurancePage extends StatelessWidget {
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
if (model.user != null)
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0,
left: 10.0,
right: 20.0),
margin:
EdgeInsets.only(top: 2.0, left: 10.0, right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
model.user.firstName ?? '' + " " + model.user.lastName ?? '',
model.user.firstName + " " + model.user.lastName,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
@ -57,11 +53,9 @@ class InsurancePage extends StatelessWidget {
height: 8,
),
Texts(
TranslationBase.of(context)
.fileno +
TranslationBase.of(context).fileno +
": " +
model.user.patientID
.toString(),
model.user.patientID.toString(),
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
@ -78,9 +72,7 @@ class InsurancePage extends StatelessWidget {
children: <Widget>[
Container(
child: SecondaryButton(
label: TranslationBase.of(
context)
.fetchData,
label: TranslationBase.of(context).fetchData,
small: true,
textColor: Colors.white,
onTap: () {
@ -88,15 +80,12 @@ class InsurancePage extends StatelessWidget {
setupID: '010266',
projectID: 15,
patientIdentificationID:
model.user
.patientIdentificationNo,
patientID: model
.user.patientID,
name: model.user
.firstName +
model.user.patientIdentificationNo,
patientID: model.user.patientID,
name: model.user.firstName +
" " +
model
.user.lastName,context: context);
model.user.lastName,
context: context);
},
),
),
@ -107,122 +96,115 @@ class InsurancePage extends StatelessWidget {
],
),
),
if(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false)
...List.generate(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, (index) =>
model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
? Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin: EdgeInsets.fromLTRB(
8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0,
left: 10.0,
right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <Widget>[
Texts(
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientName,
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(
context)
.fileno +
": " +
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientID
.toString(),
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
)
],
),
),
),
Expanded(
flex: 2,
child: Container(
margin:
EdgeInsets.only(top: 2.0),
child: Column(
children: <Widget>[
Container(
child: SecondaryButton(
label: TranslationBase
.of(context)
.fetchData,
small: true,
textColor:
Colors.white,
onTap: () {
getDetails(
projectID: 15,
patientIdentificationID: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientIdenficationNumber,
setupID:
'010266',
patientID: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.responseID,
name: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index].patientName,context: context);
},
),
if (model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList !=
null ??
false)
...List.generate(
model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList.length,
(index) => model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[index].status ==
3
? Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0, left: 10.0, right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Texts(
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientName,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).fileno +
": " +
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientID
.toString(),
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
)
],
),
),
),
Expanded(
flex: 2,
child: Container(
margin: EdgeInsets.only(top: 2.0),
child: Column(
children: <Widget>[
Container(
child: SecondaryButton(
label: TranslationBase.of(context)
.fetchData,
small: true,
textColor: Colors.white,
onTap: () {
getDetails(
projectID: 15,
patientIdentificationID: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientIdenficationNumber,
setupID: '010266',
patientID: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.responseID,
name: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientName,
context: context);
},
),
),
],
),
),
)
],
),
],
),
),
),
)
],
),
),
),
)
: Container()
),
)
: Container()),
],
),
);
@ -230,29 +212,32 @@ class InsurancePage extends StatelessWidget {
getDetails(
{String setupID,
int projectID,
String patientIdentificationID,
int patientID,
String name,BuildContext context}) {
int projectID,
String patientIdentificationID,
int patientID,
String name,
BuildContext context}) {
GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService
.getPatientInsuranceDetails(
setupID: setupID,
projectID: projectID,
patientID: patientID,
patientIdentificationID: patientIdentificationID)
setupID: setupID,
projectID: projectID,
patientID: patientID,
patientIdentificationID: patientIdentificationID)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) {
if (!_insuranceCardService.hasError &&
_insuranceCardService.isHaveInsuranceCard) {
Navigator.push(
context,
FadePage(
page: InsuranceCardUpdateDetails(
insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList,
patientID: patientID,
patientIdentificationID: patientIdentificationID,
name: name,
)));
insuranceCardDetailsModel:
_insuranceCardService.insuranceCardDetailsList,
patientID: patientID,
patientIdentificationID: patientIdentificationID,
name: name,
)));
} else {
AppToast.showErrorToast(message: _insuranceCardService.error);
}

@ -32,7 +32,11 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
super.initState();
_tabController = TabController(length: 2, vsync: this);
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png'));
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png'));
}
void dispose() {
@ -111,7 +115,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
InsurancePage(model:model),
InsurancePage(model: model),
Container(
child: ListView.builder(
itemCount: model.insuranceUpdate == null
@ -227,6 +231,4 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
),
);
}
}

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
@ -9,8 +11,10 @@ import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-locat
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesPage.dart';
import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -33,6 +37,9 @@ class HomePage extends StatefulWidget {
}
class _HomePageState extends State<HomePage> {
PharmacyModuleViewModel pharmacyModuleViewModel =
locator<PharmacyModuleViewModel>();
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -453,6 +460,33 @@ class _HomePageState extends State<HomePage> {
),
],
),
Padding(
padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15),
child: InkWell(
onTap: (){
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage()));
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Color(0xffB8382C),
),
child: Padding(
padding: const EdgeInsets.all(8),
child: Row(
children: [
Texts(
TranslationBase.of(context).offerAndPackages,
color: Colors.white, fontSize: 20, fontWeight: FontWeight.normal,
),
Spacer(),
Image.asset("assets/images/offer_icon.png"),
],
),
),
),
),
),
if (projectViewModel.havePrivilege(64) ||
projectViewModel.havePrivilege(65) ||
projectViewModel.havePrivilege(67))
@ -503,8 +537,7 @@ class _HomePageState extends State<HomePage> {
),
if (projectViewModel.havePrivilege(65))
DashboardItem(
onTap: () => Navigator.push(
context, FadePage(page: LandingPagePharmacy())),
onTap: () => getPharmacyToken(model),
child: Center(
child: Padding(
padding: const EdgeInsets.all(15.0),
@ -799,10 +832,24 @@ class _HomePageState extends State<HomePage> {
);
}
// openBrowser() {
// InAppBrowser browser = new InAppBrowser();
// browser.openUrl(url: "https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=ca9dd276-0a20-4924-a768-fafa9a855ef1&&CustomerId=1367368");
// }
getPharmacyToken(DashboardViewModel model) async {
if(!model.isLogin) {
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
} else {
GifLoaderDialogUtils.showMyDialog(context);
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if (pharmacyModuleViewModel.error.isNotEmpty) {
await pharmacyModuleViewModel.createUser().then((value) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
});
} else {
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
}
});
}
}
navigateToCovidDriveThru() {
Navigator.push(context, FadePage(page: CovidDrivethruLocation()));

@ -185,7 +185,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (results[Permission.camera].isGranted) ;
if (results[Permission.photos].isGranted) ;
if (results[Permission.accessMediaLocation].isGranted) ;
if (results[Permission.calendar].isGranted) ;
// if (results[Permission.calendar].isGranted) ;
});
requestPermissions();
// });
@ -327,15 +327,15 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
Permission.photos,
Permission.notification,
Permission.accessMediaLocation,
Permission.calendar,
// Permission.calendar,
Permission.activityRecognition
].request();
var permissionsGranted = await deviceCalendarPlugin.hasPermissions();
if (permissionsGranted.isSuccess && !permissionsGranted.data) {
permissionsGranted = await deviceCalendarPlugin.requestPermissions();
if (!permissionsGranted.isSuccess || !permissionsGranted.data) {}
}
// var permissionsGranted = await deviceCalendarPlugin.hasPermissions();
// if (permissionsGranted.isSuccess && !permissionsGranted.data) {
// permissionsGranted = await deviceCalendarPlugin.requestPermissions();
// if (!permissionsGranted.isSuccess || !permissionsGranted.data) {}
// }
return permissionResults;
}

@ -88,7 +88,9 @@ class _Login extends State<Login> {
Expanded(
flex: 2,
child: Texts(
TranslationBase.of(context).enterNationalId,
loginType == 1
? TranslationBase.of(context).enterNationalId
: TranslationBase.of(context).enterFile,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.start,
)),

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -41,20 +42,19 @@ class _WelcomeLogin extends State<WelcomeLogin> {
children: <Widget>[
Image.asset('assets/images/DQ/logo.png',
height: 90, width: 90),
Text(
AppText(
TranslationBase.of(context).welcome,
style: TextStyle(
fontSize: 30, fontWeight: FontWeight.bold),
textAlign: TextAlign.start,
fontSize: 30,
fontWeight: FontWeight.bold,
),
Text(
AppText(
TranslationBase.of(context).welcomeText,
style: TextStyle(fontSize: 24),
fontSize: 24,
textAlign: TextAlign.start,
),
Text(
AppText(
TranslationBase.of(context).welcomeText2,
style: TextStyle(fontSize: 24),
fontSize: 24,
textAlign: TextAlign.start,
),
SizedBox(

@ -237,7 +237,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
height: 90,
width: double.infinity,
padding: EdgeInsets.all(18),
child: SecondaryButton(

@ -49,7 +49,7 @@ class MyBalancePage extends StatelessWidget {
width: double.infinity,
height: 65,
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
color: Colors.red[700],
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7),
),
@ -79,7 +79,7 @@ class MyBalancePage extends StatelessWidget {
height: 65,
margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7),
),

@ -1,17 +1,28 @@
import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ClassesPage extends StatelessWidget {
final ListHISGetGlassPerscription glassPerscription;
final int appointmentNo;
final String projectName;
final int projectID;
const ClassesPage({Key key, this.glassPerscription}) : super(key: key);
const ClassesPage(
{Key key,
this.glassPerscription,
this.appointmentNo,
this.projectName,
this.projectID})
: super(key: key);
@override
Widget build(BuildContext context) {
@ -38,11 +49,16 @@ class ClassesPage extends StatelessWidget {
bold: true,
),
),
getRow(TranslationBase.of(context).sphere, '${glassPerscription.rightEyeSpherical}', '-'),
getRow(TranslationBase.of(context).cylinder, '${glassPerscription.rightEyeCylinder}', '-'),
getRow(TranslationBase.of(context).axis, '${glassPerscription.rightEyeAxis}', '-'),
getRow(TranslationBase.of(context).prism, '${glassPerscription.rightEyePrism}', '-'),
getRow(TranslationBase.of(context).va, '${glassPerscription.rightEyeVA}', '-'),
getRow(TranslationBase.of(context).sphere,
'${glassPerscription.rightEyeSpherical}', '-'),
getRow(TranslationBase.of(context).cylinder,
'${glassPerscription.rightEyeCylinder}', '-'),
getRow(TranslationBase.of(context).axis,
'${glassPerscription.rightEyeAxis}', '-'),
getRow(TranslationBase.of(context).prism,
'${glassPerscription.rightEyePrism}', '-'),
getRow(TranslationBase.of(context).va,
'${glassPerscription.rightEyeVA}', '-'),
],
),
),
@ -65,11 +81,16 @@ class ClassesPage extends StatelessWidget {
bold: true,
),
),
getRow(TranslationBase.of(context).sphere, '${glassPerscription.leftEyeSpherical}', '-'),
getRow(TranslationBase.of(context).cylinder, '${glassPerscription.leftEyeCylinder}', '-'),
getRow(TranslationBase.of(context).axis, '${glassPerscription.leftEyeAxis}', '-'),
getRow(TranslationBase.of(context).prism, '${glassPerscription.leftEyePrism}', '-'),
getRow(TranslationBase.of(context).va, '${glassPerscription.leftEyeVA}', '-'),
getRow(TranslationBase.of(context).sphere,
'${glassPerscription.leftEyeSpherical}', '-'),
getRow(TranslationBase.of(context).cylinder,
'${glassPerscription.leftEyeCylinder}', '-'),
getRow(TranslationBase.of(context).axis,
'${glassPerscription.leftEyeAxis}', '-'),
getRow(TranslationBase.of(context).prism,
'${glassPerscription.leftEyePrism}', '-'),
getRow(TranslationBase.of(context).va,
'${glassPerscription.leftEyeVA}', '-'),
],
),
),
@ -80,6 +101,16 @@ class ClassesPage extends StatelessWidget {
width: double.infinity,
child: SecondaryButton(
label: TranslationBase.of(context).sendEmail,
onTap: () {
showConfirmMessage(context, () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.sendGlassesPrescriptionEmail(
appointmentNo: appointmentNo,
projectName: projectName,
projectID: projectID);
GifLoaderDialogUtils.hideDialog(context);
}, model.user.emailAddress);
},
textColor: Colors.white,
color: Colors.red[700],
icon: Icon(
@ -96,6 +127,19 @@ class ClassesPage extends StatelessWidget {
);
}
void showConfirmMessage(
BuildContext context, GestureTapCallback onTap, String email) {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: email,
onTapSendEmail: () {
onTap();
},
),
);
}
Widget getRow(String title, String val1, String val2) => Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@ -113,7 +157,7 @@ class ClassesPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Texts(val1 == 'null' ? '-' : val1),
Texts(val2 != 'null' ? '-' :val2),
Texts(val2 != 'null' ? '-' : val2),
],
),
)

@ -1,8 +1,12 @@
import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -10,95 +14,126 @@ import 'package:provider/provider.dart';
class ContactLensPage extends StatelessWidget {
final ListHISGetContactLensPerscription listHISGetContactLensPerscription;
final int appointmentNo;
final String projectName;
final int projectID;
const ContactLensPage({Key key, this.listHISGetContactLensPerscription})
const ContactLensPage(
{Key key,
this.listHISGetContactLensPerscription,
this.appointmentNo,
this.projectName,
this.projectID})
: super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15),
child: Column(
children: [
Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).rightEye,
fontSize: 23,
bold: true,
return BaseView<EyeViewModel>(
builder: (_,model,w)=>
AppScaffold(
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15),
child: Column(
children: [
Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).rightEye,
fontSize: 23,
bold: true,
),
),
),
getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'),
getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'),
getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'),
getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'),
getRow('OZ', '${listHISGetContactLensPerscription.oZ}'),
getRow('CT', '${listHISGetContactLensPerscription.cT}'),
getRow('Blend', '${listHISGetContactLensPerscription.blend}'),
getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}'),
],
getRow(TranslationBase.of(context).brand,
'${listHISGetContactLensPerscription.brand}'),
getRow('B.C',
'${listHISGetContactLensPerscription.baseCurve}'),
getRow(TranslationBase.of(context).power,
'${listHISGetContactLensPerscription.power}'),
getRow(TranslationBase.of(context).diameter,
'${listHISGetContactLensPerscription.diameter}'),
getRow('OZ', '${listHISGetContactLensPerscription.oZ}'),
getRow('CT', '${listHISGetContactLensPerscription.cT}'),
getRow(
'Blend', '${listHISGetContactLensPerscription.blend}'),
getRow(TranslationBase.of(context).reminder,
'${listHISGetContactLensPerscription.remarks}'),
],
),
),
),
SizedBox(
height: 17,
),
Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).leftEye,
fontSize: 23,
bold: true,
),
),
getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'),
getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'),
getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'),
getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'),
getRow('OZ', '${listHISGetContactLensPerscription.oZ}'),
getRow('CT', '${listHISGetContactLensPerscription.cT}'),
getRow('Blend', '${listHISGetContactLensPerscription.blend}'),
getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}'),
],
SizedBox(
height: 17,
),
),
SizedBox(
height: 17,
),
if(projectViewModel.havePrivilege(15))
Container(
width: double.infinity,
child: SecondaryButton(
label: TranslationBase.of(context).sendEmail,
textColor: Colors.white,
color: Colors.red[700],
icon: Icon(
Icons.email,
color: Colors.white,
Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).leftEye,
fontSize: 23,
bold: true,
),
),
getRow(TranslationBase.of(context).brand,
'${listHISGetContactLensPerscription.brand}'),
getRow('B.C',
'${listHISGetContactLensPerscription.baseCurve}'),
getRow(TranslationBase.of(context).power,
'${listHISGetContactLensPerscription.power}'),
getRow(TranslationBase.of(context).diameter,
'${listHISGetContactLensPerscription.diameter}'),
getRow('OZ', '${listHISGetContactLensPerscription.oZ}'),
getRow('CT', '${listHISGetContactLensPerscription.cT}'),
getRow(
'Blend', '${listHISGetContactLensPerscription.blend}'),
getRow(TranslationBase.of(context).reminder,
'${listHISGetContactLensPerscription.remarks}'),
],
),
),
)
],
SizedBox(
height: 17,
),
if (projectViewModel.havePrivilege(15))
Container(
width: double.infinity,
child: SecondaryButton(
label: TranslationBase.of(context).sendEmail,
textColor: Colors.white,
color: Colors.red[700],
onTap: (){
showConfirmMessage(context, () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.sendContactLensPrescriptionEmail(
appointmentNo: appointmentNo,
projectName: projectName,
projectID: projectID);
GifLoaderDialogUtils.hideDialog(context);
}, model.user.emailAddress);
},
icon: Icon(
Icons.email,
color: Colors.white,
),
),
)
],
),
),
),
),
@ -130,4 +165,18 @@ class ContactLensPage extends StatelessWidget {
],
),
);
void showConfirmMessage(
BuildContext context, GestureTapCallback onTap, String email) {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: email,
onTapSendEmail: () {
onTap();
},
),
);
}
}

@ -43,6 +43,7 @@ class _EyeHomePageState extends State<EyeHomePage>
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).measurements,
body: Scaffold(
extendBodyBehindAppBar: true,
@ -81,13 +82,13 @@ class _EyeHomePageState extends State<EyeHomePage>
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.27,
width: MediaQuery.of(context).size.width * 0.40,
child: Center(
child: Texts(TranslationBase.of(context).classes),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.27,
width: MediaQuery.of(context).size.width * 0.40,
child: Center(
child: Texts(TranslationBase.of(context).contactLens),
),
@ -110,11 +111,15 @@ class _EyeHomePageState extends State<EyeHomePage>
ClassesPage(
glassPerscription: widget.appointmentAllHistoryResultList
.listHISGetGlassPerscription[0],
appointmentNo: widget.appointmentAllHistoryResultList.appointmentNo,
projectName: widget.appointmentAllHistoryResultList.projectName,
projectID: widget.appointmentAllHistoryResultList.projectID,
),
ContactLensPage(
listHISGetContactLensPerscription: widget
.appointmentAllHistoryResultList
.listHISGetContactLensPerscription[0],
listHISGetContactLensPerscription: widget.appointmentAllHistoryResultList.listHISGetContactLensPerscription[0],
appointmentNo: widget.appointmentAllHistoryResultList.appointmentNo,
projectName: widget.appointmentAllHistoryResultList.projectName,
projectID: widget.appointmentAllHistoryResultList.projectID,
)
],
),

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/PrescriptionDeliveryViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
@ -212,7 +213,51 @@ class _PrescriptionDeliveryAddressPageState
latitude: latitude,
longitude: longitude,
)),
);
).then((value) {
if (value != null &&
value is AddNewAddressRequestModel) {
setState(() {
_selectedAddress = AddressInfo(
id: value.customer.id.toString(),
email: value.customer.email,
firstName: value.customer.addresses[0].firstName,
lastName: value.customer.addresses[0].lastName,
address1: value.customer.addresses[0].address1,
address2: value.customer.addresses[0].address2,
city: value.customer.addresses[0].city,
country: value.customer.addresses[0].country,
phoneNumber: value.customer.addresses[0].phoneNumber,
latLong: value.customer.addresses[0].latLong,
company: value.customer.addresses[0].company,
countryId: value.customer.addresses[0].countryId,
createdOnUtc: value.customer.addresses[0].createdOnUtc,
customerAttributes: value.customer.addresses[0].customerAttributes,
faxNumber: value.customer.addresses[0].faxNumber,
province: value.customer.addresses[0].province,
stateProvinceId: value.customer.addresses[0].stateProvinceId,
zipPostalCode: value.customer.addresses[0].zipPostalCode,
);
List latLongArr = _selectedAddress.latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
markers = Set();
markers.add(
Marker(
markerId: MarkerId(
_selectedAddress.latLong.hashCode.toString(),
),
position: LatLng(latitude, longitude),
),
);
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
});
}
});
},
),
),

@ -20,7 +20,7 @@ class PharmacyForPrescriptionsPage extends StatelessWidget {
onModelReady: (model) => model.getListPharmacyForPrescriptions(itemId: prescriptionReport.itemID),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).ports,
appBarTitle: TranslationBase.of(context).availability,
baseViewModel: model,
body: ListView.builder(
itemBuilder: (context, index) => Container(

@ -1,4 +1,6 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -6,6 +8,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PrescriptionDetailsPage extends StatelessWidget {
final PrescriptionReport prescriptionReport;
@ -59,40 +62,49 @@ class PrescriptionDetailsPage extends StatelessWidget {
),
Container(
margin: EdgeInsets.all(8),
child: InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PharmacyForPrescriptionsPage(
prescriptionReport: prescriptionReport),
),
),
child: Center(
child: Column(
children: <Widget>[
Container(
width: 50,
decoration: BoxDecoration(
color: Colors.white, shape: BoxShape.rectangle),
child: Row(
children: [
Expanded(
child: InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PharmacyForPrescriptionsPage(
prescriptionReport: prescriptionReport),
),
),
child: Center(
child: Column(
children: <Widget>[
Icon(
Icons.pin_drop,
color: Colors.red[800],
size: 55,
Container(
width: 50,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle),
child: Column(
children: <Widget>[
Icon(
Icons.pin_drop,
color: Colors.red[800],
size: 55,
),
],
),
),
SizedBox(
height: 5,
),
Texts(TranslationBase.of(context).availability)
],
),
),
SizedBox(
height: 5,
),
Texts(TranslationBase.of(context).ports)
],
),
)),
)),
),
_addReminderButton(context)
],
),
),
Container(
color: Colors.white,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
child: Table(
border: TableBorder.symmetric(
@ -106,28 +118,28 @@ class PrescriptionDetailsPage extends StatelessWidget {
height: 30,
width: double.infinity,
child: Center(
child: Texts(TranslationBase.of(context).way))),
child: Texts(TranslationBase.of(context).route, fontSize: 14,))),
Container(
color: Colors.white,
height: 30,
width: double.infinity,
child: Center(
child:
Texts(TranslationBase.of(context).average))),
Texts(TranslationBase.of(context).frequency, fontSize: 14,))),
Container(
color: Colors.white,
height: 30,
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 4),
child: Center(
child: Texts(
TranslationBase.of(context).dailyDoses))),
"${TranslationBase.of(context).dailyDoses}", fontSize: 14,))),
Container(
color: Colors.white,
height: 30,
width: double.infinity,
child: Center(
child:
Texts(TranslationBase.of(context).period))),
Texts(TranslationBase.of(context).duration, fontSize: 14,))),
],
),
TableRow(
@ -192,4 +204,96 @@ class PrescriptionDetailsPage extends StatelessWidget {
),
);
}
Widget _addReminderButton(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return GestureDetector(
onTap: () {
DateTime startDate = DateTime.now();
DateTime endDate = DateTime(startDate.year, startDate.month,
startDate.day + prescriptionReport.days);
print(prescriptionReport);
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue =
Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform:
Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: ReminderDialog(
eventId: prescriptionReport.itemID.toString(),
title: "Prescription Reminder",
description:
"${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
startDate:
"/Date(${startDate.millisecondsSinceEpoch}+0300)/",
endDate: "/Date(${endDate.millisecondsSinceEpoch}+0300)/",
location: prescriptionReport.remarks,
),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
},
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Container(
// height: 100.0,
margin: EdgeInsets.all(7.0),
padding: EdgeInsets.only(bottom: 4.0),
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)
], borderRadius: BorderRadius.circular(10), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0),
child: Text("add",
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xffB8382C),
letterSpacing: 1.0,
fontSize: 18.0)),
),
Container(
margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Text("reminder",
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.black,
letterSpacing: 1.0,
fontSize: 15.0)),
),
Container(
alignment: projectViewModel.isArabic
? Alignment.bottomLeft
: Alignment.bottomRight,
margin: projectViewModel.isArabic
? EdgeInsets.fromLTRB(10.0, 7.0, 0.0, 8.0)
: EdgeInsets.fromLTRB(0.0, 7.0, 10.0, 8.0),
child: Image.asset(
"assets/images/new-design/reminder_icon.png",
width: 45.0,
height: 45.0),
),
],
),
),
],
),
);
}
}

@ -106,26 +106,26 @@ class _HomeReportPageState extends State<HomeReportPage>
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.15,
width: MediaQuery.of(context).size.width * 0.20,
child: Center(
child: Texts(TranslationBase.of(context).requested,fontSize: 11,),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.15,
width: MediaQuery.of(context).size.width * 0.20,
child: Center(
child: Texts(TranslationBase.of(context).ready,fontSize: 11,),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.15,
width: MediaQuery.of(context).size.width * 0.20,
child: Center(
child:
Texts(TranslationBase.of(context).completed,fontSize: 11,),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.15,
width: MediaQuery.of(context).size.width * 0.20,
child: Center(
child:
Texts(TranslationBase.of(context).cancelled,fontSize: 11,),

@ -48,16 +48,13 @@ class MedicalReports extends StatelessWidget {
)),
child: Row(
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.only(left: 5, right: 5),
child: LargeAvatar(
width: 50,
height: 50,
name: model.appointHistoryList[index].doctorNameObj,
url: model.appointHistoryList[index].doctorImageURL,
),
Container(
margin: EdgeInsets.only(left: 5, right: 5),
child: LargeAvatar(
width: 50,
height: 50,
name: model.appointHistoryList[index].doctorNameObj,
url: model.appointHistoryList[index].doctorImageURL,
),
),
Expanded(
@ -85,29 +82,26 @@ class MedicalReports extends StatelessWidget {
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () =>
confirmBox(model.appointHistoryList[index], model),
child: Container(
width: 85,
height: 50,
decoration: BoxDecoration(
color: Colors.black54,
border:
Border.all(color: Colors.transparent, width: 2),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
InkWell(
onTap: () =>
confirmBox(model.appointHistoryList[index], model),
child: Container(
width: 120,
height: 50,
decoration: BoxDecoration(
color: Colors.black54,
border:
Border.all(color: Colors.transparent, width: 2),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
child: Center(
child: Texts(
TranslationBase.of(context).requestReport,
fontSize: 12,
color: Colors.white,
),
),
child: Center(
child: Texts(
TranslationBase.of(context).requestReport,
fontSize: 12,
color: Colors.white,
),
),
),

@ -14,10 +14,18 @@ class LineChartCurved extends StatelessWidget {
List<int> xAxixs = List();
List<double> yAxixs = List();
double minY = 0;
double maxY = 0;
double minX = 0;
double maxX = 0;
double increasingY = 0;
@override
Widget build(BuildContext context) {
getXaxix();
getYaxix();
calculateMaxAndMin();
return AspectRatio(
aspectRatio: 1.1,
child: Container(
@ -70,10 +78,18 @@ class LineChartCurved extends StatelessWidget {
}
}
}
getYaxix() {
int indexess= (timeSeries.length*0.30).toInt();
// int indexess= (timeSeries.length*0.30).toInt();
// for (int index = 0; index < timeSeries.length; index++) {
// int mIndex = indexess * index;
// if (mIndex < timeSeries.length) {
// yAxixs.add(timeSeries[mIndex].sales);
// }
// }
for (int index = 0; index < timeSeries.length; index++) {
int mIndex = indexess * index;
int mIndex = indexes * index;
if (mIndex < timeSeries.length) {
yAxixs.add(timeSeries[mIndex].sales);
}
@ -100,7 +116,6 @@ class LineChartCurved extends StatelessWidget {
fontSize: 10,
),
rotateAngle:-65,
//rotateAngle:-65,
margin: 22,
getTitles: (value) {
if (timeSeries.length < 15) {
@ -128,18 +143,18 @@ class LineChartCurved extends StatelessWidget {
fontSize: 10,
),
getTitles: (value) {
// if (timeSeries.length < 10) {
// return '${value.toInt()}';
// } else {
// if (value == getMinY())
// return '${value.toInt()}';
// if (value == getMaxY())
// return '${value.toInt()}';
// if (yAxixs.contains(value)) {
// return '${value.toInt()}';
// }
// return '';
// }
if (timeSeries.length < 15) {
return '${value.toInt()}';
} else {
if (value == minY)
return '${value.toInt()}';
if (value == getMaxY())
return '${value.toInt()}';
//if (yAxixs.contains(value)) {
return '${value.toInt()}';
return '';
}
return '${value.toInt()}';
},
margin: 12,
@ -163,31 +178,55 @@ class LineChartCurved extends StatelessWidget {
),
),
),
minX: 0,
maxX: (timeSeries.length - 1).toDouble(),
maxY: getMaxY()+0.3,
minY: getMinY(),
minX: minX,
maxX: maxX,
maxY: maxY,
minY: minY,
lineBarsData: getData(context),
);
}
calculateMaxAndMin(){
getMaxY();
getMaxX();
getMin();
getMinY();
increasingY = ((maxY-minY)/timeSeries.length - 1)*15;
maxY += increasingY.abs();
minY -= increasingY.abs();
}
double getMaxY() {
double max = 0;
maxY = 0;
timeSeries.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > maxY) maxY = resultValueDouble;
});
return maxY.roundToDouble() ;
}
getMaxX(){
maxX = (timeSeries.length - 1).toDouble();
}
double getMin(){
minX = 0;
timeSeries.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
if (resultValueDouble < minX) minX = resultValueDouble;
});
return max.roundToDouble() ;
return minX.roundToDouble() ;
}
double getMinY() {
double min = timeSeries[0].sales;
minY = 0;
timeSeries.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
if (resultValueDouble < minY) minY = resultValueDouble;
});
int value = min.toInt();
int value = minY.toInt();
return value.toDouble();
}
@ -202,7 +241,7 @@ class LineChartCurved extends StatelessWidget {
spots: spots,
isCurved: true,
colors: [secondaryColor],
barWidth: 5,
barWidth: 3,
isStrokeCapRound: true,
dotData: FlDotData(
show: false,

@ -81,7 +81,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
height: 20,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.grey),
color: Colors.red),
),
SizedBox(width: 5,),
Texts(TranslationBase.of(context).diastolicLng)
@ -125,7 +125,6 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
fontSize: 10,
),
rotateAngle: -65,
//rotateAngle:-65,
margin: 22,
getTitles: (value) {
if (timeSeries1.length < 15) {
@ -178,8 +177,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
),
minX: 0,
maxX: (timeSeries1.length - 1).toDouble(),
maxY: getMaxY() + 0.3,
minY: getMinY(),
maxY: getMaxY() + 15,
minY: getMinY()-15,
lineBarsData: getData(context),
);
}

@ -0,0 +1,108 @@
import 'package:after_layout/after_layout.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/requests/AddProductToCartRequestModel.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/PackagesCategoriesResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesResponseModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/packages_offers/PackagesOffersViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackageDetailPage.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart' as utils;
import 'package:diplomaticquarterapp/widgets/loadings/ShimmerLoading.dart';
import 'package:diplomaticquarterapp/widgets/offers_packages/PackagesOfferCard.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_material_pickers/flutter_material_pickers.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'CreateCustomerDailogPage.dart';
dynamic languageID;
class ClinicPackagesPage extends StatefulWidget {
List<PackagesResponseModel> products;
ClinicPackagesPage({@required this.products});
@override
_ClinicPackagesPageState createState() => _ClinicPackagesPageState();
}
class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayoutMixin<ClinicPackagesPage>{
AppScaffold appScaffold;
List<PackagesResponseModel> get _products => widget.products;
PackagesViewModel viewModel;
onProductCartClick(PackagesResponseModel product) async {
if(viewModel.service.customer == null)
viewModel.service.customer = await CreateCustomerDialogPage(context: context).show();
if(viewModel.service.customer != null) {
var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id);
await viewModel.service.addProductToCart(request, context: context).then((response){
appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
}).catchError((error) {
utils.Utils.showErrorToast(error);
});
}
}
@override
void afterFirstLayout(BuildContext context) async{
appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
}
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return BaseView<PackagesViewModel>(
allowAny: true,
onModelReady: (model){
viewModel = model;
},
builder: (_, model, wi) => appScaffold = AppScaffold(
appBarTitle: TranslationBase.of(context).offerAndPackages,
isShowAppBar: true,
isPharmacy: false,
showPharmacyCart: false,
showHomeAppBarIcon: false,
isOfferPackages: true,
showOfferPackagesCart: true,
isShowDecPage: false,
body: Padding(
padding: const EdgeInsets.all(5),
child: StaggeredGridView.countBuilder(
crossAxisCount:4,
itemCount: _products.length,
itemBuilder: (BuildContext context, int index) => new Container(
color: Colors.transparent,
child: PackagesItemCard( itemContentPadding: 10,itemModel: _products[index], onCartClick: onProductCartClick,)
),
staggeredTileBuilder: (int index) => StaggeredTile.fit(2),
mainAxisSpacing: 20,
crossAxisSpacing: 10,
)
),
),
);
}
}

@ -0,0 +1,198 @@
import 'package:after_layout/after_layout.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/config/size_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/PackagesCustomerResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesResponseModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/packages_offers/PackagesOffersViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/ClinicOfferAndPackagesPage.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackageDetailPage.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesCartPage.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart' as utils;
import 'package:diplomaticquarterapp/widgets/AnimatedTextFields.dart';
import 'package:diplomaticquarterapp/widgets/Loader/gif_loader_container.dart';
import 'package:diplomaticquarterapp/widgets/LoadingButton.dart';
import 'package:diplomaticquarterapp/widgets/carousel_indicator/carousel_indicator.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/loadings/ShimmerLoading.dart';
import 'package:diplomaticquarterapp/widgets/offers_packages/PackagesOfferCard.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_material_pickers/flutter_material_pickers.dart';
dynamic languageID;
var emailRegex = RegExp(r'^[^\s@]+@[^\s@]+\.[^\s@]+$');
class CreateCustomerDialogPage extends StatefulWidget {
final BuildContext context;
CreateCustomerDialogPage({this.context});
PackagesViewModel viewModel;
Future<PackagesCustomerResponseModel> show() async{
await showDialog(context: context, builder: (context ){
return AlertDialog(content: this, shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20)
), elevation: 5, );
});
return viewModel.service.customer;
}
@override
_CreateCustomerDialogPageState createState() => _CreateCustomerDialogPageState();
}
class _CreateCustomerDialogPageState extends State<CreateCustomerDialogPage> with AfterLayoutMixin<CreateCustomerDialogPage>, TickerProviderStateMixin{
AnimationController _loadingController;
AnimationController _submitController;
bool _enableInput = true;
Interval _nameTextFieldLoadingAnimationInterval = const Interval(0, .85);
final _phoneFocusNode = FocusNode();
@override
void initState() {
_submitController = AnimationController(vsync: this, duration: Duration(milliseconds: 1000),);
super.initState();
}
@override
void afterFirstLayout(BuildContext context) async{
}
// Controllers
TextEditingController _emailTextController = TextEditingController();
TextEditingController _phoneTextController = TextEditingController();
TextEditingController _emailPinTextController = TextEditingController();
TextEditingController _phonePinTextController = TextEditingController();
bool verifyPin = false;
PackagesViewModel viewModel() => widget.viewModel;
@override
Widget build(BuildContext context) {
return BaseView<PackagesViewModel>(
allowAny: true,
onModelReady: (model) => widget.viewModel = model,
builder: (_, model, wi) => verifyPin ? verifyPinWidget() : userDetailWidget()
);
}
Widget verifyPinWidget(){
}
Widget userDetailWidget(){
return
Container(
width: SizeConfig.realScreenWidth * 0.8,
height: 270,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Align(
alignment: Alignment.center,
child: Texts("Create Guest Customer", textAlign: TextAlign.center, fontSize: 18, fontWeight: FontWeight.bold,)
),
SizedBox(height: 30,),
AnimatedTextFormField(
enabled: _enableInput,
controller: _emailTextController,
width: 100,
loadingController: _loadingController,
interval: _nameTextFieldLoadingAnimationInterval,
labelText: "Email",
prefixIcon: Icon(Icons.email),
keyboardType: TextInputType.emailAddress,
textInputAction: TextInputAction.next,
onFieldSubmitted: (value) {
FocusScope.of(context).requestFocus(_phoneFocusNode);
},
validator: (value){
return (value.isEmpty || !emailRegex.hasMatch(value))
? 'Invalid email!'
: null;
},
),
SizedBox(height: 30,),
AnimatedTextFormField(
enabled: _enableInput,
controller: _phoneTextController,
width: 100,
loadingController: _loadingController,
interval: _nameTextFieldLoadingAnimationInterval,
labelText: "Mobile Number",
prefixIcon: Icon(Icons.phone_android),
keyboardType: TextInputType.phone,
textInputAction: TextInputAction.next,
onFieldSubmitted: (value) {
FocusScope.of(context).requestFocus(_phoneFocusNode);
},
validator: (value){
return (value.isEmpty || !emailRegex.hasMatch(value))
? 'Invalid email!'
: null;
},
),
Spacer(flex: 1,),
AnimatedButton(
color: Theme.of(context).primaryColor,
loadingColor: Theme.of(context).primaryColor,
controller: _submitController,
text: TranslationBase.of(context).done,
onPressed: (){
createCustomer();
},
)
,
],
),
);
}
createCustomer() async{
setState(() => _enableInput = false);
loading(true);
var request = PackagesCustomerRequestModel(email: _emailTextController.text, phoneNumber: _phoneTextController.text);
viewModel().service
.createCustomer(request, context: context, showLoading: false)
.then((value) => success())
.catchError((error) => showError(error));
}
success() async{
loading(false);
await Future.delayed(Duration(seconds: 2));
Navigator.of(context).pop();
}
showError(String errorMessage) async{
loading(false);
setState(() => _enableInput = true);
}
loading(bool can){
can ? _submitController.forward() : _submitController.reverse();
}
}

@ -0,0 +1,221 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/packages_offers/PackagesOffersViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/ProductCheckTypeWidget.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart' as utils;
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'ClinicOfferAndPackagesPage.dart';
class OfferAndPackagesDetail extends StatefulWidget{
final dynamic model;
const OfferAndPackagesDetail({@required this.model, Key key}) : super(key: key);
@override
State<StatefulWidget> createState() => OfferAndPackagesDetailState();
}
class OfferAndPackagesDetailState extends State<OfferAndPackagesDetail>{
PackagesViewModel viewModel;
@override
Widget build(BuildContext context) {
getLanguageID();
return BaseView<PackagesViewModel>(
onModelReady: (model){
viewModel = model;
},
builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).offerAndPackages,
isShowAppBar: true,
isPharmacy: false,
showPharmacyCart: false,
showHomeAppBarIcon: false,
isOfferPackages: true,
showOfferPackagesCart: true,
isShowDecPage: false,
body: Stack(
children: [
Padding(
padding: const EdgeInsets.only(bottom: 60),
child: ListView(
children: [
Padding(
padding: const EdgeInsets.all(5),
child: Stack(
children: [
Padding(
padding: const EdgeInsets.all(10),
child: AspectRatio(
aspectRatio: 1/1,
child: utils.applyShadow(
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: utils.Utils.loadNetworkImage(url: "https://wallpaperaccess.com/full/30103.jpg",)
),
)
),
),
Align(
alignment: Alignment.topLeft,
child: Image.asset(
'assets/images/discount_${'en'}.png',
height: 70,
width: 70,
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
"Child Dental Offer",
fontSize: 25,
fontWeight: FontWeight.normal,
color: Colors.black,
),
Stack(
children: [
Texts(
"200 SAR",
fontWeight: FontWeight.normal,
decoration: TextDecoration.lineThrough,
color: Colors.grey,
fontSize: 12
),
Padding(
padding: const EdgeInsets.only(top: 15),
child: Texts(
"894.99 SAR",
fontWeight: FontWeight.bold,
color: Colors.green,
fontSize: 18
),
),
],
),
StarRating(
size: 20,
totalCount: null,
totalAverage: 5,
forceStars: true),
SizedBox(height: 20,),
Texts(
"Details",
fontWeight: FontWeight.bold,
color: Colors.grey,
fontSize: 20
),
AspectRatio(
aspectRatio: 2/1,
child: Container(
color: Colors.grey[300],
child: Padding(
padding: const EdgeInsets.all(10),
child: Texts("Detail of offers written here"),
)
),
),
SizedBox(height: 10,),
],
),
),
],
),
),
Padding(
padding: const EdgeInsets.all(10),
child: Align(
alignment: Alignment.bottomRight,
child: Row(
children: [
Expanded(
child: RaisedButton.icon(
padding: EdgeInsets.only(top: 5, bottom: 5, left: 0, right: 0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
side: BorderSide(color: Colors.red, width: 0.5)
),
color: Colors.red,
icon: Icon(
Icons.add_shopping_cart_outlined,
size: 25,
color: Colors.white,
),
label: Texts(
"Add to Cart",
fontSize: 17, color: Colors.white, fontWeight: FontWeight.normal,
),
onPressed: (){},),
),
SizedBox(width: 15,),
Expanded(
child: OutlineButton.icon(
padding: EdgeInsets.only(top: 5, bottom: 5, left: 0, right: 0),
borderSide: BorderSide(width: 1.0, color: Colors.red),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
color: Colors.white,
icon: Icon(
Icons.favorite_rounded,
size: 25,
color: Colors.red,
),
label: Texts(
"Add to Favorites",
fontSize: 17, color: Colors.red, fontWeight: FontWeight.normal
),
onPressed: (){
},),
),
],
),
),
)
],
)
),
);
}
}

@ -0,0 +1,405 @@
import 'package:after_layout/after_layout.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/core/enum/PaymentOptions.dart';
import 'package:diplomaticquarterapp/core/model/ResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/requests/AddProductToCartRequestModel.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/viewModels/packages_offers/PackagesOffersViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/ClinicOfferAndPackagesPage.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackageDetailPage.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/PackageOrderCompletedPage.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart' as utils;
import 'package:diplomaticquarterapp/widgets/Loader/gif_loader_container.dart';
import 'package:diplomaticquarterapp/widgets/carousel_indicator/carousel_indicator.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/loadings/ShimmerLoading.dart';
import 'package:diplomaticquarterapp/widgets/offers_packages/PackagesCartItemCard.dart';
import 'package:diplomaticquarterapp/widgets/offers_packages/PackagesOfferCard.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_material_pickers/flutter_material_pickers.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
dynamic languageID;
const _columnCount = 1;
AnimationController _animationController;
class PackagesCartPage extends StatefulWidget {
PackagesCartPage();
@override
_PackagesCartPageState createState() => _PackagesCartPageState();
}
class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMixin<PackagesCartPage>, SingleTickerProviderStateMixin {
getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
@override
void initState() {
_agreeTerms = false;
_selectedPaymentMethod = null;
_animationController = AnimationController(vsync: this, duration: Duration(seconds: 500));
super.initState();
}
@override
void dispose() {
_animationController.dispose();
viewModel.cartItemList.clear();
super.dispose();
}
PackagesViewModel viewModel;
bool loadWidgets = false;
onTermsClick(bool isAgree) {
setState(() => _agreeTerms = isAgree);
}
onTermsInfoClick() {
Navigator.push(context, FadePage(page: PharmacyTermsConditions()));
}
onPayNowClick() async{
await viewModel.service.placeOrder(context: context,paymentOption: _selectedPaymentMethod.toUpperCase()).then((orderId){
if(orderId.runtimeType == int){ // result == order_id
var browser = MyInAppBrowser(
context: context,
onExitCallback: (data, isDone) => paymentClosed(orderId: orderId, withStatus: isDone, data: data)
);
browser.openPackagesPaymentBrowser(customer_id: viewModel.service.customer.id, order_id: orderId);
}else{
utils.Utils.showErrorToast('Failed to place order, please try again later');
}
}).catchError((error){
utils.Utils.showErrorToast(error);
});
}
@override
void afterFirstLayout(BuildContext context) {
fetchData();
}
@override
Widget build(BuildContext context) {
return BaseView<PackagesViewModel>(
allowAny: true,
onModelReady: (model) => viewModel = model,
builder: (_, model, wi) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).offerAndPackages,
isShowAppBar: true,
isPharmacy: false,
showPharmacyCart: false,
showHomeAppBarIcon: false,
isOfferPackages: true,
showOfferPackagesCart: false,
isShowDecPage: false,
body: Column(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.all(5),
child: StaggeredGridView.countBuilder(
crossAxisCount: (_columnCount * _columnCount),
itemCount: viewModel.cartItemList.length,
itemBuilder: (BuildContext context, int index) {
var item = viewModel.cartItemList[index];
return Dismissible(
key: Key(index.toString()),
direction: DismissDirection.startToEnd,
background: _cartItemDeleteContainer(),
secondaryBackground: _cartItemDeleteContainer(),
confirmDismiss: (direction) async {
bool status = await viewModel.service.deleteProductFromCart(item.id, context: context, showLoading: false);
return status;
},
onDismissed: (direction) {
debugPrint('Index: $index');
viewModel.cartItemList.removeAt(index);
},
child: PackagesCartItemCard(
itemModel: item,
shouldStepperChangeApply: (apply,total) async{
var request = AddProductToCartRequestModel(product_id: item.productId, quantity: apply);
ResponseModel response = await viewModel.service.addProductToCart(request, context: context, showLoading: false).catchError((error){
utils.Utils.showErrorToast(error);
});
return response.status ?? false;
},
)
);
},
staggeredTileBuilder: (int index) => StaggeredTile.fit(_columnCount),
mainAxisSpacing: 0,
crossAxisSpacing: 10,
)),
),
Container(
height: 0.25,
color: Theme.of(context).primaryColor,
),
Container(
color: Colors.white,
child: Column(
children: [
Texts(
TranslationBase.of(context).selectPaymentOption,
fontSize: 10,
fontWeight: FontWeight.bold
),
Container(height: 0.25, width: 100, color: Colors.grey[300],),
_paymentOptions(context, (paymentMethod) {
setState(() => _selectedPaymentMethod = paymentMethod);
}),
Container(height: 0.25, color: Colors.grey[300],),
Container(height: 40,
child: _termsAndCondition(context, onSelected: onTermsClick, onInfoClick: onTermsInfoClick)
),
Container(height: 0.25, color: Colors.grey[300],),
_payNow(context, onPayNowClick: onPayNowClick)
],
),
)
],
),
);
});
}
fetchData() async {
await viewModel.service.cartItems(context: context).catchError((error) {});
setState((){});
}
paymentClosed({@required int orderId, @required bool withStatus, dynamic data}) async{
viewModel.service.getOrderById(orderId, context: context).then((value){
var heading = withStatus ? "Success" : "Failed";
var title = "Your order has been placed successfully";
var subTitle = "Order# ${value.data.customOrderNumber}";
Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (context) => PackageOrderCompletedPage(heading: heading, title: title, subTitle: subTitle))
);
}).catchError((error){
debugPrint(error);
});
}
}
// /* Payment Footer Widgets */
// ---------------------------
String _selectedPaymentMethod;
Widget _paymentOptions(BuildContext context, Function(String) onSelected) {
double height = 30;
Widget buttonContent(bool isSelected, String imageName) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: isSelected ? Colors.green[50] : Colors.grey[200],
blurRadius: 1,
spreadRadius: 2,
),
],
borderRadius: BorderRadius.all(Radius.circular(5)),
border: Border.all(color: isSelected ? Colors.green : Colors.grey, width: isSelected ? 1 : 0.5)
),
child: Padding(
padding: const EdgeInsets.all(4),
child: Image.asset('assets/images/new-design/$imageName'),
)
);
}
return Padding(
padding: const EdgeInsets.all(5),
child: Container(
height: height,
color: Colors.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
InkWell(
child: buttonContent(_selectedPaymentMethod == "mada", 'mada.png'),
onTap: () {
onSelected("mada");
},
),
SizedBox(
width: 5,
),
InkWell(
child: buttonContent(_selectedPaymentMethod == "visa", 'visa.png'),
onTap: () {
onSelected("visa");
},
),
SizedBox(
width: 5,
),
InkWell(
child: buttonContent(_selectedPaymentMethod == "mastercard", 'mastercard.png'),
onTap: () {
onSelected("mastercard");
},
),
SizedBox(
width: 5,
),
InkWell(
child: buttonContent(_selectedPaymentMethod == "installment", 'installment.png'),
onTap: () {
onSelected("installment");
},
),
],
),
),
);
}
bool _agreeTerms = false;
Widget _termsAndCondition(BuildContext context, {@required Function(bool) onSelected, @required VoidCallback onInfoClick}) {
return Padding(
padding: const EdgeInsets.all(5),
child: Row(
children: [
InkWell(
child: Icon(
_agreeTerms ? Icons.check_circle : Icons.radio_button_unchecked_sharp,
size: 20,
color: _agreeTerms ? Colors.green[600] : Colors.grey[400],
),
onTap: () {
onSelected(!_agreeTerms);
},
),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Texts(
TranslationBase.of(context).pharmacyServiceTermsCondition,
fontWeight: FontWeight.normal, fontSize: 13,
),
)),
InkWell(
child: Icon(
Icons.info,
size: 20,
color: Colors.grey[600],
),
onTap: () {
onInfoClick();
},
),
],
),
);
}
Widget _payNow(BuildContext context, {@required VoidCallback onPayNowClick}) {
bool isPayNowAQctive = (_agreeTerms && (_selectedPaymentMethod != null));
return Padding(
padding: const EdgeInsets.all(5),
child: Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('${TranslationBase.of(context).subtotal}: ${'999.9'} ${TranslationBase.of(context).sar}',
heightFactor: 1.5, fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 8),
Texts('${TranslationBase.of(context).vat}: ${'14.9'} ${TranslationBase.of(context).sar}', heightFactor: 1.5, fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 8),
Padding(
padding: const EdgeInsets.all(3),
child: Container(
height: 0.25,
width: 120,
color: Colors.grey[300],
),
),
Texts('${TranslationBase.of(context).total}: 999.99 ${TranslationBase.of(context).sar}',
heightFactor: 1.5, fontWeight: FontWeight.bold, color: Colors.black54, fontSize: 15)
],
),
),
Expanded(child: Container()),
RaisedButton(
child: Texts(
TranslationBase.of(context).payNow,
fontSize: 15, color: Colors.white, fontWeight: FontWeight.bold,
),
padding: EdgeInsets.only(top: 5, bottom: 5, left: 0, right: 0),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5), side: BorderSide(color: Theme.of(context).primaryColor, width: 0.5)),
color: Theme.of(context).primaryColor,
onPressed: isPayNowAQctive ? onPayNowClick : null,
),
],
)),
);
}
// -------------------
Widget _cartItemDeleteContainer() {
_animationController.duration = Duration(milliseconds: 500);
_animationController.repeat(reverse: true);
return FadeTransition(
opacity: _animationController,
child: Padding(
padding: const EdgeInsets.all(5),
child: Container(
decoration: BoxDecoration(
color: Colors.red,
boxShadow: [
BoxShadow(
color: Colors.grey[500],
blurRadius: 2,
spreadRadius: 1,
),
],
borderRadius: BorderRadius.all(Radius.circular(5)),
),
child: Center(
child: Texts(
"Deleting...",
fontWeight: FontWeight.normal,
fontSize: 15,
color: Colors.white,
)),
),
),
);
}

@ -0,0 +1,418 @@
import 'package:after_layout/after_layout.dart';
import 'package:carousel_slider/carousel_slider.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/PackagesCustomerResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesResponseModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/packages_offers/PackagesOffersViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/ClinicOfferAndPackagesPage.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/CreateCustomerDailogPage.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackageDetailPage.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesCartPage.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart' as utils;
import 'package:diplomaticquarterapp/widgets/Loader/gif_loader_container.dart';
import 'package:diplomaticquarterapp/widgets/carousel_indicator/carousel_indicator.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/loadings/ShimmerLoading.dart';
import 'package:diplomaticquarterapp/widgets/offers_packages/PackagesOfferCard.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_material_pickers/flutter_material_pickers.dart';
dynamic languageID;
class PackagesHomePage extends StatefulWidget {
dynamic offersModel;
PackagesHomePage({@required this.offersModel});
@override
_PackagesHomePageState createState() => _PackagesHomePageState();
}
class _PackagesHomePageState extends State<PackagesHomePage> with AfterLayoutMixin<PackagesHomePage>{
getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
@override
void initState() {
super.initState();
getLanguageID();
}
@override
void afterFirstLayout(BuildContext context) async{
viewModel.service.loadOffersPackagesDataForMainPage(context: context, completion: (){
setState((){});
});
}
// Controllers
var _searchTextController = TextEditingController();
var _filterTextController = TextEditingController();
var _carouselController = CarouselController();
int carouselIndicatorIndex = 0;
CarouselSlider _bannerCarousel;
TextField _textFieldSearch;
TextField _textFieldFilterSelection;
ListView _listViewLatestOffers;
ListView _listViewBestSeller;
PackagesViewModel viewModel;
onCartClick(){
if (viewModel.service.customer == null){
utils.Utils.showErrorToast("Cart is empty for your current session");
return;
}
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) => PackagesCartPage()
)
);
}
onProductCartClick(PackagesResponseModel product) async {
if(viewModel.service.customer == null)
viewModel.service.customer = await CreateCustomerDialogPage(context: context).show();
if(viewModel.service.customer != null) {
var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id);
await viewModel.service.addProductToCart(request, context: context).then((response){
appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
}).catchError((error) {
utils.Utils.showErrorToast(error);
});
}
}
AppScaffold appScaffold;
@override
Widget build(BuildContext context) {
return BaseView<PackagesViewModel>(
allowAny: true,
onModelReady: (model) => viewModel = model,
builder: (_, model, wi){
return
appScaffold =
AppScaffold(
appBarTitle: TranslationBase.of(context).offerAndPackages,
isShowAppBar: true,
isPharmacy: false,
showPharmacyCart: false,
showHomeAppBarIcon: false,
isOfferPackages: true,
showOfferPackagesCart: true,
isShowDecPage: false,
body: ListView(
children: [
// Top Banner Carousel
AspectRatio(
aspectRatio: 2.2/1,
child: bannerCarousel()
),
Center(
child: CarouselIndicator(
activeColor: Theme.of(context).appBarTheme.color,
color: Colors.grey[300],
cornerRadius: 15,
width: 15, height: 15,
count: _bannerCarousel.itemCount,
index: carouselIndicatorIndex,
onClick: (index){
debugPrint('onClick at ${index}');
},
),
),
SizedBox(height: 10,),
Padding(
padding: const EdgeInsets.all(15),
child: Column(
children: [
// Search Textfield
searchTextField(),
SizedBox(height: 10,),
// Filter Selection
filterOptionSelection(),
SizedBox(height: 20,),
// Horizontal Scrollable Cards
Texts(
"Latest offers",
fontWeight: FontWeight.bold,
color: Colors.black87,
fontSize: 20
),
// Latest Offers Horizontal Scrollable List
AspectRatio(
aspectRatio: 1.3/1,
child: LayoutBuilder(builder: (context, constraints){
double itemContentPadding = 10;
double itemWidth = (constraints.maxWidth/2) - (itemContentPadding*2);
return latestOfferListView(itemWidth: itemWidth, itemContentPadding: itemContentPadding);
}),
),
SizedBox(height: 10,),
Texts(
"Best sellers",
fontWeight: FontWeight.bold,
color: Colors.black87,
fontSize: 20
),
// Best Seller Horizontal Scrollable List
AspectRatio(
aspectRatio: 1.3/1,
child: LayoutBuilder(builder: (context, constraints){
double itemContentPadding = 10; // 10 is content padding in each item
double itemWidth = (constraints.maxWidth/2) - (itemContentPadding*2 /* 2 = LeftRight */);
return bestSellerListView(itemWidth: itemWidth, itemContentPadding: itemContentPadding);
}),
)
],),
),
],
),
)
.setOnAppBarCartClick(onCartClick);
}
);
}
showClinicSelectionList() async {
var clinics = viewModel.service.categoryList;
if(clinics.isEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
clinics = await viewModel.service.getAllCategories(OffersCategoriesRequestModel());
GifLoaderDialogUtils.hideDialog(context);
}
List<String> options = clinics.map((e) => e.toString()).toList();
showMaterialSelectionPicker(
context: context,
title: "Select Clinic",
items: options,
selectedItem: options.first,
onChanged: (value) async {
var selectedClinic = clinics.firstWhere((element) => element.toString() == value);
var clinicProducts = await viewModel.service.getAllProducts(request: OffersProductsRequestModel(categoryId: selectedClinic.id), context: context, showLoading: true);
if(clinicProducts.isNotEmpty)
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) => ClinicPackagesPage(products: clinicProducts)
)
);
else
utils.Utils.showErrorToast("No offers available for this clinic");
},
);
}
//----------------------------------
// Main Widgets of Page
//----------------------------------
CarouselSlider bannerCarousel(){
_bannerCarousel = CarouselSlider.builder(
carouselController: _carouselController,
itemCount: 10,
itemBuilder: (BuildContext context, int itemIndex) {
return Padding(
padding: const EdgeInsets.only(top: 10, bottom: 10, left: 15, right: 15),
child: FractionallySizedBox(
widthFactor: 1,
heightFactor: 1,
child: utils.applyShadow(
spreadRadius: 1,
blurRadius: 5,
child: InkWell(
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: utils.Utils.loadNetworkImage(url: "https://wallpaperaccess.com/full/30103.jpg",)
),
onTap: (){
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) => OfferAndPackagesDetail(model: "",)
)
);
},
)
),
),
);
},
options: CarouselOptions(
autoPlayInterval: Duration(milliseconds: 3500),
enlargeStrategy: CenterPageEnlargeStrategy.scale,
enlargeCenterPage: true,
autoPlay: false,
autoPlayCurve: Curves.fastOutSlowIn,
enableInfiniteScroll: true,
autoPlayAnimationDuration: Duration(milliseconds: 1500),
viewportFraction: 1,
onPageChanged: (page, reason){
setState(() {
carouselIndicatorIndex = page;
});
},
),
);
return _bannerCarousel;
}
TextField searchTextField(){
return _textFieldSearch =
TextField(
controller: _searchTextController,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(top: 0.0, bottom: 0.0, left: 10, right: 10),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide( width: 0.5, color: Colors.grey),
borderRadius: const BorderRadius.all(
const Radius.circular(10.0),
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide( width: 1, color: Colors.grey),
borderRadius: const BorderRadius.all(
const Radius.circular(10.0),
),
),
filled: true,
fillColor: Colors.white,
hintText: "Search",
hintStyle: TextStyle(color: Colors.grey[350], fontWeight: FontWeight.bold),
suffixIcon: IconButton(
onPressed: (){
// viewModel.search(text: _searchTextController.text);
},
icon: Icon(Icons.search_rounded, size: 35,),
),
),
);
}
Widget filterOptionSelection(){
_textFieldFilterSelection =
TextField(
enabled: false,
controller: _searchTextController,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(top: 0.0, bottom: 0.0, left: 10, right: 10),
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1),
borderRadius: const BorderRadius.all(
const Radius.circular(10.0),
),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide( width: 0.5, color: Colors.grey),
borderRadius: const BorderRadius.all(
const Radius.circular(10.0),
),
),
focusedBorder: OutlineInputBorder(
borderRadius: const BorderRadius.all(
const Radius.circular(10.0),
),
),
filled: true,
fillColor: Colors.white,
hintText: "Browse offers by Clinic",
hintStyle: TextStyle(color: Colors.grey[350], fontWeight: FontWeight.bold),
suffixIcon: IconButton(
onPressed: (){
showClinicSelectionList();
},
icon: Icon(Icons.keyboard_arrow_down_rounded, size: 35, color: Colors.grey,),
),
),
);
return InkWell(
child: _textFieldFilterSelection,
onTap: (){
showClinicSelectionList();
},
);
}
Widget latestOfferListView({@required double itemWidth, @required double itemContentPadding}){
return _listViewLatestOffers =
ListView.separated(
scrollDirection: Axis.horizontal,
itemCount: viewModel.bestSellerList.length,
itemBuilder: (BuildContext context, int index) {
return PackagesItemCard(itemWidth: itemWidth, itemContentPadding: itemContentPadding, itemModel: viewModel.bestSellerList[index], onCartClick: onProductCartClick,);
},
separatorBuilder: separator,
);
}
Widget bestSellerListView({@required double itemWidth, @required double itemContentPadding}){
return _listViewLatestOffers =
ListView.separated(
scrollDirection: Axis.horizontal,
itemCount: viewModel.bestSellerList.length,
itemBuilder: (BuildContext context, int index) {
return PackagesItemCard(itemWidth: itemWidth, itemContentPadding: itemContentPadding, itemModel: viewModel.bestSellerList[index], onCartClick: onProductCartClick,);
},
separatorBuilder: separator,
);
}
Widget separator(BuildContext context, int index){
return Container(
width: 1,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment(-1.0, -2.0),
end: Alignment(1.0, 4.0),
colors: [
Colors.grey,
Colors.grey[100],
Colors.grey[200],
Colors.grey[300],
Colors.grey[400],
Colors.grey[500]
]
)),
);
}
}

@ -0,0 +1,136 @@
import 'package:diplomaticquarterapp/core/viewModels/packages_offers/PackagesOffersViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_svg/svg.dart';
dynamic languageID;
class PackageOrderCompletedPage extends StatelessWidget{
double buttonHeight;
double buttonWidth;
Widget icon;
String heading;
String title;
String subTitle;
String actionTitle;
PackageOrderCompletedPage({this.buttonWidth, this.buttonHeight, @required this.heading, @required this.title, @required this.subTitle, this.actionTitle });
@override
Widget build(BuildContext context) {
assert((heading != null || title != null || subTitle != null), "Data missing in properties");
buttonWidth = buttonWidth ?? MediaQuery.of(context).size.width/2;
buttonHeight = buttonHeight ?? 40;
actionTitle = actionTitle ?? TranslationBase.of(context).done;
return BaseView<PackagesViewModel>(
allowAny: true,
onModelReady: (model){},
builder: (_, model, wi){
return Container(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(15),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AspectRatio(
aspectRatio: 1.2/1,
child:
iconWidget(context),
),
headingWidget(context),
AspectRatio(
aspectRatio: 1/1,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
titleWidget(context),
SizedBox(height: 20,),
subTitleWidget(context),
SizedBox(height: 50,),
actionWidget(context)
],
),
),
)
],
),
),
);
}
);
}
Widget iconWidget(BuildContext context){
return Padding(
padding: const EdgeInsets.all(50),
child: icon ?? SvgPicture.asset(
"assets/images/svg/success.svg",
semanticsLabel: 'icon'
),
);
}
Widget headingWidget(BuildContext context) => Texts(
heading,
textAlign: TextAlign.center,
maxLines: 1,
color: Theme.of(context).primaryColor,
fontSize: 35.0,
fontWeight: FontWeight.bold,
);
Widget titleWidget(BuildContext context) => Texts(
title,
textAlign: TextAlign.center,
maxLines: 2,
color: Theme.of(context).primaryColor,
fontSize: 25.0,
fontWeight: FontWeight.w200,
);
Widget subTitleWidget(BuildContext context) => Texts(
subTitle,
textAlign: TextAlign.center,
maxLines: 2,
color: Theme.of(context).primaryColor,
fontSize: 15.0,
fontWeight: FontWeight.normal,
);
Widget actionWidget(BuildContext context) => Container(
height: buttonHeight,
width: buttonWidth,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
shape:RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(buttonHeight/2),
)
),
child: Texts(
actionTitle,
color: Colors.white,
fontSize: 18.0,
fontWeight: FontWeight.normal,
),
onPressed: (){
Navigator.of(context).pop();
},
),
);
}

@ -117,7 +117,7 @@ class PaymentService extends StatelessWidget {
)
],
),
// if(!projectViewModel.havePrivilege(33))
//if(!projectViewModel.havePrivilege(33))
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

@ -28,6 +28,7 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
@override
Widget build(BuildContext context) {
return BaseView<BrandsViewModel>(
allowAny: true,
onModelReady: (model) => model.getBrandsData(),
builder: (_, model, wi) => AppScaffold(
appBarTitle: 'Brands page',
@ -142,6 +143,7 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
topBrand(BuildContext context) {
return BaseView<BrandsViewModel>(
allowAny: true,
onModelReady: (model) => model.getTopBrandsData(),
builder: (_, model, wi) => GridView.count(
crossAxisCount: 4,

@ -1,23 +1,22 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/login/welcome.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scafold_detail_page.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scafold_detail_page.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
int price = 0;
var languageID;
@ -30,7 +29,9 @@ PharmacyProduct specificationData;
class ProductDetailPage extends StatefulWidget {
final PharmacyProduct product;
ProductDetailPage(this.product);
@override
__ProductDetailPageState createState() => __ProductDetailPageState();
}
@ -42,8 +43,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
bool isAvailabilty = false;
dynamic wishlistItems;
var model;
// String ProductId="4561";
String productId = "";
checkWishlist() async {
GifLoaderDialogUtils.showMyDialog(context);
ProductDetailViewModel x = new ProductDetailViewModel();
@ -62,6 +65,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
GifLoaderDialogUtils.hideDialog(context);
setState(() {});
}
void initState() {
price = 1;
specificationData = widget.product;
@ -613,21 +617,20 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
Container(
width: 410,
height: 50,
// margin: EdgeInsets.only(bottom: 5),
// margin: EdgeInsets.only(bottom: 5),
color: Colors.white,
child: Texts(
TranslationBase.of(context).recommended,
bold: true,
),
),
],
),
SingleChildScrollView(
child: Container(
color: Colors.white,
child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
children: [
@ -636,208 +639,252 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
height: 210,
margin: EdgeInsets.only(bottom: 75),
padding: EdgeInsets.only(bottom: 5),
// margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4),
// margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4),
child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) =>
model.getRecommendedProducts(widget.product.id.toString()),
builder: (_, model, wi) =>
Container(
model.getRecommendedProducts(
widget.product.id.toString()),
builder: (_, model, wi) => Container(
child:
// Text(model.recommendedProductList[0].id),
model.recommendedProductList.length != null
? Expanded(
child: ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
itemCount: model.recommendedProductList.length,
itemBuilder: (context, index) {
return Card(
elevation: 2,
shape: RoundedRectangleBorder(
side: BorderSide(
color: Colors.grey[300], width: 2),
borderRadius: BorderRadius.circular(10)),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 0,
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(15),
),
),
padding: EdgeInsets.symmetric(horizontal: 4),
width: MediaQuery.of(context).size.width / 3,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Stack(children: [
Container(
child: Align(
alignment: Alignment.topRight,
child: //true
itemID.contains(model.recommendedProductList[index].id)
// !isInWishlist
? IconButton(
icon: Icon(Icons
.favorite_border),
color: Colors.grey,
iconSize: 30,
onPressed: () {
setState(() {
addToWishlistFunction(itemID);
});
},
)
: IconButton(
icon: Icon(
Icons.favorite),
color: Colors.red,
iconSize: 30,
onPressed: () {
setState(() {
deleteFromWishlistFunction(itemID);
});
},
)
//
model.recommendedProductList.length !=
null
? Expanded(
child: ListView.builder(
scrollDirection:
Axis.horizontal,
shrinkWrap: true,
physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
itemCount: model
.recommendedProductList
.length,
itemBuilder:
(context, index) {
return Card(
elevation: 2,
shape: RoundedRectangleBorder(
side: BorderSide(
color: Colors
.grey[
300],
width: 2),
borderRadius:
BorderRadius
.circular(
10)),
margin: EdgeInsets
.symmetric(
horizontal: 8,
vertical: 0,
),
),
Container(
margin: EdgeInsets.fromLTRB(
0, 16, 10, 16),
alignment: Alignment.center,
child: Container(
decoration:
BoxDecoration(
borderRadius:
BorderRadius
.all(
Radius.circular(
15),
),
),
padding: EdgeInsets
.symmetric(
horizontal:
4),
width: MediaQuery.of(
context)
.size
.width /
3,
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Stack(
children: [
Container(
child: Align(
alignment: Alignment.topRight,
child: //true
itemID.contains(model.recommendedProductList[index].id)
// !isInWishlist
? IconButton(
icon: Icon(Icons.favorite_border),
color: Colors.grey,
iconSize: 30,
onPressed: () {
setState(() {
addToWishlistFunction(itemID);
});
},
)
: IconButton(
icon: Icon(Icons.favorite),
color: Colors.red,
iconSize: 30,
onPressed: () {
setState(() {
deleteFromWishlistFunction(itemID);
});
},
)
//
),
),
Container(
margin: EdgeInsets.fromLTRB(
0,
16,
10,
16),
alignment:
Alignment.center,
// padding: EdgeInsets.only(left: 25, bottom: 20),
child: (model.recommendedProductList[index].images != null &&
model.recommendedProductList[index].images.length > 0)
? Image.network(
model.recommendedProductList[index].images[0].src.toString(),
child: (model.recommendedProductList[index].images != null &&
model.recommendedProductList[index].images.length > 0)
? Image.network(
model.recommendedProductList[index].images[0].src.toString(),
// item.images[0].src,
fit: BoxFit.cover,
height: 60,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: 60,
),
),
Container(
width: model
.recommendedProductList[
index]
.rxMessage !=
null
? MediaQuery.of(context)
.size
.width /
5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6)),
),
child: Texts(
model.recommendedProductList[index]
.rxMessage !=
null
? model
.recommendedProductList[
index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
),
]),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
languageID == "ar"
? model.recommendedProductList[index].namen
: model.recommendedProductList[index].name,
style: TextStyle(
color: Colors.black,
fontSize: 13.0,
fit: BoxFit.cover,
height: 60,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: 60,
),
),
Container(
width: model.recommendedProductList[index].rxMessage !=
null
? MediaQuery.of(context).size.width /
5
: 0,
padding:
EdgeInsets.all(4),
decoration:
BoxDecoration(
color:
Color(0xffb23838),
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child:
Texts(
model.recommendedProductList[index].rxMessage != null
? model.recommendedProductList[index].rxMessage
: "",
color:
Colors.white,
regular:
true,
fontSize:
10,
fontWeight:
FontWeight.w400,
),
),
]),
Container(
margin: EdgeInsets
.symmetric(
horizontal:
6,
vertical: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Text(
languageID ==
"ar"
? model.recommendedProductList[index].namen
: model.recommendedProductList[index].name,
style:
TextStyle(
color:
Colors.black,
fontSize:
13.0,
// fontWeight: FontWeight.bold,
),
),
Padding(
),
),
Padding(
// padding: const EdgeInsets.only(top: 15, bottom: 10),
padding: const EdgeInsets.only(
top: 10, bottom: 5),
child: Texts(
"SAR ${model.recommendedProductList[index].price}",
bold: true,
fontSize: 14,
),
),
],
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
padding:
EdgeInsets.only(right: 10),
padding: const EdgeInsets.only(
top:
10,
bottom:
5),
child:
Texts(
"SAR ${model.recommendedProductList[index].price}",
bold:
true,
fontSize:
14,
),
),
],
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <
Widget>[
Container(
padding:
EdgeInsets.only(right: 10),
// margin: EdgeInsets.only(left: 5),
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: model
.recommendedProductList[
index]
.approvedRatingSum
.toDouble(),
child:
Align(
alignment:
Alignment.topLeft,
child:
RatingBar.readOnly(
initialRating:
model.recommendedProductList[index].approvedRatingSum.toDouble(),
// initialRating: productRate,
size: 13.0,
filledColor:
Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon:
Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
),
Texts(
"(${model.recommendedProductList[index].approvedTotalReviews.toString()})",
size:
13.0,
filledColor:
Colors.yellow[700],
emptyColor:
Colors.grey[500],
isHalfAllowed:
true,
halfFilledIcon:
Icons.star_half,
filledIcon:
Icons.star,
emptyIcon:
Icons.star,
),
),
),
Texts(
"(${model.recommendedProductList[index].approvedTotalReviews.toString()})",
// bold: true,
fontSize: 12,
fontSize:
12,
),
]),
],
),
]),
],
),
),
);
}),
)
: Container(
),
);
}),
)
: Container(
// child: Text("NO DATA"),
),
)
),
),
)),
),
],
),
@ -1341,8 +1388,10 @@ class footerWidget extends StatefulWidget {
final int minQuantity;
final int quantityLimit;
final PharmacyProduct item;
footerWidget(this.isAvailble, this.maxQuantity, this.minQuantity,
this.quantityLimit, this.item);
@override
_footerWidgetState createState() => _footerWidgetState();
}
@ -1350,6 +1399,7 @@ class footerWidget extends StatefulWidget {
class _footerWidgetState extends State<footerWidget> {
double quantityUI = 70;
bool showUI = false;
@override
Widget build(BuildContext context) {
return Container(
@ -1752,7 +1802,7 @@ class _footerWidgetState extends State<footerWidget> {
)
: InkWell(
onTap: () {
addToCartFunction(price, widget.item.id);
addToCartFunction(price, widget.item.id, context);
},
child: Container(
alignment: Alignment.center,
@ -1792,11 +1842,10 @@ class _footerWidgetState extends State<footerWidget> {
: InkWell(
onTap: () {
print('buy now');
addToCartFunction(price, widget.item.id);
addToCartFunction(price, widget.item.id, context);
Navigator.push(
context,
FadePage(page:
CartOrderPage()),
FadePage(page: CartOrderPage()),
);
},
child: Container(
@ -1824,7 +1873,9 @@ class _footerWidgetState extends State<footerWidget> {
class productNameAndPrice extends StatefulWidget {
BuildContext context;
PharmacyProduct item;
productNameAndPrice(this.context, this.item);
@override
_productNameAndPriceState createState() => _productNameAndPriceState();
}
@ -2014,9 +2065,12 @@ getSpecificationData(itemID) async {
specificationData = await x.productSpecificationData(itemID);
}
addToCartFunction(quantity, itemID) async {
addToCartFunction(quantity, itemID, BuildContext context) async {
GifLoaderDialogUtils.showMyDialog(context);
ProductDetailViewModel x = new ProductDetailViewModel();
await x.addToCartData(quantity, itemID);
await x.addToCartData(quantity, itemID).then((value) {
GifLoaderDialogUtils.hideDialog(context);
});
}
notifyMeWhenAvailable(context, itemId) async {
@ -2071,7 +2125,7 @@ settingModalBottomSheet(context) {
title: Text('Add to cart'),
onTap: () => {
if (price > 0)
{addToCartFunction(price, itemID)}
{addToCartFunction(price, itemID, context)}
else
{
AppToast.showErrorToast(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-preview
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderItem.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -32,7 +34,7 @@ class CartOrderPage extends StatelessWidget {
baseViewModel: model,
backgroundColor: Colors.white,
body: !(model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0)
model.cartResponse.shoppingCarts.length == 0)
? Container(
height: height * 0.85,
width: double.infinity,
@ -70,8 +72,16 @@ class CartOrderPage extends StatelessWidget {
cart.shoppingCarts[index], () {
print(cart.shoppingCarts[index]
.quantity);
model.changeProductQuantity(
cart.shoppingCarts[index]);
model
.changeProductQuantity(
cart.shoppingCarts[index])
.then((value) {
if (model.state ==
ViewState.ErrorLocal) {
Utils.showErrorToast(
model.error);
}
});
},
() => model.deleteProduct(
cart.shoppingCarts[index])))
@ -246,64 +256,62 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
height: widget.height * 0.070,
color: Color(0xffe6ffe0),
padding: EdgeInsets.symmetric(horizontal: 4),
child: Expanded(
child: Row(
children: [
InkWell(
onTap: () {
setState(() {
isAgree = !isAgree;
});
},
child: Container(
width: 25.0,
height: widget.height * 0.070,
decoration: new BoxDecoration(
color: !isAgree
? Color(0xffeeeeee)
: Colors.green,
shape: BoxShape.circle,
child: Row(
children: [
InkWell(
onTap: () {
setState(() {
isAgree = !isAgree;
});
},
child: Container(
width: 25.0,
height: widget.height * 0.070,
decoration: new BoxDecoration(
color: !isAgree
? Color(0xffeeeeee)
: Colors.green,
shape: BoxShape.circle,
),
child: !isAgree
? null
: Padding(
padding: const EdgeInsets.all(0.0),
child: Icon(
Icons.check,
color: Colors.white,
size: 25,
),
child: !isAgree
? null
: Padding(
padding: const EdgeInsets.all(0.0),
child: Icon(
Icons.check,
color: Colors.white,
size: 25,
),
),
),
),
Expanded(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 4),
margin: const EdgeInsets.symmetric(vertical: 4),
child: Texts(
TranslationBase.of(context)
.pharmacyServiceTermsCondition,
fontSize: 13,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
),
Expanded(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 4),
margin: const EdgeInsets.symmetric(vertical: 4),
child: Texts(
TranslationBase.of(context)
.pharmacyServiceTermsCondition,
fontSize: 13,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
),
InkWell(
onTap: () => {
Navigator.push(context,
FadePage(page: PharmacyTermsConditions()))
},
child: Container(
child: Icon(
Icons.info,
size: 25,
color: Color(0xff005aff),
),
),
InkWell(
onTap: () => {
Navigator.push(context,
FadePage(page: PharmacyTermsConditions()))
},
child: Container(
child: Icon(
Icons.info,
size: 25,
color: Color(0xff005aff),
),
),
],
),
),
],
),
),
Container(

File diff suppressed because it is too large Load Diff

@ -72,7 +72,7 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
child: Texts(
projectProvider.isArabic
? widget.item.product.namen
: widget.item.product.name,
: "${widget.item.product.name}",
regular: true,
textAlign: TextAlign.justify,
fontSize: 12,
@ -88,91 +88,90 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
),
margin: const EdgeInsets.only(bottom: 4),
),
Row(
children: [
InkWell(
onTap: () =>
{_quantityOnChangeClick(Operation.dec)},
child: Container(
width: 25,
height: 25,
child: Center(
child: Texts(
"-",
color: Colors.grey.shade400,
)),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey.shade400,
width: 1.0,
Container(
margin: EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
InkWell(
onTap: () =>
{_quantityOnChangeClick(Operation.dec)},
child: Container(
width: 25,
height: 25,
child: Icon(
Icons.remove, color: Colors.grey.shade400, size: 20,
),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey.shade400,
width: 1.0,
),
),
),
),
),
Container(
margin:
const EdgeInsets.symmetric(horizontal: 4),
width: 25,
height: 25,
color: Colors.grey.shade300,
child: Center(
child: TextField(
cursorColor: Colors.black,
keyboardType: TextInputType.number,
controller: _quantityController,
textAlign: TextAlign.center,
onChanged: (text) {
setState(() {
var value = int.tryParse(text);
if (value == null) {
widget.item.quantity = 0;
} else {
widget.item.quantity = int.parse(text);
}
_totalPrice =
"${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}";
});
},
)),
),
InkWell(
onTap: () =>
{_quantityOnChangeClick(Operation.inc)},
child: Container(
Container(
margin:
const EdgeInsets.symmetric(horizontal: 4),
width: 25,
height: 25,
color: Colors.grey.shade300,
child: Center(
child: Texts(
"+",
color: Colors.grey.shade400,
child: TextField(
cursorColor: Colors.black,
keyboardType: TextInputType.number,
controller: _quantityController,
textAlign: TextAlign.center,
onChanged: (text) {
setState(() {
var value = int.tryParse(text);
if (value == null) {
widget.item.quantity = 0;
} else {
widget.item.quantity = int.parse(text);
}
_totalPrice =
"${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}";
});
},
)),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey.shade400,
width: 1.0,
),
),
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Texts(
TranslationBase.of(context).total,
color: Colors.grey.shade500,
fontWeight: FontWeight.bold,
fontSize: 12,
InkWell(
onTap: () =>
{_quantityOnChangeClick(Operation.inc)},
child: Container(
width: 25,
height: 25,
child: Icon(
Icons.add, color: Colors.grey.shade400, size: 20,
),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey.shade400,
width: 1.0,
),
),
Texts(
"$_totalPrice ${projectProvider.isArabic ? widget.item.currencyn : widget.item.currency}",
fontSize: 12,
fontWeight: FontWeight.bold,
)
],
),
),
)
],
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Texts(
TranslationBase.of(context).total,
color: Colors.grey.shade500,
fontWeight: FontWeight.bold,
fontSize: 12,
),
Texts(
"$_totalPrice ${projectProvider.isArabic ? widget.item.currencyn : widget.item.currency}",
fontSize: 12,
fontWeight: FontWeight.bold,
)
],
),
)
],
),
)
],
),

@ -1,13 +1,26 @@
import 'dart:async';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:async/async.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_animarker/lat_lng_interpolation.dart';
import 'package:flutter_animarker/models/lat_lng_delta.dart';
import 'package:flutter_animarker/models/lat_lng_info.dart';
import 'package:flutter_polyline_points/flutter_polyline_points.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:location/location.dart';
import 'package:flutter_animarker/streams/lat_lng_stream.dart';
class TrackDriver extends StatefulWidget {
final OrderDetailModel order;
@ -18,12 +31,13 @@ class TrackDriver extends StatefulWidget {
}
class _TrackDriverState extends State<TrackDriver> {
OrderPreviewService _orderServices = locator<OrderPreviewService>();
OrderDetailModel _order;
Completer<GoogleMapController> _controller = Completer();
double CAMERA_ZOOM = 16;
double CAMERA_ZOOM = 14;
double CAMERA_TILT = 0;
double CAMERA_BEARING = 30;
LatLng SOURCE_LOCATION = null;
@ -40,66 +54,120 @@ class _TrackDriverState extends State<TrackDriver> {
BitmapDescriptor destinationIcon; // for my custom marker pins
Location location;// wrapper around the location API
int locationUpdateFreq = 2;
LatLngInterpolationStream _latLngStream;
StreamGroup<LatLngDelta> subscriptions;
@override
void initState() {
super.initState();
_order = widget.order;
DEST_LOCATION = _order.shippingAddress.getLocation();
location = new Location();
polylinePoints = PolylinePoints();
setSourceAndDestinationIcons();
initMarkerUpdateStream();
startUpdatingDriverLocation();
}
@override
void dispose() {
super.dispose();
subscriptions.close();
_latLngStream.cancel();
stopUpdatingDriverLocation();
}
initMarkerUpdateStream(){
_latLngStream = LatLngInterpolationStream(movementDuration: Duration(seconds: locationUpdateFreq+1));
subscriptions = StreamGroup<LatLngDelta>();
subscriptions.add(_latLngStream.getAnimatedPosition('sourcePin'));
subscriptions.stream.listen((LatLngDelta delta) {
//Update the marker with animation
setState(() {
//Get the marker Id for this animation
var markerId = MarkerId(delta.markerId);
Marker sourceMarker = Marker(
markerId: markerId,
// rotation: delta.rotation,
icon: sourceIcon,
position: LatLng(
delta.from.latitude,
delta.from.longitude,
),
onTap: onSourceMarkerTap
);
_markers.removeWhere((m) => m.markerId.value == 'sourcePin');
_markers.add(sourceMarker);
});
});
}
@override
Widget build(BuildContext context) {
return new Scaffold(
return AppScaffold(
appBarTitle: TranslationBase.of(context).deliveryDriverTrack,
isShowAppBar: true,
isPharmacy: true,
showPharmacyCart: false,
showHomeAppBarIcon: false,
body: GoogleMap(
myLocationEnabled: true,
compassEnabled: true,
markers: _markers,
polylines: _polylines,
mapType: MapType.normal,
initialCameraPosition: _orderDeliveryLocationCamera(),
initialCameraPosition: CameraPosition(target: DEST_LOCATION, zoom: 4),
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
showPinsOnMap();
// showPinsOnMap();
},
),
floatingActionButton: FloatingActionButton.extended(
onPressed: _goToDriver,
label: Text('To the lake!'),
icon: Icon(Icons.directions_boat),
),
// floatingActionButton: FloatingActionButton.extended(
// onPressed: _goToDriver,
// label: Text('To the lake!'),
// icon: Icon(Icons.directions_boat),
// ),
);
}
void setSourceAndDestinationIcons() async {
sourceIcon = await BitmapDescriptor.fromAssetImage(
ImageConfiguration(devicePixelRatio: 2.5),
'assets/images/map_markers/source_map_marker.png');
destinationIcon = await BitmapDescriptor.fromAssetImage(
ImageConfiguration(devicePixelRatio: 2.5),
'assets/images/map_markers/destination_map_marker.png');
final Uint8List srcMarkerBytes = await getBytesFromAsset('assets/images/map_markers/source_map_marker.png', getMarkerIconSize());
final Uint8List destMarkerBytes = await getBytesFromAsset('assets/images/map_markers/destination_map_marker.png', getMarkerIconSize());
sourceIcon = await BitmapDescriptor.fromBytes(srcMarkerBytes);
destinationIcon = await BitmapDescriptor.fromBytes(destMarkerBytes);
}
CameraPosition _orderDeliveryLocationCamera(){
final CameraPosition orderDeliveryLocCamera = CameraPosition(
bearing: CAMERA_BEARING,
target: DEST_LOCATION,
tilt: CAMERA_TILT,
zoom: CAMERA_ZOOM);
return orderDeliveryLocCamera;
if(DEST_LOCATION != null){
final CameraPosition orderDeliveryLocCamera = CameraPosition(
bearing: CAMERA_BEARING,
target: DEST_LOCATION,
tilt: CAMERA_TILT,
zoom: CAMERA_ZOOM);
return orderDeliveryLocCamera;
}
return null;
}
CameraPosition _driverLocationCamera(){
final CameraPosition driverLocCamera = CameraPosition(
bearing: CAMERA_BEARING,
target: SOURCE_LOCATION,
tilt: CAMERA_TILT,
zoom: CAMERA_ZOOM);
return driverLocCamera;
if(DEST_LOCATION != null) {
final CameraPosition driverLocCamera = CameraPosition(
bearing: CAMERA_BEARING,
target: SOURCE_LOCATION,
tilt: CAMERA_TILT,
zoom: CAMERA_ZOOM);
return driverLocCamera;
}
return null;
}
@ -116,25 +184,18 @@ class _TrackDriverState extends State<TrackDriver> {
}
Future<void> _fitCameraBetweenBothPoints() async {
final GoogleMapController controller = await _controller.future;
final CameraPosition driverLocCamera = CameraPosition(
bearing: CAMERA_BEARING,
target: SOURCE_LOCATION,
tilt: CAMERA_TILT,
zoom: CAMERA_ZOOM);
controller.animateCamera(CameraUpdate.newCameraPosition(driverLocCamera));
}
void showPinsOnMap() {
// source pin
if(SOURCE_LOCATION != null){
setState(() {
var pinPosition = SOURCE_LOCATION;
_markers.removeWhere((m) => m.markerId.value == 'sourcePin');
_markers.add(Marker(
markerId: MarkerId('sourcePin'),
position: pinPosition,
icon: sourceIcon
icon: sourceIcon,
infoWindow: InfoWindow(title: TranslationBase.of(context).driver),
onTap: onSourceMarkerTap
));
});
}
@ -143,10 +204,13 @@ class _TrackDriverState extends State<TrackDriver> {
if(DEST_LOCATION != null){
setState(() {
var destPosition = DEST_LOCATION;
_markers.removeWhere((m) => m.markerId.value == 'destPin');
_markers.add(Marker(
markerId: MarkerId('destPin'),
position: destPosition,
icon: destinationIcon
icon: destinationIcon,
infoWindow: InfoWindow(title: TranslationBase.of(context).deliveryLocation),
onTap: onDestinationMarkerTap
));
});
}
@ -156,32 +220,8 @@ class _TrackDriverState extends State<TrackDriver> {
}
void updatePinOnMap() async {
// create a new CameraPosition instance
// every time the location changes, so the camera
// follows the pin as it moves with an animation
CameraPosition cPosition = CameraPosition(
zoom: CAMERA_ZOOM,
tilt: CAMERA_TILT,
bearing: CAMERA_BEARING,
target: SOURCE_LOCATION,
);
final GoogleMapController controller = await _controller.future;
controller.animateCamera(CameraUpdate.newCameraPosition(cPosition));
// do this inside the setState() so Flutter gets notified
// that a widget update is due
setState(() {
// updated position
var pinPosition = SOURCE_LOCATION;
// the trick is to remove the marker (by id)
// and add it again at the updated location
_markers.removeWhere((m) => m.markerId.value == 'sourcePin');
_markers.add(Marker(
markerId: MarkerId('sourcePin'),
position: pinPosition, // updated position
icon: sourceIcon
));
});
_latLngStream.addLatLng(LatLngInfo(SOURCE_LOCATION.latitude, SOURCE_LOCATION.longitude, "sourcePin"));
drawRoute();
}
void drawRoute() async {
@ -209,4 +249,96 @@ class _TrackDriverState extends State<TrackDriver> {
});
}
}
}
bool isLocationUpdating = false;
startUpdatingDriverLocation({int frequencyInSeconds = 2}) async{
isLocationUpdating = true;
int driverId = int.tryParse(_order.driverID);
Future.doWhile(() async{
if(isLocationUpdating){
await Future.delayed(Duration(seconds: frequencyInSeconds));
showLoading();
LatLng driverLocation = (await _orderServices.getDriverLocation(driverId));
hideLoading();
if(driverLocation != null){
if(SOURCE_LOCATION == null || DEST_LOCATION == null){
SOURCE_LOCATION = driverLocation;
DEST_LOCATION = _order.shippingAddress.getLocation();
showPinsOnMap();
}
SOURCE_LOCATION = driverLocation;
updatePinOnMap();
updateMapCamera();
}else{
GifLoaderDialogUtils.hideDialog(context);
}
}
return isLocationUpdating;
});
}
showLoading(){
if(SOURCE_LOCATION == null){
GifLoaderDialogUtils.showMyDialog(context);
}
}
hideLoading(){
if(SOURCE_LOCATION == null){
GifLoaderDialogUtils.hideDialog(context);
}
}
stopUpdatingDriverLocation(){
isLocationUpdating = false;
}
Future<Uint8List> getBytesFromAsset(String path, int width) async {
ByteData data = await rootBundle.load(path);
ui.Codec codec = await ui.instantiateImageCodec(data.buffer.asUint8List(), targetWidth: width);
ui.FrameInfo fi = await codec.getNextFrame();
return (await fi.image.toByteData(format: ui.ImageByteFormat.png)).buffer.asUint8List();
}
int getMarkerIconSize(){
return 140;
}
updateMapCamera() async{
if(SOURCE_LOCATION != null && DEST_LOCATION != null){
// 'package:google_maps_flutter_platform_interface/src/types/location.dart': Failed assertion: line 72 pos 16: 'southwest.latitude <= northeast.latitude': is not true.
LatLngBounds bound;
if(SOURCE_LOCATION.latitude <= DEST_LOCATION.latitude){
bound = LatLngBounds(southwest: SOURCE_LOCATION, northeast: DEST_LOCATION);
}else{
bound = LatLngBounds(southwest: DEST_LOCATION, northeast: SOURCE_LOCATION);
}
if(bound == null)
return;
CameraUpdate camera = CameraUpdate.newLatLngBounds(bound, 50);
final GoogleMapController controller = await _controller.future;
controller.animateCamera(camera);
}
}
bool showSrcMarkerTitle = false;
onSourceMarkerTap() async{
// showSrcMarkerTitle = !showSrcMarkerTitle;
}
bool showDestMarkerTitle = false;
onDestinationMarkerTap() async{
// showDestMarkerTitle = !showDestMarkerTitle;
// Marker m = _markers.firstWhere((m) => m.markerId.value == 'destPin');
// if(showDestMarkerTitle){
// }
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save