Merge branch 'development' into pharmacy-Fatima

# Conflicts:
#	lib/config/config.dart
#	lib/core/service/parmacyModule/parmacy_module_service.dart
#	lib/pages/pharmacies/product_detail.dart
#	lib/pages/pharmacies/screens/pharmacy_module_page.dart
merge-requests/277/head
Fatimah Alshammari 5 years ago
commit 42bf76f712

@ -0,0 +1,14 @@
{
"client":{
"appType":"1",
"cp_id":"2640966000002322881",
"product_id":"736430079244816576",
"client_id":"563737844552565952",
"client_secret":"9C9A2C272576B8AE6E886C78AF944E8354B91F0AF3381129BB8369FB35E41C47",
"project_id":"736430079244816576",
"app_id":"103856487",
"api_key":"CgB6e3x90XxBrOCMun809w+DOzcFEettcBDUF3fqaLry1ViqTeJqoPwpfaOq/uGw//x0oYwucu9aWazs+Rdj0GUF",
"package_name":"com.cloud.diplomaticquarterapp"
},
"configuration_version":"1.0"
}

@ -0,0 +1,14 @@
{
"client":{
"appType":"1",
"cp_id":"2640966000002322881",
"product_id":"736430079244816567",
"client_id":"563735388191982656",
"client_secret":"650C7C799812AFFD53A10C7756CF05FB9F215A7E49032ABA8EBF3E14B77535CF",
"project_id":"736430079244816567",
"app_id":"102857389",
"api_key":"CgB6e3x9DJzMgRCmnT6dyUEkp6UsIfddb6l3w0ZEXzeiRMHEFi3400Z5fJ5qaHneU0OrAI/JRpk+DMGVs3QpUxlI",
"package_name":"com.ejada.hmg"
},
"configuration_version":"1.0"
}

@ -1,39 +1,37 @@
{
"project_info": {
"project_number": "815750722565",
"firebase_url": "https://api-project-815750722565.firebaseio.com",
"project_id": "api-project-815750722565",
"storage_bucket": "api-project-815750722565.appspot.com"
"project_number": "864393916058",
"firebase_url": "https://diplomaticquarter-d2385.firebaseio.com",
"project_id": "diplomaticquarter-d2385",
"storage_bucket": "diplomaticquarter-d2385.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063",
"mobilesdk_app_id": "1:864393916058:android:5b5a65cd6d8c18b4b97923",
"android_client_info": {
"package_name": "com.cloud.diplomaticquarterapp"
}
},
"oauth_client": [
{
"client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com",
"client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDUfg6AKM1-00WyzpvLImUBC46wFrq9-qw"
"current_key": "AIzaSyBdV3mos1BPhUzNKCj2KANJtiO3o2zh9IM"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
"other_platform_oauth_client": [
{
"client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
# platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

@ -1,25 +1,461 @@
PODS:
- android_intent (0.0.1):
- Flutter
- barcode_scan_fix (0.0.1):
- Flutter
- MTBBarcodeScanner
- connectivity (0.0.1):
- Flutter
- Reachability
- connectivity_for_web (0.1.0):
- Flutter
- connectivity_macos (0.0.1):
- Flutter
- device_calendar (0.0.1):
- Flutter
- device_info (0.0.1):
- Flutter
- Firebase/CoreOnly (6.33.0):
- FirebaseCore (= 6.10.3)
- Firebase/Messaging (6.33.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 4.7.0)
- firebase_core (0.5.3):
- Firebase/CoreOnly (~> 6.33.0)
- Flutter
- firebase_core_web (0.1.0):
- Flutter
- firebase_messaging (7.0.3):
- Firebase/CoreOnly (~> 6.33.0)
- Firebase/Messaging (~> 6.33.0)
- firebase_core
- Flutter
- FirebaseCore (6.10.3):
- FirebaseCoreDiagnostics (~> 1.6)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Logger (~> 6.7)
- FirebaseCoreDiagnostics (1.7.0):
- GoogleDataTransport (~> 7.4)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Logger (~> 6.7)
- nanopb (~> 1.30906.0)
- FirebaseInstallations (1.7.0):
- FirebaseCore (~> 6.10)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/UserDefaults (~> 6.7)
- PromisesObjC (~> 1.2)
- FirebaseInstanceID (4.8.0):
- FirebaseCore (~> 6.10)
- FirebaseInstallations (~> 1.6)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/UserDefaults (~> 6.7)
- FirebaseMessaging (4.7.1):
- FirebaseCore (~> 6.10)
- FirebaseInstanceID (~> 4.7)
- GoogleUtilities/AppDelegateSwizzler (~> 6.7)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Reachability (~> 6.7)
- GoogleUtilities/UserDefaults (~> 6.7)
- Protobuf (>= 3.9.2, ~> 3.9)
- Flutter (1.0.0)
- flutter_email_sender (0.0.1):
- Flutter
- flutter_flexible_toast (0.0.1):
- Flutter
- flutter_inappwebview (0.0.1):
- Flutter
- flutter_local_notifications (0.0.1):
- Flutter
- flutter_plugin_android_lifecycle (0.0.1):
- Flutter
- flutter_tts (0.0.1):
- Flutter
- geolocator (6.1.9):
- Flutter
- google_maps_flutter (0.0.1):
- Flutter
- GoogleMaps (< 3.10)
- GoogleDataTransport (7.5.1):
- nanopb (~> 1.30906.0)
- GoogleMaps (3.9.0):
- GoogleMaps/Maps (= 3.9.0)
- GoogleMaps/Base (3.9.0)
- GoogleMaps/Maps (3.9.0):
- GoogleMaps/Base
- GoogleUtilities/AppDelegateSwizzler (6.7.2):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (6.7.2):
- PromisesObjC (~> 1.2)
- GoogleUtilities/Logger (6.7.2):
- GoogleUtilities/Environment
- GoogleUtilities/Network (6.7.2):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (6.7.2)"
- GoogleUtilities/Reachability (6.7.2):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (6.7.2):
- GoogleUtilities/Logger
- hexcolor (0.0.1):
- Flutter
- image_cropper (0.0.3):
- Flutter
- TOCropViewController (~> 2.5.4)
- image_picker (0.0.1):
- Flutter
- just_audio (0.0.1):
- Flutter
- local_auth (0.0.1):
- Flutter
- location (0.0.1):
- Flutter
- manage_calendar_events (0.0.1):
- Flutter
- map_launcher (0.0.1):
- Flutter
- maps_launcher (0.0.1):
- Flutter
- MTBBarcodeScanner (5.0.11)
- nanopb (1.30906.0):
- nanopb/decode (= 1.30906.0)
- nanopb/encode (= 1.30906.0)
- nanopb/decode (1.30906.0)
- nanopb/encode (1.30906.0)
- native_device_orientation (0.0.1):
- Flutter
- native_progress_hud (0.0.1):
- Flutter
- NVActivityIndicatorView (5.1.1):
- NVActivityIndicatorView/Base (= 5.1.1)
- NVActivityIndicatorView/Base (5.1.1)
- path_provider (0.0.1):
- Flutter
- path_provider_linux (0.0.1):
- Flutter
- path_provider_macos (0.0.1):
- Flutter
- path_provider_windows (0.0.1):
- Flutter
- "permission_handler (5.0.1+1)":
- Flutter
- PromisesObjC (1.2.11)
- Protobuf (3.13.0)
- Reachability (3.2)
- screen (0.0.1):
- Flutter
- shared_preferences (0.0.1):
- Flutter
- shared_preferences_linux (0.0.1):
- Flutter
- shared_preferences_macos (0.0.1):
- Flutter
- shared_preferences_web (0.0.1):
- Flutter
- shared_preferences_windows (0.0.1):
- Flutter
- speech_to_text (0.0.1):
- Flutter
- Try
- TOCropViewController (2.5.5)
- Try (2.1.1)
- "twilio_programmable_video (0.5.0+4)":
- Flutter
- TwilioVideo (~> 3.4)
- TwilioVideo (3.8.0)
- url_launcher (0.0.1):
- Flutter
- url_launcher_linux (0.0.1):
- Flutter
- url_launcher_macos (0.0.1):
- Flutter
- url_launcher_web (0.0.1):
- Flutter
- url_launcher_windows (0.0.1):
- Flutter
- vibration (1.7.3):
- Flutter
- vibration_web (1.6.2):
- Flutter
- video_player (0.0.1):
- Flutter
- video_player_web (0.0.1):
- Flutter
- wakelock (0.0.1):
- Flutter
- webview_flutter (0.0.1):
- Flutter
- wifi (0.0.1):
- Flutter
DEPENDENCIES:
- android_intent (from `.symlinks/plugins/android_intent/ios`)
- barcode_scan_fix (from `.symlinks/plugins/barcode_scan_fix/ios`)
- 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`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`)
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
- Flutter (from `Flutter`)
- flutter_email_sender (from `.symlinks/plugins/flutter_email_sender/ios`)
- flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`)
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
- geolocator (from `.symlinks/plugins/geolocator/ios`)
- google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`)
- hexcolor (from `.symlinks/plugins/hexcolor/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`)
- just_audio (from `.symlinks/plugins/just_audio/ios`)
- local_auth (from `.symlinks/plugins/local_auth/ios`)
- location (from `.symlinks/plugins/location/ios`)
- manage_calendar_events (from `.symlinks/plugins/manage_calendar_events/ios`)
- map_launcher (from `.symlinks/plugins/map_launcher/ios`)
- maps_launcher (from `.symlinks/plugins/maps_launcher/ios`)
- native_device_orientation (from `.symlinks/plugins/native_device_orientation/ios`)
- 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`)
- path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
- path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- screen (from `.symlinks/plugins/screen/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
- shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`)
- speech_to_text (from `.symlinks/plugins/speech_to_text/ios`)
- twilio_programmable_video (from `.symlinks/plugins/twilio_programmable_video/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
- vibration (from `.symlinks/plugins/vibration/ios`)
- vibration_web (from `.symlinks/plugins/vibration_web/ios`)
- video_player (from `.symlinks/plugins/video_player/ios`)
- video_player_web (from `.symlinks/plugins/video_player_web/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
- webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
- wifi (from `.symlinks/plugins/wifi/ios`)
SPEC REPOS:
trunk:
- Firebase
- FirebaseCore
- FirebaseCoreDiagnostics
- FirebaseInstallations
- FirebaseInstanceID
- FirebaseMessaging
- GoogleDataTransport
- GoogleMaps
- GoogleUtilities
- MTBBarcodeScanner
- nanopb
- NVActivityIndicatorView
- PromisesObjC
- Protobuf
- Reachability
- TOCropViewController
- Try
- TwilioVideo
EXTERNAL SOURCES:
android_intent:
:path: ".symlinks/plugins/android_intent/ios"
barcode_scan_fix:
:path: ".symlinks/plugins/barcode_scan_fix/ios"
connectivity:
:path: ".symlinks/plugins/connectivity/ios"
connectivity_for_web:
:path: ".symlinks/plugins/connectivity_for_web/ios"
connectivity_macos:
:path: ".symlinks/plugins/connectivity_macos/ios"
device_calendar:
:path: ".symlinks/plugins/device_calendar/ios"
device_info:
:path: ".symlinks/plugins/device_info/ios"
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
firebase_core_web:
:path: ".symlinks/plugins/firebase_core_web/ios"
firebase_messaging:
:path: ".symlinks/plugins/firebase_messaging/ios"
Flutter:
:path: Flutter
flutter_email_sender:
:path: ".symlinks/plugins/flutter_email_sender/ios"
flutter_flexible_toast:
:path: ".symlinks/plugins/flutter_flexible_toast/ios"
flutter_inappwebview:
:path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_plugin_android_lifecycle:
:path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios"
flutter_tts:
:path: ".symlinks/plugins/flutter_tts/ios"
geolocator:
:path: ".symlinks/plugins/geolocator/ios"
google_maps_flutter:
:path: ".symlinks/plugins/google_maps_flutter/ios"
hexcolor:
:path: ".symlinks/plugins/hexcolor/ios"
image_cropper:
:path: ".symlinks/plugins/image_cropper/ios"
image_picker:
:path: ".symlinks/plugins/image_picker/ios"
just_audio:
:path: ".symlinks/plugins/just_audio/ios"
local_auth:
:path: ".symlinks/plugins/local_auth/ios"
location:
:path: ".symlinks/plugins/location/ios"
manage_calendar_events:
:path: ".symlinks/plugins/manage_calendar_events/ios"
map_launcher:
:path: ".symlinks/plugins/map_launcher/ios"
maps_launcher:
:path: ".symlinks/plugins/maps_launcher/ios"
native_device_orientation:
:path: ".symlinks/plugins/native_device_orientation/ios"
native_progress_hud:
:path: ".symlinks/plugins/native_progress_hud/ios"
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
path_provider_linux:
:path: ".symlinks/plugins/path_provider_linux/ios"
path_provider_macos:
:path: ".symlinks/plugins/path_provider_macos/ios"
path_provider_windows:
:path: ".symlinks/plugins/path_provider_windows/ios"
permission_handler:
:path: ".symlinks/plugins/permission_handler/ios"
screen:
:path: ".symlinks/plugins/screen/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
shared_preferences_linux:
:path: ".symlinks/plugins/shared_preferences_linux/ios"
shared_preferences_macos:
:path: ".symlinks/plugins/shared_preferences_macos/ios"
shared_preferences_web:
:path: ".symlinks/plugins/shared_preferences_web/ios"
shared_preferences_windows:
:path: ".symlinks/plugins/shared_preferences_windows/ios"
speech_to_text:
:path: ".symlinks/plugins/speech_to_text/ios"
twilio_programmable_video:
:path: ".symlinks/plugins/twilio_programmable_video/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
url_launcher_linux:
:path: ".symlinks/plugins/url_launcher_linux/ios"
url_launcher_macos:
:path: ".symlinks/plugins/url_launcher_macos/ios"
url_launcher_web:
:path: ".symlinks/plugins/url_launcher_web/ios"
url_launcher_windows:
:path: ".symlinks/plugins/url_launcher_windows/ios"
vibration:
:path: ".symlinks/plugins/vibration/ios"
vibration_web:
:path: ".symlinks/plugins/vibration_web/ios"
video_player:
:path: ".symlinks/plugins/video_player/ios"
video_player_web:
:path: ".symlinks/plugins/video_player_web/ios"
wakelock:
:path: ".symlinks/plugins/wakelock/ios"
webview_flutter:
:path: ".symlinks/plugins/webview_flutter/ios"
wifi:
:path: ".symlinks/plugins/wifi/ios"
SPEC CHECKSUMS:
android_intent: 367df2f1277a74e4a90e14a8ab3df3112d087052
barcode_scan_fix: 80dd65de55f27eec6591dd077c8b85f2b79e31f1
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
device_calendar: 23b28a5f1ab3bf77e34542fb1167e1b8b29a98f5
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659
firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1
firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75
FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd
FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1
FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2
FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1
FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_email_sender: f787522d0e82f50e5766c1213dbffff22fdcf009
flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143
flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189
flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186
flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
geolocator: 057a0c63a43e9c5296d8ad845a3ac8e6df23d899
google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619
GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89
image_cropper: c8f9b4157933c7bb965a66d1c5e6c8fd408c6eb4
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd
location: 3a2eed4dd2fab25e7b7baf2a9efefe82b512d740
manage_calendar_events: 0338d505ea26cdfd20cd883279bc28afa11eca34
map_launcher: e325db1261d029ff33e08e03baccffe09593ffea
maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92
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
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae
speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe
TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
twilio_programmable_video: 6a41593640f3d86af60b22541fd457b22deaae7f
TwilioVideo: c13a51ceca375e91620eb7578d2573c90cf53b46
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5
vibration: b5a33e764c3f609a975b9dca73dce20fdde627dc
vibration_web: 0ba303d92469ba34d71c612a228b315908d7fcd9
video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7
wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
wifi: d7d77c94109e36c4175d845f0a5964eadba71060
PODFILE CHECKSUM: d94bd40f28772938199c67fcced06ffe96096c14
PODFILE CHECKSUM: 5a17be3f8af73a757fa4439c77cf6ab2db29a6e7
COCOAPODS: 1.10.1
COCOAPODS: 1.10.0

@ -189,6 +189,8 @@ const HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvance
const ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
const ADD_VIDA_REQUEST = 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart';
const IS_ALLOW_ASK_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo';
@ -225,7 +227,7 @@ const GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactions
const CHANNEL = 3;
const GENERAL_ID = 'Cs2020@2016\$2958';
const IP_ADDRESS = '10.20.10.20';
const VERSION_ID = 8.8;
const VERSION_ID = 6.1;
const SETUP_ID = '91877';
const LANGUAGE = 2;
const PATIENT_OUT_SA = 0;
@ -382,12 +384,12 @@ const GET_TOP_BRANDS = "topmanufacturer?page=1&limit=8";
const GET_PRODUCT_DETAIL = "products/";
const GET_LOCATION = "Services/Patients.svc/REST/GetPharmcyListBySKU";
const GET_SPECIFICATION = "productspecification/";
const GET_BRAND_ITEMS = "products?ManufacturerId=";
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
@ -400,6 +402,9 @@ const GET_SUB_CATEGORISE = 'categories?fields=id,name,namen,description,image,lo
const GET_SUB_PRODUCTS = 'products?categoryid=';
const GET_FINAL_PRODUCTS =
'products?fields=id,reviews,discount_ids,name,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&CategoryId=';
const GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory';
const GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID';
const SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime';
const TIMER_MIN = 10;

@ -590,6 +590,7 @@ const Map localizedValues = {
"checkBeneficiary": {"en": "CHECK BENEFICIARY", "ar": "تحقق من المستفيد"},
"beneficiaryName": {"en": "Beneficiary Name", "ar": "اسم المستفيد"},
"accountActivation": {"en": "Account Activation", "ar": "تفعيل الحساب"},
"lakumTransfer": {"en": "Lakum Transfer", "ar": "تفعيل الحساب"},
"acceptLbl": {"en": "Accept", "ar": "موافقة"},
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
@ -606,7 +607,7 @@ const Map localizedValues = {
"HHCNotAuthMsg": {
"en":
"This service provides a set of home health care services, continuous and comprehensive follow-up in their places of residence for those who cannot access health facilities, such as (laboratory analyzes - radiology - vaccinations - physical therapy), etc.",
"ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة"
"ar": "توفر هذه الخدمة مجموعه من خدمات الرعايه الصحيه المنزلية و متابعه مستمره وشامله للذين لا يستطيعون الوصول للمنشات الصحيه في اماكن اقامتهم (التحاليل المخبرية الاشعة التطعيمات العلاج الطبيعي)..."
},
"email": {"en": "Email", "ar": "البريد الالكتروني"},
"Book": {"en": "Book", "ar": "احجز"},
@ -1143,10 +1144,55 @@ const Map localizedValues = {
"en": "Enter the required information, In order to register for Blood Donation Service",
"ar": "أدخل المعلومات المطلوبة ، للتسجيل في خدمة التبرع بالدم"
},
"viewTermsConditions": {"en": "To view the terms and conditions", "ar": "لعرض الشروط والأحكام"},
"WalkinAppo": {"en": "Hospital Visit Appointment", "ar": "موعد زيارة للمستشفى"},
"videoAppo": {"en": "Video Call Appointment", "ar": "موعد اتصال فيديو"},
// "visit": {"en" : "Visit", "ar": "الزيارة"},
"viewTermsConditions": {
"en": "To view the terms and conditions",
"ar": "لعرض الشروط والأحكام"
},
"WalkinAppo": {
"en": "Hospital Visit Appointment",
"ar": "موعد زيارة للمستشفى"
},
"videoAppo": {
"en": "Video Call Appointment",
"ar": "موعد اتصال فيديو"
},
"generalHealth": {"en": "General Health", "ar": "صحة عامة"},
"womanHealth": {"en": "Women's Health", "ar": "صحة المرأة"},
"bmi": {"en": "BMI", "ar": "الكتلة"},
"calc-health": {"en": "Calculators", "ar": "الصحية"},
"calories": {"en": "Calories", "ar": "سعرات"},
"bmr": {"en": "BMR", "ar": "معدل الأيض القاعدي"},
"idealBody": {"en": "Ideal Body", "ar": "الجسم المثالي"},
"body_word": {"en": "Body", "ar": "الجسم"},
"fat": {"en": "Fat", "ar": "دهون"},
"carbohydrate": {"en": "Carbohydrate", "ar": "كربوهيدرات"},
"proteinFat": {"en": "Protein Fat", "ar": "دهون البروتين"},
"ovulation": {"en": "Ovulation", "ar": "الإباضة"},
"delivery": {"en": "Delivery", "ar": "الولادة"},
"bmiCalcDesc": {
"en":
"'Calculate the BMI value and weight\n status to identify the healthy weight .\n Not appropriate for children and women\n who are pregnant or breastfeeding'",
"ar":
"حساب قيمة مؤشر كتلة الجسم وحالة الوزن لتحديد الوزن الصحي. \n وغير مناسب للأطفال والنساء الحوامل أو المرضعات"
},
"selectUnit": {"en": "Select Unit", "ar": "اختر الوحدة"},
"feet": {"en": "Feet", "ar": "قدم"},
"pound": {"en": "Pound", "ar": "رطل"},
"seeListOfDoctor": {"en": "See List Of Doctors", "ar": "انظر قائمة الأطباء"},
"obese": {"en": "Obese", "ar": "سمين"},
"overWeight": {"en": "OverWeight", "ar": "وزن زائد"},
"healthy": {"en": "Healthy", "ar": "صحي"},
"underWeight": {"en": "UnderWeight", "ar": "نقص الوزن"},
"bmiCalcMsgObese": {"en" : "A BMI of over 30 indicates that are heavily overweight. Health may be at risk if not lose weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.", "ar": "يشير مؤشر كتلة الجسم الذي يزيد عن 30 إلى زيادة الوزن بشكل كبير. قد تكون الصحة في خطر إذا لم تفقد الوزن. يوصى بالتحدث إلى الطبيب أو أخصائي التغذية للحصول على المشورة. لحجز موعد ، انقر أدناه للبدء."},
"bmiCalcMsgOverweight": {"en" : 'A BMI of 25 - 30 indicates that are slightly overweight. May be advised to lose some weight for health reasons. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get ', "ar": "يشير مؤشر كتلة الجسم من 25 إلى 30 إلى زيادة الوزن قليلاً. قد ينصح بفقدان بعض الوزن لأسباب صحية. يوصى بالتحدث إلى الطبيب أو أخصائي التغذية للحصول على المشورة. لحجز موعد ، انقر أدناه للحصول على"},
"bmiCalcMsgHealthy": {"en" : "A BMI of 18.5 - 25 indicates that are at a healthy weight for the height. By maintaining a healthy weight, lower the risk of developing severe health problems. To book an appointment, click below to get started.", "ar": "يشير مؤشر كتلة الجسم من 18.5 - 25 إلى وزن صحي بالنسبة للطول. بالحفاظ على وزن صحي ، قلل من خطر الإصابة بمشاكل صحية خطيرة. لحجز موعد ، انقر أدناه للبدء."},
"bmiCalcMsgUnderWeight": {"en" : "A BMI of less than 18.5 indicates that are underweight, so may need to put on some weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.", "ar": "يشير مؤشر كتلة الجسم الذي يقل عن 18.5 إلى أنك تعاني من نقص الوزن ، لذلك قد تحتاج إلى زيادة الوزن. يوصى بالتحدث إلى الطبيب أو أخصائي التغذية للحصول على المشورة. لحجز موعد ، انقر أدناه للبدء."},
"bariatrics": {"en" : "Bariatrics", "ar": "طب السمنة"},
"bariatricsHeaderMsg": {"en" : "Choose one of the following symptoms to show the right doctors or choose a consultation to show all", "ar": "اختر أحد الأعراض التالية لتظهر للأطباء المناسبين أو اختر استشارة لإظهار الكل"},
"continue": {"en" : "CONTINUE", "ar": "إستمرار"},
"skip": {"en" : "SKIP", "ar": "تخطى"},
"calorieCalcDesc": {"en" : "Calculates daily calorie intake based on several factors, like height, weight, age, gender and daily physical activity ", "ar": "يحسب السعرات الحرارية اليومية بناءً على عدة عوامل ، مثل الطول والوزن والعمر والجنس والنشاط البدني اليومي"},
"age11_120_years": {"en" : "The Age ( 11 - 120 ) yrs", "ar": "العمر (11 - 120) سنة"},
"weight-add": {"en": "Enter Weight Value", "ar": "أدخل الوزن "},
"systolic-add": {"en": "Enter Systolic Value", "ar": "أدخل قيمة الإنقباض "},
"diastolic-add": {"en": "Enter Diastolic Value", "ar": "أدخل قيمة الإنبساط "},
@ -1185,6 +1231,98 @@ const Map localizedValues = {
"en": "To recieve water reminders, please turn on notifications in the system settings",
"ar": "الرجاء تفعيل الاشعارات في الاعدادات"
},
"select-location": {
"en": "Select Location",
"ar": "اختر موقعا"
},
"result-header": {
"en": "Get The Result During 8 Hours",
"ar": "احصل على النتيجة خلال 8 ساعة"
},
"covid-info": {
"en": "We are using the advance technology to test COVID-19, The sample for examination is taking between the nose and mouth (nasopharyngeal swab), the examination is done by ELITE In Genius of the company ELITECH GROUP MOLECULAR DIAGNOSTICS, Note that the device belongs to an Italian company and is manufactured in Japan with RC- PCR",
"ar": "يتوفر لدينا أحدث جهاز خاص بفحص مرض الكورونا (COVID-19) طريقة الفحص تؤخذ مسحة من البلعوم الأنفي ( عن طريف الأنف) ويتم الفحص بواسطة جهاز ELITE In Genius التابع لشركة ELITECH GROUP MOLECULAR DIAGNOSTICS علما بأن الجهاز تابع لشركة إيطالية ومصنع في اليابان بتقينة RC-PCR"
},
"select-appo": {
"en": "Kindly select one of the available appointments from below:",
"ar": "يرجى اختيار أحد المواعيد المتاحة من أدناه:"
},
"covid-alert-header": {
"en": "Pay With-in 15 mins to confirm the appointment",
"ar": "الرجاء اتمام عملية الدفع خلال 15 دقيقه لتاكيد الموعد"
},
"covid-alert-info": {
"en": "Payment for Covid-19 Test should Be made with-in 15 mins otherwise The system will Cancel the Scheduled appointment automatically",
"ar": "سيتم الغاء الموعد عن طريق النظام بشكل الي في حال عدم اتمام عمليه الدفع خلال 15 دقيقة​"
},
"covid-alert-mins": {
"en": "Pay With-in 15 mins",
"ar": "ادفع خلال 15 دقيقة"
},
"back": {
"en": "Back",
"ar": "رجوع"
},
"get-directions": {
"en": "Get Directions",
"ar": "احصل على الاتجاهات"
},
"selected-location": {
"en": "Selected Location:",
"ar": "الموقع المحدد:"
},
"test-fee": {
"en": "Test Fee",
"ar": "رسوم الاختبار"
},
"pay-options": {
"en": "You can pay by the following Options:",
"ar": "يمكنك الدفع عن طريق الخيارات التالية:"
},
"livecare-service": {
"en": "LiveCare Service",
"ar": "خدمة لايف كير"
},
"livecare-service-desc": {
"en": "is to obtain medical advice with a specialist doctor Via a video call",
"ar": "هي الحصول على استشارة طبية مع طبيب مختص عن طريق اتصال فيديو"
},
"why-livecare": {
"en": "WHY LIVECARE",
"ar": "لماذا خدمة اللايف كير"
},
"livecare-point-1": {
"en": "No need to wait you will get Medical consultation immediately via Video call",
"ar": "لا داعي للانتظار سوف تحصل على الاستشارة الطبية فورا عن طريق مكالمة الفيديو"
},
"doc-virtual-appo-ins4": {
"en": "The doctor will see your medical file",
"ar": "سوف يتمكن الطبيب من الاطلاع على ملفك الطبي كامل"
},
"doc-virtual-appo-ins5": {
"en": "Free prescription delivery service",
"ar": "خدمة توصيل الادوية مجانا"
},
"livecare-summary": {
"en": "** The service is included with some insurance companies according to the terms and conditions With our best wishes for health and wellness",
"ar": "** الخدمة مشمولة لدى بعض شركات التامين على حسب الشروط والاحكام مع تمنياتنا لكم بدوام الصحة والعافية"
},
"livecare-option-1": {
"en": "Get Medical consultation immediately",
"ar": "الحصول على الاستشارة فورا"
},
"livecare-option-2": {
"en": "Instant video call",
"ar": "اتصال فيديو فوري"
},
"livecare-option-3": {
"en": "Book Appointment",
"ar": "حجز موعد"
},
"livecare-option-4": {
"en": "Schedule video call",
"ar": "اتصال فيديو مجدول"
},
"verification_message_code": {"en": "Please enter verification code", "ar": "الرجاء إدخال رمز التحقق"},
"sms_code": {"en": "Enter SMS Code here", "ar": "أدخل رمز التحقق هنا"},
"code_failure": {"en": "Didnt received the code", "ar": "لم أستلم رمز التحقق"},
@ -1192,5 +1330,32 @@ const Map localizedValues = {
"submitncontinue": {"en": "Submit and continue", "ar": "إرسال ومتابعة"},
"areyousure": {"en": "Are you sure you want to Add", "ar": "هل أنت متأكد أنك تريد إضافة"},
"preferredunit": {"en": "Select the preferred unit", "ar": "اختر الوحدة المفضلة"},
"select-unit": {"en": "Select unit", "ar": "اختر وحدة القياس"}
"select-unit": {"en": "Select unit", "ar": "اختر وحدة القياس"},
"app-update": {
"en": "UPDATE THE APP",
"ar": "تحديث التطبيق"
}, "covid-alert": {
"en": "Alert",
"ar": "تنبيه"
},
"enterIdentificationNumber": {"en" : "Enter Identification Number", "ar": "أدخل رقم التعريف"},
"accountActivationDesc": {"en" : "This service allows you to activate your LAKUM account after registering through the Vida system.", "ar": "تتيح لك هذه الخدمة تفعيل حساب LAKUM الخاص بك بعد التسجيل من خلال نظام Vida."},
"pointsToTransfer": {"en" : "Point's to Transfer :", "ar": "النقاط المراد تحويلها:"},
"enterBeneficiaryAccountNo": {"en" : "Enter Beneficiary Account No.", "ar": "أدخل رقم حساب المستفيد"},
"confirm-prescription": {
"en": "Are you sure !! you want to send this request",
"ar": "تاكيد ارسال الطلب؟"
},
"you-already-have-order": {
"en": "You already have this order! do you want to view it?",
"ar": "لديك هذا الطلب بالفعل! هل تريد مشاهدته؟"
},
"order-overview": {
"en": "Order Overview",
"ar": "ملخص الطلب"
},
"shipping-address": {
"en": "Delivery Address",
"ar": "عنوان التوصيل"
},
};

@ -0,0 +1,68 @@
class ClinicCategory {
int clinicID;
int categoryID;
String categoryName;
String categoryNameN;
String icon;
String bodyImageEN;
String fullImageEN;
String bodyImageAR;
String fullmageAR;
bool isActive;
bool isCategoryGroup;
Null sortOrderAR;
Null sortOrderEN;
String clinicName;
ClinicCategory(
{this.clinicID,
this.categoryID,
this.categoryName,
this.categoryNameN,
this.icon,
this.bodyImageEN,
this.fullImageEN,
this.bodyImageAR,
this.fullmageAR,
this.isActive,
this.isCategoryGroup,
this.sortOrderAR,
this.sortOrderEN,
this.clinicName});
ClinicCategory.fromJson(Map<String, dynamic> json) {
clinicID = json['ClinicID'];
categoryID = json['CategoryID'];
categoryName = json['CategoryName'];
categoryNameN = json['CategoryNameN'];
icon = json['Icon'];
bodyImageEN = json['BodyImageEN'];
fullImageEN = json['FullImageEN'];
bodyImageAR = json['BodyImageAR'];
fullmageAR = json['FullmageAR'];
isActive = json['IsActive'];
isCategoryGroup = json['IsCategoryGroup'];
sortOrderAR = json['SortOrderAR'];
sortOrderEN = json['SortOrderEN'];
clinicName = json['ClinicName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ClinicID'] = this.clinicID;
data['CategoryID'] = this.categoryID;
data['CategoryName'] = this.categoryName;
data['CategoryNameN'] = this.categoryNameN;
data['Icon'] = this.icon;
data['BodyImageEN'] = this.bodyImageEN;
data['FullImageEN'] = this.fullImageEN;
data['BodyImageAR'] = this.bodyImageAR;
data['FullmageAR'] = this.fullmageAR;
data['IsActive'] = this.isActive;
data['IsCategoryGroup'] = this.isCategoryGroup;
data['SortOrderAR'] = this.sortOrderAR;
data['SortOrderEN'] = this.sortOrderEN;
data['ClinicName'] = this.clinicName;
return data;
}
}

@ -0,0 +1,44 @@
class DiseasesByClinic {
int diseasesID;
String diseasesEN;
String diseasesAR;
int diseasesCategoryID;
Null diseasesCategoryEN;
Null diseasesCategoryAR;
String diseases;
Null diseasesCategory;
DiseasesByClinic(
{this.diseasesID,
this.diseasesEN,
this.diseasesAR,
this.diseasesCategoryID,
this.diseasesCategoryEN,
this.diseasesCategoryAR,
this.diseases,
this.diseasesCategory});
DiseasesByClinic.fromJson(Map<String, dynamic> json) {
diseasesID = json['DiseasesID'];
diseasesEN = json['Diseases_EN'];
diseasesAR = json['Diseases_AR'];
diseasesCategoryID = json['Diseases_CategoryID'];
diseasesCategoryEN = json['Diseases_CategoryEN'];
diseasesCategoryAR = json['Diseases_CategoryAR'];
diseases = json['Diseases'];
diseasesCategory = json['Diseases_Category'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['DiseasesID'] = this.diseasesID;
data['Diseases_EN'] = this.diseasesEN;
data['Diseases_AR'] = this.diseasesAR;
data['Diseases_CategoryID'] = this.diseasesCategoryID;
data['Diseases_CategoryEN'] = this.diseasesCategoryEN;
data['Diseases_CategoryAR'] = this.diseasesCategoryAR;
data['Diseases'] = this.diseases;
data['Diseases_Category'] = this.diseasesCategory;
return data;
}
}

@ -25,7 +25,7 @@ class CustomerAddressesService extends BaseService {
var date = f.format(DateTime.now().toUtc()) + " GMT";
addNewAddressRequestModel.customer.addresses[0].createdOnUtc = date;
hasError = false;
await baseAppClient.post(ADD_ADDRESS_INFO,
await baseAppClient.post(BASE_PHARMACY_URL+ADD_ADDRESS_INFO,
onSuccess: (dynamic response, int statusCode) {
addressesList.clear();
response["customers"][0]["addresses"].forEach((data) {
@ -43,7 +43,7 @@ class CustomerAddressesService extends BaseService {
'fields':'addresses'
};
hasError = false;
await baseAppClient.getPharmacy("$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}",
await baseAppClient.getPharmacy("$BASE_PHARMACY_URL$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}",
onSuccess: (dynamic response, int statusCode) {
addressesList.clear();
response["customers"][0]["addresses"].forEach((data) {
@ -63,7 +63,7 @@ class CustomerAddressesService extends BaseService {
};
hasError = false;
await baseAppClient.getPharmacy(GET_CUSTOMER_INFO,
await baseAppClient.getPharmacy(BASE_PHARMACY_URL+GET_CUSTOMER_INFO,
onSuccess: (dynamic response, int statusCode) {
customerInfo= CustomerInfo.fromJson(response);
}, onFailure: (String error, int statusCode) {
@ -77,9 +77,9 @@ class CustomerAddressesService extends BaseService {
class CustomerInfo {
bool isRegistered;
String userName;
Null password;
dynamic password;
String email;
Null errorMessage;
dynamic errorMessage;
String mobileNumber;
int customerId;
@ -121,19 +121,19 @@ class AddressInfo {
String firstName;
String lastName;
String email;
Null company;
dynamic company;
int countryId;
String country;
Null stateProvinceId;
dynamic stateProvinceId;
String city;
String address1;
String address2;
String zipPostalCode;
String phoneNumber;
Null faxNumber;
dynamic faxNumber;
String customerAttributes;
String createdOnUtc;
Null province;
dynamic province;
String latLong;
AddressInfo(

@ -0,0 +1,76 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class BariatricsService extends BaseService {
List<ClinicCategory> clinicCategoryList = [];
List<DiseasesByClinic> diseasesList = [];
Future getClinicCategory() async {
hasError = false;
Map<String, dynamic> body = Map();
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
body['ClinicID'] = 108; // hint: it is static depend on IONIC project
body['isDentalAllowedBackend'] = false;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
await baseAppClient.post(GET_CLINIC_CATEGORY,
onSuccess: (dynamic response, int statusCode) {
clinicCategoryList.clear();
if (response['ClinicCategoryList'] != null)
response['ClinicCategoryList'].forEach((city) {
clinicCategoryList.add(ClinicCategory.fromJson(city));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getDiseaseByClinicId() async {
hasError = false;
Map<String, dynamic> body = Map();
body['ClinicID'] = 108; // hint: it is static depend on IONIC project
await baseAppClient.post(GET_DISEASE_BY_CLINIC_ID,
onSuccess: (dynamic response, int statusCode) {
diseasesList.clear();
if (response['DiseasesByClinicList'] != null)
response['DiseasesByClinicList'].forEach((city) {
diseasesList.add(DiseasesByClinic.fromJson(city));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future searchDoctorsByTime(DiseasesByClinic disease) async {
hasError = false;
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Map<String, dynamic> body = Map();
body['ClinicID'] = 108; // hint: it is static depend on IONIC project
body['ContinueDentalPlan'] = false;
body['DiseaseID'] = disease.diseasesID;
body['IsGetNearAppointment'] = false;
body['IsSearchAppointmnetByClinicID'] = true;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['Latitude'] = 0;
body['License'] = true;
body['Longitude'] = 0;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(SEARCH_DOCTOR_BY_TIME,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -0,0 +1,30 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class PrescriptionDeliveryService extends BaseService {
Future insertDeliveryOrder(
{int lineItemNo,
double latitude,
double longitude,
int appointmentNo,
int createdBy,
int dischargeID}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['LineItemNo'] = lineItemNo;
body['Latitude'] = latitude;
body['Longitude'] = longitude;
body['AppointmentNo'] = appointmentNo;
body['CreatedBy'] = createdBy;
body['DischargeID'] = dischargeID;
await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER,
onSuccess: (dynamic response, int statusCode) {
var asd="";
},
onFailure: (String error, int statusCode) {
hasError = true;
print(error);
super.error = error;
}, body: body);
}
}

@ -5,8 +5,8 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -44,10 +44,16 @@ class BaseAppClient {
}
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'
};
if (!isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE,'ar');
var user = await sharedPref.getObject(USER_PROFILE);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
@ -58,7 +64,7 @@ class BaseAppClient {
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
@ -101,22 +107,25 @@ class BaseAppClient {
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSessionId(token);
body['SessionID'] = SESSION_ID; //getSe
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': pharmacyToken,
'Mobilenumber': user['MobileNumber'].toString(),
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(),
};
}
}
}
print("URL : $url");
print("Body : ${json.encode(body)}");
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'
});
body: json.encode(body), headers: headers);
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
@ -152,14 +161,29 @@ class BaseAppClient {
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode);
}
else if(parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']){
onFailure(
parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
}
else if (!parsed['IsAuthenticated']) {
await logout();
} 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 {
@ -185,6 +209,7 @@ class BaseAppClient {
onFailure(e.toString(), -1);
}
}
Future navigateToAppUpdate(context, String text) async {
Navigator.pushReplacement(
context,
@ -194,9 +219,9 @@ class BaseAppClient {
get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, dynamic> queryParams,
bool isExternal = false}) async {
Function(String error, int statusCode) onFailure,
Map<String, dynamic> queryParams,
bool isExternal = false}) async {
String url;
if (isExternal) {
url = endPoint;
@ -234,10 +259,12 @@ class BaseAppClient {
getPharmacy(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isExternal = false,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isExternal = false,
Map<String, dynamic> queryParams}) async {
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
String url;
if (isExternal) {
@ -251,26 +278,15 @@ class BaseAppClient {
}
print("URL : $url");
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
Map test = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': token,
'Mobilenumber': user['MobileNumber'].toString(),
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(),
};
if (await Utils.checkConnection()) {
final response = await http.get(url.trim(), headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': token,
'Mobilenumber': user['MobileNumber'].toString(),
'Authorization': token??'',
'Mobilenumber': user != null ? getPhoneNumberWithoutZero(user['MobileNumber'].toString()): "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(),
'Username': user != null ? user['PatientID'].toString() : "",
});
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
@ -286,7 +302,19 @@ class BaseAppClient {
}
}
simpleGet(String fullUrl, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, String> queryParams}) async {
getPhoneNumberWithoutZero(String number){
String newNumber = number;
if(number.startsWith('0'))
{
newNumber = number.substring(1);
}
return newNumber;
}
simpleGet(String fullUrl,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async {
String url = fullUrl;
var haveParams = (queryParams != null);
if (haveParams) {
@ -298,7 +326,10 @@ class BaseAppClient {
if (await Utils.checkConnection()) {
final response = await http.get(
url.trim(),
headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
);
final int statusCode = response.statusCode;
@ -320,7 +351,8 @@ class BaseAppClient {
await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin =
false;
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context,listen: false);
var model =
Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
_vitalSignService.weightKg = "";
_vitalSignService.heightCm = "";
model.setState(0, false);
@ -329,12 +361,13 @@ class BaseAppClient {
String getSessionId(String id) {
///return id.replaceAll(RegExp('/[^\w\s]/'), '');
return id.replaceAll(RegExp('/[^a-zA-Z ]'), '');
return id.replaceAll(RegExp('/[^a-zA-Z ]'), '');
}
static defaultHttpParameters() async {
String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE);
var params = {};
if (user != null) {
@ -352,4 +385,4 @@ class BaseAppClient {
return params;
}
}
}

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.d
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class PharmacyModuleService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences();
@ -25,13 +26,13 @@ class PharmacyModuleService extends BaseService {
hasError = false;
try {
await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER,
onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) async {
if (response['UserName'] != null) {
sharedPref.setString(
PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
print(response);
} else {
createUser();
await createUser();
}
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -72,9 +73,10 @@ class PharmacyModuleService extends BaseService {
}
Future generatePharmacyToken() async {
await getUser();
Map<String, String> queryParams = {
'Filenumber': user.patientID.toString(),
'MobileNumber': user.mobileNumber,
'MobileNumber': Utils.getPhoneNumberWithoutZero(user.mobileNumber),
};
hasError = false;
try {

@ -46,6 +46,7 @@ class PrescriptionService extends BaseService {
});
print(_prescriptionsList.length);
print("response is -------------"+response);
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -1,4 +1,6 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/brands_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/final_products_model.dart';
@ -21,20 +23,20 @@ class PharmacyCategoriseService extends BaseService {
List<CategoriseParentModel> get parentCategoriseList => _parentCategoriseList;
//service three
List<ParentProductsModel> _parentProductsList = List();
List<ParentProductsModel> get parentProductsList => _parentProductsList;
List<PharmacyProduct> _parentProductsList = List();
List<PharmacyProduct> get parentProductsList => _parentProductsList;
//service four
List<SubCategoriesModel> _subCategoriseList = List();
List<SubCategoriesModel> get subCategoriseList => _subCategoriseList;
//service five
List<SubProductsModel> _subProductsList = List();
List<SubProductsModel> get subProductsList => _subProductsList;
List<PharmacyProduct> _subProductsList = List();
List<PharmacyProduct> get subProductsList => _subProductsList;
//service six
List<FinalProductsModel> _finalProducts = List();
List<FinalProductsModel> get finalProducts => _finalProducts;
List<PharmacyProduct> _finalProducts = List();
List<PharmacyProduct> get finalProducts => _finalProducts;
//service 7
@ -43,12 +45,14 @@ class PharmacyCategoriseService extends BaseService {
// service 8
List<SearchProductsModel> _searchList = List();
List<SearchProductsModel> get searchList => _searchList;
List<PharmacyProduct> _searchList = List();
List<PharmacyProduct> get searchList => _searchList;
List<ScanQrModel> _scanList = List();
List<ScanQrModel> get scanList => _scanList;
List<FinalProductsModel> manufacturerProducts = List();
clearSearchList() {
_searchList.clear();
}
@ -98,7 +102,7 @@ class PharmacyCategoriseService extends BaseService {
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
_searchList.add(SearchProductsModel.fromJson(item));
_searchList.add(PharmacyProduct.fromJson(item));
});
},
onFailure: (String error, int statusCode) {
@ -154,7 +158,7 @@ class PharmacyCategoriseService extends BaseService {
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
_parentProductsList.add(ParentProductsModel.fromJson(item));
_parentProductsList.add(PharmacyProduct.fromJson(item));
});
},
onFailure: (String error, int statusCode) {
@ -194,7 +198,7 @@ class PharmacyCategoriseService extends BaseService {
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
_subProductsList.add(SubProductsModel.fromJson(item));
_subProductsList.add(PharmacyProduct.fromJson(item));
});
},
onFailure: (String error, int statusCode) {
@ -213,7 +217,7 @@ class PharmacyCategoriseService extends BaseService {
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
_finalProducts.add(FinalProductsModel.fromJson(item));
_finalProducts.add(PharmacyProduct.fromJson(item));
});
},
onFailure: (String error, int statusCode) {
@ -222,4 +226,69 @@ class PharmacyCategoriseService extends BaseService {
},
);
}
Future getManufacturerProducts(String id) async {
hasError = false;
Map<String, String> queryParams = {'ManufacturerId': id};
_finalProducts.clear();
await baseAppClient.getPharmacy(
GET_BRAND_ITEMS,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
_finalProducts.add(PharmacyProduct.fromJson(item));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
queryParams: queryParams,
);
}
Future getLastVisitedProducts() async {
String lastVisited = "";
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) !=
null) {
lastVisited =
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
try {
await baseAppClient
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
onSuccess: (dynamic response, int statusCode) {
_finalProducts.clear();
response['products'].forEach((item) {
_finalProducts.add(PharmacyProduct.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
} catch (error) {
throw error;
}
}
}
Future getBestSellerProducts() async {
Map<String, String> queryParams = {
'fields':
'id,discount_ids,name,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,reviews',
};
try {
await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT,
onSuccess: (dynamic response, int statusCode) {
_finalProducts.clear();
response['products'].forEach((item) {
_finalProducts.add(PharmacyProduct.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
} catch (error) {
throw error;
}
}
}

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/cmc_service.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart';
@ -34,6 +35,8 @@ class CMCViewModel extends BaseViewModel {
List<CMCGetItemsResponseModel> get checkupItems =>
_cMCService.checkupItemsList;
PharmacyModuleService _pharmacyModuleService = locator<PharmacyModuleService>();
bool get isOrderUpdated => _cMCService.isOrderUpdated;
Future getCMCAllServices() async {
@ -115,8 +118,7 @@ class CMCViewModel extends BaseViewModel {
Future getCustomerAddresses() async {
setState(ViewState.Busy);
await _customerAddressesService.getCustomerAddresses(
);
await _customerAddressesService.getCustomerAddresses();
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);
@ -127,8 +129,9 @@ class CMCViewModel extends BaseViewModel {
Future getCustomerInfo() async {
setState(ViewState.Busy);
await _customerAddressesService.getCustomerInfo(
);
await _pharmacyModuleService.generatePharmacyToken().then((value) async{
await _customerAddressesService.getCustomerInfo();
});
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);

@ -0,0 +1,48 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../../locator.dart';
class BariatricsViewModel extends BaseViewModel {
BariatricsService _service = locator<BariatricsService>();
List<ClinicCategory> get clinicCategoryList => _service.clinicCategoryList;
List<DiseasesByClinic> get diseasesList => _service.diseasesList;
void getClinicCategory() async {
setState(ViewState.Busy);
await _service.getClinicCategory();
if (_service.hasError) {
error = _service.error;
setState(ViewState.Error);
} else {
getDiseaseByClinicId();
}
}
void getDiseaseByClinicId() async {
setState(ViewState.Busy);
await _service.getDiseaseByClinicId();
if (_service.hasError) {
error = _service.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future searchDoctorsByTime(DiseasesByClinic disease) async {
setState(ViewState.Busy);
await _service.searchDoctorsByTime(disease);
if (_service.hasError) {
error = _service.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/home_health_care_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:intl/intl.dart';
@ -36,6 +37,9 @@ class HomeHealthCareViewModel extends BaseViewModel {
List<GetOrderDetailByOrderIDResponseModel> get hhcAllOrderDetail =>
_homeHealthCareService.hhcAllOrderDetail;
PharmacyModuleService _pharmacyModuleService = locator<PharmacyModuleService>();
bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated;
GetHHCAllPresOrdersResponseModel pendingOrder;
@ -117,8 +121,9 @@ class HomeHealthCareViewModel extends BaseViewModel {
Future getCustomerInfo() async {
setState(ViewState.Busy);
await _customerAddressesService.getCustomerInfo(
);
await _pharmacyModuleService.generatePharmacyToken().then((value) async{
await _customerAddressesService.getCustomerInfo();
});
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);

@ -0,0 +1,68 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/service/PrescriptionDeliveryService.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart';
class PrescriptionDeliveryViewModel extends BaseViewModel {
CustomerAddressesService _customerAddressesService =
locator<CustomerAddressesService>();
PharmacyModuleService _pharmacyModuleService =
locator<PharmacyModuleService>();
PrescriptionDeliveryService _prescriptionDeliveryService =
locator<PrescriptionDeliveryService>();
List<AddressInfo> get addressesList =>
_customerAddressesService.addressesList;
Future getCustomerInfo() async {
setState(ViewState.Busy);
await _pharmacyModuleService.generatePharmacyToken().then((value) async {
await _customerAddressesService.getCustomerInfo();
});
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);
} else {
await getCustomerAddresses();
}
}
Future insertDeliveryOrder(
{int lineItemNo,
double latitude,
double longitude,
int appointmentNo,
int createdBy,
int dischargeID}) async {
setState(ViewState.BusyLocal);
await _prescriptionDeliveryService.insertDeliveryOrder(
lineItemNo: lineItemNo,
latitude: latitude,
longitude: longitude,
appointmentNo: appointmentNo,
createdBy: createdBy,
dischargeID: dischargeID
);
if (_prescriptionDeliveryService.hasError) {
error = _prescriptionDeliveryService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future getCustomerAddresses() async {
setState(ViewState.Busy);
await _customerAddressesService.getCustomerAddresses();
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}

@ -19,11 +19,13 @@ class LacumRegistrationViewModel extends LacumViewModel {
error = _lacumService.error;
setState(ViewState.Error);
} else {
if(_lacumService.lacumInformation.yahalaAccountNo != 0){
error = "The account has already been activated";
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
if(_lacumService.lacumInformation != null){
if(_lacumService.lacumInformation.yahalaAccountNo == 0){
error = _lacumService.lacumInformation.errorEndUserMessage;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}
}

@ -19,6 +19,9 @@ class LacumViewModel extends BaseViewModel {
LacumAccountInformation get lacumGroupInformation =>
_lacumService.lacumGroupInformation;
String get successMsg =>
_lacumService.successMsg;
Future getLacumData() async {
await getLacumAccountData();
getLacumGroupData();
@ -70,16 +73,14 @@ class LacumViewModel extends BaseViewModel {
}
}
Future<int> createLakumAccount(String name, String phone) async {
setState(ViewState.Busy);
Future createLakumAccount(String name, String phone) async {
setState(ViewState.BusyLocal);
await _lacumService.createLakumAccount(name, phone, lacumInformation.yahalaAccountNo, lacumInformation.identificationNo, null);
if (_lacumService.hasError) {
error = _lacumService.error;
setState(ViewState.Error);
return 404;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
return 200;
}
}

@ -11,17 +11,14 @@ import '../../../locator.dart';
class ProductDetailViewModel extends BaseViewModel{
ProductDetailService _productDetailService = locator<ProductDetailService>();
ProductDetailService _productLocationService = locator<ProductDetailService>();
ProductDetailService _productWishlistService = locator<ProductDetailService>();
ProductDetailService _productSpecification = locator<ProductDetailService>();
List<ProductDetail> get productDetailService => _productDetailService.productDetailList;
List<LocationModel> get productLocationService => _productLocationService.productLocationList;
List<LocationModel> get productLocationService => _productDetailService.productLocationList;
List<Wishlist> get wishListItems => _productWishlistService.wishListProducts;
List<Wishlist> get wishListItems => _productDetailService.wishListProducts;
List<SpecificationModel> get productSpecification => _productSpecification.productSpecification;
List<SpecificationModel> get productSpecification => _productDetailService.productSpecification;
bool hasError = false;
@ -42,9 +39,9 @@ class ProductDetailViewModel extends BaseViewModel{
print('ENAD in model view');
hasError = false;
setState(ViewState.Busy);
await _productLocationService.getProductAvailabiltyDetail();
if (_productLocationService.hasError) {
error = _productLocationService.error;
await _productDetailService.getProductAvailabiltyDetail();
if (_productDetailService.hasError) {
error = _productDetailService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -53,9 +50,9 @@ class ProductDetailViewModel extends BaseViewModel{
Future notifyMe(customerId, itemID) async {
hasError = false;
setState(ViewState.Busy);
await _productLocationService.notifyMe(customerId, itemID);
if (_productLocationService.hasError) {
error = _productLocationService.error;
await _productDetailService.notifyMe(customerId, itemID);
if (_productDetailService.hasError) {
error = _productDetailService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -64,9 +61,9 @@ class ProductDetailViewModel extends BaseViewModel{
Future addToCartData(quantity, itemID) async {
hasError = false;
setState(ViewState.Busy);
await _productLocationService.addToCart(quantity, itemID);
if (_productLocationService.hasError) {
error = _productLocationService.error;
await _productDetailService.addToCart(quantity, itemID);
if (_productDetailService.hasError) {
error = _productDetailService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -75,9 +72,9 @@ class ProductDetailViewModel extends BaseViewModel{
Future addToWishlistData(itemID) async {
hasError = false;
setState(ViewState.Busy);
await _productLocationService.addToWishlist(itemID);
if (_productLocationService.hasError) {
error = _productLocationService.error;
await _productDetailService.addToWishlist(itemID);
if (_productDetailService.hasError) {
error = _productDetailService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -86,9 +83,9 @@ class ProductDetailViewModel extends BaseViewModel{
Future checkWishlistData() async {
hasError = false;
setState(ViewState.Busy);
await _productWishlistService.getWishlistItems();
if (_productWishlistService.hasError) {
error = _productWishlistService.error;
await _productDetailService.getWishlistItems();
if (_productDetailService.hasError) {
error = _productDetailService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -98,9 +95,9 @@ class ProductDetailViewModel extends BaseViewModel{
Future deletWishlistData(itemID) async {
hasError = false;
setState(ViewState.Busy);
await _productWishlistService.delteItemFromWishlist(itemID);
if (_productWishlistService.hasError) {
error = _productWishlistService.error;
await _productDetailService.delteItemFromWishlist(itemID);
if (_productDetailService.hasError) {
error = _productDetailService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -110,9 +107,9 @@ class ProductDetailViewModel extends BaseViewModel{
Future productSpecificationData(itemID) async {
hasError = false;
setState(ViewState.Busy);
await _productWishlistService.productSpecificationData(itemID);
if (_productWishlistService.hasError) {
error = _productWishlistService.error;
await _productDetailService.productSpecificationData(itemID);
if (_productDetailService.hasError) {
error = _productDetailService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/brands_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/final_products_model.dart';
@ -16,22 +17,29 @@ import 'base_view_model.dart';
class PharmacyCategoriseViewModel extends BaseViewModel {
bool hasError = false;
PharmacyCategoriseService _pharmacyCategoriseService = locator<PharmacyCategoriseService>();
PharmacyCategoriseService _pharmacyCategoriseService =
locator<PharmacyCategoriseService>();
List<PharmacyCategorise> get categorise => _pharmacyCategoriseService.categoriseList;
List<PharmacyCategorise> get categorise =>
_pharmacyCategoriseService.categoriseList;
List<CategoriseParentModel> get categoriseParent => _pharmacyCategoriseService.parentCategoriseList;
List<CategoriseParentModel> get categoriseParent =>
_pharmacyCategoriseService.parentCategoriseList;
List<ParentProductsModel> get parentProducts => _pharmacyCategoriseService.parentProductsList;
List<PharmacyProduct> get parentProducts =>
_pharmacyCategoriseService.parentProductsList;
List<SubCategoriesModel> get subCategorise => _pharmacyCategoriseService.subCategoriseList;
List<SubCategoriesModel> get subCategorise =>
_pharmacyCategoriseService.subCategoriseList;
List<SubProductsModel> get subProducts => _pharmacyCategoriseService.subProductsList;
List<PharmacyProduct> get subProducts =>
_pharmacyCategoriseService.subProductsList;
List<FinalProductsModel> get finalProducts => _pharmacyCategoriseService.finalProducts;
List<PharmacyProduct> get finalProducts =>
_pharmacyCategoriseService.finalProducts;
List<BrandsModel> get brandsList => _pharmacyCategoriseService.brandsList;
List<SearchProductsModel> get searchList => _pharmacyCategoriseService.searchList;
List<PharmacyProduct> get searchList => _pharmacyCategoriseService.searchList;
List<ScanQrModel> get scanList => _pharmacyCategoriseService.scanList;
@ -147,4 +155,37 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
Future getManufacturerProducts(String id) async {
setState(ViewState.Busy);
await _pharmacyCategoriseService.getManufacturerProducts(id);
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future getLastVisitedProducts() async {
setState(ViewState.Busy);
await _pharmacyCategoriseService.getLastVisitedProducts();
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future getBestSellerProducts() async {
setState(ViewState.Busy);
await _pharmacyCategoriseService.getBestSellerProducts();
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}

@ -19,8 +19,10 @@ import 'package:get_it/get_it.dart';
import 'core/service/AlHabibMedicalService/cmc_service.dart';
import 'core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'core/service/AlHabibMedicalService/e_referral_service.dart';
import 'core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'core/service/AlHabibMedicalService/home_health_care_service.dart';
import 'core/service/AuthenticatedUserObject.dart';
import 'core/service/PrescriptionDeliveryService.dart';
import 'core/service/appointment_rate_service.dart';
import 'core/service/blood/blood_details_servies.dart';
import 'core/service/blood/blood_donation_service.dart';
@ -68,6 +70,8 @@ import 'core/service/parmacyModule/parmacy_module_service.dart';
import 'core/service/offers_service.dart';
import 'core/service/pharmacy_categorise_service.dart';
import 'core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart';
import 'core/viewModels/medical/PrescriptionDeliveryViewModel.dart';
import 'core/viewModels/TermsConditionsViewModel.dart';
import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'core/viewModels/appointment_rate_view_model.dart';
@ -213,6 +217,8 @@ void setupLocator() {
locator.registerLazySingleton(() => PrivilegeService());
locator.registerLazySingleton(() => WeatherService());
locator.registerLazySingleton(() => TermsConditionsService());
locator.registerLazySingleton(() => BariatricsService());
locator.registerLazySingleton(() => PrescriptionDeliveryService());
/// View Model
locator.registerFactory(() => HospitalViewModel());
@ -255,6 +261,7 @@ void setupLocator() {
locator.registerFactory(() => EyeViewModel());
locator.registerFactory(() => ActiveMedicationsViewModel());
locator.registerFactory(() => AskDoctorViewModel());
locator.registerFactory(() => PrescriptionDeliveryViewModel());
locator.registerFactory(() => AllergiesViewModel());
locator.registerFactory(() => HomeHealthCareViewModel());
@ -276,6 +283,7 @@ void setupLocator() {
//pharmacy
locator.registerFactory(() => PharmacyCategoriseViewModel());
locator.registerFactory(() => OffersCategoriseViewModel());
locator.registerFactory(() => BariatricsViewModel());
// Offer And Packages
//----------------------

@ -43,7 +43,7 @@ class _CMCPageState extends State<CMCPage>
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
description:TranslationBase.of(context).infoCMC,
imagesInfo: [ImagesInfo(imageAr: 'assets/images/AlHabibMedicalService/Wifi-AR.png',imageEn: 'assets/images/AlHabibMedicalService/Wifi-EN.png', isAsset: true)],
imagesInfo: [ImagesInfo(imageAr: 'assets/images/Wifi-AR.png',imageEn: 'assets/images/wifi-EN.png', isAsset: true)],
appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup,
body: Scaffold(
extendBodyBehindAppBar: true,

@ -42,6 +42,7 @@ class _NewHomeHealthCareStepThreePageState
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude != null) {
markers.clear();
markers.add(

@ -1,5 +1,6 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -37,13 +38,14 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage>
Widget build(BuildContext context) {
return BaseView<HomeHealthCareViewModel>(
onModelReady: (model){
// model.getHHCAllServices();
model.getHHCAllPresOrders();
},
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
description: TranslationBase.of(context).HHCNotAuthMsg,
appBarTitle: TranslationBase.of(context).homeHealthCare,
imagesInfo: [ImagesInfo(imageAr: 'assets/images/Wifi-AR.png',imageEn: 'assets/images/wifi-EN.png', isAsset: true)],
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(

@ -0,0 +1,190 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
// TODO mosa_remark
class BariatricsPage extends StatefulWidget {
final age;
final gender;
final double obeseResult;
BariatricsPage(this.age, this.gender, this.obeseResult);
@override
_BariatricsPageState createState() => _BariatricsPageState();
}
class _BariatricsPageState extends State<BariatricsPage> {
DiseasesByClinic _selectedDisease;
@override
Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return BaseView<BariatricsViewModel>(
onModelReady: (model) => model.getClinicCategory(),
builder: (_, model, w) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: "${TranslationBase
.of(context)
.bariatrics}",
baseViewModel: model,
body: Column(
children: [
Container(
margin: EdgeInsets.all(8.0),
child: Center(
child: Texts(TranslationBase
.of(context)
.bariatricsHeaderMsg),
),
),
Expanded(
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 16.0, vertical: 8.0),
child: Row(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
...model.diseasesList
.map((item) =>
RadioListTile(
title: Texts("${item.diseases}"),
activeColor: Colors.blue.shade700,
value: item.diseasesID,
groupValue: _selectedDisease != null
? _selectedDisease.diseasesID
: -1,
selected: _selectedDisease != null ? item
.diseasesID ==
_selectedDisease.diseasesID : false,
onChanged: (val) {
setState(() {
_selectedDisease = item;
});
},
))
.toList()
],
),
),
),
Image.asset(
_getImageName(widget.gender, widget.obeseResult,
projectProvider.isArabic),
fit: BoxFit.cover,
),
],
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: BorderedButton(
TranslationBase
.of(context)
.continues,
fontSize: SizeConfig.textMultiplier * 2.1,
textColor: Colors.white,
vPadding: 8,
hPadding: 8,
backgroundColor: Theme
.of(context)
.primaryColor,
radius: 8,
fontWeight: FontWeight.bold,
handler: () async {
await model.searchDoctorsByTime(_selectedDisease);
if(model.state == ViewState.ErrorLocal){
AppToast.showErrorToast(message: model.error);
}
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => BariatricsPage()),
// );
},
),
),
Container(
margin: EdgeInsets.only(bottom: 16.0, left: 16, right: 16),
child: BorderedButton(
TranslationBase
.of(context)
.skip,
fontSize: SizeConfig.textMultiplier * 2.1,
textColor: Colors.blue,
vPadding: 8,
hPadding: 8,
backgroundColor: Color(0x00000000),
radius: 8,
hasBorder: true,
borderColor: Color(0x00000000),
fontWeight: FontWeight.bold,
handler: () async {
await model.searchDoctorsByTime(_selectedDisease);
if(model.state == ViewState.ErrorLocal){
AppToast.showErrorToast(message: model.error);
}
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => BariatricsPage()),
// );
},
),
),
],
),
),
);
}
_getImageName(int gender, double obeseResult, bool isArabic) {
String path = "assets/images/BMI/";
double result = obeseResult;
if (result < 18.5 && gender == 1) {
path += "bmi_blue_male";
} else if (result >= 18.5 && result <= 24.9 && gender == 1) {
path += "bmi_green_male";
} else if (result >= 25 && result <= 29.9 && gender == 1) {
path += "bmi_yellow_male";
} else if (result >= 30 && result <= 34.9 && gender == 1) {
path += "bmi_orange_male";
} else if (result >= 35 && gender == 1) {
path += "bmi_red_male";
} else if (result < 18.5 && gender == 2) {
path += "bmi_blue_female";
} else if (result >= 18.5 && result <= 24.9 && gender == 2) {
path += "bmi_green_female";
} else if (result >= 25 && result <= 29.9 && gender == 2) {
path += "bmi_yellow_female";
} else if (result >= 30 && result <= 34.9 && gender == 2) {
path += "bmi_orange_female";
} else if (result >= 35 && gender == 2) {
path += "bmi_red_female";
} else {
path += "default.png";
}
if (isArabic) {
path += "_ar.png";
} else {
path += "_en.png";
}
return path;
}
}

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -27,6 +28,7 @@ class _BMICalculatorState extends State<BMICalculator> {
Color ftCard = inactiveCardColor;
Color lbCard = inactiveCardColor;
Color kgCard = activeCardColor;
void updateColor(int type) {
//MG/DLT card
if (type == 1) {
@ -84,31 +86,27 @@ class _BMICalculatorState extends State<BMICalculator> {
return bmiResult;
}
void showTextResult() {
void showTextResult(BuildContext context) {
if (bmiResult >= 30) {
textResult = 'Obese';
textResult = TranslationBase.of(context).obese;
} else if (bmiResult < 30 && bmiResult >= 25) {
textResult = 'OverWeight';
textResult = TranslationBase.of(context).overWeight;
} else if (bmiResult < 25 && bmiResult >= 18.5) {
textResult = 'Healthy';
textResult = TranslationBase.of(context).healthy;
} else if (bmiResult < 18.5) {
textResult = 'UnderWeight';
textResult = TranslationBase.of(context).underWeight;
}
}
void showMsg() {
void showMsg(BuildContext context) {
if (bmiResult >= 30) {
msg =
'A BMI of over 30 indicates that are heavily overweight. Health may be at risk if not lose weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.';
msg = TranslationBase.of(context).bmiCalcMsgObese;
} else if (bmiResult < 30 && bmiResult >= 25) {
msg =
'A BMI of 25 - 30 indicates that are slightly overweight. May be advised to lose some weight for health reasons. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get ';
msg = TranslationBase.of(context).bmiCalcMsgOverweight;
} else if (bmiResult < 25 && bmiResult >= 18.5) {
msg =
'A BMI of 18.5 - 25 indicates that are at a healthy weight for the height. By maintaining a healthy weight, lower the risk of developing severe health problems. To book an appointment, click below to get started.';
msg = TranslationBase.of(context).bmiCalcMsgHealthy;
} else if (bmiResult < 18.5) {
msg =
'A BMI of less than 18.5 indicates that are underweight, so may need to put on some weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.';
msg = TranslationBase.of(context).bmiCalcMsgUnderWeight;
}
}
@ -121,26 +119,28 @@ class _BMICalculatorState extends State<BMICalculator> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'BMI Calculator',
isShowDecPage: false,
appBarTitle:
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Container(
width: 350.0,
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: Padding(
padding: EdgeInsets.symmetric(vertical: 15.0),
child: Text(
'Calculate the BMI value and weight\n status to identify the healthy weight .\n Not appropriate for children and women\n who are pregnant or breastfeeding',
TranslationBase.of(context).bmiCalcDesc,
style: TextStyle(fontSize: 18.0),
),
),
),
),
Container(
height: 200.0,
width: 350.0,
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.0),
@ -151,7 +151,7 @@ class _BMICalculatorState extends State<BMICalculator> {
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts('Height'),
child: Texts(TranslationBase.of(context).height),
),
],
),
@ -241,7 +241,7 @@ class _BMICalculatorState extends State<BMICalculator> {
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts('Select Unit'),
child: Texts(TranslationBase.of(context).selectUnit),
),
],
),
@ -273,7 +273,8 @@ class _BMICalculatorState extends State<BMICalculator> {
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts('CM')),
child: Center(
child: Texts(TranslationBase.of(context).cm)),
),
),
),
@ -302,7 +303,8 @@ class _BMICalculatorState extends State<BMICalculator> {
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts('FT')),
child: Center(
child: Texts(TranslationBase.of(context).feet)),
),
),
),
@ -315,8 +317,8 @@ class _BMICalculatorState extends State<BMICalculator> {
height: 25.0,
),
Container(
height: 200.0,
width: 350.0,
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.0),
@ -327,7 +329,7 @@ class _BMICalculatorState extends State<BMICalculator> {
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts('Weight'),
child: Texts(TranslationBase.of(context).weight),
),
],
),
@ -417,7 +419,7 @@ class _BMICalculatorState extends State<BMICalculator> {
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts('Select Unit'),
child: Texts(TranslationBase.of(context).selectUnit),
),
],
),
@ -449,7 +451,8 @@ class _BMICalculatorState extends State<BMICalculator> {
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts('KG')),
child: Center(
child: Texts(TranslationBase.of(context).kg)),
),
),
),
@ -478,7 +481,9 @@ class _BMICalculatorState extends State<BMICalculator> {
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts('LB')),
child: Center(
child:
Texts(TranslationBase.of(context).pound)),
),
),
),
@ -491,15 +496,15 @@ class _BMICalculatorState extends State<BMICalculator> {
height: 25.0,
),
Container(
height: 50.0,
width: 350.0,
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: EdgeInsets.symmetric(vertical: 8),
child: SecondaryButton(
label: 'CALCULATE',
label: TranslationBase.of(context).calculate,
onTap: () => {
setState(() {
calculateBMI();
showTextResult();
showMsg();
showTextResult(context);
showMsg(context);
{
Navigator.push(
context,

@ -1,5 +1,9 @@
import 'dart:ffi';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -12,6 +16,7 @@ class ResultPage extends StatelessWidget {
final String msg;
ResultPage({this.finalResult, this.textResult, this.msg});
Color inductorColor;
double percent;
@ -45,53 +50,74 @@ class ResultPage extends StatelessWidget {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: "BMI Calculator",
appBarTitle:
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
SizedBox(
// height: 40.0,
),
Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 20.0,
percent: percentInductor(),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
Text(
finalResult.toStringAsFixed(1),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
Container(
margin: EdgeInsets.only(top: 50),
child: Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 20.0,
percent: percentInductor(),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
finalResult.toStringAsFixed(1),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 5.0,
),
Text(
textResult,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
),
),
],
),
progressColor: colorInductor(),
backgroundColor: Colors.white,
),
),
),
SizedBox(
height: 5.0,
),
Text(
textResult,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Texts(msg),
),
],
),
progressColor: colorInductor(),
backgroundColor: Colors.white,
),
),
Container(
height: 120,
width: 280.0,
child: Texts(msg),
),
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: BorderedButton(
TranslationBase.of(context).seeListOfDoctor,
fontSize: SizeConfig.textMultiplier * 2.1,
textColor: Colors.white,
vPadding: 8,
hPadding: 8,
backgroundColor: Theme.of(context).primaryColor,
radius: 8,
fontWeight: FontWeight.bold,
handler: (){
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BariatricsPage(1, 1, finalResult)),
);
},
),
),
],

@ -122,6 +122,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: 'Bmr Calculator',
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -29,6 +30,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
int weight = 0;
double calories;
String dropdownValue;
void updateColor(int type) {
//MG/DLT card
if (type == 1) {
@ -102,89 +104,91 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Calorie Calculator',
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0),
child: SingleChildScrollView(
child: Container(
height: 890.0,
child: Column(
//mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(10.0),
child: Texts(
'Calculates daily calorie intake based on several factors, like height, weight, age, gender and daily physical activity rate',
),
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 10.0, vertical: 15.0),
child: Texts('Gender'),
),
Container(
width: 350,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(35.0),
color: Colors.white,
border: Border.all(
color: Colors.black45,
)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
setState(() {
updateColor(1);
isMale = false;
});
},
child: Container(
height: 55.0,
width: 170.0,
decoration: BoxDecoration(
color: maleCard,
borderRadius: BorderRadius.circular(35.0),
isShowDecPage: false,
appBarTitle:
"${TranslationBase.of(context).calories} ${TranslationBase.of(context).calcHealth}",
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
child: Column(
//mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).calorieCalcDesc,
),
SizedBox(
height: 8.0,
),
Texts(TranslationBase.of(context).gender),
SizedBox(
height: 8.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.0),
color: Colors.white,
border: Border.all(
color: Colors.black45,
)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
updateColor(1);
isMale = false;
});
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 16),
decoration: BoxDecoration(
color: maleCard,
borderRadius: BorderRadius.circular(30.0),
),
child: Center(
child: Texts(
TranslationBase.of(context).female)),
),
),
),
child: Center(child: Texts('FEMALE')),
),
),
GestureDetector(
onTap: () {
setState(() {
updateColor(2);
isMale = true;
});
},
child: Container(
height: 55.0,
width: 170.0,
decoration: BoxDecoration(
color: femaleCard,
borderRadius: BorderRadius.circular(35.0),
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
updateColor(2);
isMale = true;
});
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 16),
decoration: BoxDecoration(
color: femaleCard,
borderRadius: BorderRadius.circular(30.0),
),
child: Center(
child: Texts(
TranslationBase.of(context).male)),
),
),
),
child: Center(child: Texts('MALE')),
),
],
),
],
),
),
SizedBox(
height: 15.0,
),
Texts(
'The Age ( 11 - 120 ) yrs',
),
SizedBox(
height: 10.0,
),
Row(
children: [
),
SizedBox(
height: 12.0,
),
Texts(
TranslationBase.of(context).age11_120Years,
),
Container(
width: 340.0,
height: 60.0,
margin:
EdgeInsets.symmetric(horizontal: 4.0, vertical: 12.0),
decoration: BoxDecoration(
color: Colors.white,
),
@ -195,7 +199,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 60.0,
width: 60,
foregroundDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
border: Border.all(
@ -206,12 +210,16 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(age.toString()),
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Center(
child: Text(age.toString()),
),
),
),
Container(
height: 38.0,
padding:
EdgeInsets.symmetric(horizontal: 4),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
@ -274,16 +282,12 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
],
),
),
],
),
Texts(
'Height',
),
Row(
children: [
Texts(
TranslationBase.of(context).height,
),
Container(
width: 340.0,
height: 60.0,
margin:
EdgeInsets.symmetric(horizontal: 4.0, vertical: 12.0),
decoration: BoxDecoration(
color: Colors.white,
),
@ -305,12 +309,16 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(height.toString()),
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Center(
child: Text(height.toString()),
),
),
),
Container(
height: 38.0,
padding:
EdgeInsets.symmetric(horizontal: 4.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
@ -373,85 +381,90 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
],
),
),
],
),
Texts('Select Unit'),
SizedBox(
height: 5.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
setState(() {
updateColorHeight(1);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
),
],
color: cmCard,
borderRadius: BorderRadius.circular(3.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts('CM')),
),
),
Texts(
TranslationBase.of(context).selectUnit,
),
SizedBox(
height: 8.0,
),
GestureDetector(
onTap: () {
setState(() {
updateColorHeight(2);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
color: ftCard,
borderRadius: BorderRadius.circular(3.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
updateColorHeight(1);
});
},
child: Container(
padding: EdgeInsets.all(12),
margin: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: Offset(
0, 3), // changes position of shadow
),
],
color: cmCard,
borderRadius: BorderRadius.circular(3.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts(TranslationBase.of(context).cm)),
),
),
],
),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts('Ft')),
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
updateColorHeight(2);
});
},
child: Container(
padding: EdgeInsets.all(12),
margin: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
color: ftCard,
borderRadius: BorderRadius.circular(3.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: Offset(
0, 3), // changes position of shadow
),
],
),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts(TranslationBase.of(context).feet))),
),
),
),
),
],
),
SizedBox(
height: 8.0,
),
Texts(
TranslationBase.of(context).weight,
),
SizedBox(
height: 5.0,
),
],
),
SizedBox(
height: 5.0,
),
Texts(
'Weight',
),
Row(
children: [
Container(
width: 340.0,
height: 60.0,
margin:
EdgeInsets.symmetric(horizontal: 4.0, vertical: 12.0),
decoration: BoxDecoration(
color: Colors.white,
),
@ -500,7 +513,8 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
),
onTap: () {
setState(() {
if (weight < 250) weight++;
if (weight < 250)
weight++;
});
},
),
@ -541,137 +555,140 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
],
),
),
],
),
Texts('Select Unit'),
SizedBox(
height: 5.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
setState(() {
updateColorWeight(1);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
Texts(TranslationBase.of(context).selectUnit),
SizedBox(
height: 5.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
updateColorWeight(1);
});
},
child: Container(
padding: EdgeInsets.all(12),
margin: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: Offset(
0, 3), // changes position of shadow
),
],
color: kgCard,
borderRadius: BorderRadius.circular(3.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts(TranslationBase.of(context).kg)),
),
),
],
color: kgCard,
borderRadius: BorderRadius.circular(3.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts('KG')),
),
),
),
),
GestureDetector(
onTap: () {
setState(() {
updateColorWeight(2);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
color: lbCard,
borderRadius: BorderRadius.circular(3.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
updateColorWeight(2);
});
},
child: Container(
padding: EdgeInsets.all(12),
margin: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
color: lbCard,
borderRadius: BorderRadius.circular(3.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: Offset(
0, 3), // changes position of shadow
),
],
),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts(TranslationBase.of(context).pound)),
),
),
],
),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts('LB')),
],
),
SizedBox(
height: 8.0,
),
Texts(TranslationBase.of(context).activityLevel),
Container(
child: DropdownButton<String>(
value: dropdownValue,
icon: Icon(Icons.arrow_downward),
iconSize: 24,
elevation: 16,
style: TextStyle(color: Colors.black87),
underline: Container(
height: 2,
color: Colors.black54,
),
onChanged: (String newValue) {
setState(() {
dropdownValue = newValue;
});
},
items: <String>[
'Almost Inactive(Little or no exercises)',
'Lighty Active (1-3) days per week',
'very Active(6-7) days per week',
'Super Active(very hard exercises)'
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
),
],
),
SizedBox(
height: 5.0,
),
Texts('Activity level'),
Container(
width: 300,
child: DropdownButton<String>(
value: dropdownValue,
icon: Icon(Icons.arrow_downward),
iconSize: 24,
elevation: 16,
style: TextStyle(color: Colors.black87),
underline: Container(
height: 2,
color: Colors.black54,
SizedBox(
height: 25.0,
),
onChanged: (String newValue) {
setState(() {
dropdownValue = newValue;
});
},
items: <String>[
'Almost Inactive(Little or no exercises)',
'Lighty Active (1-3) days per week',
'very Active(6-7) days per week',
'Super Active(very hard exercises)'
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
),
SizedBox(
height: 25.0,
),
Container(
height: 100.0,
width: 350.0,
child: SecondaryButton(
label: 'CALCULATE',
onTap: () {
setState(() {
calculateCalories();
print(calories);
{
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CalorieResultPage(
calorie: calories,
)),
);
}
});
},
),
],
),
],
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
child: SecondaryButton(
label: TranslationBase.of(context).calculate,
onTap: () {
setState(() {
calculateCalories();
print(calories);
{
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CalorieResultPage(
calorie: calories,
)),
);
}
});
},
),
),
),
],
),
);
}

@ -1,3 +1,4 @@
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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -12,7 +13,8 @@ class CalorieResultPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: 'Calorie Calculator',
isShowDecPage: false,
appBarTitle: "${TranslationBase.of(context).calories} ${TranslationBase.of(context).calculators}",
isShowAppBar: true,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,

@ -18,6 +18,7 @@ class _HealthConverterState extends State<HealthConverter> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).converters,
body: Column(
children: [

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculat
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/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';
@ -37,7 +38,8 @@ class _HealthCalculatorsState extends State<HealthCalculators>
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Health Calculators',
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).calculators,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
@ -72,13 +74,13 @@ class _HealthCalculatorsState extends State<HealthCalculators>
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: Center(
child: Texts('General Health'),
child: Texts(TranslationBase.of(context).generalHealth),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: Center(
child: Texts("Women's Health"),
child: Texts(TranslationBase.of(context).womanHealth),
),
),
],
@ -115,9 +117,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'BMI',
title: TranslationBase.of(context).bmi,
imagePath: 'bmi_health_calculator.png',
subTitle: 'Calculators',
subTitle: TranslationBase.of(context).calcHealth,
),
),
),
@ -133,9 +135,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'Calories',
title: TranslationBase.of(context).calories,
imagePath: 'calories-calculator.png',
subTitle: 'Calculators',
subTitle: TranslationBase.of(context).calcHealth,
),
),
),
@ -155,9 +157,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'BMR',
title: TranslationBase.of(context).bmr,
imagePath: 'BMR_calculator.png',
subTitle: 'Calculators',
subTitle: TranslationBase.of(context).calcHealth,
),
),
),
@ -173,9 +175,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'Ideal Body',
title: TranslationBase.of(context).idealBody,
imagePath: 'body_weight.png',
subTitle: 'Weight',
subTitle: TranslationBase.of(context).weight,
),
),
),
@ -195,9 +197,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'Body',
title: TranslationBase.of(context).bodyWord,
imagePath: 'body_fat.png',
subTitle: 'Fat',
subTitle: TranslationBase.of(context).fat,
),
),
),
@ -213,9 +215,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'Carbohydrate',
title: TranslationBase.of(context).carbohydrate,
imagePath: 'carb_protein.png',
subTitle: 'Protein Fat',
subTitle: TranslationBase.of(context).proteinFat,
),
),
),
@ -243,9 +245,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'Ovulation',
title: TranslationBase.of(context).ovulation,
imagePath: 'ovulation_period_icon.png',
subTitle: 'Period',
subTitle: TranslationBase.of(context).period,
),
),
),
@ -261,9 +263,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'Delivery',
title: TranslationBase.of(context).delivery,
imagePath: 'delivery_date_icon.png',
subTitle: 'Due Date',
subTitle: TranslationBase.of(context).dueDate,
),
),
),

@ -29,7 +29,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:giffy_dialog/giffy_dialog.dart';
import 'package:provider/provider.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
//import '../../../core/model/my_balance/AdvanceModel.dart';
import 'confirm_payment_page.dart';

@ -8,13 +8,13 @@ import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobi
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class ConfirmSMSDialog extends StatefulWidget {
final String phoneNumber;
@ -112,32 +112,31 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
height: 40,
color: Theme.of(context).primaryColor,
child: Stack(
children: [
Center(
child: Texts(
'SMS',
color: Colors.white,
textAlign: TextAlign.center,
),
),
Positioned(child: Container(
child: InkWell(
onTap: () => Navigator.pop(context),
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle, color: Colors.white),
child: Icon(
Icons.clear,
color: Colors.grey[900],
)),
child: Texts(
'SMS',
color: Colors.white,
textAlign: TextAlign.center,
),
),
left: projectViewModel.isArabic? 2:0,
right: projectViewModel.isArabic? 0:2,
Positioned(
child: Container(
child: InkWell(
onTap: () => Navigator.pop(context),
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle, color: Colors.white),
child: Icon(
Icons.clear,
color: Colors.grey[900],
)),
),
),
left: projectViewModel.isArabic ? 2 : 0,
right: projectViewModel.isArabic ? 0 : 2,
)
],
),
),
Image.asset(
@ -335,14 +334,13 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
void submit(MyBalanceViewModel model) {
if (verifyAccountForm.currentState.validate()) {
GifLoaderDialogUtils.showMyDialog(context);
final activationCode =
digit1.text + digit2.text + digit3.text + digit4.text;
model
.checkActivationCodeForAdvancePayment(activationCode: activationCode)
.then((value) {})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.pop(context, true);
});
}

@ -61,6 +61,7 @@ class _BookConfirmState extends State<BookConfirm> {
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowDecPage: false,
isShowAppBar: true,
body: SingleChildScrollView(
child: Container(
@ -461,6 +462,7 @@ class _BookConfirmState extends State<BookConfirm> {
dialog.showAlertDialog(context);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});

@ -5,9 +5,9 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplai
import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class DentalComplaints extends StatefulWidget {
SearchInfo searchInfo;
@ -59,12 +59,14 @@ class _DentalComplaintsState extends State<DentalComplaints> {
}
getChiefComplaintsList() {
GifLoaderDialogUtils.showMyDialog(context);
getLanguageID();
ClinicListService service = new ClinicListService();
service
.getChiefComplaintsList(
widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
print(res['List_DentalChiefComplain']);
setState(() {
@ -75,8 +77,8 @@ class _DentalComplaintsState extends State<DentalComplaints> {
});
} else {}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
}

@ -10,11 +10,11 @@ import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsLis
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class QRCode extends StatefulWidget {
PatientShareResponse patientShareResponse;
@ -235,6 +235,7 @@ class _QRCodeState extends State<QRCode> {
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () {
GifLoaderDialogUtils.showMyDialog(context);
service
.sendAppointmentQREmail(
widget.authUser.emailAddress,
@ -247,15 +248,14 @@ class _QRCodeState extends State<QRCode> {
widget.patientShareResponse.doctorSpeciality),
context)
.then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog.closeAlertDialog(context);
}).catchError((err) {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading",
backgroundColor: Colors.blue.withOpacity(0.6));
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);

@ -26,6 +26,7 @@ class _SearchResultsState extends State<SearchResults> {
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowDecPage: false,
isShowAppBar: true,
body: Container(
margin: EdgeInsets.all(10.0),

@ -13,7 +13,6 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class SearchByClinic extends StatefulWidget {
final List clnicIds;
@ -213,6 +212,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
});
}
// TODO Mosa_REMARk to come back later
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
SearchInfo searchInfo = new SearchInfo();

@ -4,7 +4,6 @@ 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:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import '../SearchResults.dart';

@ -3,8 +3,8 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
// ignore: must_be_immutable
class DentalComplaintCard extends StatefulWidget {
@ -70,11 +70,13 @@ class _DentalComplaintCardState extends State<DentalComplaintCard> {
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
List();
GifLoaderDialogUtils.showMyDialog(context);
ClinicListService service = new ClinicListService();
service
.getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD,
widget.listDentalChiefComplain.projectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
print(res['List_DentalDoctorChiefComplaintMapping']);
setState(() {
@ -114,9 +116,9 @@ class _DentalComplaintCardState extends State<DentalComplaintCard> {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
Future navigateToSearchResults(

@ -6,7 +6,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import '../DoctorProfile.dart';

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
@ -13,10 +14,11 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:intl/intl.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:provider/provider.dart';
import 'package:table_calendar/table_calendar.dart';
class CovidTimeSlots extends StatefulWidget {
@ -29,6 +31,8 @@ class CovidTimeSlots extends StatefulWidget {
int selectedClinicID;
int selectedDoctorID;
var language;
PatientShareResponse patientShareResponse;
CovidTimeSlots({@required this.projectID});
@ -90,10 +94,10 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
super.dispose();
}
void _onDaySelected(DateTime day, List events) {
void _onDaySelected(DateTime day, List events, ProjectViewModel projectViewModel) {
final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() {
this.selectedDate = DateUtil.getMonthDayYearDateFormatted(day);
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en");
openTimeSlotsPickerForDate(day, docFreeSlots);
CovidTimeSlots.selectedDate = formatter.format(day);
print(CovidTimeSlots.selectedDate);
@ -112,8 +116,9 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: "COVID-19 TEST",
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
body: SingleChildScrollView(
child: Container(
@ -147,8 +152,8 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
children: <Widget>[
Container(
margin: EdgeInsets.only(
left: 20.0, right: 20.0, top: 40.0),
child: Text("COVID-19 TEST",
left: 20.0, right: 20.0, top: 20.0),
child: Text(TranslationBase.of(context).covidTest,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
@ -157,7 +162,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
Container(
margin: EdgeInsets.only(
left: 20.0, right: 20.0, top: 10.0),
child: Text("Drive-Thru",
child: Text(TranslationBase.of(context).driveThru,
style: TextStyle(
color: Colors.white, fontSize: 24.0)),
),
@ -171,16 +176,16 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
borderRadius: BorderRadius.circular(10.0),
color: Colors.white),
margin: EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 5.0),
padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0),
padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 20.0),
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * 0.65,
// height: MediaQuery.of(context).size.height * 0.65,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"Kindly select one of the available appointments from below: ",
child: Text(TranslationBase.of(context).selectAppo,
style:
TextStyle(color: Colors.black, fontSize: 16.0)),
),
@ -221,7 +226,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
},
),
),
_buildTableCalendarWithBuilders(),
_buildTableCalendarWithBuilders(projectViewModel),
],
),
),
@ -255,7 +260,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
onPressed: () {
bookCovidTestAppointment();
},
child: Text("BOOK", style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)),
),
),
),
@ -266,9 +271,9 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
);
}
Widget _buildTableCalendarWithBuilders() {
Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) {
return TableCalendar(
locale: 'en_US',
locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US',
calendarController: _calendarController,
events: _events,
initialCalendarFormat: CalendarFormat.month,
@ -353,6 +358,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
_onDaySelected(
date,
event,
projectViewModel
);
_animationController.forward(from: 0.0);
},
@ -490,13 +496,10 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
CovidTimeSlots.selectedDate,
context)
.then((res) {
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
// Future.delayed(new Duration(milliseconds: 1800), () {
getPatientShare(context, res['AppointmentNo'], docObject.clinicID,
docObject.projectID, docObject);
// });
} else {
GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList();
@ -522,15 +525,15 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
}
}).catchError((err) {
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo,
BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) {
@ -543,8 +546,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
getPatientShare(context, String appointmentNo, int clinicID, int projectID,
@ -553,35 +555,34 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
service
.getPatientShare(appointmentNo, clinicID, projectID, context)
.then((res) {
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
navigateToPaymentAlert();
});
GifLoaderDialogUtils.hideDialog(context);
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
navigateToPaymentAlert();
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
navigateToPaymentAlert() {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CovidPaymentAlert(
patientShareResponse: widget.patientShareResponse)));
context,
FadePage(
page: CovidPaymentAlert(
patientShareResponse: widget.patientShareResponse),
),
);
}
getCovidFreeSlots(BuildContext context, int projectID) {
CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context);
service.getCovidFreeSlots(context, projectID).then((res) {
print(res['COVID19_FreeTimeSlots']);
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['COVID19_FreeTimeSlots'].length != 0) {
freeSlotsResponse = res['COVID19_FreeTimeSlots'];
print(res['COVID19_FreeTimeSlots'].length);
_getJSONSlots().then((value) => {
setState(() => {
widget.selectedClinicID =
@ -599,7 +600,6 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
}

@ -1,13 +1,16 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:provider/provider.dart';
class CovidDrivethruLocation extends StatefulWidget {
@override
@ -23,6 +26,8 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
String projectName = "";
String projectID = "";
ProjectViewModel projectViewModel;
@override
void initState() {
WidgetsBinding.instance
@ -32,8 +37,9 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: "COVID-19 TEST",
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
body: SingleChildScrollView(
child: Container(
@ -41,8 +47,10 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
child: Column(
children: <Widget>[
Container(
alignment: Alignment.centerLeft,
child: Text("Get The Result During 8 Hours",
alignment: projectViewModel.isArabic
? Alignment.centerRight
: Alignment.centerLeft,
child: Text(TranslationBase.of(context).resultHeader,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 22.0,
@ -50,14 +58,15 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(
"We are using the advance technology to test COVID-19, The sample for examination is taking between the nose and mouth (nasopharyngeal swab), the examination is done by ELITE In Genius of the company ELITECH GROUP MOLECULAR DIAGNOSTICS, Note that the device belongs to an Italian company and is manufactured in Japan with RC- PCR",
child: Text(TranslationBase.of(context).covidInfo,
style: TextStyle(fontSize: 16.0, color: Colors.black)),
),
Container(
margin: EdgeInsets.only(top: 20.0),
alignment: Alignment.centerLeft,
child: Text("Select Location",
alignment: projectViewModel.isArabic
? Alignment.centerRight
: Alignment.centerLeft,
child: Text(TranslationBase.of(context).selectLocation,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
@ -79,7 +88,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
margin: EdgeInsets.only(top: 15.0),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
hint: new Text("Select Address"),
hint: new Text(TranslationBase.of(context).selectAddress),
value: projectDropdownValue,
items: projectsList.map((item) {
return new DropdownMenuItem<String>(
@ -98,8 +107,10 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
isLocationSelected
? Container(
margin: EdgeInsets.only(top: 15.0),
alignment: Alignment.centerLeft,
child: Text("Selected Location",
alignment: projectViewModel.isArabic
? Alignment.centerRight
: Alignment.centerLeft,
child: Text(TranslationBase.of(context).selectLocation,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
@ -150,8 +161,8 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
onPressed: () {
getDirections();
},
child:
Text("GET DIRECTIONS", style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).getDirections,
style: TextStyle(fontSize: 18.0)),
),
),
),
@ -178,7 +189,8 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
onPressed: () {
back();
},
child: Text("BACK", style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).back,
style: TextStyle(fontSize: 18.0)),
),
),
),
@ -201,7 +213,8 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
onPressed: () {
next();
},
child: Text("NEXT", style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).next,
style: TextStyle(fontSize: 18.0)),
),
),
),
@ -258,35 +271,35 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
CovidPaymentInfoResponse covidPaymentInfoResponse =
new CovidPaymentInfoResponse();
GifLoaderDialogUtils.showMyDialog(context);
service
.getCovidPaymentInformation(context, int.parse(projectID))
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(
res['COVID19_PatientShare']);
print(covidPaymentInfoResponse.procedureNameField);
});
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CovidPaymentDetails(
covidPaymentInfoResponse: covidPaymentInfoResponse,
projectID: int.parse(projectID),
)));
} else {}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CovidPaymentDetails(
covidPaymentInfoResponse: covidPaymentInfoResponse,
projectID: int.parse(projectID),
)));
});
}
getProjectsList(BuildContext context) {
CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context);
service.getCovidProjectsList(context).then((res) {
print(res);
if (res['MessageStatus'] == 1) {
@ -296,10 +309,11 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
projectsList.add(new DriveThroughTestingCenterModel.fromJson(v));
});
});
GifLoaderDialogUtils.hideDialog(context);
} else {}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
}

@ -1,7 +1,13 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@ -15,10 +21,13 @@ class CovidPaymentAlert extends StatefulWidget {
}
class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "COVID-19 TEST",
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
body: SingleChildScrollView(
child: Column(
@ -43,7 +52,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 30.0, right: 20.0),
child: Text("Alert",
child: Text(TranslationBase.of(context).covidAlert,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
@ -54,7 +63,8 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
margin: EdgeInsets.only(
left: 30.0, right: 20.0, top: 5.0),
child: Text(
"Pay With-in 15 mins to confirm the appointment",
TranslationBase.of(context).covidAlertHeader,
// "Pay With-in 15 mins to confirm the appointment",
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.white, fontSize: 20.0)),
@ -72,7 +82,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
children: <Widget>[
Container(
alignment: Alignment.center,
child: Text("Pay With-in 15 mins",
child: Text(TranslationBase.of(context).covidAlertMins,
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xFFc5272d),
@ -83,7 +93,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
alignment: Alignment.center,
margin: EdgeInsets.only(top: 15.0),
child: Text(
"Payment for Covid-19 Test should Be made with-in 15 mins otherwise The system will Cancel the Scheduled appointment automatically.",
TranslationBase.of(context).covidAlertInfo,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey[700],
@ -115,7 +125,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
Container(
margin: EdgeInsets.only(
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text("COVID-19 TEST",
child: Text(TranslationBase.of(context).covidTest,
style: TextStyle(
fontSize: 18.0,
color: Colors.black,
@ -137,10 +147,12 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
child: Text(
widget.patientShareResponse.projectName !=
null
? widget.patientShareResponse.projectName
? widget
.patientShareResponse.projectName
: "NULL",
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
fontSize: 18.0,
color: Colors.grey[700])),
),
],
),
@ -159,14 +171,16 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
)),
Container(
child: Text(
widget.patientShareResponse.appointmentDate !=
widget.patientShareResponse
.appointmentDate !=
null
? getDate(widget.patientShareResponse
.appointmentDate)
.split(" ")[0]
: "NULL",
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
fontSize: 18.0,
color: Colors.grey[700])),
),
],
),
@ -185,14 +199,16 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
)),
Container(
child: Text(
widget.patientShareResponse.appointmentDate !=
widget.patientShareResponse
.appointmentDate !=
null
? getDate(widget.patientShareResponse
.appointmentDate)
.split(" ")[1]
: "NULL",
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
fontSize: 18.0,
color: Colors.grey[700])),
),
],
),
@ -216,7 +232,8 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
.patientShareResponse.doctorNameObj
: "NULL",
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
fontSize: 18.0,
color: Colors.grey[700])),
),
],
),
@ -251,9 +268,9 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
// bookCovidTestAppointment();
startPaymentProcess();
},
child: Text("NEXT", style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)),
),
),
),
@ -264,6 +281,37 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
);
}
startPaymentProcess() {
navigateToPaymentMethod(context, widget.patientShareResponse);
}
Future navigateToPaymentMethod(
context, PatientShareResponse patientShareResponse) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
setState(() {
authUser = data;
});
}
Navigator.push(
context, MaterialPageRoute(builder: (context) => PaymentMethod()))
.then((value) {
print(value);
if (value != null) {
Navigator.push(
context,
FadePage(
page: CovidPaymentSummary(
patientShareResponse: widget.patientShareResponse,
selectedPaymentMethod: value.toString()),
),
);
}
});
}
String getDate(String appoDate) {
var appoDateFormatted = "";

@ -23,7 +23,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "COVID-19 TEST",
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
body: SingleChildScrollView(
child: Container(
@ -57,8 +57,8 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
children: <Widget>[
Container(
margin: EdgeInsets.only(
left: 20.0, right: 20.0, top: 40.0),
child: Text("COVID-19 TEST",
left: 20.0, right: 20.0, top: 20.0),
child: Text(TranslationBase.of(context).covidTest,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
@ -67,7 +67,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
Container(
margin: EdgeInsets.only(
left: 20.0, right: 20.0, top: 10.0),
child: Text("Drive-Thru",
child: Text(TranslationBase.of(context).driveThru,
style: TextStyle(
color: Colors.white, fontSize: 24.0)),
),
@ -88,7 +88,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
alignment: Alignment.center,
margin:
EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0),
child: Text("Test Fees",
child: Text(TranslationBase.of(context).testFee,
style: TextStyle(
color: Colors.black,
fontSize: 22.0,
@ -156,7 +156,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 5.0),
child: Text("You can pay by following options: ",
child: Text(TranslationBase.of(context).payOptions,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.0,
@ -197,7 +197,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
onPressed: () {
cancel();
},
child: Text("CANCEL", style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)),
),
),
),
@ -218,7 +218,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: isAgree ? next : null,
child: Text("NEXT", style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)),
),
),
),

@ -0,0 +1,331 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class CovidPaymentSummary extends StatefulWidget {
PatientShareResponse patientShareResponse;
final String selectedPaymentMethod;
MyInAppBrowser browser;
AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences();
String transID = "";
CovidPaymentSummary(
{@required this.patientShareResponse, this.selectedPaymentMethod});
@override
_CovidPaymentSummaryState createState() => _CovidPaymentSummaryState();
}
class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).confirmThePayment,
textAlign: TextAlign.center,
fontWeight: FontWeight.w500,
fontSize: 24,
),
SizedBox(
height: 12,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: 100.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child:
Image.asset(getImagePath(widget.selectedPaymentMethod)),
),
Texts(
'${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar,
fontSize: 26,
bold: true,
)
],
),
SizedBox(
height: 12,
),
Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.all(3),
child: NewTextFields(
hintText: TranslationBase.of(context).fileNumber,
initialValue:
projectViewModel.user.patientID.toString(),
isEnabled: false,
),
),
),
Expanded(
child: Container(
margin: EdgeInsets.all(3),
child: NewTextFields(
hintText: TranslationBase.of(context).name,
initialValue: projectViewModel.user.firstName,
isEnabled: false,
),
),
),
],
),
SizedBox(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context).mobileNumber,
initialValue: projectViewModel.user.mobileNumber,
isEnabled: false,
),
SizedBox(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context).depositorName,
initialValue: projectViewModel.user.firstName +
" " +
projectViewModel.user.middleName +
" " +
projectViewModel.user.lastName,
isEnabled: false,
),
],
),
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
padding: EdgeInsets.all(12),
child: SecondaryButton(
textColor: Colors.white,
color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).confirm.toUpperCase(),
onTap: () {
startPaymentProcess(projectViewModel.user);
},
),
),
);
}
startPaymentProcess(AuthenticatedUser authenticatedUser) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.patientShareResponse.projectID;
appo.clinicID = widget.patientShareResponse.clinicID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo;
openPayment(
widget.selectedPaymentMethod,
authenticatedUser,
double.parse(
widget.patientShareResponse.patientShareWithTax.toString()),
widget.patientShareResponse,
appo);
}
openPayment(
String paymentMethod,
AuthenticatedUser authenticatedUser,
double amount,
PatientShareResponse patientShareResponse,
AppoitmentAllHistoryResultList appo) async {
if (paymentMethod == "ApplePay") {
// await widget.chromeBrowser.open(
// url: "https://applepay-datatrans-sample.herokuapp.com/",
// options: ChromeSafariBrowserClassOptions(
// android: AndroidChromeCustomTabsOptions(
// addDefaultShareMenuItem: false),
// ios: IOSSafariOptions(barCollapsingEnabled: true)));
} else {
widget.browser = new MyInAppBrowser(
onExitCallback: onBrowserExit,
appo: appo,
onLoadStartCallback: onBrowserLoadStart);
widget.browser.openPaymentBrowser(
amount,
"Appointment check in",
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(),
authenticatedUser.emailAddress,
paymentMethod,
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
widget.browser,
widget.patientShareResponse.isLiveCareAppointment,
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID,
widget.patientShareResponse.doctorID);
}
}
onBrowserLoadStart(String url) {
print("onBrowserLoadStart");
print(url);
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
MyInAppBrowser.isPaymentDone = true;
return;
}
});
MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
MyInAppBrowser.isPaymentDone = false;
return;
}
});
}
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!");
if (isPaymentMade) checkPaymentStatus(appo);
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.checkPaymentStatus(
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
context)
.then((res) {
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') {
createAdvancePayment(res, appo);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['Response_Message']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
service
.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'],
res['Fort_id'], res['PaymentMethod'], context)
.then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString());
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
addAdvancedNumberRequest(
String advanceNumber, String paymentReference, String appointmentID) {
DoctorsListService service = new DoctorsListService();
service
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, context)
.then((res) {
print(res);
getAppoQR(context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
getAppoQR(context) {
DoctorsListService service = new DoctorsListService();
service
.generateAppointmentQR(widget.patientShareResponse, context)
.then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);
navigateToQR(context, res['AppointmentQR']);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
Future navigateToQR(context, String appoQR) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => QRCode(
patientShareResponse: widget.patientShareResponse,
appoQR: appoQR,
)));
}
String getImagePath(String paymentMethod) {
switch (paymentMethod) {
case "MADA":
return 'assets/images/new-design/mada.png';
break;
case "SADAD":
return 'assets/images/new-design/sadad.png';
break;
case "VISA":
return 'assets/images/new-design/visa.png';
break;
case "MASTERCARD":
return 'assets/images/new-design/mastercard.png';
break;
case "Installment":
return 'assets/images/new-design/installment.png';
break;
}
return 'assets/images/new-design/mada.png';
}
}

@ -365,7 +365,9 @@ class _ToDoState extends State<ToDo> {
color: Color(0xff20bc44),
),
height: 30.0,
margin: projectViewModel.isArabic ? EdgeInsets.fromLTRB(160.0, 0.0, 30.0, 0.0) : EdgeInsets.fromLTRB(30.0, 0.0, 160.0, 0.0),
margin: projectViewModel.isArabic
? EdgeInsets.fromLTRB(160.0, 0.0, 30.0, 0.0)
: EdgeInsets.fromLTRB(20.0, 0.0, 160.0, 0.0),
transform: Matrix4.translationValues(0.0, -8.0, 0.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
@ -385,18 +387,21 @@ class _ToDoState extends State<ToDo> {
),
widget.appoList[index].isLiveCareAppointment
? Container(
child: Text(TranslationBase.of(context).videoAppo,
child: Text(
TranslationBase.of(context).videoAppo,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
fontSize: 11.0)),
)
: Container(
child: Text(TranslationBase.of(context).walkinAppo,
child: Text(
TranslationBase.of(context)
.walkinAppo,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
fontSize: 11.0)),
)
],
),
@ -825,20 +830,25 @@ class _ToDoState extends State<ToDo> {
res['Fort_id'], res['PaymentMethod'], context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
print(res['OnlineCheckInAppointments'][0]);
addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString(),
appo);
appo,
res['OnlineCheckInAppointments'][0]);
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
});
}
addAdvancedNumberRequest(String advanceNumber, String paymentReference,
String appointmentID, AppoitmentAllHistoryResultList appo) {
addAdvancedNumberRequest(
String advanceNumber,
String paymentReference,
String appointmentID,
AppoitmentAllHistoryResultList appo,
dynamic apptData) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
@ -846,8 +856,25 @@ class _ToDoState extends State<ToDo> {
advanceNumber, paymentReference, appointmentID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (appo.isLiveCareAppointment)
addVIDARequestInsert(advanceNumber, paymentReference, apptData);
else
getAppoQR(context, appo);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
addVIDARequestInsert(
String advanceNumber, String paymentReference, dynamic apptData) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.addVIDARequest(advanceNumber, paymentReference, apptData, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
getAppoQR(context, appo);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);

@ -27,7 +27,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
Container(
margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
alignment: Alignment.center,
child: Text("Select Payment Method",
child: Text(TranslationBase.of(context).selectPaymentOption,
style: TextStyle(
fontSize: 26.0, fontWeight: FontWeight.bold)),
),

@ -1,15 +1,21 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'base/base_view.dart';
class FinalProductsPage extends StatefulWidget {
String id;
FinalProductsPage({this.id});
final String id;
final int productType; // 1 : default, 2 : manufacturer , 3 : recently viewed
FinalProductsPage({this.id, this.productType = 1});
@override
_FinalProductsPageState createState() => _FinalProductsPageState(id: id);
}
@ -28,11 +34,22 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
@override
Widget build(BuildContext context) {
return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) => model.getFinalProducts(i: id),
onModelReady: (model) {
if (widget.productType == 1) {
model.getFinalProducts(i: id);
} else if (widget.productType == 2) {
model.getManufacturerProducts(id);
} else if (widget.productType == 3) {
model.getLastVisitedProducts();
} else {
model.getBestSellerProducts();
}
},
allowAny: true,
builder: (BuildContext context, PharmacyCategoriseViewModel model,
Widget child) =>
PharmacyAppScaffold(
appBarTitle: 'Products',
appBarTitle: "Products",
isBottomBar: false,
isShowAppBar: true,
backgroundColor: Colors.white,
@ -117,193 +134,220 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
itemBuilder: (BuildContext context, int index) {
return NetworkBaseView(
baseViewModel: model,
child: Card(
color: model.finalProducts[index]
.discountName !=
null
? Color(0xffFFFF00)
: Colors.white,
elevation: 0,
shape: Border(
right: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
left: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
bottom: BorderSide(
color: Colors.grey.shade300,
width: 1,
child: InkWell(
child: Card(
color: model.finalProducts[index]
.discountName !=
null
? Color(0xffFFFF00)
: Colors.white,
elevation: 0,
shape: Border(
right: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
left: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
bottom: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
top: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
),
top: BorderSide(
color: Colors.grey.shade300,
width: 1,
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(110.0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(110.0),
),
color: Colors.white,
),
color: Colors.white,
),
padding: EdgeInsets.symmetric(
horizontal: 0),
width: MediaQuery.of(context)
.size
.width /
3,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Stack(
children: [
Container(
margin: EdgeInsets.fromLTRB(
0, 16, 0, 0),
alignment: Alignment.center,
child: Image.network(
model.finalProducts[index]
.images.isNotEmpty
? model
.finalProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover,
height: 80,
),
),
Container(
width: model
padding: EdgeInsets.symmetric(
horizontal: 0),
width: MediaQuery.of(context)
.size
.width /
3,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Stack(
children: [
Container(
margin:
EdgeInsets.fromLTRB(
0, 16, 0, 0),
alignment:
Alignment.center,
child: Image.network(
model
.finalProducts[
index]
.rxMessage !=
null
? MediaQuery.of(context)
.size
.width /
2.8
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(6)),
.images
.isNotEmpty
? model
.finalProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover,
height: 80,
),
),
child: Texts(
model.finalProducts[index]
Container(
width: model
.finalProducts[
index]
.rxMessage !=
null
? model
.finalProducts[
index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w600,
? MediaQuery.of(
context)
.size
.width /
2.8
: 0,
padding:
EdgeInsets.all(4),
decoration: BoxDecoration(
color:
Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
),
child: Texts(
model
.finalProducts[
index]
.rxMessage !=
null
? model
.finalProducts[
index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w600,
),
),
),
],
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
],
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
if (model
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
if (model
.finalProducts[
index]
.discountName !=
null)
Container(
width:
double.infinity,
height: 13.0,
decoration:
BoxDecoration(
color: Color(
0xff5AB145),
),
child: Center(
child: Texts(
model
.finalProducts[
index]
.discountName,
regular: true,
color:
Colors.white,
fontSize: 10.4,
),
),
),
Texts(
model
.finalProducts[
index]
.discountName !=
null)
Container(
width: double.infinity,
height: 13.0,
decoration:
BoxDecoration(
color:
Color(0xff5AB145),
),
child: Center(
child: Texts(
model
.finalProducts[
index]
.discountName,
regular: true,
color: Colors.white,
fontSize: 10.4,
),
.name,
regular: true,
fontSize: 12,
fontWeight:
FontWeight.w400,
),
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.finalProducts[index].price}",
bold: true,
fontSize: 14,
),
),
Texts(
model.finalProducts[index]
.name,
regular: true,
fontSize: 12,
fontWeight:
FontWeight.w400,
),
Padding(
padding:
const EdgeInsets.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.finalProducts[index].price}",
bold: true,
fontSize: 14,
Row(
children: [
StarRating(
totalAverage: model
.finalProducts[
index]
.approvedRatingSum >
0
? (model.finalProducts[index].approvedRatingSum
.toDouble() /
model
.finalProducts[index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.finalProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
),
),
Row(
children: [
StarRating(
totalAverage: model
.finalProducts[
index]
.approvedRatingSum >
0
? (model.finalProducts[index].approvedRatingSum
.toDouble() /
model
.finalProducts[index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.finalProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
),
],
],
),
),
),
],
],
),
),
),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(
model.finalProducts[index]),
)),
},
));
},
),
@ -316,158 +360,186 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
itemCount: model.finalProducts.length,
itemBuilder:
(BuildContext context, int index) {
return Card(
child: Row(
children: [
Stack(
children: [
Column(
children: [
Container(
decoration: BoxDecoration(),
child: Padding(
padding: EdgeInsets.only(
left: 9.0,
top: 8.0,
right: 10.0,
return InkWell(
child: Card(
child: Row(
children: [
Stack(
children: [
Column(
children: [
Container(
decoration:
BoxDecoration(),
child: Padding(
padding:
EdgeInsets.only(
left: 9.0,
top: 8.0,
right: 10.0,
),
),
),
),
Container(
margin: EdgeInsets.fromLTRB(
0, 0, 0, 0),
alignment: Alignment.center,
child: Image.network(
model.finalProducts[index]
.images.isNotEmpty
? model
.finalProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain,
height: 80,
Container(
margin:
EdgeInsets.fromLTRB(
0, 0, 0, 0),
alignment:
Alignment.center,
child: Image.network(
model
.finalProducts[
index]
.images
.isNotEmpty
? model
.finalProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain,
height: 80,
),
),
),
],
],
),
Column(
children: [
Container(
width: model
.finalProducts[
index]
.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
3.5
: 0,
padding:
EdgeInsets.all(4),
decoration: BoxDecoration(
color:
Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
),
child: Texts(
model
.finalProducts[
index]
.rxMessage !=
null
? model
.finalProducts[
index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w600,
),
),
],
),
],
),
Container(
height: 100.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
Column(
child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 4.0,
),
Container(
width: model
.finalProducts[
index]
.rxMessage !=
null
? MediaQuery.of(context)
width:
MediaQuery.of(context)
.size
.width /
3.5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(6)),
),
.width *
0.65,
child: Texts(
model.finalProducts[index]
.rxMessage !=
null
? model
.finalProducts[
index]
.rxMessage
: "",
color: Colors.white,
.name,
regular: true,
fontSize: 10,
fontSize: 13.2,
fontWeight:
FontWeight.w600,
FontWeight.w500,
maxLines: 5,
),
),
],
),
],
),
Container(
height: 100.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 4.0,
),
Container(
height: 35.0,
width: 250.0,
child: Texts(
model.finalProducts[index]
.name,
regular: true,
fontSize: 13.2,
fontWeight: FontWeight.w500,
maxLines: 2,
SizedBox(
height: 8.0,
),
),
SizedBox(
height: 8.0,
),
Padding(
padding:
const EdgeInsets.only(
top: 4, bottom: 4),
child: Texts(
"SAR ${model.finalProducts[index].price}",
bold: true,
fontSize: 14,
Padding(
padding:
const EdgeInsets.only(
top: 4, bottom: 4),
child: Texts(
"SAR ${model.finalProducts[index].price}",
bold: true,
fontSize: 14,
),
),
),
Row(
children: [
StarRating(
totalAverage: model
.finalProducts[
index]
.approvedRatingSum >
0
? (model
.finalProducts[
index]
.approvedRatingSum
.toDouble() /
model
.finalProducts[
index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.finalProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
),
],
Row(
children: [
StarRating(
totalAverage: model
.finalProducts[
index]
.approvedRatingSum >
0
? (model
.finalProducts[
index]
.approvedRatingSum
.toDouble() /
model
.finalProducts[
index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.finalProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
),
],
),
),
),
],
],
),
),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(
model.finalProducts[index]),
)),
},
);
}),
),

@ -289,13 +289,22 @@ class _HomePageState extends State<HomePage> {
SizedBox(
height: 8,
),
Texts(
model.user.firstName +
" " +
model.user.lastName,
color: Colors.grey[100],
bold: true,
fontSize: 15,
Row(
children: [
Texts(
model.user.firstName +
" " +
model.user.lastName,
color: Colors.grey[100],
bold: true,
fontSize: 15,
),
Container(
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
child: SvgPicture.asset(
"assets/images/new-design/verification_check.svg"),
),
],
),
Texts(
'${model.user.patientID}',
@ -440,7 +449,7 @@ class _HomePageState extends State<HomePage> {
height: 10,
),
Texts(
TranslationBase.of(context).cmcHeading,
TranslationBase.of(context).homeHealthCare,
textAlign: TextAlign.center,
color: Colors.white,
fontWeight: FontWeight.w700,
@ -509,7 +518,7 @@ class _HomePageState extends State<HomePage> {
height:10,
),
Texts(
TranslationBase.of(context).emergencyService,
TranslationBase.of(context).cmcHeading,
textAlign: TextAlign.center,
color: Colors.white,
fontWeight: FontWeight.w700,

@ -49,78 +49,74 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar:
// currentTab == 0 || currentTab == 1 || currentTab == 2
// ?
AppBar(
backgroundColor: Color(0xff5AB145),
elevation: 0,
title: Container(
height: MediaQuery.of(context).size.height * 0.056,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white,
),
child: InkWell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.search, size: 25.0),
SizedBox(
width: 15.0,
appBar: currentTab != 4
? AppBar(
backgroundColor: Color(0xff5AB145),
elevation: 0,
title: Container(
height: MediaQuery.of(context).size.height * 0.056,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white,
),
child: InkWell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.search, size: 25.0),
SizedBox(
width: 15.0,
),
Texts(
TranslationBase.of(context).searchProductHere,
fontSize: 13,
)
],
),
),
Texts(
TranslationBase.of(context).searchProductHere,
fontSize: 13,
)
],
),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SearchProductsPage()),
);
},
),
),
leading: Builder(
builder: (BuildContext context) {
return InkWell(
onTap: () {
setState(() {
currentTab = 0;
pageController.jumpToPage(0);
});
},
child: Container(
height: 2.0,
width: 10.0,
child: Image.asset(
'assets/images/pharmacy_logo.png',
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SearchProductsPage()),
);
},
),
),
);
},
),
actions: [
IconButton(
// iconSize: 70,
icon: Image.asset(
'assets/images/new-design/qr-code.png',
leading: Builder(
builder: (BuildContext context) {
return InkWell(
onTap: () {
setState(() {
currentTab = 0;
pageController.jumpToPage(0);
});
},
child: Container(
height: 2.0,
width: 10.0,
child: Image.asset(
'assets/images/pharmacy_logo.png',
),
),
);
},
),
onPressed: _scanQrAndGetProduct //do something,
)
],
centerTitle: true,
),
// : currentTab == 4
// ? null:null,
actions: [
IconButton(
// iconSize: 70,
icon: Image.asset(
'assets/images/new-design/qr-code.png',
),
onPressed: _scanQrAndGetProduct //do something,
)
],
centerTitle: true,
)
: null,
// : AppBar(
// backgroundColor: Color(0xff5AB145),
// elevation: 0,
@ -155,7 +151,6 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: [
// TODO mosa_comeback
PharmacyPage(),
PharmacyCategorisePage(),
// OffersCategorisePage(),
@ -180,8 +175,9 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
try {
String barcode = result;
GifLoaderDialogUtils.showMyDialog(context);
await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode",
onSuccess: (dynamic response, int statusCode) {
await BaseAppClient()
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode",
onSuccess: (dynamic response, int statusCode) {
print(response);
var product = PharmacyProduct.fromJson(response["products"][0]);
GifLoaderDialogUtils.hideDialog(context);

@ -3,12 +3,10 @@ import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingReque
import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/livecare_logs.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.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:smart_progress_bar/smart_progress_bar.dart';
import 'livecare_type_select.dart';
class LiveCareHome extends StatefulWidget {
static bool showFooterButton = true;
@ -35,7 +33,9 @@ class _LiveCareHomeState extends State<LiveCareHome>
pendingERRequestHistoryList = new ErRequestHistoryList();
WidgetsBinding.instance.addPostFrameCallback((_) => getLiveCareHistory());
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!isDataLoaded) getLiveCareHistory();
});
super.initState();
}
@ -89,6 +89,7 @@ class _LiveCareHomeState extends State<LiveCareHome>
}
void getLiveCareHistory() {
GifLoaderDialogUtils.showMyDialog(context);
setState(() {
isDataLoaded = false;
hasLiveCareRequest = false;
@ -96,38 +97,31 @@ class _LiveCareHomeState extends State<LiveCareHome>
LiveCareService service = new LiveCareService();
PatientERVirtualHistoryResponse patientERVirtualHistoryResponse =
new PatientERVirtualHistoryResponse();
service
.getLivecareHistory(context)
.then((res) {
setState(() {
print(res['ErRequestHistoryList'].length);
if (res['ErRequestHistoryList'].length != 0) {
patientERVirtualHistoryResponse =
PatientERVirtualHistoryResponse.fromJson(res);
erRequestHistoryList =
patientERVirtualHistoryResponse.erRequestHistoryList;
service.getLivecareHistory(context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
setState(() {
print(res['ErRequestHistoryList'].length);
if (res['ErRequestHistoryList'].length != 0) {
patientERVirtualHistoryResponse =
PatientERVirtualHistoryResponse.fromJson(res);
erRequestHistoryList =
patientERVirtualHistoryResponse.erRequestHistoryList;
if (patientERVirtualHistoryResponse
.erRequestHistoryList[0].callStatus <
4) {
pendingERRequestHistoryList =
patientERVirtualHistoryResponse.erRequestHistoryList[0];
hasLiveCareRequest = true;
} else {
hasLiveCareRequest = false;
}
}
});
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
setState(() {
isDataLoaded = true;
});
});
if (patientERVirtualHistoryResponse
.erRequestHistoryList[0].callStatus <
4) {
pendingERRequestHistoryList =
patientERVirtualHistoryResponse.erRequestHistoryList[0];
hasLiveCareRequest = true;
} else {
hasLiveCareRequest = false;
}
}
isDataLoaded = true;
});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -36,7 +36,7 @@ class _ScheduleClinicCardState extends State<ScheduleClinicCard> {
child: Text(
widget.languageID == 'ar'
? widget.clinicsHaveScheduleList.clinicDescN != null ? widget.clinicsHaveScheduleList.clinicDescN: ""
: widget.clinicsHaveScheduleList.clinicDesc != null ? widget.clinicsHaveScheduleList.clinicDesc: "Dermatology",
: widget.clinicsHaveScheduleList.clinicDesc != null ? widget.clinicsHaveScheduleList.clinicDesc: "Test Clinic",
style: TextStyle(
fontSize: 16.0,
color:

@ -51,20 +51,19 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
),
Container(
alignment: Alignment.center,
child: Text("LiveCare Service",
child: Text(TranslationBase.of(context).livecareService,
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20.0))),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text(
"is to obtain medical advice with a specialist doctor Via a video call",
TranslationBase.of(context).livecareServiceDesc,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18.0))),
Container(
margin: EdgeInsets.only(top: 15.0),
alignment: Alignment.centerLeft,
child: Text("WHY LIVECARE?",
child: Text(TranslationBase.of(context).whyLivecare,
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20.0))),
Container(
@ -77,7 +76,7 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
width: MediaQuery.of(context).size.width * 0.72,
margin: EdgeInsets.all(10.0),
child: Text(
"No need to wait, you will get Medical consultation immediately via Video call.",
TranslationBase.of(context).livecarePoint1,
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 14.0)),
)
@ -93,7 +92,7 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
Container(
width: MediaQuery.of(context).size.width * 0.72,
margin: EdgeInsets.all(10.0),
child: Text("The doctor will see your medical file.",
child: Text(TranslationBase.of(context).docVirtualAppoIns4,
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 14.0)),
)
@ -109,7 +108,7 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
Container(
width: MediaQuery.of(context).size.width * 0.72,
margin: EdgeInsets.all(10.0),
child: Text("Free Prescription delivery service.",
child: Text(TranslationBase.of(context).docVirtualAppoIns5,
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 14.0)),
)
@ -119,7 +118,7 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
Container(
margin: EdgeInsets.only(top: 20.0),
child: Text(
"** The service is included with some insurance companies according to the terms and conditions With our best wishes for health and wellness",
TranslationBase.of(context).livecareSummary,
style: TextStyle(fontSize: 16.0))),
InkWell(
onTap: (){
@ -134,7 +133,7 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 20.0),
margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: SvgPicture.asset(
"assets/images/new-design/liveCare_logo_icon_white.svg",
width: 80),
@ -144,7 +143,7 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0),
child: Column(
children: <Widget>[
Text("Get Medical consultation immediately",
Text(TranslationBase.of(context).livecareOption1,
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.bold,
@ -152,8 +151,7 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
color: Colors.white)),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.centerLeft,
child: Text("Instant video call",
child: Text(TranslationBase.of(context).livecareOption2,
style: TextStyle(
fontSize: 18.0, color: Colors.white)),
)
@ -176,19 +174,18 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 20.0),
margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: Image.asset(
"assets/images/new-design/calendar.png",
width: 70),
),
Container(
width: MediaQuery.of(context).size.width * 0.58,
margin: EdgeInsets.fromLTRB(30.0, 30.0, 0.0, 0.0),
margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0),
child: Column(
children: <Widget>[
Container(
alignment: Alignment.centerLeft,
child: Text("Book Appointment",
child: Text(TranslationBase.of(context).livecareOption3,
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.bold,
@ -197,8 +194,7 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.centerLeft,
child: Text("Schedule Video Call",
child: Text(TranslationBase.of(context).livecareOption4,
style: TextStyle(
fontSize: 18.0, color: Colors.white)),
)

@ -5,11 +5,11 @@ import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class LiveCareHistoryCard extends StatefulWidget {
ErRequestHistoryList erRequestHistoryList;
@ -178,6 +178,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
sendInvoiceEmail(context) {
ConfirmDialog.closeAlertDialog(context);
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
service
.sendLiveCareInvoiceEmail(
widget.erRequestHistoryList.appointmentNo.toString(),
@ -189,8 +190,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
}).catchError((err) {
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
getAuthenticatedUser() async {

@ -3,9 +3,9 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryR
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class LiveCarePendingRequest extends StatefulWidget {
ErRequestHistoryList pendingERRequestHistoryList;
@ -149,19 +149,17 @@ class _LiveCarePendingRequestState extends State<LiveCarePendingRequest> {
cancelLiveCareRequest() {
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
service
.cancelLiveCareRequest(widget.pendingERRequestHistoryList.vCID, context)
.then((res) {
AppToast.showSuccessToast(
message: "LiveCare request cancelled successfully");
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
widget.getLiveCareHistory();
});
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(
message: "LiveCare request cancelled successfully");
widget.getLiveCareHistory();
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -2,8 +2,8 @@ import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsRespon
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'ClinicTimingsDialog.dart';
@ -90,9 +90,11 @@ class _State extends State<ClinicCard> {
getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) {
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
service
.getLivecareClinicTiming(patientERGetClinicsList.serviceID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
clinicsServiceTimingsResponse =
@ -129,8 +131,8 @@ class _State extends State<ClinicCard> {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
}

@ -54,6 +54,8 @@ class _clinic_listState extends State<ClinicList> {
MyInAppBrowser browser;
bool isLiveCareTypeSelected = false;
@override
void initState() {
liveCareClinicsListResponse = new LiveCareClinicsListResponse();
@ -61,7 +63,7 @@ class _clinic_listState extends State<ClinicList> {
new LiveCareScheduleClinicsListResponse();
WidgetsBinding.instance.addPostFrameCallback((_) {
openLiveCareSelectionDialog();
if (!isLiveCareTypeSelected) openLiveCareSelectionDialog();
});
getLanguageID();
@ -431,6 +433,7 @@ class _clinic_listState extends State<ClinicList> {
Navigator.pop(context);
} else {
print(value);
isLiveCareTypeSelected = true;
if (value == "immediate") {
setState(() {
currentSelectedLiveCareType = "immediate";

@ -12,7 +12,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class AskDoctorPage extends StatelessWidget {
@override

@ -20,7 +20,6 @@ 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:smart_progress_bar/smart_progress_bar.dart';
import '../../../core/model/my_balance/AdvanceModel.dart';
import 'confirm_payment_page.dart';

@ -121,7 +121,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
childAspectRatio: MediaQuery.of(context)
.size
.width /
(MediaQuery.of(context).size.height / 2.40),
(MediaQuery.of(context).size.height / 2.20),
),
itemCount: myMedicalList.length,
itemBuilder: (BuildContext context, int index) {

@ -0,0 +1,257 @@
import 'dart:async';
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/medical/PrescriptionDeliveryViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.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:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'PrescriptionOrderOverveiw.dart';
class PrescriptionDeliveryAddressPage extends StatefulWidget {
final Prescriptions prescriptions;
final List<PrescriptionReport> prescriptionReportList;
final List<PrescriptionReportEnh> prescriptionReportEnhList;
const PrescriptionDeliveryAddressPage({Key key, this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList})
: super(key: key);
@override
_PrescriptionDeliveryAddressPageState createState() =>
_PrescriptionDeliveryAddressPageState();
}
class _PrescriptionDeliveryAddressPageState
extends State<PrescriptionDeliveryAddressPage> {
AddressInfo _selectedAddress;
Completer<GoogleMapController> _controller = Completer();
CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(24.665011045779107, 46.73502189439707),
zoom: 14.4746,
);
Set<Marker> markers = new Set();
double latitude = 0;
double longitude = 0;
@override
void initState(){
super.initState();
_getCurrentLocation();
}
_getCurrentLocation() async {
await Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
latitude = value.longitude;
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
}).catchError((e) {
latitude = 24.665011045779107;
latitude = 46.73502189439707;
});
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionDeliveryViewModel>(
onModelReady: (model) => model.getCustomerInfo(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).shippingAddresss,
baseViewModel: model,
body: Container(
height: MediaQuery.of(context).size.height* 0.65,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectLocationDialog(model.addressesList);
},
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
height: 50,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(7),
color: Colors.white,
shape: BoxShape.rectangle,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Text(
getAddressName(),
),
margin: EdgeInsets.only(left: 10, right: 10),
),
),
),
Icon(
Icons.arrow_drop_down,
size: 22,
color: Colors.grey,
)
],
),
),
),
SizedBox(
height: 10,
),
_selectedAddress == null
? Container(
child: Image.asset(
projectViewModel.isArabic
? 'assets/images/pharmacy/shipping_image_ar.png'
: 'assets/images/pharmacy/shipping_image.png',
height: 300,
),
)
: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey)
),
height: 200,
child: GoogleMap(
mapType: MapType.normal,
markers: markers,
initialCameraPosition: _kGooglePlex,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
),
),
),
SizedBox(height: 10,),
Texts(TranslationBase.of(context).shippingAddresss),
SizedBox(height: 10,),
Texts('${model.user.firstName} ${model.user.lastName}'),
SizedBox(height: 10,),
Texts(_selectedAddress.address1),
SizedBox(height: 10,),
Texts(_selectedAddress.address2),
SizedBox(height: 10,),
Texts(_selectedAddress.city+" "+_selectedAddress.country),
],
),
)
],
),
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.25,
color: Colors.grey[100],
child: Column(
children: <Widget>[
Divider(),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label: TranslationBase.of(context).addNewAddress.toUpperCase(),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => LocationPage(latitude: latitude, longitude: longitude,),),
);
},
),
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label: TranslationBase.of(context).continues.toUpperCase(),
disabled: _selectedAddress==null,
backgroundColor: _selectedAddress==null?Colors.green[300]: Colors.green[700],
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
PrescriptionOrderOverview(latitude: latitude,
longitude: longitude,
prescriptionReportEnhList: widget.prescriptionReportEnhList,
prescriptionReportList:widget.prescriptionReportList,
prescriptions: widget.prescriptions,
selectedAddress: _selectedAddress,
),
),
);
},
))
],
),
)),
);
}
void confirmSelectLocationDialog(List<AddressInfo> addresses,) {
showDialog(
context: context,
child: SelectLocationDialog(
addresses: addresses,
selectedAddress: _selectedAddress,
onValueSelected: (value) {
setState(() {
_selectedAddress = value;
List latLongArr = value.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,
);
});
},
),
);
}
String getAddressName() {
if (_selectedAddress != null)
return _selectedAddress.address1;
else
return TranslationBase.of(context).selectAddress;
}
}

@ -0,0 +1,203 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
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/medical/PrescriptionDeliveryViewModel.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/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class PrescriptionOrderOverview extends StatelessWidget {
final Prescriptions prescriptions;
final List<PrescriptionReport> prescriptionReportList;
final List<PrescriptionReportEnh> prescriptionReportEnhList;
final AddressInfo selectedAddress;
final double latitude;
final double longitude;
PrescriptionOrderOverview(
{Key key,
this.prescriptions,
this.prescriptionReportList,
this.prescriptionReportEnhList, this.selectedAddress, this.latitude, this.longitude});
@override
Widget build(BuildContext context) {
return BaseView<PrescriptionDeliveryViewModel>(
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).orderOverview,
baseViewModel: model,
body: Container(
height: MediaQuery.of(context).size.height * 0.8,
child: Column(
children: [
if (!prescriptions.isInOutPatient)
...List.generate(
prescriptionReportList.length,
(index) => Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border:
Border.all(color: Colors.grey[200], width: 0.5),
),
child: Row(
children: <Widget>[
ClipRRect(
borderRadius:
BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReportList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
SizedBox(
width: 10,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(prescriptionReportList[index]
.itemDescription
.isNotEmpty
? prescriptionReportList[index]
.itemDescription
: prescriptionReportList[index]
.itemDescriptionN)),
)),
Icon(
Icons.arrow_forward_ios,
size: 18,
color: Colors.grey[500],
)
],
),
))
else
...List.generate(
prescriptionReportEnhList.length,
(index) => Container(
margin: EdgeInsets.all(8.0),
color: Colors.white,
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
SizedBox(
width: 10,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(prescriptionReportEnhList[index]
.itemDescription),
],
),
),
),
Icon(
Icons.arrow_forward_ios,
size: 18,
color: Colors.grey[500],
)
],
),
),
)
],
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.15,
color: Colors.grey[100],
child: Column(
children: <Widget>[
SizedBox(height: 12,),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: SecondaryButton(
label: TranslationBase.of(context).submit.toUpperCase(),
color: Colors.green[800],
onTap: () async {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).confirmPrescription,
okTitle: TranslationBase.of(context).ok,
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.insertDeliveryOrder(lineItemNo: 0,
longitude: longitude,
latitude: latitude,appointmentNo: prescriptions.appointmentNo,
dischargeID: prescriptions.dischargeNo,createdBy: model.user.patientID)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal)
showErrorDialog(context,model.error);
else
{
Navigator.pop(context);
Navigator.pop(context);
Navigator.pop(context);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
});
},
),
);
},
))
],
),
),
),
);
}
void showErrorDialog(BuildContext context,String error) {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).youAlreadyHaveOrder,
okTitle: TranslationBase.of(context).orderOverview,
onTap: () {
Navigator.pop(context);
Navigator.pop(context);
Navigator.pop(context);
},
),
);
}
}

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -14,12 +15,13 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../widgets/dialogs/confirm_send_email_dialog.dart';
import 'PrescriptionIDeliveryAddressPage.dart';
class PrescriptionItemsPage extends StatelessWidget {
final Prescriptions prescriptions;
PrescriptionItemsPage({Key key, this.prescriptions});
//TODO
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -181,7 +183,7 @@ class PrescriptionItemsPage extends StatelessWidget {
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.14,
height: MediaQuery.of(context).size.height * 0.25,
color: Colors.grey[100],
child: Column(
children: <Widget>[
@ -197,12 +199,24 @@ class PrescriptionItemsPage extends StatelessWidget {
loading: model.state == ViewState.BusyLocal,
),
),
if (false)
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label: TranslationBase.of(context).resendOrder,
backgroundColor: Colors.green[200],
backgroundColor: Colors.green[800],
onTap: (){
Navigator.push(
context,
FadePage(
page: PrescriptionDeliveryAddressPage(
prescriptions: prescriptions,
prescriptionReportList: model.prescriptionReportList,
prescriptionReportEnhList: model.prescriptionReportEnhList,
),
),
);
},
))
],
),

@ -1,5 +1,8 @@
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/stepsTracker.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
// import 'package:fit_kit/fit_kit.dart';
import 'package:flutter/material.dart';
class HealthDataList extends StatefulWidget {
@ -8,13 +11,30 @@ class HealthDataList extends StatefulWidget {
}
class _HealthDataListState extends State<HealthDataList> {
// List<DataType> dataTypes = List();
@override
void initState() {
// dataTypes.add(DataType.DISTANCE);
// dataTypes.add(DataType.STEP_COUNT);
// dataTypes.add(DataType.HEART_RATE);
// dataTypes.add(DataType.SLEEP);
// dataTypes.add(DataType.ENERGY);
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "Smartwatches",
isShowAppBar: true,
body: Container(
height: MediaQuery.of(context).size.height,
height: MediaQuery
.of(context)
.size
.height,
margin: EdgeInsets.all(20.0),
child: SingleChildScrollView(
child: Column(
@ -58,21 +78,31 @@ class _HealthDataListState extends State<HealthDataList> {
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Steps",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: StepsTracker(),
),
);
},
child: Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Steps",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
),
Divider(
color: Colors.grey[500],
@ -121,25 +151,68 @@ class _HealthDataListState extends State<HealthDataList> {
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.1,
height: MediaQuery
.of(context)
.size
.height * 0.1,
color: Colors.grey[100],
child: Column(
children: <Widget>[
Divider(
color: Colors.transparent,
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
onTap: () {
// launch(model.radImageURL);
},
label: 'Sync Health Data',
backgroundColor: Colors.grey[800],
),
),
InkWell(
onTap: () {
print("ReadLast");
// readLast();
},
child:Container(
height: (MediaQuery
.of(context)
.size
.height/2)*0.12,
width: MediaQuery
.of(context)
.size
.width * 0.8,
decoration: BoxDecoration(
color: Colors.grey[800],
borderRadius: BorderRadius.circular(6.0),
),
child: Container(
padding: EdgeInsets.only(top: 10.0),
child: Text(
'Sync Health Data' , textAlign: TextAlign.center,style: TextStyle(
color: Colors.white , fontSize: 18.0
),
),
),),),
],
),
));
}
}
// void readLast() async {
// print("ReadLast");
// final result = await FitKit.readLast(DataType.DISTANCE);
// print(result);
// print(result);
// }
//
// void readAll() async {
// if (await FitKit.requestPermissions(dataTypes)) {
// for (DataType type in dataTypes) {
// final results = await FitKit.read(
// type,
// dateFrom: DateTime.now().subtract(Duration(days: 7)),
// dateTo: DateTime.now(),
// limit: 100,
// );
// print(results);
// print(results.length);
// }
// readLast();
// }
// }
}

@ -3,9 +3,10 @@ import 'dart:io';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/health_data_list.dart';
import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:url_launcher/url_launcher.dart';
class SmartWatchInstructions extends StatefulWidget {
@ -88,8 +89,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Apple Watch Series 1",
"Apple Watch Series 1", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -108,8 +110,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Apple Watch Series 2",
"Apple Watch Series 2", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -135,8 +138,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Apple Watch Series 3",
"Apple Watch Series 3", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -155,8 +159,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Apple Watch Series 4",
"Apple Watch Series 4", overflow: TextOverflow.clip ,
style: TextStyle(
fontSize: 12.0)),
)
@ -182,8 +187,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Apple Watch Series 5",
"Apple Watch Series 5", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -202,8 +208,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Apple Watch Series 6",
"Apple Watch Series 6", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -229,7 +236,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 3",
width: MediaQuery.of(context).size.width*0.22,
child: Text("Mi Band 3", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -248,7 +256,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 4",
width: MediaQuery.of(context).size.width*0.22,
child: Text("Mi Band 4", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -417,9 +426,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: CarouselSlider(
carouselController: buttonCarouselController,
options: CarouselOptions(
enableInfiniteScroll: false,
viewportFraction: 0.95,
height: MediaQuery.of(context).size.height * 0.9),
// enableInfiniteScroll: true,
viewportFraction: 0.99,
height: MediaQuery.of(context).size.height*1.02 ),
items: [1, 2].map((i) {
return Builder(
builder: (BuildContext context) {
@ -427,7 +436,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
margin: EdgeInsets.only(top:16.0 , bottom: 8.0),
// fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white.withOpacity(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
@ -457,8 +467,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Huawei Watch 2",
"Huawei Watch 2", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -477,8 +488,10 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Mobovi TicWatch E2",
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -504,7 +517,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
child: Text("Huawei Watch",
width: MediaQuery.of(context).size.width*0.22,
child: Text("Huawei Watch", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -523,7 +537,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
child: Text("Fossil Sport",
width: MediaQuery.of(context).size.width*0.22,
child: Text("Fossil Sport", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -549,8 +564,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"MisFit Vapor 2",
"MisFit Vapor 2", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -569,8 +585,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"LG Watch Sport",
"LG Watch Sport", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -596,7 +613,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 3",
width: MediaQuery.of(context).size.width*0.22,
child: Text("Mi Band 3", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -615,7 +633,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 4",
width: MediaQuery.of(context).size.width*0.22,
child: Text("Mi Band 4", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -735,7 +754,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
),
Container(
margin: EdgeInsets.fromLTRB(
15.0, 95.0, 15.0, 15.0),
15.0, 75.0, 15.0, 15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
@ -796,7 +815,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
getLastPatientRecord(BuildContext context) {
SmartWatchIntegrationService service = new SmartWatchIntegrationService();
GifLoaderDialogUtils.showMyDialog(context);
service.getLastPatientRecord(context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
print(res['Med_GetPatientLastRecordList']);
setState(() {
@ -807,9 +828,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
});
} else {}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
_openHealthDataList() {

@ -84,6 +84,7 @@ class _StepsTrackerState extends State<StepsTracker>
print(res['Med_GetYearStepsTransactionsStsList']);
yearlyStepsList.clear();
res['Med_GetYearStepsTransactionsStsList'].forEach((element) {
print('in forEach');
yearlyStepsList.add(new YearlyStepsResModel.fromJson(element));
if (element['ValueSum'] != null) {
double value = element['ValueSum'];
@ -91,7 +92,7 @@ class _StepsTrackerState extends State<StepsTracker>
dataLength++;
}
});
print("innnnnnnnnnnnnnnnn");
print(avgStepsValue);
print(dataLength);
setState(() {

File diff suppressed because it is too large Load Diff

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/pages/sub_categorise_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -8,6 +9,7 @@ import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:giffy_dialog/giffy_dialog.dart';
@ -111,10 +113,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
context: context,
builder: (BuildContext context) {
return Container(
height: MediaQuery.of(context)
.size
.height *
0.89,
// height: MediaQuery.of(context)
// .size
// .height *
// 0.89,
color: Colors.white,
child: Center(
child: ListView.builder(
@ -130,7 +132,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
child: Padding(
padding:
EdgeInsets.all(
8.0),
4.0),
child: InkWell(
child: Column(
crossAxisAlignment:
@ -229,10 +231,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
.size
.width *
0.197,
height: MediaQuery.of(context)
.size
.height *
0.08,
// height: MediaQuery.of(context)
// .size
// .height *
// 0.08,
child: Center(
child: Texts(
projectViewModel.isArabic
@ -646,246 +648,260 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
(BuildContext context, int index) {
return NetworkBaseView(
baseViewModel: model,
child: Card(
color: model.parentProducts[index]
.discountName !=
null
? Color(0xffFFFF00)
: Colors.white,
elevation: 0,
shape: Border(
right: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
left: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
bottom: BorderSide(
color: Colors.grey.shade300,
width: 1,
child: InkWell(
child: Card(
color: model.parentProducts[index]
.discountName !=
null
? Color(0xffFFFF00)
: Colors.white,
elevation: 0,
shape: Border(
right: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
left: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
bottom: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
top: BorderSide(
color: Colors.grey.shade300,
width: 1,
),
),
top: BorderSide(
color: Colors.grey.shade300,
width: 1,
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft:
Radius.circular(110.0),
child: Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.only(
topLeft:
Radius.circular(110.0),
),
color: Colors.white,
),
color: Colors.white,
),
padding: EdgeInsets.symmetric(
horizontal: 0),
width: MediaQuery.of(context)
.size
.width /
3,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Stack(
children: [
if (model
.parentProducts[
index]
.discountName !=
null)
RotatedBox(
quarterTurns: 4,
child: Container(
decoration:
BoxDecoration(),
child: Padding(
padding:
EdgeInsets
.only(
right: 5.0,
top: 20.0,
bottom: 5.0,
),
child: Texts(
'offer'
.toUpperCase(),
color:
Colors.red,
fontSize: 13.0,
fontWeight:
FontWeight
.w900,
padding: EdgeInsets.symmetric(
horizontal: 0),
width: MediaQuery.of(context)
.size
.width /
3,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Stack(
children: [
if (model
.parentProducts[
index]
.discountName !=
null)
RotatedBox(
quarterTurns: 4,
child: Container(
decoration:
BoxDecoration(),
child: Padding(
padding:
EdgeInsets
.only(
right: 5.0,
top: 20.0,
bottom: 5.0,
),
child: Texts(
'offer'
.toUpperCase(),
color: Colors
.red,
fontSize:
13.0,
fontWeight:
FontWeight
.w900,
),
),
transform: new Matrix4
.rotationZ(
5.837200),
),
transform: new Matrix4
.rotationZ(
5.837200),
),
),
Container(
margin:
EdgeInsets.fromLTRB(
0, 16, 0, 0),
alignment:
Alignment.center,
child: Image.network(
model
.parentProducts[
index]
.images
.isNotEmpty
? model
.parentProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover,
height: 80,
),
),
Container(
width: model
Container(
margin: EdgeInsets
.fromLTRB(
0, 16, 0, 0),
alignment:
Alignment.center,
child: Image.network(
model
.parentProducts[
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)),
.images
.isNotEmpty
? model
.parentProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover,
height: 80,
),
),
child: Texts(
model
Container(
width: model
.parentProducts[
index]
.rxMessage !=
null
? model
.parentProducts[
index]
.rxMessage
: "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
? 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
.parentProducts[
index]
.rxMessage !=
null
? model
.parentProducts[
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: [
if (model
Container(
margin:
EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
if (model
.parentProducts[
index]
.discountName !=
null)
Container(
width: double
.infinity,
height: 13.0,
decoration:
BoxDecoration(
color: Color(
0xff5AB145),
),
child: Center(
child: Texts(
model
.parentProducts[
index]
.discountName,
regular: true,
color: Colors
.white,
fontSize:
10.4,
),
),
),
Texts(
model
.parentProducts[
index]
.discountName !=
null)
Container(
width:
double.infinity,
height: 13.0,
decoration:
BoxDecoration(
color: Color(
0xff5AB145),
),
child: Center(
child: Texts(
model
.parentProducts[
index]
.discountName,
regular: true,
color: Colors
.white,
fontSize: 10.4,
),
.name,
regular: true,
fontSize: 12,
fontWeight:
FontWeight.w700,
),
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.parentProducts[index].price}",
bold: true,
fontSize: 14,
),
),
Texts(
model
.parentProducts[
index]
.name,
regular: true,
fontSize: 12,
fontWeight:
FontWeight.w700,
),
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.parentProducts[index].price}",
bold: true,
fontSize: 14,
Row(
children: [
StarRating(
totalAverage: model
.parentProducts[
index]
.approvedRatingSum >
0
? (model.parentProducts[index].approvedRatingSum.toDouble() /
model.parentProducts[index].approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars:
true),
Texts(
"(${model.parentProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight
.w400,
)
],
),
),
Row(
children: [
StarRating(
totalAverage: model
.parentProducts[
index]
.approvedRatingSum >
0
? (model.parentProducts[index].approvedRatingSum.toDouble() /
model.parentProducts[index].approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars:
true),
Texts(
"(${model.parentProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight
.w400,
)
],
),
],
],
),
),
),
],
],
),
),
),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(
model.parentProducts[
index]),
)),
},
));
},
),
@ -898,168 +914,191 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
itemCount: model.parentProducts.length,
itemBuilder:
(BuildContext context, int index) {
return Card(
child: Row(
children: [
Stack(
children: [
Column(
children: [
Container(
decoration:
BoxDecoration(),
child: Padding(
padding:
EdgeInsets.only(
left: 9.0,
top: 8.0,
right: 10.0,
return InkWell(
child: Card(
child: Row(
children: [
Stack(
children: [
Column(
children: [
Container(
decoration:
BoxDecoration(),
child: Padding(
padding:
EdgeInsets.only(
left: 9.0,
top: 8.0,
right: 10.0,
),
),
),
),
Container(
margin:
EdgeInsets.fromLTRB(
0, 0, 0, 0),
alignment:
Alignment.center,
child: Image.network(
model
.parentProducts[
index]
.images
.isNotEmpty
? model
.parentProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain,
height: 80,
),
),
],
),
Column(
children: [
Container(
width: model
Container(
margin: EdgeInsets
.fromLTRB(
0, 0, 0, 0),
alignment:
Alignment.center,
child: Image.network(
model
.parentProducts[
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)),
.images
.isNotEmpty
? model
.parentProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain,
height: 80,
),
),
child: Texts(
model
],
),
Column(
children: [
Container(
width: model
.parentProducts[
index]
.rxMessage !=
null
? model
.parentProducts[
index]
.rxMessage
: "",
color: Colors.white,
? MediaQuery.of(
context)
.size
.width /
5
: 0,
padding:
EdgeInsets.all(4),
decoration:
BoxDecoration(
color: Color(
0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
),
child: Expanded(
child: Texts(
model
.parentProducts[
index]
.rxMessage !=
null
? model
.parentProducts[
index]
.rxMessage
: "",
color:
Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight
.w400,
),
),
),
],
),
],
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
SizedBox(
height: 4.0,
),
Container(
width: MediaQuery.of(
context)
.size
.width *
0.65,
child: Texts(
model
.parentProducts[
index]
.name,
regular: true,
fontSize: 10,
fontSize: 13.2,
fontWeight:
FontWeight.w400,
FontWeight.w500,
maxLines: 5,
),
),
SizedBox(
height: 8.0,
),
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.parentProducts[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage: model
.parentProducts[
index]
.approvedRatingSum >
0
? (model.parentProducts[index].approvedRatingSum
.toDouble() /
model
.parentProducts[index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.parentProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
),
],
),
],
),
Container(
height: 100.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 4.0,
),
Texts(
model
.parentProducts[index]
.name,
regular: true,
fontSize: 13.2,
fontWeight:
FontWeight.w500,
maxLines: 5,
),
SizedBox(
height: 8.0,
),
Padding(
padding:
const EdgeInsets.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.parentProducts[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage: model
.parentProducts[
index]
.approvedRatingSum >
0
? (model.parentProducts[index].approvedRatingSum
.toDouble() /
model
.parentProducts[index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${model.parentProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
)
],
),
],
),
),
],
],
),
),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(model
.parentProducts[index]),
)),
},
);
}),
)

@ -265,52 +265,45 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
? Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Text(
TranslationBase.of(context).description,
style: TextStyle(
fontSize: 17,
color: Colors.grey,
fontWeight: FontWeight.w600),
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
child: Text(
TranslationBase.of(context)
.description,
style: TextStyle(
fontSize: 17,
color: Colors.grey,
fontWeight: FontWeight.w600),
),
),
),
SizedBox(
height: 10,
),
Divider(height: 1, color: Colors.grey),
SizedBox(
height: 15,
),
Container(
child: Text(
languageID == 'ar'
? widget.product.fullDescriptionn
: widget.product.fullDescription ??
"",
style: TextStyle(
fontSize: 16,
fontFamily: 'WorkSans-Regular'),
SizedBox(
height: 10,
),
),
SizedBox(
height: 20,
),
// Container(
// child: Text(
// TranslationBase.of(context).howToUse,
// style: TextStyle(
// fontSize: 17,
// color: Colors.grey,
// fontWeight: FontWeight.w600),
// ),
// ),
// Divider(height: 1, color: Colors.grey),
// SizedBox(
// height: 10,
// ),
Divider(height: 1, color: Colors.grey),
SizedBox(
height: 15,
),
Container(
child: Text(
languageID == 'ar'
? widget.product.fullDescriptionn
: widget.product
.fullDescription ??
"",
style: TextStyle(
fontSize: 16,
fontFamily: 'WorkSans-Regular'),
),
),
SizedBox(
height: 20,
),
]),
)
// Container(
// child: Text(
// languageID == 'ar'
@ -352,9 +345,9 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
// fontFamily: 'WorkSans-Regular'),
// ),
// ),
],
),
)
// ],
// ),
// )
: isReviews
? BaseView<ProductDetailViewModel>(
onModelReady: (model) =>
@ -1900,7 +1893,7 @@ checkWishlist() async {
for (int i = 0; i < x.wishListItems.length; i++) {
print("---------Enad----wishlist---------------");
print(itemID);
print(x.wishListItems[i].product.id);
print(x.wishListItems[i].product.id);
if (itemID == x.wishListItems[i].product.id) {
isInWishlit = true;
// print('in wishlist');

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

Loading…
Cancel
Save