Merge branch 'development' into pharmacy-Fatima

# Conflicts:
#	lib/core/service/parmacyModule/parmacy_module_service.dart
#	lib/core/service/parmacyModule/prescription_service.dart
#	lib/pages/pharmacies/product_detail.dart
merge-update-with-lab-changes
Fatimah Alshammari 5 years ago
commit ef8312f2b8

@ -10,6 +10,7 @@
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -1,455 +1,25 @@
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.2):
- 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.0.0+4)":
- 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
- 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`)
- 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"
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: 350ba329d1641211bc6183a3236893cafdacfea7
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: 1ae40084cc6c1586ce5ad12cfc3fd38c64d05f2f
google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619
GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89
image_cropper: c8f9b4157933c7bb965a66d1c5e6c8fd408c6eb4
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd
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: 5a17be3f8af73a757fa4439c77cf6ab2db29a6e7
PODFILE CHECKSUM: d94bd40f28772938199c67fcced06ffe96096c14
COCOAPODS: 1.10.0
COCOAPODS: 1.10.1

@ -219,8 +219,7 @@
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
125A739F71A29FBAE7B4D5AC /* [CP] Embed Pods Frameworks */,
CBB18A5CEEEB971DCFC36E00 /* [CP] Copy Pods Resources */,
EFDAD5E1235DCA1DB6187148 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@ -284,23 +283,6 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
125A739F71A29FBAE7B4D5AC /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
299B8FE131E5BAE7FA7E2FC9 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@ -351,21 +333,21 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
CBB18A5CEEEB971DCFC36E00 /* [CP] Copy Pods Resources */ = {
EFDAD5E1235DCA1DB6187148 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@ -496,7 +478,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_BUNDLE_IDENTIFIER = com.hmg.smartphone;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
@ -635,7 +617,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_BUNDLE_IDENTIFIER = com.hmg.smartphone;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -668,7 +650,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_BUNDLE_IDENTIFIER = com.hmg.smartphone;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;

@ -36,40 +36,29 @@ const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege';
const WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID";
///Doctor
const GET_MY_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_RATING_NOTES =
'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
const GET_DOCTOR_RATING_DETAILS =
'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
const GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT =
'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const SEND_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT =
'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT =
'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
///
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT =
'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
@ -134,8 +123,7 @@ const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_G
///Reports
const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
const SEND_MEDICAL_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendMedicalReportEmail';
const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail';
///Rate
const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
@ -231,6 +219,8 @@ const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoice
const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions';
const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
const GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts';
//URL to get medicine and pharmacies list
const CHANNEL = 3;
const GENERAL_ID = 'Cs2020@2016\$2958';
@ -252,10 +242,8 @@ const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceD
const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList";
const GET_PATIENT_INSURANCE_DETAILS =
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
const UPLOAD_INSURANCE_CARD =
'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
@ -288,15 +276,25 @@ const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRe
const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
const GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults';
const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult';
const SEND_AVERAGE_BLOOD_SUGAR_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodSugarReport';
const DEACTIVATE_DIABETIC_STATUS = 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus';
const DEACTIVATE_BLOOD_PRESSURES_STATUS = 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus';
const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage';
const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult';
const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const UPDATE_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult';
const SEND_AVERAGE_BLOOD_WEIGHT_REPORT = 'Services/Notifications.svc/REST/SendAverageBodyWeightReport';
const SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport';
const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult';
const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult';
const DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus';
const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID';
const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult';
@ -308,8 +306,11 @@ const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies';
// H2O
const H2O_GET_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New";
const H2O_UPDATE_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New";
const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress";
const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity";
const H2O_UNDO_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity";
//E_Referral Services
const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes";
@ -323,14 +324,17 @@ const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
// pharmacy
const PHARMACY_VERIFY_CUSTOMER = "epharmacy/api/VerifyCustomer";
const PHARMACY_GET_COUNTRY = "epharmacy/api/countries";
const PHARMACY_AUTORZIE_CUSTOMER = "epharmacy/api/AutorizeCustomer";
const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer";
const PHARMACY_GET_COUNTRY = "countries";
const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer";
const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners";
const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer";
const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts";
const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/";
const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/";
const GET_PHARMACY_BANNER = "promotionbanners";
const GET_PHARMACY_TOP_MANUFACTURER = "topmanufacturer";
const GET_PHARMACY_BEST_SELLER_PRODUCT = "bestsellerproducts";
const GET_PHARMACY_PRODUCTs_BY_IDS = "productsbyids/";
const GET_PHARMACY_PRODUCTs_BY_SKU = "productbysku/";
const GET_CUSTOMERS_ADDRESSES = "Customers/";
const SUBSCRIBE_PRODUCT = "subscribe?";
const GET_ORDER = "orders?";
const GET_ORDER_DETAILS = "orders/";
const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress";
@ -339,26 +343,18 @@ const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress";
const GET_ADDRESS = "Customers/";
const GET_Cancel_ORDER = "cancelorder/";
const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8";
const GET_SHOPPING_CART = "epharmacy/api/shopping_cart_items/";
const GET_SHIPPING_OPTIONS = "epharmacy/api/get_shipping_option/";
const GET_SHOPPING_CART = "shopping_cart_items/";
const GET_SHIPPING_OPTIONS = "get_shipping_option/";
const DELETE_SHOPPING_CART = "epharmacy/api/delete_shopping_cart_items/";
const DELETE_SHOPPING_CART_ALL =
"epharmacy/api/delete_shopping_cart_item_by_customer/";
const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/";
const ORDER_SHOPPING_CART = "epharmacy/api/orders";
const GET_LACUM_ACCOUNT_INFORMATION =
"Services/Patients.svc/REST/GetLakumAccountInformation";
const GET_LACUM_GROUP_INFORMATION =
"Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
const LACUM_ACCOUNT_ACTIVATE =
"Services/Patients.svc/REST/LakumAccountActivation";
const LACUM_ACCOUNT_DEACTIVATE =
"Services/Patients.svc/REST/LakumAccountDeactivation";
const CREATE_LAKUM_ACCOUNT =
"Services/Patients.svc/REST/PHR_CreateLakumAccount";
const TRANSFER_YAHALA_LOYALITY_POINTS =
"Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation";
const GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
const LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation";
const LACUM_ACCOUNT_DEACTIVATE = "Services/Patients.svc/REST/LakumAccountDeactivation";
const CREATE_LAKUM_ACCOUNT = "Services/Patients.svc/REST/PHR_CreateLakumAccount";
const TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
@ -369,15 +365,13 @@ const PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_Updat
const GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder";
const GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems";
const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS =
'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ =
'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
const GET_PATIENT_ALL_PRES_ORD =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const PATIENT_ER_INSERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
const GET_PATIENT_ALL_PRES_ORD = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const PATIENT_ER_INSERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews';
const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
//Pharmacy wishlist
const GET_WISHLIST = "shopping_cart_items/";
@ -391,39 +385,32 @@ const GET_SPECIFICATION = "productspecification/";
const GET_BRAND_ITEMS = "products?ManufacturerId=";
// 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 = "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";
//Pharmacy
const GET_PHARMACY_CATEGORISE =
'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0';
const GET_OFFERS_CATEGORISE = 'epharmacy/api/discountcategories';
const GET_OFFERS_PRODUCTS = 'epharmacy/api/offerproducts/';
const GET_CATEGORISE_PARENT =
'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_PARENT_PRODUCTS = 'epharmacy/api/products?categoryid=';
const GET_SUB_CATEGORISE =
'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_SUB_PRODUCTS = 'epharmacy/api/products?categoryid=';
const GET_PHARMACY_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0';
const GET_OFFERS_CATEGORISE = 'discountcategories';
const GET_OFFERS_PRODUCTS = 'offerproducts/';
const GET_CATEGORISE_PARENT = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_PARENT_PRODUCTS = 'products?categoryid=';
const GET_SUB_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_SUB_PRODUCTS = 'products?categoryid=';
const GET_FINAL_PRODUCTS =
'epharmacy/api/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=';
'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 TIMER_MIN = 10;
const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw";
const GET_BRANDS_LIST = 'epharmacy/api/categoryManufacturer?categoryids=';
const GET_BRANDS_LIST = 'categoryManufacturer?categoryids=';
const GET_SEARCH_PRODUCTS =
'epharmacy/api/searchproducts?fields=id,discount_ids,reviews,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&search_key=';
'searchproducts?fields=id,discount_ids,reviews,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&search_key=';
const SCAN_QR_CODE = 'epharmacy/api/productbysku/';
const SCAN_QR_CODE = 'productbysku/';
class AppGlobal {
static var context;

File diff suppressed because it is too large Load Diff

@ -26,3 +26,4 @@ const WEATHER = 'weather';
const BLOOD_TYPE = 'blood-type';
const NOTIFICATION_COUNT = 'notification-count';
const PHARMACY_SELECTED_ADDRESS = 'selected-address';
const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN';

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
enum Ambulate { Wheelchair, Walker, Stretcher, None }
@ -6,19 +7,19 @@ extension SelectedAmbulate on Ambulate {
String getAmbulateTitle(BuildContext context) {
switch (this) {
case Ambulate.Wheelchair:
return 'Wheelchair';
return TranslationBase.of(context).wheelchair;
break;
case Ambulate.Walker:
return 'Walker';
return TranslationBase.of(context).walker;
break;
case Ambulate.Stretcher:
return 'Stretcher';
return TranslationBase.of(context).stretcher;
break;
case Ambulate.None:
return 'None';
return TranslationBase.of(context).none;
break;
}
return 'None';
return TranslationBase.of(context).none;
}
int selectAmbulateNumber() {

@ -0,0 +1,104 @@
class UserDetailModel {
int userID;
int patientID;
int patientType;
bool patientOutSA;
String firstName;
String middleName;
String lastName;
String firstNameN;
String middleNameN;
String lastNameN;
String identificationNo;
String mobile;
String emailID;
String zipCode;
String dOB;
String gender;
int activityID;
String createdDate;
double height;
double weight;
bool isHeightInCM;
bool isWeightInKG;
bool isNotificationON;
UserDetailModel(
{this.userID,
this.patientID,
this.patientType,
this.patientOutSA,
this.firstName,
this.middleName,
this.lastName,
this.firstNameN,
this.middleNameN,
this.lastNameN,
this.identificationNo,
this.mobile,
this.emailID,
this.zipCode,
this.dOB,
this.gender,
this.activityID,
this.createdDate,
this.height,
this.weight,
this.isHeightInCM,
this.isWeightInKG,
this.isNotificationON});
UserDetailModel.fromJson(Map<String, dynamic> json) {
userID = json['UserID'];
patientID = json['PatientID'];
patientType = json['PatientType'];
patientOutSA = json['PatientOutSA'];
firstName = json['FirstName'];
middleName = json['MiddleName'];
lastName = json['LastName'];
firstNameN = json['FirstNameN'];
middleNameN = json['MiddleNameN'];
lastNameN = json['LastNameN'];
identificationNo = json['IdentificationNo'];
mobile = json['Mobile'];
emailID = json['EmailID'];
zipCode = json['ZipCode'];
dOB = json['DOB'];
gender = json['Gender'];
activityID = json['ActivityID'];
createdDate = json['CreatedDate'];
height = json['Height'];
weight = json['Weight'];
isHeightInCM = json['IsHeightInCM'];
isWeightInKG = json['IsWeightInKG'];
isNotificationON = json['IsNotificationON'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['UserID'] = this.userID;
data['PatientID'] = this.patientID;
data['PatientType'] = this.patientType;
data['PatientOutSA'] = this.patientOutSA;
data['FirstName'] = this.firstName;
data['MiddleName'] = this.middleName;
data['LastName'] = this.lastName;
data['FirstNameN'] = this.firstNameN;
data['MiddleNameN'] = this.middleNameN;
data['LastNameN'] = this.lastNameN;
data['IdentificationNo'] = this.identificationNo;
data['Mobile'] = this.mobile;
data['EmailID'] = this.emailID;
data['ZipCode'] = this.zipCode;
data['DOB'] = this.dOB;
data['Gender'] = this.gender;
data['ActivityID'] = this.activityID;
data['CreatedDate'] = this.createdDate;
data['Height'] = this.height;
data['Weight'] = this.weight;
data['IsHeightInCM'] = this.isHeightInCM;
data['IsWeightInKG'] = this.isWeightInKG;
data['IsNotificationON'] = this.isNotificationON;
return data;
}
}

@ -0,0 +1,124 @@
class UserDetailRequestModel {
String activityID;
int channel;
int deviceTypeID;
String dOB;
String email;
String firstName;
String gender;
String generalid;
double height;
String identificationNo;
String iPAdress;
bool isDentalAllowedBackend;
bool isHeightInCM;
bool isNotificationOn;
bool isWeightInKG;
int languageID;
String lastName;
String middleName;
String mobileNumber;
int patientID;
int patientOutSA;
int patientType;
int patientTypeID;
String sessionID;
String tokenID;
double versionID;
double weight;
String zipCode;
UserDetailRequestModel(
{this.activityID,
this.channel,
this.deviceTypeID,
this.dOB,
this.email,
this.firstName,
this.gender,
this.generalid,
this.height,
this.identificationNo,
this.iPAdress,
this.isDentalAllowedBackend,
this.isHeightInCM,
this.isNotificationOn,
this.isWeightInKG,
this.languageID,
this.lastName,
this.middleName,
this.mobileNumber,
this.patientID,
this.patientOutSA,
this.patientType,
this.patientTypeID,
this.sessionID,
this.tokenID,
this.versionID,
this.weight,
this.zipCode});
UserDetailRequestModel.fromJson(Map<String, dynamic> json) {
activityID = json['ActivityID'];
channel = json['Channel'];
deviceTypeID = json['DeviceTypeID'];
dOB = json['DOB'];
email = json['Email'];
firstName = json['FirstName'];
gender = json['Gender'];
generalid = json['generalid'];
height = json['Height'];
identificationNo = json['IdentificationNo'];
iPAdress = json['IPAdress'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
isHeightInCM = json['IsHeightInCM'];
isNotificationOn = json['isNotificationOn'];
isWeightInKG = json['IsWeightInKG'];
languageID = json['LanguageID'];
lastName = json['LastName'];
middleName = json['MiddleName'];
mobileNumber = json['MobileNumber'];
patientID = json['PatientID'];
patientOutSA = json['PatientOutSA'];
patientType = json['PatientType'];
patientTypeID = json['PatientTypeID'];
sessionID = json['SessionID'];
tokenID = json['TokenID'];
versionID = json['VersionID'];
weight = json['Weight'];
zipCode = json['ZipCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ActivityID'] = this.activityID;
data['Channel'] = this.channel;
data['DeviceTypeID'] = this.deviceTypeID;
data['DOB'] = this.dOB;
data['Email'] = this.email;
data['FirstName'] = this.firstName;
data['Gender'] = this.gender;
data['generalid'] = this.generalid;
data['Height'] = this.height;
data['IdentificationNo'] = this.identificationNo;
data['IPAdress'] = this.iPAdress;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['IsHeightInCM'] = this.isHeightInCM;
data['isNotificationOn'] = this.isNotificationOn;
data['IsWeightInKG'] = this.isWeightInKG;
data['LanguageID'] = this.languageID;
data['LastName'] = this.lastName;
data['MiddleName'] = this.middleName;
data['MobileNumber'] = this.mobileNumber;
data['PatientID'] = this.patientID;
data['PatientOutSA'] = this.patientOutSA;
data['PatientType'] = this.patientType;
data['PatientTypeID'] = this.patientTypeID;
data['SessionID'] = this.sessionID;
data['TokenID'] = this.tokenID;
data['VersionID'] = this.versionID;
data['Weight'] = this.weight;
data['ZipCode'] = this.zipCode;
return data;
}
}

@ -17,7 +17,7 @@ class DiabtecPatientResult {
int patientID;
var remark;
var resultDesc;
int resultValue;
dynamic resultValue;
String unit;
var weekAverageResult;
String weekDesc;

@ -1,7 +1,7 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class WeekDiabtectResultAverage {
int dailyAverageResult;
dynamic dailyAverageResult;
DateTime dateChart;
WeekDiabtectResultAverage({this.dailyAverageResult, this.dateChart});

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart';
@ -10,8 +12,66 @@ class H2OService extends BaseService {
List<UserProgressForTodayDataModel> userProgressForTodayDataList = List();
List<UserProgressForWeekDataModel> userProgressForWeekDataList = List();
List<UserProgressForMonthDataModel> userProgressForMonthDataList = List();
UserProgressRequestModel userProgressRequestModel =
UserProgressRequestModel();
UserProgressRequestModel userProgressRequestModel = UserProgressRequestModel();
UserDetailModel userDetailModel = UserDetailModel();
Future getUserDetail() async {
userProgressRequestModel.progress = 1;
userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1);
userProgressRequestModel.identificationNo = user.patientIdentificationNo;
hasError = false;
await baseAppClient.post(H2O_GET_USER_DETAIL, onSuccess: (dynamic response, int statusCode) {
userDetailModel = UserDetailModel.fromJson(response["UserDetailData_New"]);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: userProgressRequestModel.toJson());
}
Future updateUserDetail(UserDetailModel userDetail) async {
userProgressRequestModel.progress = 1;
userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1);
userProgressRequestModel.identificationNo = user.patientIdentificationNo;
UserDetailRequestModel _requestModel = UserDetailRequestModel();
_requestModel.activityID = userDetail.activityID.toString();
_requestModel.channel = userProgressRequestModel.channel;
_requestModel.dOB = userDetail.dOB;
_requestModel.deviceTypeID = userProgressRequestModel.deviceTypeID;
_requestModel.email = userDetail.emailID;
_requestModel.firstName = userDetail.firstName;
_requestModel.gender = userDetail.gender;
_requestModel.height = userDetail.height;
_requestModel.iPAdress = userProgressRequestModel.iPAdress;
_requestModel.identificationNo = userProgressRequestModel.identificationNo;
_requestModel.isHeightInCM = userDetail.isHeightInCM;
_requestModel.isWeightInKG = userDetail.isWeightInKG;
_requestModel.languageID = userProgressRequestModel.languageID;
_requestModel.mobileNumber = userProgressRequestModel.mobileNumber;
_requestModel.patientID = userProgressRequestModel.patientID;
_requestModel.patientOutSA = userProgressRequestModel.patientOutSA;
_requestModel.patientType = userProgressRequestModel.patientType;
_requestModel.patientTypeID = userProgressRequestModel.patientOutSA;
_requestModel.sessionID = userProgressRequestModel.sessionID;
_requestModel.tokenID = userProgressRequestModel.tokenID;
_requestModel.versionID = userProgressRequestModel.versionID;
_requestModel.zipCode = userDetail.zipCode;
_requestModel.weight = userDetail.weight;
_requestModel.generalid = userProgressRequestModel.generalid;
_requestModel.isDentalAllowedBackend = userProgressRequestModel.isDentalAllowedBackend;
_requestModel.isNotificationOn = userDetail.isNotificationON;
hasError = false;
await baseAppClient.post(H2O_UPDATE_USER_DETAIL, onSuccess: (dynamic response, int statusCode) {
userDetailModel = userDetail;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestModel.toJson());
}
Future getUserProgressForTodayData() async {
userProgressRequestModel.progress = 1;
@ -19,12 +79,10 @@ class H2OService extends BaseService {
userProgressRequestModel.identificationNo = user.patientIdentificationNo;
hasError = false;
await baseAppClient.post(H2O_GET_USER_PROGRESS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(H2O_GET_USER_PROGRESS, onSuccess: (dynamic response, int statusCode) {
userProgressForTodayDataList.clear();
response['UserProgressForTodayData'].forEach((progressData) {
userProgressForTodayDataList
.add(UserProgressForTodayDataModel.fromJson(progressData));
userProgressForTodayDataList.add(UserProgressForTodayDataModel.fromJson(progressData));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -38,16 +96,15 @@ class H2OService extends BaseService {
userProgressRequestModel.identificationNo = super.user.patientIdentificationNo;
hasError = false;
await baseAppClient.post(H2O_GET_USER_PROGRESS,
onSuccess: (dynamic response, int statusCode) {
userProgressForTodayDataList.clear();
response['UserProgressForWeekData'].forEach((hospital) {
userProgressForWeekDataList.add(UserProgressForWeekDataModel.fromJson(hospital));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: userProgressRequestModel.toJson());
await baseAppClient.post(H2O_GET_USER_PROGRESS, onSuccess: (dynamic response, int statusCode) {
userProgressForWeekDataList.clear();
response['UserProgressForWeekData'].forEach((hospital) {
userProgressForWeekDataList.add(UserProgressForWeekDataModel.fromJson(hospital));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: userProgressRequestModel.toJson());
}
Future getUserProgressForMonthData() async {
@ -56,8 +113,7 @@ class H2OService extends BaseService {
userProgressRequestModel.identificationNo = super.user.patientIdentificationNo;
hasError = false;
await baseAppClient.post(H2O_GET_USER_PROGRESS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(H2O_GET_USER_PROGRESS, onSuccess: (dynamic response, int statusCode) {
userProgressForMonthDataList.clear();
response['UserProgressForMonthData'].forEach((hospital) {
userProgressForMonthDataList.add(UserProgressForMonthDataModel.fromJson(hospital));
@ -68,22 +124,33 @@ class H2OService extends BaseService {
}, body: userProgressRequestModel.toJson());
}
Future insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async {
hasError = false;
await baseAppClient.post(H2O_INSERT_USER_ACTIVITY, onSuccess: (dynamic response, int statusCode) {
userProgressForTodayDataList.clear();
response['UserProgressForTodayData'].forEach((progressData) {
userProgressForTodayDataList.add(UserProgressForTodayDataModel.fromJson(progressData));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: insertUserActivityRequestModel.toJson());
}
Future undoUserActivity() async {
userProgressRequestModel.progress = 1;
userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1);
userProgressRequestModel.identificationNo = user.patientIdentificationNo;
hasError = false;
await baseAppClient.post(H2O_INSERT_USER_ACTIVITY,
onSuccess: (dynamic response, int statusCode) {
userProgressForTodayDataList.clear();
response['UserProgressForTodayData'].forEach((progressData) {
userProgressForTodayDataList
.add(UserProgressForTodayDataModel.fromJson(progressData));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: insertUserActivityRequestModel.toJson());
await baseAppClient.post(H2O_UNDO_USER_ACTIVITY, onSuccess: (dynamic response, int statusCode) {
userProgressForTodayDataList.clear();
response['UserProgressForTodayData'].forEach((progressData) {
userProgressForTodayDataList.add(UserProgressForTodayDataModel.fromJson(progressData));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: userProgressRequestModel.toJson());
}
}

@ -43,7 +43,7 @@ class CustomerAddressesService extends BaseService {
'fields':'addresses'
};
hasError = false;
await baseAppClient.get("$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}",
await baseAppClient.getPharmacy("$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.get(GET_CUSTOMER_INFO,
await baseAppClient.getPharmacy(GET_CUSTOMER_INFO,
onSuccess: (dynamic response, int statusCode) {
customerInfo= CustomerInfo.fromJson(response);
}, onFailure: (String error, int statusCode) {

@ -195,7 +195,7 @@ class BaseAppClient {
get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams,
Map<String, dynamic> queryParams,
bool isExternal = false}) async {
String url;
if (isExternal) {
@ -236,19 +236,41 @@ class BaseAppClient {
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
Map<String, String> queryParams}) async {
String url = PHARMACY_BASE_URL + endPoint;
bool isExternal = false,
Map<String, dynamic> queryParams}) async {
String url;
if (isExternal) {
url = endPoint;
} else {
url = PHARMACY_BASE_URL + endPoint;
}
if (queryParams != null) {
String queryString = Uri(queryParameters: queryParams).query;
url += '?' + queryString;
}
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'
'Accept': 'application/json',
'Authorization': token,
'Mobilenumber': user['MobileNumber'].toString(),
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(),
});
final int statusCode = response.statusCode;
print("statusCode :$statusCode");

@ -68,6 +68,19 @@ class BloodPressureService extends BaseService {
super.error = error;
}, body: Map());
}
Future sendReportByEmail() async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['to'] = user.emailAddress;
await baseAppClient.post(SEND_AVERAGE_BLOOD_PRESSURE_REPORT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
addDiabtecResult(
{String bloodPressureDate,
@ -93,4 +106,43 @@ class BloodPressureService extends BaseService {
super.error = error;
}, body: body);
}
updateDiabtecResult(
{String bloodPressureDate,
String diastolicPressure,
String systolicePressure,
int measuredArm}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['BloodPressureDate'] = bloodPressureDate;
body['DiastolicPressure'] = diastolicPressure;
body['SystolicePressure'] = systolicePressure;
body['MeasuredArm'] ='$measuredArm';
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_BLOOD_PRESSURE_RESULT,
onSuccess: (response, statusCode) async {
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future deactivateDiabeticStatus({int lineItemNo }) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['LineItemNo'] =lineItemNo;
await baseAppClient.post(DEACTIVATE_BLOOD_PRESSURES_STATUS,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -24,6 +24,11 @@ class BloodSugarService extends BaseService {
monthDiabtectResultAverageList.clear();
weekDiabtectResultAverageList.clear();
yearDiabtecResultAverageList.clear();
monthDiabtecPatientResult.clear();
weekDiabtecPatientResult.clear();
yearDiabtecPatientResult.clear();
response['List_MonthDiabtectResultAverage'].forEach((item) {
monthDiabtectResultAverageList
.add(MonthDiabtectResultAverage.fromJson(item));
@ -69,28 +74,66 @@ class BloodSugarService extends BaseService {
}, body: Map());
}
addDiabtecResult(
{String bloodSugerDateChart,
String bloodSugerResult,
String diabtecUnit,
int measuredTime}) async {
addDiabtecResult({String bloodSugerDateChart, String bloodSugerResult, String diabtecUnit, int measuredTime}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['BloodSugerDateChart'] = bloodSugerDateChart;
body['BloodSugerResult'] = bloodSugerResult;
body['DiabtecUnit'] = diabtecUnit;
body['MeasuredTime'] =2;// measuredTime;
body['MeasuredTime'] = measuredTime+1;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(ADD_DIABTEC_RESULT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
await baseAppClient.post(ADD_BLOOD_PRESSURE_RESULT,
onSuccess: (response, statusCode) async {
var asd ="";
},
updateDiabtecResult({DateTime month,DateTime hour,String bloodSugerResult,String diabtecUnit, int measuredTime,int lineItemNo}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['BloodSugerResult'] = bloodSugerResult;
body['DiabtecUnit'] = diabtecUnit;
body['BloodSugerDateChart'] = '${month.year}-${month.month}-${month.day} ${hour.hour}:${hour.minute}:00';
body['isDentalAllowedBackend'] = false;
body['MeasuredTime'] = measuredTime+1;
body['LineItemNo'] = lineItemNo;
await baseAppClient.post(UPDATE_DIABETIC_RESULT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future sendReportByEmail() async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['to'] = user.emailAddress;
await baseAppClient.post(SEND_AVERAGE_BLOOD_SUGAR_REPORT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future deactivateDiabeticStatus({int lineItemNo }) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['LineItemNo'] =lineItemNo;
await baseAppClient.post(DEACTIVATE_DIABETIC_STATUS,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -6,11 +6,13 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/weight/YearWeightMeas
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class WeightService extends BaseService {
///Average
List<MonthWeightMeasurementResultAverage> monthWeightMeasurementResultAverage = List();
List<WeekWeightMeasurementResultAverage> weekWeightMeasurementResultAverage = List();
List<YearWeightMeasurementResultAverage> yearWeightMeasurementResultAverage = List();
List<MonthWeightMeasurementResultAverage>
monthWeightMeasurementResultAverage = List();
List<WeekWeightMeasurementResultAverage> weekWeightMeasurementResultAverage =
List();
List<YearWeightMeasurementResultAverage> yearWeightMeasurementResultAverage =
List();
///Result
List<WeightMeasurementResult> monthWeightMeasurementResult = List();
@ -59,7 +61,8 @@ class WeightService extends BaseService {
});
response['List_MonthWeightMeasurementResult'].forEach((item) {
monthWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item));
monthWeightMeasurementResult
.add(WeightMeasurementResult.fromJson(item));
});
response['List_YearWeightMeasurementResult'].forEach((item) {
@ -72,9 +75,7 @@ class WeightService extends BaseService {
}
addWeightResult(
{String weightDate,
String weightMeasured,
int weightUnit}) async {
{String weightDate, String weightMeasured, int weightUnit}) async {
hasError = false;
super.error = "";
@ -85,9 +86,53 @@ class WeightService extends BaseService {
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(ADD_WEIGHT_PRESSURE_RESULT,
onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
updateWeightResult({int lineItemNo, int weightUnit,String weightMeasured,String weightDate}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['LineItemNo'] = lineItemNo;
body['weightUnit'] = '$weightUnit';
body['WeightMeasured'] = weightMeasured;
body['WeightDate'] = weightDate;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_WEIGHT_PRESSURE_RESULT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future sendReportByEmail() async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['to'] = user.emailAddress;
await baseAppClient.post(SEND_AVERAGE_BLOOD_WEIGHT_REPORT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
deleteWeightResult({int lineItemNo, }) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['LineItemNo'] = lineItemNo;
body['isDentalAllowedBackend'] = false;
},
await baseAppClient.post(DEACTIVATE_WEIGHT_PRESSURE_RESULT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
@ -23,11 +24,11 @@ class MyBalanceService extends BaseService {
PatientInfoAndMobileNumber patientInfoAndMobileNumber;
String logInTokenID;
String verificationCode;
String updatedRegisterBloodMessage = "";
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
MyBalanceService(){
MyBalanceService() {
getFamilyFiles();
}
@ -156,4 +157,49 @@ class MyBalanceService extends BaseService {
return await getSharedRecordByStatus();
}
}
Future updateBloodGroup(List_BloodGroupDetailsModel detailsModel) async {
hasError = false;
await getUser();
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Map<String, dynamic> body = Map();
body['City'] = detailsModel.city;
body['cityCode'] = detailsModel.cityCode;
body['Gender'] = detailsModel.gender;
body['BloodGroup'] = detailsModel.bloodGroup;
body['CellNumber'] = user.mobileNumber;
body['LanguageID'] = languageID;
body['NationalID'] = user.nationalityID;
body['ZipCode'] = user.zipCode ?? "+966";
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(BLOOD_DONATION_REGISTER_BLOOD_TYPE,
onSuccess: (dynamic response, int statusCode) {
updatedRegisterBloodMessage = response['ErrorEndUserMessage'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
if(error == null){
super.error = "Something went wrong";
}
}, body: body);
}
Future addUserAgreementForBloodDonation() async {
hasError = false;
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Map<String, dynamic> body = Map();
body['IsAgreed'] = true;
body['LanguageID'] = languageID;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(ADD_USER_AGREEMENT_FOR_BLOOD_DONATION,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -21,7 +21,7 @@ class OffersCategoriseService extends BaseService {
Future getOffersCategorise() async {
hasError = false;
_offersList.clear();
await baseAppClient.get(
await baseAppClient.getPharmacy(
GET_OFFERS_CATEGORISE,
onSuccess: (dynamic response, int statusCode) {
response['categories'].forEach((item) {
@ -40,7 +40,7 @@ class OffersCategoriseService extends BaseService {
_offerProducts.clear();
String endPoint =
id != null ? GET_OFFERS_PRODUCTS + "$id" : GET_OFFERS_PRODUCTS + "1";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {

@ -21,7 +21,7 @@ class OrderPreviewService extends BaseService {
Map<String, String> queryParams = {'fields': 'addresses'};
hasError = false;
try {
await baseAppClient.get("$GET_CUSTOMERS_ADDRESSES$customerId",
await baseAppClient.getPharmacy("$GET_CUSTOMERS_ADDRESSES$customerId",
onSuccess: (dynamic response, int statusCode) {
addresses.clear();
response['customers'][0]['addresses'].forEach((item) {
@ -42,7 +42,7 @@ class OrderPreviewService extends BaseService {
dynamic localRes;
hasError = false;
try {
await baseAppClient.get("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}",
await baseAppClient.getPharmacy("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}",
onSuccess: (dynamic response, int statusCode) {
localRes = response['shipping_option'][0];
}, onFailure: (String error, int statusCode) {
@ -61,7 +61,7 @@ class OrderPreviewService extends BaseService {
dynamic localRes;
hasError = false;
try {
await baseAppClient.get("$GET_SHOPPING_CART$customerId",
await baseAppClient.getPharmacy("$GET_SHOPPING_CART$customerId",
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
@ -125,7 +125,7 @@ class OrderPreviewService extends BaseService {
super.error = "";
dynamic localRes;
await baseAppClient.get("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart",
await baseAppClient.getPharmacy("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart",
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {

@ -6,31 +6,29 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
class PharmacyModuleService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences();
bool isFinished = true;
bool hasError = false;
String errorMsg = '';
String url ="";
String url = "";
List<PharmacyImageObject> bannerItems = List();
List<Manufacturer> manufacturerList = List();
List<PharmacyProduct> bestSellerProducts = List();
List<PharmacyProduct> lastVisitedProducts = List();
Future makeVerifyCustomer(dynamic data) async {
Map<String, String> queryParams = {'FileNumber': data['PatientID'].toString()};
Map<String, String> queryParams = {
'FileNumber': data['PatientID'].toString()
};
hasError = false;
try {
await baseAppClient.get(PHARMACY_VERIFY_CUSTOMER,
await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER,
onSuccess: (dynamic response, int statusCode) {
if (response['UserName'] != null) {
sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
sharedPref.setString(
PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
print(response);
} else {
createUser();
@ -61,8 +59,31 @@ class PharmacyModuleService extends BaseService {
hasError = false;
try {
await baseAppClient.get(PHARMACY_CREATE_CUSTOMER,
onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) async {
if (!response['IsRegistered']) {}
await generatePharmacyToken();
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
} catch (error) {
throw error;
}
}
Future generatePharmacyToken() async {
Map<String, String> queryParams = {
'Filenumber': user.patientID.toString(),
'MobileNumber': user.mobileNumber,
};
hasError = false;
try {
await baseAppClient.get(PHARMACY_AUTORZIE_CUSTOMER,
onSuccess: (dynamic response, int statusCode) async {
if (response['Status'] == 200) {
await sharedPref.setString(
PHARMACY_AUTORZIE_TOKEN, response['token'].toString());
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -75,7 +96,7 @@ class PharmacyModuleService extends BaseService {
Future getBannerListList() async {
hasError = false;
try {
await baseAppClient.get(GET_PHARMACY_BANNER,
await baseAppClient.getPharmacy(GET_PHARMACY_BANNER,
onSuccess: (dynamic response, int statusCode) {
bannerItems.clear();
response['images'].forEach((item) {
@ -93,12 +114,12 @@ class PharmacyModuleService extends BaseService {
Future getTopManufacturerList() async {
Map<String, String> queryParams = {'page': '1', 'limit': '8'};
try {
await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER,
await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER,
onSuccess: (dynamic response, int statusCode) {
manufacturerList.clear();
response['manufacturer'].forEach((item) {
Manufacturer manufacturer = Manufacturer.fromJson(item);
if(manufacturer.image != null){
if (manufacturer.image != null) {
manufacturerList.add(Manufacturer.fromJson(item));
}
});
@ -117,7 +138,7 @@ class PharmacyModuleService extends BaseService {
'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.get(GET_PHARMACY_BEST_SELLER_PRODUCT,
await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT,
onSuccess: (dynamic response, int statusCode) {
bestSellerProducts.clear();
response['products'].forEach((item) {
@ -139,8 +160,9 @@ class PharmacyModuleService extends BaseService {
lastVisited =
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
try {
await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
onSuccess: (dynamic response, int statusCode) {
await baseAppClient
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
onSuccess: (dynamic response, int statusCode) {
lastVisitedProducts.clear();
response['products'].forEach((item) {
lastVisitedProducts.add(PharmacyProduct.fromJson(item));
@ -154,5 +176,4 @@ class PharmacyModuleService extends BaseService {
}
}
}
}

@ -38,9 +38,15 @@ class PrescriptionService extends BaseService {
url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url);
hasError = false;
<<<<<<< HEAD
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(PRESCRIPTION,
=======
url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url);
await baseAppClient.post(url,
>>>>>>> development
onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((prescriptions) {

@ -56,7 +56,7 @@ class PharmacyCategoriseService extends BaseService {
Future getCategorise() async {
hasError = false;
_categoriseList.clear();
await baseAppClient.get(
await baseAppClient.getPharmacy(
GET_PHARMACY_CATEGORISE,
onSuccess: (dynamic response, int statusCode) {
response['categories'].forEach((item) {
@ -74,7 +74,7 @@ class PharmacyCategoriseService extends BaseService {
hasError = false;
_scanList.clear();
String endPoint = id != null ? SCAN_QR_CODE + "$id" : SCAN_QR_CODE + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
@ -94,7 +94,7 @@ class PharmacyCategoriseService extends BaseService {
String endPoint = productName != null
? GET_SEARCH_PRODUCTS + "$productName" + '&language_id=1'
: GET_SEARCH_PRODUCTS + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
@ -111,7 +111,7 @@ class PharmacyCategoriseService extends BaseService {
Future getBrands() async {
hasError = false;
_brandsList.clear();
await baseAppClient.get(
await baseAppClient.getPharmacy(
GET_BRANDS_LIST,
onSuccess: (dynamic response, int statusCode) {
response['manufacturer'].forEach((item) {
@ -130,7 +130,7 @@ class PharmacyCategoriseService extends BaseService {
_parentCategoriseList.clear();
String endPoint =
id != null ? GET_CATEGORISE_PARENT + "$id" : GET_CATEGORISE_PARENT + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['categories'].forEach((item) {
@ -150,7 +150,7 @@ class PharmacyCategoriseService extends BaseService {
String endPoint = id != null
? GET_PARENT_PRODUCTS + "$id" + '&page=1&limit=50'
: GET_PARENT_PRODUCTS + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
@ -170,7 +170,7 @@ class PharmacyCategoriseService extends BaseService {
String endPoint =
id != null ? GET_SUB_CATEGORISE + "$id" : GET_SUB_CATEGORISE + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['categories'].forEach((item) {
@ -190,7 +190,7 @@ class PharmacyCategoriseService extends BaseService {
String endPoint = id != null
? GET_SUB_PRODUCTS + "$id" + '&page=1&limit=50'
: GET_SUB_PRODUCTS + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
@ -209,7 +209,7 @@ class PharmacyCategoriseService extends BaseService {
_finalProducts.clear();
String endPoint =
id != null ? GET_FINAL_PRODUCTS + "$id" : GET_FINAL_PRODUCTS + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {

@ -0,0 +1,18 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class TermsConditionsService extends BaseService {
String userAgreementContent = "";
Future getUserTermsAndConditions() async {
hasError = false;
await baseAppClient.post(GET_USER_TERMS,
onSuccess: (dynamic response, int statusCode) {
userAgreementContent = response['UserAgreementContent'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: Map<String, dynamic>());
}
}

@ -1,26 +1,54 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import '../../../locator.dart';
class H2OViewModel extends BaseViewModel {
H2OService _h2OService = locator<H2OService>();
List<charts.Series> userProgressForWeekDataSeries;
List<charts.Series> userProgressForMonthDataSeries;
UserDetailModel get userDetail => _h2OService.userDetailModel;
UserProgressForTodayDataModel get userProgressData {
if (_h2OService.userProgressForTodayDataList.length != 0)
return _h2OService.userProgressForTodayDataList[0];
return null;
if (_h2OService.userProgressForTodayDataList.length != 0) return _h2OService.userProgressForTodayDataList[0];
return null;
}
Future getUserDetail() async {
// if(_h2OService.userProgressForTodayDataList.length==0){
setState(ViewState.Busy);
await _h2OService.getUserDetail();
if (_h2OService.hasError) {
error = _h2OService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future updateUserDetail(UserDetailModel userDetailModel, Function(bool) onResponse) async {
setState(ViewState.Busy);
await _h2OService.updateUserDetail(userDetailModel);
if (_h2OService.hasError) {
error = _h2OService.error;
setState(ViewState.Error);
onResponse(false);
} else {
_h2OService.userDetailModel = userDetailModel;
setState(ViewState.Idle);
onResponse(true);
}
}
Future getUserProgressForTodayData() async {
// if(_h2OService.userProgressForTodayDataList.length==0){
@ -58,13 +86,9 @@ class H2OViewModel extends BaseViewModel {
}
}
List<charts.Series<ChartSeries,
String>> createUserProgressForWeekDataSeries() {
List<ChartSeries> globalData = [
];
_h2OService.userProgressForWeekDataList.forEach((
UserProgressForWeekDataModel data) {
List<charts.Series<ChartSeries, String>> createUserProgressForWeekDataSeries() {
List<ChartSeries> globalData = [];
_h2OService.userProgressForWeekDataList.forEach((UserProgressForWeekDataModel data) {
globalData.add(new ChartSeries(data.dayName, data.percentageConsumed));
});
return [
@ -77,12 +101,9 @@ class H2OViewModel extends BaseViewModel {
];
}
List<charts.Series<ChartSeries,
String>> createUserProgressForMonthDataSeries() {
List<ChartSeries> globalData = [
];
_h2OService.userProgressForMonthDataList.forEach((
UserProgressForMonthDataModel data) {
List<charts.Series<ChartSeries, String>> createUserProgressForMonthDataSeries() {
List<ChartSeries> globalData = [];
_h2OService.userProgressForMonthDataList.forEach((UserProgressForMonthDataModel data) {
globalData.add(new ChartSeries(data.monthName, data.percentageConsumed));
});
return [
@ -95,14 +116,10 @@ class H2OViewModel extends BaseViewModel {
];
}
Future insertUserActivity(
InsertUserActivityRequestModel insertUserActivityRequestModel) async {
Future insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async {
setState(ViewState.BusyLocal);
insertUserActivityRequestModel.mobileNumber =
user.mobileNumber.substring(1);
insertUserActivityRequestModel.identificationNo =
user.patientIdentificationNo;
insertUserActivityRequestModel.mobileNumber = user.mobileNumber.substring(1);
insertUserActivityRequestModel.identificationNo = user.patientIdentificationNo;
await _h2OService.insertUserActivity(insertUserActivityRequestModel);
if (_h2OService.hasError) {
@ -113,9 +130,18 @@ class H2OViewModel extends BaseViewModel {
}
}
Future undoUserActivity() async {
setState(ViewState.BusyLocal);
await _h2OService.undoUserActivity();
if (_h2OService.hasError) {
error = _h2OService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}
/// Sample ordinal data type.
class ChartSeries {
final String y;

@ -0,0 +1,29 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/service/termsConditionsService.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../locator.dart';
class TermsConditionsViewModel extends BaseViewModel{
TermsConditionsService _service = locator<TermsConditionsService>();
String get userAgreementContent => _service.userAgreementContent;
getUserTermsAndConditions() async {
setState(ViewState.Busy);
await _service.getUserTermsAndConditions();
if (_service.hasError) {
error = _service.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
@override
void dispose() {
super.dispose();
}
}

@ -1,33 +1,31 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart';
import 'package:diplomaticquarterapp/core/service/medical/BloodPressureService.dart';
import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import '../../../core/viewModels/base_view_model.dart';
class BloodPressureViewMode extends BaseViewModel {
BloodPressureService bloodPressureService = locator<BloodPressureService>();
///BLOOD
List<WeekChartDate> _bloodDiastolicPressureWeeklyTimeSeriesSalesList = List();
List<WeekChartDate> _bloodSystolicePressureWeeklyTimeSeriesSalesList = List();
List<BloodPressureResult> get monthDiabtecPatientResult =>
bloodPressureService.monthDiabtecPatientResult;
List<YearMonthlyChartDate> _bloodDiastolicMonthlyTimeSeriesSalesList = List();
List<YearMonthlyChartDate> _bloodSystolicMonthlyTimeSeriesSalesList = List();
List<BloodPressureResult> get weekDiabtecPatientResult =>
bloodPressureService.weekDiabtecPatientResult;
List<WeekChartDate> _bloodSystoliceYearTimeSeriesSalesList = List();
List<WeekChartDate> _bloodDiastolicYearTimeSeriesSalesList = List();
List<BloodPressureResult> get yearDiabtecPatientResult =>
bloodPressureService.yearDiabtecPatientResult;
List<BloodPressureResult> get monthDiabtecPatientResult => bloodPressureService.monthDiabtecPatientResult;
List<TimeSeriesSales2> weightWeekTimeSeriesDataTop = [];
List<TimeSeriesSales2> weightWeekTimeSeriesDataLow = [];
List<BloodPressureResult> get weekDiabtecPatientResult => bloodPressureService.weekDiabtecPatientResult;
List<TimeSeriesSales3> weighMonthTimeSeriesDataTop = [];
List<TimeSeriesSales3> weighMonthTimeSeriesDataLow = [];
List<BloodPressureResult> get yearDiabtecPatientResult => bloodPressureService.yearDiabtecPatientResult;
List<TimeSeriesSales2> weightYearTimeSeriesDataTop = [];
List<TimeSeriesSales2> weightYearTimeSeriesDataLow = [];
Future getBloodPressure() async {
setState(ViewState.Busy);
@ -35,114 +33,94 @@ class BloodPressureViewMode extends BaseViewModel {
await bloodPressureService.getDiabtecResults();
if (bloodPressureService.hasError) {
error = bloodPressureService.error;
setState(ViewState.Error);
setState(ViewState.ErrorLocal);
} else {
clearDate();
bloodPressureService.weekDiabtectResultAverageList.forEach((element) {
_bloodDiastolicPressureWeeklyTimeSeriesSalesList.add(WeekChartDate(
x: element.bloodPressureDate,
y: element.dailyDiastolicPressureAverageResult));
_bloodSystolicePressureWeeklyTimeSeriesSalesList.add(WeekChartDate(
x: element.bloodPressureDate,
y: element.dailySystolicePressureAverageResult));
});
weightWeekTimeSeriesDataTop.add(TimeSeriesSales2(
element.bloodPressureDate,
element.dailyDiastolicPressureAverageResult.toDouble()));
weightWeekTimeSeriesDataLow.add(TimeSeriesSales2(
element.bloodPressureDate,
element.dailySystolicePressureAverageResult.toDouble()));
for (int index = 0;
index < bloodPressureService.monthDiabtectResultAverageList.length;
index++) {
_bloodDiastolicMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate(
x: index,
y: bloodPressureService.monthDiabtectResultAverageList[index]
.weekDiastolicPressureAverageResult));
_bloodSystolicMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate(
x: index,
y: bloodPressureService.monthDiabtectResultAverageList[index]
.weekSystolicePressureAverageResult));
}
bloodPressureService.yearDiabtecResultAverageList.forEach((element) {
_bloodSystoliceYearTimeSeriesSalesList
.add(WeekChartDate(x: element.date, y: element.monthSystolicePressureAverageResult));
_bloodDiastolicYearTimeSeriesSalesList
.add(WeekChartDate(x: element.date, y: element.monthDiastolicPressureAverageResult));
});
for (int index = 0; index < bloodPressureService.monthDiabtectResultAverageList.length; index++) {
weighMonthTimeSeriesDataTop.add(TimeSeriesSales3(index, bloodPressureService.monthDiabtectResultAverageList[index].weekDiastolicPressureAverageResult.toDouble()));
weighMonthTimeSeriesDataLow.add(TimeSeriesSales3(index, bloodPressureService.monthDiabtectResultAverageList[index].weekSystolicePressureAverageResult.toDouble()));
}
bloodPressureService.yearDiabtecResultAverageList.forEach((element) {
weightYearTimeSeriesDataTop.add(TimeSeriesSales2(element.date,
element.monthSystolicePressureAverageResult.toDouble()));
weightYearTimeSeriesDataLow.add(TimeSeriesSales2(element.date,
element.monthDiastolicPressureAverageResult.toDouble()));
});
});
setState(ViewState.Idle);
}
}
List<charts.Series<WeekChartDate, DateTime>> getBloodWeeklySeries() {
return [
charts.Series<WeekChartDate, DateTime>(
id: 'Diastolic',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _bloodDiastolicPressureWeeklyTimeSeriesSalesList,
),
charts.Series<WeekChartDate, DateTime>(
id: 'Systolice',
colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _bloodSystolicePressureWeeklyTimeSeriesSalesList,
)
];
}
List<charts.Series<YearMonthlyChartDate, int>>
getBloodMonthlyTimeSeriesSales() {
return [
charts.Series<YearMonthlyChartDate, int>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (YearMonthlyChartDate sales, _) => sales.x,
measureFn: (YearMonthlyChartDate sales, _) => sales.y,
data: _bloodDiastolicMonthlyTimeSeriesSalesList,
),
charts.Series<YearMonthlyChartDate, int>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault,
domainFn: (YearMonthlyChartDate sales, _) => sales.x,
measureFn: (YearMonthlyChartDate sales, _) => sales.y,
data: _bloodSystolicMonthlyTimeSeriesSalesList,
),
];
void clearDate(){
weightWeekTimeSeriesDataTop.clear();
weightWeekTimeSeriesDataLow.clear();
weighMonthTimeSeriesDataTop.clear();
weighMonthTimeSeriesDataLow.clear();
weightYearTimeSeriesDataTop.clear();
weightYearTimeSeriesDataLow.clear();
}
List<charts.Series<WeekChartDate, DateTime>> getBloodYearTimeSeriesSales() {
return [
charts.Series<WeekChartDate, DateTime>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _bloodSystoliceYearTimeSeriesSalesList,
),
charts.Series<WeekChartDate, DateTime>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _bloodDiastolicYearTimeSeriesSalesList,
)
];
Future sendReportByEmail() async {
setState(ViewState.BusyLocal);
await bloodPressureService.sendReportByEmail();
if (bloodPressureService.hasError) {
error = bloodPressureService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
addDiabtecResult(
Future addORUpdateDiabtecResult(
{String bloodPressureDate,
String diastolicPressure,
String systolicePressure,
int measuredArm}) async {
String diastolicPressure,
String systolicePressure,
int measuredArm,bool isUpdate = false}) async {
setState(ViewState.BusyLocal);
if(!isUpdate)
await bloodPressureService.addDiabtecResult(
bloodPressureDate: bloodPressureDate,
diastolicPressure: diastolicPressure,
systolicePressure: systolicePressure,
measuredArm: measuredArm);
else
await bloodPressureService.updateDiabtecResult(
bloodPressureDate: bloodPressureDate,
diastolicPressure: diastolicPressure,
systolicePressure: systolicePressure,
measuredArm: measuredArm);
if (bloodPressureService.hasError) {
error = bloodPressureService.error;
setState(ViewState.ErrorLocal);
} else {
await getBloodPressure();
setState(ViewState.Idle);
}
}
Future deactivateDiabeticStatus({int lineItemNo}) async {
setState(ViewState.BusyLocal);
await bloodPressureService.deactivateDiabeticStatus(lineItemNo: lineItemNo);
if (bloodPressureService.hasError) {
error = bloodPressureService.error;
setState(ViewState.Error);
setState(ViewState.ErrorLocal);
} else {
await getBloodPressure();
setState(ViewState.Idle);

@ -5,17 +5,13 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthly
import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import '../../../core/viewModels/base_view_model.dart';
class BloodSugarViewMode extends BaseViewModel {
BloodSugarService bloodSugarService = locator<BloodSugarService>();
///BLOOD
List<WeekChartDate> _bloodWeeklyTimeSeriesSalesList = List();
List<YearMonthlyChartDate> _bloodMonthlyTimeSeriesSalesList = List();
List<WeekChartDate> _bloodYearTimeSeriesSalesList = List();
List<DiabtecPatientResult> get monthDiabtecPatientResult =>
bloodSugarService.monthDiabtecPatientResult;
@ -25,6 +21,10 @@ class BloodSugarViewMode extends BaseViewModel {
List<DiabtecPatientResult> get yearDiabtecPatientResult =>
bloodSugarService.yearDiabtecPatientResult;
List<TimeSeriesSales2> bloodWeekTimeSeriesData = [];
List<TimeSeriesSales2> yearTimeSeriesData = [];
List<TimeSeriesSales3> monthTimeSeriesData = [];
Future getBloodSugar() async {
setState(ViewState.Busy);
await bloodSugarService.getBloodSugar();
@ -34,67 +34,35 @@ class BloodSugarViewMode extends BaseViewModel {
setState(ViewState.Error);
} else {
bloodSugarService.weekDiabtectResultAverageList.forEach((element) {
_bloodWeeklyTimeSeriesSalesList.add(
WeekChartDate(x: element.dateChart, y: element.dailyAverageResult));
bloodWeekTimeSeriesData.add(TimeSeriesSales2(
element.dateChart,
element.dailyAverageResult.toDouble(),
));
});
for (int index = 0;
index < bloodSugarService.monthDiabtectResultAverageList.length;
index++) {
_bloodMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate(
x: index,
y: bloodSugarService
.monthDiabtectResultAverageList[index].weekAverageResult));
var asd="";
monthTimeSeriesData.add(TimeSeriesSales3(
index,
bloodSugarService
.monthDiabtectResultAverageList[index].weekAverageResult
.toDouble(),
));
}
bloodSugarService.yearDiabtecResultAverageList.forEach((element) {
_bloodYearTimeSeriesSalesList
.add(WeekChartDate(x: element.date, y: element.monthAverageResult));
yearTimeSeriesData.add(TimeSeriesSales2(
element.date,
element.monthAverageResult.toDouble(),
));
});
setState(ViewState.Idle);
}
}
List<charts.Series<WeekChartDate, DateTime>> getBloodWeeklySeries() {
return [
new charts.Series<WeekChartDate, DateTime>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _bloodWeeklyTimeSeriesSalesList,
)
];
}
List<charts.Series<YearMonthlyChartDate, int>>
getBloodMonthlyTimeSeriesSales() {
return [
new charts.Series<YearMonthlyChartDate, int>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (YearMonthlyChartDate sales, _) => sales.x,
measureFn: (YearMonthlyChartDate sales, _) => sales.y,
data: _bloodMonthlyTimeSeriesSalesList,
)
];
}
List<charts.Series<WeekChartDate, DateTime>> getBloodYearTimeSeriesSales() {
return [
new charts.Series<WeekChartDate, DateTime>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _bloodYearTimeSeriesSalesList,
)
];
}
addDiabtecResult(
Future addDiabtecResult(
{String bloodSugerDateChart,
String bloodSugerResult,
String diabtecUnit,
@ -102,7 +70,7 @@ class BloodSugarViewMode extends BaseViewModel {
setState(ViewState.BusyLocal);
await bloodSugarService.addDiabtecResult(
bloodSugerDateChart: bloodSugerDateChart,
bloodSugerResult: bloodSugerResult ,
bloodSugerResult: bloodSugerResult,
diabtecUnit: diabtecUnit,
measuredTime: measuredTime);
if (bloodSugarService.hasError) {
@ -113,7 +81,54 @@ class BloodSugarViewMode extends BaseViewModel {
setState(ViewState.Idle);
}
}
Future updateDiabtecResult(
{DateTime month,
DateTime hour,
String bloodSugerResult,
String diabtecUnit,
int measuredTime,
int lineItemNo}) async {
setState(ViewState.BusyLocal);
await bloodSugarService.updateDiabtecResult(
bloodSugerResult: bloodSugerResult,
diabtecUnit: diabtecUnit,
hour: hour,
measuredTime: measuredTime,
lineItemNo: lineItemNo,
month: month);
if (bloodSugarService.hasError) {
error = bloodSugarService.error;
setState(ViewState.ErrorLocal);
} else {
await getBloodSugar();
setState(ViewState.Idle);
}
}
Future sendReportByEmail() async {
setState(ViewState.BusyLocal);
await bloodSugarService.sendReportByEmail();
if (bloodSugarService.hasError) {
error = bloodSugarService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future deactivateDiabeticStatus({int lineItemNo}) async {
setState(ViewState.BusyLocal);
await bloodSugarService.deactivateDiabeticStatus(lineItemNo: lineItemNo);
if (bloodSugarService.hasError) {
error = bloodSugarService.error;
setState(ViewState.ErrorLocal);
} else {
await getBloodSugar();
setState(ViewState.Idle);
}
}
}

@ -41,6 +41,9 @@ class MyBalanceViewModel extends BaseViewModel {
double get totalAdvanceBalanceAmount =>
_myBalanceService.totalAdvanceBalanceAmount;
String get updatedRegisterBloodMessage =>
_myBalanceService.updatedRegisterBloodMessage;
GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse =>
_myBalanceService.getAllSharedRecordsByStatusResponse;
@ -74,7 +77,6 @@ class MyBalanceViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getCities() async {
setState(ViewState.Busy);
await _bloodDonationService.getAllCitiesOrders();
@ -159,4 +161,17 @@ class MyBalanceViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
Future updateBloodGroup(List_BloodGroupDetailsModel detailsModel) async {
setState(ViewState.Busy);
await _myBalanceService.updateBloodGroup(detailsModel);
if (_myBalanceService.hasError) {
error = _myBalanceService.error;
setState(ViewState.ErrorLocal);
} else {
await _myBalanceService.addUserAgreementForBloodDonation();
setState(ViewState.Idle);
}
}
}

@ -9,16 +9,13 @@ import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart
import 'package:diplomaticquarterapp/core/service/medical/WeightPressureService.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import '../../../core/viewModels/base_view_model.dart';
class WeightPressureViewMode extends BaseViewModel {
class WeightPressureViewModel extends BaseViewModel {
WeightService weightService = locator<WeightService>();
List<WeekChartDate> _weightWeeklyTimeSeriesSalesList = List();
List<YearMonthlyChartDate> _weightMonthlyTimeSeriesSalesList = List();
List<WeekChartDate> _weightYearTimeSeriesSalesList = List();
List<WeightMeasurementResult> get monthWeightMeasurementResult =>
weightService.monthWeightMeasurementResult;
@ -28,6 +25,10 @@ class WeightPressureViewMode extends BaseViewModel {
List<WeightMeasurementResult> get yearWeightMeasurementResult =>
weightService.yearWeightMeasurementResult;
List<TimeSeriesSales2> weightWeekTimeSeriesData = [];
List<TimeSeriesSales3> weighMonthTimeSeriesData = [];
List<TimeSeriesSales2> weightYearTimeSeriesData = [];
Future getWeight() async {
setState(ViewState.Busy);
await weightService.getWeightAverage();
@ -37,71 +38,84 @@ class WeightPressureViewMode extends BaseViewModel {
setState(ViewState.Error);
} else {
weightService.weekWeightMeasurementResultAverage.forEach((element) {
_weightWeeklyTimeSeriesSalesList.add(WeekChartDate(
x: element.weightDate, y: element.dailyAverageResult));
weightWeekTimeSeriesData.add(TimeSeriesSales2(
element.weightDate,
element.dailyAverageResult.toDouble(),
));
});
for (int index = 0;
index < weightService.monthWeightMeasurementResultAverage.length;
index++) {
_weightMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate(
x: index,
y: weightService.monthWeightMeasurementResultAverage[index].weekAverageResult));
weighMonthTimeSeriesData.add(TimeSeriesSales3(
index,
weightService
.monthWeightMeasurementResultAverage[index].weekAverageResult
.toDouble(),
));
}
weightService.yearWeightMeasurementResultAverage.forEach((element) {
_weightYearTimeSeriesSalesList
.add(WeekChartDate(x: element.date, y: element.monthAverageResult));
weightYearTimeSeriesData.add(TimeSeriesSales2(
element.date,
element.monthAverageResult.toDouble(),
));
});
setState(ViewState.Idle);
}
}
List<charts.Series<WeekChartDate, DateTime>> getWeightWeeklySeries() {
return [
charts.Series<WeekChartDate, DateTime>(
id: 'Diastolic',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _weightWeeklyTimeSeriesSalesList,
),
];
addWeightResult(
{String weightDate, String weightMeasured, int weightUnit}) async {
setState(ViewState.BusyLocal);
await weightService.addWeightResult(
weightDate: weightDate,
weightMeasured: weightMeasured,
weightUnit: weightUnit,
);
if (weightService.hasError) {
error = weightService.error;
setState(ViewState.Error);
} else {
await getWeight();
setState(ViewState.Idle);
}
}
Future sendReportByEmail() async {
setState(ViewState.BusyLocal);
List<charts.Series<YearMonthlyChartDate, int>>
getWeightMonthlyTimeSeriesSales() {
return [
charts.Series<YearMonthlyChartDate, int>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (YearMonthlyChartDate sales, _) => sales.x,
measureFn: (YearMonthlyChartDate sales, _) => sales.y,
data: _weightMonthlyTimeSeriesSalesList,
),
];
await weightService.sendReportByEmail();
if (weightService.hasError) {
error = weightService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
List<charts.Series<WeekChartDate, DateTime>> getWeightYearTimeSeriesSales() {
return [
charts.Series<WeekChartDate, DateTime>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _weightYearTimeSeriesSalesList,
),
];
updateWeightResult({int lineItemNo, int weightUnit, String weightMeasured,String weightDate}) async {
setState(ViewState.BusyLocal);
await weightService.updateWeightResult(
lineItemNo: lineItemNo,
weightMeasured: weightMeasured,
weightUnit: weightUnit,
weightDate: weightDate
);
if (weightService.hasError) {
error = weightService.error;
setState(ViewState.Error);
} else {
await getWeight();
setState(ViewState.Idle);
}
}
addWeightResult(
{String weightDate, String weightMeasured, int weightUnit}) async {
deleteWeightResult({int lineItemNo, }) async {
setState(ViewState.BusyLocal);
await weightService.addWeightResult(
weightDate: weightDate,
weightMeasured: weightMeasured,
weightUnit: weightUnit,);
await weightService.deleteWeightResult(
lineItemNo: lineItemNo,
);
if (weightService.hasError) {
error = weightService.error;
setState(ViewState.Error);

@ -62,6 +62,27 @@ class PharmacyModuleViewModel extends BaseViewModel {
}
}
Future createUser() async {
setState(ViewState.Busy);
await _pharmacyService.createUser();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future generatePharmacyToken() async {
setState(ViewState.Busy);
await _pharmacyService.generatePharmacyToken();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future getBannerList() async {
setState(ViewState.Busy);
await _pharmacyService.getBannerListList();

@ -50,6 +50,17 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle);
}
Future notifyMe(customerId, itemID) async {
hasError = false;
setState(ViewState.Busy);
await _productLocationService.notifyMe(customerId, itemID);
if (_productLocationService.hasError) {
error = _productLocationService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future addToCartData(quantity, itemID) async {
hasError = false;
setState(ViewState.Busy);

@ -16,30 +16,22 @@ 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<ParentProductsModel> get parentProducts => _pharmacyCategoriseService.parentProductsList;
List<SubCategoriesModel> get subCategorise =>
_pharmacyCategoriseService.subCategoriseList;
List<SubCategoriesModel> get subCategorise => _pharmacyCategoriseService.subCategoriseList;
List<SubProductsModel> get subProducts =>
_pharmacyCategoriseService.subProductsList;
List<SubProductsModel> get subProducts => _pharmacyCategoriseService.subProductsList;
List<FinalProductsModel> get finalProducts =>
_pharmacyCategoriseService.finalProducts;
List<FinalProductsModel> get finalProducts => _pharmacyCategoriseService.finalProducts;
List<BrandsModel> get brandsList => _pharmacyCategoriseService.brandsList;
List<SearchProductsModel> get searchList =>
_pharmacyCategoriseService.searchList;
List<SearchProductsModel> get searchList => _pharmacyCategoriseService.searchList;
List<ScanQrModel> get scanList => _pharmacyCategoriseService.scanList;

@ -32,7 +32,7 @@ class ProjectViewModel extends BaseViewModel {
Locale get appLocal => _appLocale;
LocaleType get localeType => isArabic ? LocaleType.en : LocaleType.ar;
LocaleType get localeType => isArabic ? LocaleType.ar : LocaleType.en;
bool get isArabic => _isArabic;

@ -61,12 +61,14 @@ import 'core/service/parmacyModule/order-preview-service.dart';
import 'core/service/notifications_service.dart';
import 'core/service/parmacyModule/terms-condition-service.dart';
import 'core/service/privilege_service.dart';
import 'core/service/termsConditionsService.dart';
import 'core/service/weather_service.dart';
import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'core/service/parmacyModule/parmacy_module_service.dart';
import 'core/service/offers_service.dart';
import 'core/service/pharmacy_categorise_service.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';
import 'core/viewModels/blooddonation/blood_details_view_model.dart';
@ -210,6 +212,7 @@ void setupLocator() {
locator.registerLazySingleton(() => PrivilegeService());
locator.registerLazySingleton(() => WeatherService());
locator.registerLazySingleton(() => TermsConditionsService());
/// View Model
locator.registerFactory(() => HospitalViewModel());
@ -248,7 +251,7 @@ void setupLocator() {
locator.registerFactory(() => H2OViewModel());
locator.registerFactory(() => BloodSugarViewMode());
locator.registerFactory(() => BloodPressureViewMode());
locator.registerFactory(() => WeightPressureViewMode());
locator.registerFactory(() => WeightPressureViewModel());
locator.registerFactory(() => EyeViewModel());
locator.registerFactory(() => ActiveMedicationsViewModel());
locator.registerFactory(() => AskDoctorViewModel());
@ -287,4 +290,5 @@ void setupLocator() {
// ---------------------
locator.registerLazySingleton(
() => GeofencingServices()); // Geofencing Services
locator.registerFactory(() => TermsConditionsViewModel());
}

@ -0,0 +1,8 @@
class healthData {
int MedCategoryID;
int MedSubCategoryID;
String Value;
String Notes;
String MachineDate;
int TransactionsListID;
}

@ -0,0 +1,36 @@
class YearlyStepsResModel {
double valueSum;
int medCategoryID;
int month;
String monthName;
int patientID;
int year;
YearlyStepsResModel(
{this.valueSum,
this.medCategoryID,
this.month,
this.monthName,
this.patientID,
this.year});
YearlyStepsResModel.fromJson(Map<String, dynamic> json) {
valueSum = json['ValueSum'];
medCategoryID = json['MedCategoryID'];
month = json['Month'];
monthName = json['MonthName'];
patientID = json['PatientID'];
year = json['Year'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ValueSum'] = this.valueSum;
data['MedCategoryID'] = this.medCategoryID;
data['Month'] = this.month;
data['MonthName'] = this.monthName;
data['PatientID'] = this.patientID;
data['Year'] = this.year;
return data;
}
}

@ -37,6 +37,8 @@ import 'package:geolocator/geolocator.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'h2o/h2o_page.dart';
class AllHabibMedicalService extends StatefulWidget {
//TODO
final Function goToMyProfile;
@ -56,12 +58,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => {
Geolocator.getLastKnownPosition()
.then((value) => setLocation(value))
});
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => {Geolocator.getLastKnownPosition().then((value) => setLocation(value))});
});
super.initState();
}
@ -100,8 +98,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.healthWeatherIndicators,
TranslationBase.of(context).healthWeatherIndicators,
color: Colors.white,
fontWeight: FontWeight.w600,
),
@ -134,11 +131,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
width: 60,
height: 60,
),
Directionality(
textDirection: TextDirection.ltr,
child: AppText(weather,
fontSize: 22,
color: Colors.white))
Directionality(textDirection: TextDirection.ltr, child: AppText(weather, fontSize: 22, color: Colors.white))
],
),
Texts(
@ -158,8 +151,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
Navigator.pop(context);
widget.goToMyProfile();
},
imageLocation:
'assets/images/new-design/my_file_bottom_bar.png',
imageLocation: 'assets/images/new-design/my_file_bottom_bar.png',
title: TranslationBase.of(context).myMedicalFile,
),
ServicesContainer(
@ -181,8 +173,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
),
),
),
imageLocation:
'assets/images/new-design/booking_icon_active.png',
imageLocation: 'assets/images/new-design/booking_icon_active.png',
title: TranslationBase.of(context).bookAppo,
),
ServicesContainer(
@ -192,8 +183,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: PaymentService(),
),
),
imageLocation:
'assets/images/al-habib_online_payment_service_icon.png',
imageLocation: 'assets/images/al-habib_online_payment_service_icon.png',
title: TranslationBase.of(context).onlinePaymentService,
),
ServicesContainer(
@ -201,8 +191,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
context,
FadePage(),
),
imageLocation:
'assets/images/al-habib_online_payment_service_icon.png',
imageLocation: 'assets/images/al-habib_online_payment_service_icon.png',
title: TranslationBase.of(context).covid19_driveThrueTest,
),
ServicesContainer(
@ -235,17 +224,13 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: InsuranceUpdate(),
),
),
imageLocation:
'assets/images/medical/insurance_card_icon.png',
imageLocation: 'assets/images/medical/insurance_card_icon.png',
title: TranslationBase.of(context).updateInsurance,
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: authUser.patientID == null
? EReferralIndexPage()
: EReferralPage()),
FadePage(page: authUser.patientID == null ? EReferralIndexPage() : EReferralPage()),
),
imageLocation: 'assets/images/ereferral_service_icon.png',
title: TranslationBase.of(context).ereferral,
@ -257,20 +242,18 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: MyFamily(),
),
),
imageLocation:
'assets/images/new-design/family_menu_icon_red.png',
imageLocation: 'assets/images/new-design/family_menu_icon_red.png',
title: TranslationBase.of(context).myFamily,
),
if(projectViewModel.havePrivilege(35))
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: ChildVaccinesPage()),
if (projectViewModel.havePrivilege(35))
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: ChildVaccinesPage()),
),
imageLocation: 'assets/images/new-design/children_vaccines_icon.png',
title: TranslationBase.of(context).childVaccine,
),
imageLocation:
'assets/images/new-design/children_vaccines_icon.png',
title: TranslationBase.of(context).childVaccine,
),
ServicesContainer(
onTap: () => Navigator.push(
context,
@ -278,27 +261,26 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: ToDo(isShowAppBar: true),
),
),
imageLocation:
'assets/images/new-design/upcoming_icon_bottom_bar.png',
imageLocation: 'assets/images/new-design/upcoming_icon_bottom_bar.png',
title: TranslationBase.of(context).todoList,
),
if(projectViewModel.havePrivilege(42))
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: SymptomInfo()),
),
imageLocation: 'assets/images/new-design/body_icon.png',
title: TranslationBase.of(context).symptomCheckerTitle),
if(projectViewModel.havePrivilege(36))
if (projectViewModel.havePrivilege(42))
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: BloodDonationPage()),
onTap: () => Navigator.push(
context,
FadePage(page: SymptomInfo()),
),
imageLocation: 'assets/images/new-design/body_icon.png',
title: TranslationBase.of(context).symptomCheckerTitle),
if (projectViewModel.havePrivilege(36))
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: BloodDonationPage()),
),
imageLocation: 'assets/images/new-design/blood_icon.png',
title: TranslationBase.of(context).bloodD,
),
imageLocation: 'assets/images/new-design/blood_icon.png',
title: TranslationBase.of(context).bloodD,
),
ServicesContainer(
onTap: () => Navigator.push(
context,
@ -306,8 +288,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: (HealthCalculators()),
),
),
imageLocation:
'assets/images/new-design/health_calculator_icon.png',
imageLocation: 'assets/images/new-design/health_calculator_icon.png',
title: TranslationBase.of(context).calculators,
),
ServicesContainer(
@ -317,30 +298,30 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: HealthConverter(),
),
),
imageLocation:
'assets/images/new-design/health_convertor_icon.png',
imageLocation: 'assets/images/new-design/health_convertor_icon.png',
title: TranslationBase.of(context).converters,
),
if(projectViewModel.havePrivilege(38))
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: H2OPageIndexPage(),
),
if (projectViewModel.havePrivilege(38))
ServicesContainer(
onTap: () => Navigator.push(context, FadePage(page: H2OPage())),
// Navigator.push(
// context,
// FadePage(
// page: H2OPageIndexPage(),
// ),
// ),
imageLocation: 'assets/images/new-design/water_icon.png',
title: TranslationBase.of(context).h2o,
),
imageLocation: 'assets/images/new-design/water_icon.png',
title: 'H2O',
),
if(projectViewModel.havePrivilege(41))
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(),
if (projectViewModel.havePrivilege(41))
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(),
),
imageLocation: 'assets/images/new-design/smartwatch_icon.png',
title: TranslationBase.of(context).smartWatches,
),
imageLocation: 'assets/images/new-design/smartwatch_icon.png',
title: TranslationBase.of(context).smartWatches,
),
ServicesContainer(
onTap: () => Navigator.push(
context,
@ -348,15 +329,12 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
page: ParkingPage(),
),
),
imageLocation:
'assets/images/new-design/parking_system_icon.png',
imageLocation: 'assets/images/new-design/parking_system_icon.png',
title: TranslationBase.of(context).parking,
),
ServicesContainer(
onTap: () => launch(
"https://hmgwebservices.com/vt_mobile/html/index.html"),
imageLocation:
'assets/images/new-design/virtual_tour_icon.png',
onTap: () => launch("https://hmgwebservices.com/vt_mobile/html/index.html"),
imageLocation: 'assets/images/new-design/virtual_tour_icon.png',
title: TranslationBase.of(context).vTour,
),
ServicesContainer(
@ -364,12 +342,10 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => MyWebView(
title: "HMG News",
selectedUrl:
"https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live",
selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live",
)));
},
imageLocation:
'assets/images/new-design/twitter_dashboard_icon.png',
imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png',
title: TranslationBase.of(context).latestNews,
),
ServicesContainer(
@ -392,8 +368,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
getAuthUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
setState(() {
authUser = data;
});
@ -407,8 +382,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
});
} else {
setState(() {
weather =
data != null ? data['Temperature'].toString() + '\u2103' : '--';
weather = data != null ? data['Temperature'].toString() + '\u2103' : '--';
});
}
}

@ -12,9 +12,7 @@ class ConfirmAddAmountDialog extends StatefulWidget {
final String unit;
final H2OViewModel model;
ConfirmAddAmountDialog(
{Key key, this.model,this.amount,this.unit ="ml"});
ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"});
@override
_ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState();
@ -29,10 +27,12 @@ class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
@override
Widget build(BuildContext context) {
return SimpleDialog(
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0),
titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0),
title: Center(
child: Texts(
"Confirm",
TranslationBase.of(context).confirm,
textAlign: TextAlign.center,
color: Colors.black,
),
),
@ -42,12 +42,13 @@ class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
Divider(),
Center(
child: Texts(
"Are you sure you want to Add ${widget.amount} ${widget.unit} ?",
"${TranslationBase.of(context).areyousure} ${widget.amount} ${widget.unit} ?",
textAlign: TextAlign.center,
color: Colors.grey,
),
),
SizedBox(
height: 5.0,
height: 16.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -79,8 +80,8 @@ class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
Expanded(
flex: 1,
child: InkWell(
onTap: () async{
InsertUserActivityRequestModel insertUserActivityRequestModel= InsertUserActivityRequestModel(quantityIntake:widget.amount );
onTap: () async {
InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount);
await widget.model.insertUserActivity(insertUserActivityRequestModel);
Navigator.pop(context);
},
@ -88,20 +89,17 @@ class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
TranslationBase.of(context).ok.toUpperCase(),
fontWeight: FontWeight.w400,
)),
),
),
),
],
)
),
],
)
],
);
}
}

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
@ -5,25 +7,32 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable
class SelectAmountDialog extends StatefulWidget {
List<AmountModel> searchAmount = [
AmountModel(name: "l",nameAr:"لتر",value: 1),
AmountModel(name: "ml",nameAr:"مم لتر",value: 2),
];
final Function(AmountModel) onValueSelected;
AmountModel selectedAmount;
SelectAmountDialog(
{Key key, this.onValueSelected, this.selectedAmount});
SelectAmountDialog({Key key, this.onValueSelected, this.selectedAmount});
@override
_SelectAmountDialogState createState() => _SelectAmountDialogState();
}
class _SelectAmountDialogState extends State<SelectAmountDialog> {
List<AmountModel> searchAmount = [
AmountModel(name: "l", nameAr: "لتر", value: 1),
AmountModel(name: "ml", nameAr: "مم لتر", value: 2),
];
@override
void initState() {
super.initState();
widget.selectedAmount = widget.selectedAmount ?? widget.searchAmount[0];
widget.selectedAmount = widget.selectedAmount ?? searchAmount[0];
getLanguage();
}
String languageID = "en";
void getLanguage() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
setState(() {});
}
@override
@ -32,11 +41,14 @@ class _SelectAmountDialogState extends State<SelectAmountDialog> {
children: [
Column(
children: [
Texts("Select the preferred unit", fontSize: 20,),
Texts(
TranslationBase.of(context).preferredunit,
fontSize: 20,
),
Divider(),
...List.generate(
widget.searchAmount.length,
(index) => Column(
searchAmount.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
@ -49,13 +61,13 @@ class _SelectAmountDialogState extends State<SelectAmountDialog> {
child: InkWell(
onTap: () {
setState(() {
widget.selectedAmount = widget.searchAmount[index];
widget.selectedAmount = searchAmount[index];
});
},
child: ListTile(
title: Text(widget.searchAmount[index].name),
title: Text(languageID == "ar" ? searchAmount[index].nameAr : searchAmount[index].name),
leading: Radio(
value: widget.searchAmount[index],
value: searchAmount[index],
groupValue: widget.selectedAmount,
activeColor: Colors.red[800],
onChanged: (value) {
@ -116,9 +128,9 @@ class _SelectAmountDialogState extends State<SelectAmountDialog> {
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
),
),
),
@ -130,6 +142,7 @@ class _SelectAmountDialogState extends State<SelectAmountDialog> {
);
}
}
class AmountModel {
String name;
String nameAr;
@ -151,7 +164,3 @@ class AmountModel {
return data;
}
}

@ -0,0 +1,101 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
class CommonRadioButtonDialog extends StatefulWidget {
final List<String> list;
final String title;
final int selectedIndex;
final Function(int) onSelect;
CommonRadioButtonDialog({Key key, this.title = "", this.selectedIndex = 0, this.list, this.onSelect}) : super(key: key);
@override
_CommonRadioButtonDialogState createState() {
return _CommonRadioButtonDialogState();
}
}
class _CommonRadioButtonDialogState extends State<CommonRadioButtonDialog> {
int _selectedIndex = 0;
@override
void initState() {
super.initState();
_selectedIndex = widget.selectedIndex;
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Dialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4),
),
elevation: 0,
backgroundColor: Colors.white,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: widget.title == "" ? 24 : 50,
alignment: Alignment.center,
child: Text(
widget.title,
style: TextStyle(color: Colors.black87, fontSize: 18, fontWeight: FontWeight.w500),
),
),
Divider(height: 1, color: Colors.black38),
ListView.builder(
shrinkWrap: true,
padding: EdgeInsets.only(top: 4, bottom: 4),
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return RadioListTile(
value: index,
dense: true,
activeColor: Colors.black54,
groupValue: _selectedIndex,
onChanged: (_index) => setState(() => _selectedIndex = _index),
title: Text(
widget.list[index],
style: TextStyle(fontWeight: FontWeight.w500),
),
);
},
itemCount: widget.list?.length ?? 0,
),
Divider(height: 1, color: Colors.black38),
Container(
height: 50,
alignment: Alignment.center,
child: Row(
children: [
Expanded(
child: FlatButton(
child: Text(
TranslationBase.of(context).cancel,
style: TextStyle(color: Colors.redAccent, fontSize: 16, fontWeight: FontWeight.w500),
),
onPressed: () => Navigator.pop(context),
),
),
Expanded(
child: FlatButton(
child: Text(
TranslationBase.of(context).ok,
style: TextStyle(color: Colors.black87, fontSize: 16, fontWeight: FontWeight.w500),
),
onPressed: () => widget.onSelect(_selectedIndex),
),
)
],
),
),
],
),
);
}
}

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.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/others/app_scaffold_widget.dart';
@ -36,7 +37,7 @@ class _AddCustomAmountState extends State<AddCustomAmount> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: "Enter amount",
appBarTitle:TranslationBase.of(context).customLabel,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
@ -51,7 +52,7 @@ class _AddCustomAmountState extends State<AddCustomAmount> {
height: 12,
),
NewTextFields(
hintText: "Enter the amount of water:",
hintText: TranslationBase.of(context).h2oAmountOfWater,
// type: "Number",
controller: _nameTextController,
),
@ -81,7 +82,7 @@ class _AddCustomAmountState extends State<AddCustomAmount> {
),
SecondaryButton(
textColor: Colors.white,
label: "OK",
label: TranslationBase.of(context).ok,
onTap: () async {
Navigator.of(context).pop();
showConfirmMessage (int.parse(_nameTextController.text), widget.model);
@ -120,7 +121,7 @@ void confirmAmountTypeDialog() {
if (selectedAmount != null)
return selectedAmount.name;
else
return "Select unit";
return TranslationBase.of(context).selectUnit;
}

@ -0,0 +1,463 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.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/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'Dialog/setting_page_radio_button_list_dialog.dart';
class H2oSetting extends StatefulWidget {
final UserDetailModel userDetailModel;
final H2OViewModel viewModel;
H2oSetting({Key key, this.userDetailModel, this.viewModel}) : super(key: key);
@override
_H2oSettingState createState() {
return _H2oSettingState();
}
}
class _H2oSettingState extends State<H2oSetting> {
TextEditingController _nameController = TextEditingController();
TextEditingController _heightController = TextEditingController();
TextEditingController _weightController = TextEditingController();
bool _isUnitML = false;
bool _isGenderMale = false;
bool _isHeightCM = false;
bool _isWeightKG = false;
double _heightValue = 1;
double _weightValue = 1;
List<String> _activityLevelListEng = [];
List<String> _remindedTimeListEng = [];
int _selectedActiveLevel = 1;
int _selectedRemindedTime = 0;
DateTime _dobDate = DateTime.now();
DateTime _tempDate = DateTime.now();
UserDetailModel _userDetailModel;
@override
void initState() {
super.initState();
_userDetailModel = widget.userDetailModel;
_heightValue = _userDetailModel.height;
_weightValue = _userDetailModel.weight;
_heightController.text = _heightValue.toStringAsFixed(0);
_weightController.text = _weightValue.toStringAsFixed(0);
_nameController.text = _userDetailModel.firstName;
_isWeightKG = _userDetailModel.isWeightInKG;
_isHeightCM = _userDetailModel.isHeightInCM;
_isGenderMale = _userDetailModel.gender == "M" ? true : false;
_dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB);
_selectedActiveLevel = _userDetailModel.activityID ?? 1;
}
@override
void didChangeDependencies() {
// TODO: implement didChangeDependencies
super.didChangeDependencies();
_activityLevelListEng = [
TranslationBase.of(context).notActive,
TranslationBase.of(context).lightActive,
TranslationBase.of(context).modActive,
TranslationBase.of(context).active
];
_remindedTimeListEng = [
"1 ${TranslationBase.of(context).time}",
"2 ${TranslationBase.of(context).times}",
"3 ${TranslationBase.of(context).times}",
"4 ${TranslationBase.of(context).times}"
];
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).h2o,
showHomeAppBarIcon: false,
body: SingleChildScrollView(
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextField(
controller: _nameController,
decoration: InputDecoration(
labelText: TranslationBase.of(context).enterNameHere,
labelStyle: TextStyle(color: Colors.black87),
fillColor: Colors.white,
filled: true,
border: UnderlineInputBorder(
borderSide: BorderSide(
width: 0,
style: BorderStyle.none,
),
borderRadius: BorderRadius.circular(6.0),
),
),
),
SizedBox(height: 8),
Text(TranslationBase.of(context).preferredunit),
SizedBox(height: 8),
_commonButtonsRow(TranslationBase.of(context).ml, TranslationBase.of(context).l, _isUnitML, (value) {
if (_isUnitML != value) {
setState(() {
_isUnitML = value;
});
}
}),
Padding(
padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Divider(height: 1.5, color: Colors.black54),
),
Text(TranslationBase.of(context).gender),
SizedBox(height: 8),
_commonButtonsRow(TranslationBase.of(context).male, TranslationBase.of(context).female, _isGenderMale, (value) {
if (_isGenderMale != value) {
setState(() {
_isGenderMale = value;
});
}
}),
Padding(
padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Divider(height: 1.5, color: Colors.black54),
),
Text(TranslationBase.of(context).height),
_commonSlidersRow(_heightController, 1, 270, _heightValue, (text) {
_heightController.text = text;
}, (value) {
setState(() {
_heightValue = value;
});
}),
SizedBox(height: 8),
Text(TranslationBase.of(context).heightUnit),
SizedBox(height: 8),
_commonButtonsRow(TranslationBase.of(context).cm, TranslationBase.of(context).ft, _isHeightCM, (value) {
if (_isHeightCM != value) {
setState(() {
_isHeightCM = value;
});
}
}),
SizedBox(height: 8),
_commonSlidersRow(_weightController, 1, 250, _weightValue, (text) {
_weightController.text = text;
}, (value) {
setState(() {
_weightValue = value;
});
}),
SizedBox(height: 8),
Text(TranslationBase.of(context).weightUnit),
SizedBox(height: 8),
_commonButtonsRow(TranslationBase.of(context).kg, TranslationBase.of(context).lb, _isWeightKG, (value) {
if (_isWeightKG != value) {
setState(() {
_isWeightKG = value;
});
}
}),
Padding(
padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Divider(height: 1.5, color: Colors.black54),
),
Container(
padding: EdgeInsets.all(8),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("${TranslationBase.of(context).birth_date}:"),
SizedBox(height: 8),
InkWell(
onTap: () {
showModalBottomSheet(
context: context,
builder: (context) {
return Container(
height: 250,
padding: EdgeInsets.all(8),
child: Column(children: [
Container(
height: 40,
alignment: Alignment.centerRight,
child: Row(mainAxisSize: MainAxisSize.min, children: [
InkWell(
onTap: () => Navigator.pop(context),
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
child: Text(TranslationBase.of(context).cancel),
),
),
SizedBox(width: 8),
InkWell(
onTap: () {
Navigator.pop(context);
setState(() {
_dobDate = _tempDate;
});
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
child: Text(TranslationBase.of(context).ok),
),
)
]),
),
Expanded(
child: Container(
width: MediaQuery.of(context).size.width,
child: CupertinoDatePicker(
initialDateTime: _dobDate,
mode: CupertinoDatePickerMode.date,
onDateTimeChanged: (_date) {
_tempDate = _date;
},
),
),
)
]),
);
});
}, // implement cupertino dialog to select date
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Text(DateUtil.getFormattedDate(_dobDate, "yyyy-MM-dd")), Icon(Icons.arrow_drop_down_outlined)]),
)
],
),
),
SizedBox(height: 8),
_commonDialogSelectorRow(TranslationBase.of(context).activityLevel, _activityLevelListEng[_selectedActiveLevel - 1], () {
showDialog(
context: context,
child: CommonRadioButtonDialog(
list: _activityLevelListEng,
title: TranslationBase.of(context).activityLevel,
onSelect: (index) {
Navigator.pop(context);
setState(() {
_selectedActiveLevel = index + 1;
});
},
selectedIndex: _selectedActiveLevel - 1,
),
);
}),
SizedBox(height: 8),
_commonDialogSelectorRow(TranslationBase.of(context).reminderLabel, _remindedTimeListEng[_selectedRemindedTime], () {
showDialog(
context: context,
child: CommonRadioButtonDialog(
list: _remindedTimeListEng,
onSelect: (index) {
Navigator.pop(context);
setState(() {
_selectedRemindedTime = index;
});
},
selectedIndex: _selectedRemindedTime,
),
);
}),
SizedBox(height: 16),
SizedBox(
height: 50,
width: MediaQuery.of(context).size.width,
child: FlatButton(
color: Theme.of(context).appBarTheme.color,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
onPressed: _updateUserDetails,
child: Text(
TranslationBase.of(context).save,
style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600),
),
),
)
],
),
),
);
}
Widget _commonButtonsRow(String rightText, String leftText, bool checkParam, Function(bool) callBack) {
return Row(children: [
Expanded(
child: SizedBox(
height: 40,
child: RaisedButton(
color: checkParam ? Theme.of(context).appBarTheme.color : Colors.white,
child: Text(
rightText,
style: TextStyle(color: checkParam ? Colors.white : Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w600),
),
onPressed: () => callBack(true),
),
),
),
SizedBox(width: 12),
Expanded(
child: SizedBox(
height: 40,
child: RaisedButton(
color: !checkParam ? Theme.of(context).appBarTheme.color : Colors.white,
child: Text(
leftText,
style: TextStyle(color: !checkParam ? Colors.white : Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w600),
),
onPressed: () => callBack(false),
),
),
),
]);
}
Widget _commonSlidersRow(
_controller, double _minValue, double _maxValue, double _valueOrg, Function(String) onTextValueChange, Function(double) onValueChange) {
return Container(
margin: EdgeInsets.only(top: 6),
padding: EdgeInsets.all(6),
color: Colors.white,
height: 50,
child: Row(
children: [
SizedBox(
width: 75,
child: TextField(
controller: _controller,
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
onChanged: (value) {
double _value = double.parse(value);
if (_value > _maxValue) {
onTextValueChange(_maxValue.toStringAsFixed(0));
onValueChange(_maxValue);
return;
} else if (_value < _minValue) {
onTextValueChange(_minValue.toStringAsFixed(0));
onValueChange(_minValue);
return;
} else if (_value >= _minValue && _value <= _maxValue) {
onValueChange(_value);
return;
}
},
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(r'[0-9]')),
],
decoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 4, right: 4),
fillColor: Colors.white,
filled: true,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 1,
color: Colors.grey,
style: BorderStyle.solid,
),
borderRadius: BorderRadius.circular(6.0),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 1,
color: Colors.grey,
style: BorderStyle.solid,
),
borderRadius: BorderRadius.circular(6.0),
),
),
),
),
Expanded(
flex: 6,
child: Slider(
min: _minValue,
max: _maxValue,
activeColor: Colors.redAccent,
inactiveColor: Colors.redAccent.withOpacity(.3),
value: _valueOrg,
onChanged: (value) {
onTextValueChange(value.toStringAsFixed(0));
onValueChange(value);
},
),
)
],
),
);
}
Widget _commonDialogSelectorRow(String title, String selectedText, VoidCallback onPressed) {
return Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
Text(title),
SizedBox(height: 8),
InkWell(
onTap: onPressed,
child: Container(
height: 50,
padding: EdgeInsets.all(8),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Text(selectedText), Icon(Icons.arrow_drop_down_outlined)],
),
),
)
]);
}
void _updateUserDetails() async {
_userDetailModel.height = _heightValue;
_userDetailModel.weight = _weightValue;
_userDetailModel.firstName = _nameController.text;
_userDetailModel.isWeightInKG = _isWeightKG;
_userDetailModel.isHeightInCM = _isHeightCM;
_userDetailModel.gender = _isGenderMale ? "M" : "F";
var tempDate = DateUtil.convertDateToString(_dobDate);
if (!tempDate.endsWith("/")) {
tempDate = tempDate + "/";
}
_userDetailModel.dOB = tempDate;
_userDetailModel.activityID = _selectedActiveLevel;
GifLoaderDialogUtils.showMyDialog(context);
await widget.viewModel.updateUserDetail(_userDetailModel, (tag) {
if (tag) {
AppToast.showSuccessToast(message: TranslationBase.of(context).success);
}
GifLoaderDialogUtils.hideDialog(context);
});
Navigator.pop(context);
}
}

@ -1,12 +1,15 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/week_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package: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';
@ -34,9 +37,26 @@ class _H2OPageState extends State<H2OPage>
@override
Widget build(BuildContext context) {
return BaseView<H2OViewModel>(
onModelReady: (model) => model.getUserDetail(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: "Water Tracker",
appBarTitle: TranslationBase.of(context).waterTracker,
showHomeAppBarIcon: false,
baseViewModel: model,
appBarIcons: [
IconButton(
icon: Image.asset("assets/images/new-design/setting_gear_icon.png"),
color: Colors.white,
onPressed: () {
Navigator.push(
context,
FadePage(
page: H2oSetting(userDetailModel: model.userDetail, viewModel: model),
),
);
},
),
],
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
@ -50,9 +70,7 @@ class _H2OPageState extends State<H2OPage>
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Container(
color: Theme.of(context)
.scaffoldBackgroundColor
.withOpacity(0.8),
color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8),
height: 70.0,
),
),
@ -60,48 +78,46 @@ class _H2OPageState extends State<H2OPage>
Center(
child: Container(
height: 60.0,
margin: EdgeInsets.only(top: 10.0),
width: MediaQuery.of(context).size.width * 0.9,
alignment: Alignment.center,
// margin: EdgeInsets.only(top: 10.0),
// width: MediaQuery.of(context).size.width * 0.9,
child: Center(
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding:
EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.28,
child: Center(
child: Texts(
"Today"),
),
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.28,
child: Center(
child: Texts(TranslationBase.of(context).today),
),
Container(
width: MediaQuery.of(context).size.width * 0.28,
child: Center(
child: Texts("Week"),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.28,
child: Center(
child: Texts(TranslationBase.of(context).week),
),
Container(
width: MediaQuery.of(context).size.width * 0.28,
child: Center(
child: Texts("Month"),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.28,
child: Center(
child: Texts(TranslationBase.of(context).month),
),
],
),
),
],
),
),
),
],
),
),
backgroundColor: Colors.white,
body: Column(
children: <Widget>[
Expanded(

@ -1,11 +1,13 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart';
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class MonthPage extends StatelessWidget {
@override
@ -14,12 +16,39 @@ class MonthPage extends StatelessWidget {
onModelReady: (model) => model.getUserProgressForMonthData(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
appBarTitle: "Water Tracker",
baseViewModel:model ,
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(vertical: 12),
child: AppBarChart(
seriesList: model.userProgressForMonthDataSeries),
appBarTitle: TranslationBase.of(context).h2o,
baseViewModel: model,
body: Padding(
padding: EdgeInsets.all(8.0),
child: ListView(
children: [
Center(
child: Text(
TranslationBase.of(context).waterConsumedInMonth,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0, color: Colors.black87),
),
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 10,
width: 40,
color: Colors.blue,
),
SizedBox(width: 8),
Text(
TranslationBase.of(context).waterConsumedInMonth,
style: TextStyle(fontSize: 12.0),
),
],
),
// SizedBox(height: 8),
AppBarChart(seriesList: model.userProgressForMonthDataSeries),
],
),
),
),
);

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -14,7 +15,7 @@ class TodayPage extends StatelessWidget {
onModelReady: (model) => model.getUserProgressForTodayData(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
appBarTitle: "Water Tracker",
appBarTitle: TranslationBase.of(context).h2o,
baseViewModel: model,
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(vertical: 12),
@ -36,13 +37,14 @@ class TodayPage extends StatelessWidget {
//,
center: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
height: 40,
),
// SizedBox(
// height: 40,
// ),
Text(
"Consumed",
style: TextStyle(fontSize: 20.0),
TranslationBase.of(context).consumed,
style: TextStyle(fontSize: 16.0),
),
SizedBox(
height: 4,
@ -50,13 +52,8 @@ class TodayPage extends StatelessWidget {
Text(
model.userProgressData == null
? "0.0"
: model.userProgressData.quantityConsumed
.toString() +
'ml',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20.0,
color: HexColor("#60BCF9")),
: model.userProgressData.quantityConsumed.toString() + TranslationBase.of(context).ml,
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")),
),
SizedBox(
height: 4,
@ -70,8 +67,8 @@ class TodayPage extends StatelessWidget {
height: 4,
),
Text(
"Remaining",
style: TextStyle(fontSize: 20.0),
TranslationBase.of(context).remaining,
style: TextStyle(fontSize: 16.0),
),
SizedBox(
height: 4,
@ -79,18 +76,11 @@ class TodayPage extends StatelessWidget {
Text(
model.userProgressData == null
? "0.0"
: (model.userProgressData.quantityLimit -
model.userProgressData
.quantityConsumed) <
0
? "0 ml"
: (model.userProgressData.quantityLimit -
model.userProgressData
.quantityConsumed)
.toString() +
' ml',
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 18.0),
: (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed) < 0
? "0 ${TranslationBase.of(context).ml}"
: (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed).toString() +
' ${TranslationBase.of(context).ml}',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0),
),
],
),
@ -104,42 +94,32 @@ class TodayPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Container(
margin: EdgeInsets.only(left: 20),
height: 30,
width: 70,
decoration: BoxDecoration(
color: HexColor("#D1E3F6"),
borderRadius:
BorderRadius.all(Radius.circular(30))),
),
Container(
margin: EdgeInsets.only(bottom: 16),
height: 30,
width: 70,
decoration: BoxDecoration(color: HexColor("#D1E3F6"), borderRadius: BorderRadius.all(Radius.circular(30))),
),
Text(
"Remaining % ",
style: TextStyle(fontSize: 20.0),
"${TranslationBase.of(context).remaining} %",
style: TextStyle(fontSize: 16.0),
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Container(
margin: EdgeInsets.only(left: 20),
height: 30,
width: 70,
decoration: BoxDecoration(
color: HexColor("#60BCF9"),
borderRadius:
BorderRadius.all(Radius.circular(30))),
),
Container(
margin: EdgeInsets.only(bottom: 16),
height: 30,
width: 70,
decoration: BoxDecoration(color: HexColor("#60BCF9"), borderRadius: BorderRadius.all(Radius.circular(30))),
),
Text(
"Consumed % ",
style: TextStyle(fontSize: 20.0),
"${TranslationBase.of(context).consumed} %",
style: TextStyle(fontSize: 16.0),
)
],
)

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart';
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -15,16 +16,41 @@ class WeekPage extends StatelessWidget {
onModelReady: (model) => model.getUserProgressForWeekData(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
appBarTitle: "Water Tracker",
appBarTitle: TranslationBase.of(context).h2o,
baseViewModel: model,
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(vertical: 12),
child: AppBarChart(seriesList: model.userProgressForWeekDataSeries),
body: Padding(
padding: EdgeInsets.all(8.0),
child: ListView(
children: [
Center(
child: Text(
TranslationBase.of(context).waterConsumedInWeek,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0, color: Colors.black87),
),
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 10,
width: 40,
color: Colors.blue,
),
SizedBox(width: 8),
Text(
TranslationBase.of(context).waterConsumedInWeek,
style: TextStyle(fontSize: 12.0),
),
],
),
// SizedBox(height: 8),
AppBarChart(seriesList: model.userProgressForWeekDataSeries),
],
),
),
),
);
}
}

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -12,13 +13,7 @@ import 'package:flutter/material.dart';
import '../add_custom_amount.dart';
class H20FloatingActionButton extends StatefulWidget {
const H20FloatingActionButton({
Key key,
@required AnimationController controller,
@required this.model
}) :
super(key: key);
const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key);
final H2OViewModel model;
@ -26,7 +21,7 @@ class H20FloatingActionButton extends StatefulWidget {
_H20FloatingActionButtonState createState() => _H20FloatingActionButtonState();
}
class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with TickerProviderStateMixin {
class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with TickerProviderStateMixin {
AnimationController _controller;
@override
void initState() {
@ -37,15 +32,20 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
super.initState();
}
void showConfirmMessage(int amount, H2OViewModel model) {
showDialog(
context: context,
child: ConfirmAddAmountDialog(
model: model,
amount: amount,
),
);
}
@override
Widget build(BuildContext context) {
void showConfirmMessage(int amount, H2OViewModel model) {
showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,));
}
return Container(
margin: EdgeInsets.only(left: 20),
margin: EdgeInsets.only(left: 20, right: 20),
child: new Column(mainAxisSize: MainAxisSize.min, children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
@ -55,21 +55,21 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
children: [
ActionButton(
controller: _controller,
text: "600ml",
text: "600${TranslationBase.of(context).ml}",
onTap: () {
showConfirmMessage(600, widget.model);
},
),
ActionButton(
controller: _controller,
text: "330ml",
text: "330${TranslationBase.of(context).ml}",
onTap: () {
showConfirmMessage(330, widget.model);
},
),
ActionButton(
controller: _controller,
text: "200ml",
text: "200${TranslationBase.of(context).ml}",
onTap: () {
showConfirmMessage(200, widget.model);
},
@ -87,11 +87,9 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
animation: _controller,
builder: (BuildContext context, Widget child) {
return new Transform(
transform: new Matrix4.rotationZ(
_controller.value * 0.5 * math.pi),
transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi),
alignment: FractionalOffset.center,
child: new Icon(
_controller.isDismissed ? Icons.add : Icons.close),
child: new Icon(_controller.isDismissed ? Icons.add : Icons.close),
);
},
),
@ -104,21 +102,21 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
},
),
new Container(
margin: EdgeInsets.only(left: 8, bottom: 4),
alignment: FractionalOffset.topCenter,
child: new ScaleTransition(
scale: new CurvedAnimation(
parent: _controller,
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0,
curve: Curves.easeOut),
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
),
child: new FloatingActionButton(
backgroundColor: Colors.white,
heroTag: null,
mini: true,
// mini: true,
child: Text(
"Custom",
TranslationBase.of(context).custom,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14.0, color: Colors.grey),
style: TextStyle(fontSize: 12, color: Colors.grey),
),
onPressed: () {
Navigator.push(
@ -134,23 +132,23 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
),
),
new Container(
margin: EdgeInsets.only(left: 8, bottom: 4),
alignment: FractionalOffset.topCenter,
child: new ScaleTransition(
scale: new CurvedAnimation(
parent: _controller,
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0,
curve: Curves.easeOut),
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
),
child: new FloatingActionButton(
backgroundColor: Colors.white,
heroTag: null,
mini: true,
//mini: true,
child: Text(
"Undo",
TranslationBase.of(context).undo,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14.0, color: Colors.grey),
style: TextStyle(fontSize: 12.0, color: Colors.grey),
),
onPressed: () {},
onPressed: undoVolume,
),
),
),
@ -159,14 +157,16 @@ class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with
]),
);
}
void undoVolume() async {
GifLoaderDialogUtils.showMyDialog(context);
await widget.model.undoUserActivity();
GifLoaderDialogUtils.hideDialog(context);
}
}
class ActionButton extends StatelessWidget {
const ActionButton(
{Key key,
@required AnimationController controller,
@required this.text,
this.onTap})
const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap})
: _controller = controller,
super(key: key);
@ -177,6 +177,7 @@ class ActionButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 4, bottom: 8),
alignment: FractionalOffset.topCenter,
child: new ScaleTransition(
scale: new CurvedAnimation(
@ -184,16 +185,15 @@ class ActionButton extends StatelessWidget {
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
),
child: new FloatingActionButton(
heroTag: null,
backgroundColor: Colors.white,
mini: true,
child: Text(
text,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14.0, color: Colors.grey),
),
onPressed: onTap
),
heroTag: null,
backgroundColor: Colors.white,
//mini: true,
child: Text(
text,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 12.0, color: Colors.grey),
),
onPressed: onTap),
),
);
}

@ -1,4 +1,5 @@
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:flutter/material.dart';
@ -490,11 +491,11 @@ class _BMICalculatorState extends State<BMICalculator> {
height: 25.0,
),
Container(
height: 100.0,
height: 50.0,
width: 350.0,
child: Button(
child: SecondaryButton(
label: 'CALCULATE',
onTap: () {
onTap: () => {
setState(() {
calculateBMI();
showTextResult();
@ -510,7 +511,7 @@ class _BMICalculatorState extends State<BMICalculator> {
)),
);
}
});
})
},
),
),

@ -1,4 +1,5 @@
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:flutter/material.dart';
@ -687,9 +688,9 @@ class _BmrCalculatorState extends State<BmrCalculator> {
height: 30.0,
),
Container(
height: 100.0,
height: 50.0,
width: 350.0,
child: Button(
child: SecondaryButton(
label: 'CALCULATE',
onTap: () {
setState(() {

@ -1,4 +1,5 @@
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:flutter/material.dart';
@ -985,8 +986,13 @@ class _BodyFatState extends State<BodyFat> {
Container(
height: 100.0,
width: 350.0,
child: Button(
child: SecondaryButton(
label: 'CALCULATE',
// onTap: () => {
// setState(() {
// print('hiii');
// })
// }
onTap: () {
setState(() {
calculateBodyFat();

@ -1,4 +1,5 @@
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:flutter/material.dart';
@ -648,7 +649,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Container(
height: 100.0,
width: 350.0,
child: Button(
child: SecondaryButton(
label: 'CALCULATE',
onTap: () {
setState(() {

@ -1,4 +1,5 @@
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:flutter/material.dart';
@ -329,9 +330,9 @@ class _CarbsState extends State<Carbs> {
height: 55.0,
),
Container(
height: 100.0,
height: 50.0,
width: 350.0,
child: Button(
child: SecondaryButton(
label: 'CALCULATE',
onTap: () {
setState(() {

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.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:flutter/material.dart';
@ -111,9 +112,9 @@ class _DeliveryDueState extends State<DeliveryDue> {
height: 280.0,
),
Container(
height: 100.0,
height: 50.0,
width: 350.0,
child: Button(
child: SecondaryButton(
label: 'CALCULATE',
onTap: () {
setState(() {

@ -1,4 +1,5 @@
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:flutter/material.dart';
@ -518,7 +519,7 @@ class _IdealBodyState extends State<IdealBody> {
Container(
height: 100.0,
width: 350.0,
child: Button(
child: SecondaryButton(
label: 'CALCULATE',
onTap: () {
setState(() {

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.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:flutter/material.dart';
@ -319,9 +320,9 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
height: 220.0,
),
Container(
height: 100.0,
height: 50.0,
width: 350.0,
child: Button(
child: SecondaryButton(
label: 'CALCULATE',
onTap: () {
setState(() {

@ -18,7 +18,7 @@ class _HealthConverterState extends State<HealthConverter> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Health Converter',
appBarTitle: TranslationBase.of(context).converters,
body: Column(
children: [
Container(
@ -37,9 +37,9 @@ class _HealthConverterState extends State<HealthConverter> {
);
},
child: MedicalProfileItem(
title: 'Blood',
title: TranslationBase.of(context).bloodSugar,
imagePath: 'blood_sugar_icon.png',
subTitle: 'Sugar',
subTitle: TranslationBase.of(context).sugar,
),
),
),
@ -55,9 +55,9 @@ class _HealthConverterState extends State<HealthConverter> {
);
},
child: MedicalProfileItem(
title: 'Blood',
title: TranslationBase.of(context).bloodCholesterol,
imagePath: 'blood_cholesterol_icon.png',
subTitle: 'Cholesterol',
subTitle: TranslationBase.of(context).cholesterol,
),
),
),
@ -77,9 +77,9 @@ class _HealthConverterState extends State<HealthConverter> {
);
},
child: MedicalProfileItem(
title: 'Triglycerides',
title: TranslationBase.of(context).triglycerides,
imagePath: 'triglycerides_blood_icon.png',
subTitle: 'Fat in blood',
subTitle: TranslationBase.of(context).fatInBlood,
),
),
),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -62,7 +63,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Blood Cholesterol ',
appBarTitle: TranslationBase.of(context).bloodCholesterol,
body: Padding(
padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
@ -74,7 +75,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
Container(
width: 350.0,
child: Text(
'Convert blood cholesterol from\n mmol/l to mg/dlt and vice versa.',
TranslationBase.of(context).convertCholesterolStatement,
//textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
),
@ -95,7 +96,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
child: Row(
children: [
Texts(
'Convert from',
TranslationBase.of(context).convertFrom,
),
],
),
@ -117,7 +118,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
});
},
child: Container(
height: 55.0,
height: 65.0,
width: 150.0,
decoration: BoxDecoration(
boxShadow: [
@ -150,7 +151,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
});
},
child: Container(
height: 55.0,
height: 65.0,
width: 150.0,
decoration: BoxDecoration(
color: cardMMOLColor,
@ -196,7 +197,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black45)),
labelText: " Enter the reading value",
labelText: TranslationBase.of(context).enterReadingValue,
labelStyle: TextStyle(
color: Colors.black87,
),
@ -209,7 +210,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
Visibility(
visible: _visible,
child: Container(
height: 95.0,
height: 115.0,
width: 350.0,
decoration: BoxDecoration(
color: Colors.white,
@ -222,7 +223,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Texts('Result:'),
Texts(TranslationBase.of(context).result + ":"),
Row(
children: [
Text(
@ -252,10 +253,10 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
),
Flexible(
child: Container(
height: 100.0,
height: 60.0,
width: 150.0,
child: Button(
label: 'CALCULATE',
child: SecondaryButton(
label: TranslationBase.of(context).calculate,
onTap: () {
setState(() {
_visible == false

@ -64,7 +64,7 @@ class _BloodSugarState extends State<BloodSugar> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Blood Sugar Conversion',
appBarTitle: TranslationBase.of(context).bloodSugarConversion,
body: Padding(
padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
@ -76,7 +76,7 @@ class _BloodSugarState extends State<BloodSugar> {
Container(
width: 350.0,
child: Text(
'Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.',
TranslationBase.of(context).convertBloodSugarStatement,
//textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
),
@ -97,7 +97,7 @@ class _BloodSugarState extends State<BloodSugar> {
child: Row(
children: [
Texts(
'Convert from',
TranslationBase.of(context).convertFrom,
)
],
),
@ -119,7 +119,7 @@ class _BloodSugarState extends State<BloodSugar> {
});
},
child: Container(
height: 55.0,
height: 65.0,
width: 150.0,
decoration: BoxDecoration(
boxShadow: [
@ -152,7 +152,7 @@ class _BloodSugarState extends State<BloodSugar> {
});
},
child: Container(
height: 55.0,
height: 65.0,
width: 150.0,
decoration: BoxDecoration(
color: cardMMOLColor,
@ -196,7 +196,7 @@ class _BloodSugarState extends State<BloodSugar> {
],
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: " Enter the reading value",
labelText: TranslationBase.of(context).enterReadingValue,
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black45)),
labelStyle: TextStyle(
@ -211,7 +211,7 @@ class _BloodSugarState extends State<BloodSugar> {
Visibility(
visible: _visible,
child: Container(
height: 95.0,
height: 115.0,
width: 350.0,
decoration: BoxDecoration(
color: Colors.white,
@ -224,7 +224,7 @@ class _BloodSugarState extends State<BloodSugar> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Texts('Result:'),
Texts(TranslationBase.of(context).result + ": "),
Row(
children: [
Text(
@ -254,10 +254,10 @@ class _BloodSugarState extends State<BloodSugar> {
),
Flexible(
child: Container(
height: 100.0,
height: 60.0,
width: 150.0,
child: Button(
label: 'CALCULATE',
child: SecondaryButton(
label: TranslationBase.of(context).calculate,
onTap: () {
setState(() {
_visible == false

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -64,7 +65,7 @@ class _TriglyceridesState extends State<Triglycerides> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Triglycerides',
appBarTitle: TranslationBase.of(context).triglycerides,
body: Padding(
padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
@ -76,7 +77,7 @@ class _TriglyceridesState extends State<Triglycerides> {
Container(
width: 350.0,
child: Text(
'Convert Triglycerides from mmol/l to\n mg/dlt and vice versa.',
TranslationBase.of(context).triglyceridesConvertStatement,
//textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
),
@ -95,7 +96,9 @@ class _TriglyceridesState extends State<Triglycerides> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15.0),
child: Row(
children: [Texts('Convert from')],
children: [
Texts(TranslationBase.of(context).convertFrom)
],
),
),
SizedBox(
@ -115,7 +118,7 @@ class _TriglyceridesState extends State<Triglycerides> {
});
},
child: Container(
height: 55.0,
height: 65.0,
width: 150.0,
decoration: BoxDecoration(
boxShadow: [
@ -148,7 +151,7 @@ class _TriglyceridesState extends State<Triglycerides> {
});
},
child: Container(
height: 55.0,
height: 65.0,
width: 150.0,
decoration: BoxDecoration(
color: cardMMOLColor,
@ -194,7 +197,7 @@ class _TriglyceridesState extends State<Triglycerides> {
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black45)),
labelText: " Enter the reading value",
labelText: TranslationBase.of(context).enterReadingValue,
labelStyle: TextStyle(
color: Colors.black87,
),
@ -207,7 +210,7 @@ class _TriglyceridesState extends State<Triglycerides> {
Visibility(
visible: _visible,
child: Container(
height: 95.0,
height: 115.0,
width: 350.0,
decoration: BoxDecoration(
color: Colors.white,
@ -220,7 +223,7 @@ class _TriglyceridesState extends State<Triglycerides> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Texts('Result:'),
Texts(TranslationBase.of(context).result + ":"),
Row(
children: [
Text(
@ -250,10 +253,11 @@ class _TriglyceridesState extends State<Triglycerides> {
),
Flexible(
child: Container(
height: 100.0,
height: 60.0,
width: 250.0,
child: Button(
label: 'CALCULATE',
child: SecondaryButton(
label:
TranslationBase.of(context).calculate.toUpperCase(),
onTap: () {
setState(() {
_visible == false

@ -1,14 +1,15 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
//import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/core/service/blood/blood_details_servies.dart';
import 'package:diplomaticquarterapp/core/viewModels/blooddonation/blood_details_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart';
@ -27,6 +28,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
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';
@ -39,8 +41,8 @@ import 'dialogs/SelectPatientInfoDialog.dart';
import 'new_text_Field.dart';
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
enum Gender{Male,Female,NON}
enum Blood{Oplus,Ominus,Aplus,Aminus,Bplus,Bminus,ABplus,ABminus,NON}
enum Gender { Male, Female, NON }
enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON }
class BloodDonationPage extends StatefulWidget {
@override
@ -51,8 +53,8 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
TextEditingController _fileTextController = TextEditingController();
TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON;
Gender gender = Gender.Male;//Gender.NON;
Blood blood = Blood.Aminus;//Blood.NON;
Gender gender = Gender.Male; //Gender.NON;
Blood blood = Blood.Aminus; //Blood.NON;
//HospitalsModel _selectedHospital;
CitiesModel _selectedHospital;
@ -62,22 +64,27 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
AuthenticatedUser authenticatedUser;
GetAllSharedRecordsByStatusList selectedPatientFamily;
AdvanceModel advanceModel = AdvanceModel();
List_BloodGroupDetailsModel bloodDetails=List_BloodGroupDetailsModel();
List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-");
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
var checkedValue = false;
var checkedValue = false;
@override
void initState() {
super.initState();
getAuthUser();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return BaseView<MyBalanceViewModel>(
onModelReady: (model) => model.getCities(),//model.getHospitals(),
onModelReady: (model) => model.getCities(), //model.getHospitals(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: "Blood Donation",//TranslationBase.of(context).advancePayment,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).bloodD,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
@ -86,15 +93,16 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
// TranslationBase.of(context).advancePaymentLabel,
"Enter the required information, In order to register for Blood Donation Service",//+model.user.firstName,
TranslationBase.of(context).bloodDEnterDesc,
textAlign: TextAlign.center,
),
SizedBox(
height: 12,
),
InkWell(
onTap: () => confirmSelectHospitalDialog(model.CitiesModelList),//model.hospitals
onTap: () =>
confirmSelectHospitalDialog(model.CitiesModelList),
//model.hospitals
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
@ -105,7 +113,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getHospitalName()),
Texts(getHospitalName(projectProvider, context)),
Icon(Icons.arrow_drop_down)
],
),
@ -116,7 +124,8 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
),
InkWell(
//======Gender========
onTap: () => confirmSelectGenderDialog(),//confirmSelectBeneficiaryDialog(model),
onTap: () => confirmSelectGenderDialog(),
//confirmSelectBeneficiaryDialog(model),
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
@ -128,49 +137,19 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
//Texts(getBeneficiaryType()),
Texts(getGender()),
Texts(getGender(context)),
Icon(Icons.arrow_drop_down)
],
),
),
),
// if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
// SizedBox(
// height: 12,
// ),
// if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
// InkWell(
// onTap: () {
// model.getFamilyFiles().then((value) {
// confirmSelectFamilyDialog(model
// .getAllSharedRecordsByStatusResponse
// .getAllSharedRecordsByStatusList);
// }).showProgressBar(
// text: "Loading",
// backgroundColor: Colors.blue.withOpacity(0.6));
// },
// child: Container(
// padding: EdgeInsets.all(12),
// width: double.infinity,
// height: 65,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Texts(getFamilyMembersName()),
// Icon(Icons.arrow_drop_down)
// ],
// ),
// ),
// ),
SizedBox(
height: 12,
),
InkWell(
//======Gender========
onTap: () => confirmSelectBloodDialog(),//confirmSelectBeneficiaryDialog(model),
onTap: () => confirmSelectBloodDialog(),
//confirmSelectBeneficiaryDialog(model),
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
@ -188,44 +167,14 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
),
),
),
// if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
// SizedBox(
// height: 12,
// ),
// if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
// InkWell(
// onTap: () {
// model.getFamilyFiles().then((value) {
// confirmSelectFamilyDialog(model
// .getAllSharedRecordsByStatusResponse
// .getAllSharedRecordsByStatusList);
// }).showProgressBar(
// text: "Loading",
// backgroundColor: Colors.blue.withOpacity(0.6));
// },
// child: Container(
// padding: EdgeInsets.all(12),
// width: double.infinity,
// height: 65,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Texts(getFamilyMembersName()),
// Icon(Icons.arrow_drop_down)
// ],
// ),
// ),
// ),
SizedBox(
height: 12,
),
Row(
children: [
Container(
child: Text(" To view the terms and conditions "),
child: Text(
TranslationBase.of(context).viewTermsConditions),
),
SizedBox(
width: MediaQuery.of(context).size.height * 0.10,
@ -233,10 +182,14 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
InkWell(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => UserAgreementPage()));
builder: (BuildContext context) =>
UserAgreementPage()));
},
child: Container(
child: Texts(" Click here ",color: Colors.blue,),
child: Texts(
TranslationBase.of(context).clickHere,
color: Colors.blue,
),
),
)
],
@ -247,99 +200,34 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
Row(
children: [
Checkbox(
onChanged: (bool value) {
onChanged: (bool value) {
setState(() {
checkedValue = value;
});
},
// tristate: checkedValue==true,//i == 1,
// tristate: checkedValue==true,//i == 1,
value: checkedValue,
activeColor: Colors.red,//Color(0xFF6200EE),
activeColor: Color(0xFFc5272d), //Color(0xFF6200EE),
),
SizedBox(
height: 10,
),
Row(
children: [],
),
SizedBox(height: 10,),
Row(children: [
],),
SizedBox(
width: 10,
),
Text(
'I agree to the terms and conditions ',
style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue? Colors.red : Colors.black),
TranslationBase.of(context)
.iAgreeToTheTermsAndConditions,
style: Theme.of(context).textTheme.subtitle1.copyWith(
color: checkedValue
? Color(0xFFc5272d)
: Colors.black),
),
],
),
// NewTextFields(
// hintText: TranslationBase.of(context).fileNumber,
// controller: _fileTextController,
// ),
// if (beneficiaryType == BeneficiaryType.OtherAccount)
// SizedBox(
// height: 12,
// ),
// if (beneficiaryType == BeneficiaryType.OtherAccount)
// InkWell(
// onTap: () {
// if (_fileTextController.text.isNotEmpty)
// model
// .getPatientInfoByPatientID(
// id: _fileTextController.text)
// .then((value) {
// confirmSelectPatientDialog(model.patientInfoList);
// }).showProgressBar(
// text: "Loading",
// backgroundColor:
// Colors.blue.withOpacity(0.6));
// else
// AppToast.showErrorToast(
// message: 'Please Enter The File Number');
// },
// child: Container(
// padding: EdgeInsets.all(12),
// width: double.infinity,
// height: 65,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Texts(getPatientName()),
// Icon(Icons.arrow_drop_down)
// ],
// ),
// ),
// ),
// SizedBox(
// height: 12,
// ),
// NewTextFields(
// hintText: TranslationBase.of(context).amount,
// keyboardType: TextInputType.number,
// onChanged: (value) {
// setState(() {
// amount = value;
// });
// },
// ),
// SizedBox(
// height: 12,
// ),
// NewTextFields(
// hintText: TranslationBase.of(context).depositorEmail,
// initialValue: model.user.emailAddress,
// onChanged: (value) {
// email = value;
// },
// ),
// SizedBox(
// height: 12,
// ),
// NewTextFields(
// hintText: TranslationBase.of(context).notes,
// controller: _notesTextController,
// ),
SizedBox(
height: 10,
),
@ -355,29 +243,25 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
onTap: () {
showDialog(
context: context,
builder: (_) =>
AssetGiffyDialog(
builder: (_) => AssetGiffyDialog(
title: Text(
"",
style: TextStyle(
fontSize: 22.0,
fontWeight:
FontWeight
.w600),
fontWeight: FontWeight.w600),
),
image: Image.asset(
'assets/images/BloodChrt_EN.png'),
buttonCancelText:
Text('cancel'),
buttonCancelColor:
Colors.grey,
buttonCancelText: Text(
TranslationBase.of(context).cancel),
buttonCancelColor: Colors.grey,
onlyCancelButton: true,
));
},
child: Container(
width: 250,
height: 200,
child:Image.asset(
child: Image.asset(
'assets/images/BloodChrt_EN.png')),
),
),
@ -395,25 +279,41 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity,
padding: EdgeInsets.all(12),
child: SecondaryButton(
textColor: Colors.white,
color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,),
label: "Save",
//
onTap: (){
bloodDetails.city=_selectedHospital.toString();
// bloodDetails.
color: checkedValue == false
? Color(0xFFa0a4a6)
: Color.fromRGBO(
63,
72,
74,
1,
),
label: TranslationBase.of(context).save,
onTap: () async {
if(_selectedHospital == null){
AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
return;
}
bloodDetails.city = projectProvider.isArabic
? _selectedHospital.descriptionN
: _selectedHospital.description;
bloodDetails.cityCode = _selectedHospital.iD.toString();
bloodDetails.gender = gender == Gender.Male ? 1 : 2;
await model.updateBloodGroup(bloodDetails);
if (model.state == ViewState.Idle) {
AppToast.showSuccessToast(
message: model.updatedRegisterBloodMessage);
} else {
AppToast.showErrorToast(message: model.error);
}
},
),
)),
);
}
//==============
void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) {
showDialog(
@ -435,94 +335,85 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
),
);
}
void confirmSelectBloodDialog(){
void confirmSelectBloodDialog() {
showDialog(
context: context,
child: SelectBloodDialog(bloodType: blood,
child: SelectBloodDialog(
bloodType: blood,
onValueSelected: (value) {
setState(() {
if (value == Blood.Oplus) {
bloodDetails.bloodGroup="O+";
bloodDetails.bloodGroup = "O+";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
}else
if (value == Blood.Ominus) {
} else if (value == Blood.Ominus) {
// _fileTextController.text = model.user.patientID.toString();
bloodDetails.bloodGroup="O-";
bloodDetails.bloodGroup = "O-";
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
}else
if (value == Blood.ABplus) {
bloodDetails.bloodGroup="AB+";
} else if (value == Blood.ABplus) {
bloodDetails.bloodGroup = "AB+";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
}else
if (value == Blood.ABminus) {
bloodDetails.bloodGroup="AB-";
} else if (value == Blood.ABminus) {
bloodDetails.bloodGroup = "AB-";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
}else
if (value == Blood.Aplus) {
bloodDetails.bloodGroup="A+";
} else if (value == Blood.Aplus) {
bloodDetails.bloodGroup = "A+";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
}else
if (value == Blood.Aminus) {
bloodDetails.bloodGroup="A-";
} else if (value == Blood.Aminus) {
bloodDetails.bloodGroup = "A-";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
}else
if (value == Blood.Bplus) {
bloodDetails.bloodGroup="B+";
} else if (value == Blood.Bplus) {
bloodDetails.bloodGroup = "B+";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
}else
if (value == Blood.Bminus) {
bloodDetails.bloodGroup="B-";
} else if (value == Blood.Bminus) {
bloodDetails.bloodGroup = "B-";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
}
else
} else
_fileTextController.text = "";
// beneficiaryType = value;
blood=value;
}
);
blood = value;
});
},
),
);
}
void confirmSelectGenderDialog(){
void confirmSelectGenderDialog() {
showDialog(
context: context,
child: SelectGenderDialog(beneficiaryType: gender,
child: SelectGenderDialog(
beneficiaryType: gender,
onValueSelected: (value) {
setState(() {
if (value == Gender.Male) {
// _fileTextController.text = model.user.patientID.toString();
bloodDetails.patientType=1;
bloodDetails.patientType = 1;
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else
// _fileTextController.text = "";
{bloodDetails.gender=2;}
// _fileTextController.text = "";
{
bloodDetails.gender = 2;
}
// beneficiaryType = value;
gender=value;
// beneficiaryType = value;
gender = value;
});
},
),
@ -591,23 +482,25 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
return TranslationBase.of(context).otherAccount;
break;
case BeneficiaryType.NON:
return "Select Gender";//TranslationBase.of(context).selectBeneficiary;
return TranslationBase.of(context).selectBeneficiary;
}
return "Select Gender";//TranslationBase.of(context).selectBeneficiary;
return TranslationBase.of(context).selectBeneficiary;
}
String getGender() {
String getGender(BuildContext context) {
switch (gender) {
case Gender.Male:
return "Male";
return TranslationBase.of(context).male;
case Gender.Female:
return "Female";
return TranslationBase.of(context).female;
break;
case Gender.NON:
return "Select Gender";//TranslationBase.of(context).selectBeneficiary;
return TranslationBase.of(context).selectGender;
}
return "Select Gender";//TranslationBase.of(context).selectBeneficiary;
return TranslationBase.of(context).selectGender;
}
String getBlood() {
switch (blood) {
case Blood.Oplus:
@ -639,18 +532,19 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
break;
case Blood.NON:
return "Select Blood Type";//TranslationBase.of(context).selectBeneficiary;
return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary;
}
return "Select Blood Type";//TranslationBase.of(context).selectBeneficiary;
return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary;
}
String getHospitalName() {
String getHospitalName(ProjectViewModel projectProvider, BuildContext context) {
if (_selectedHospital != null)
return _selectedHospital.description;
return projectProvider.isArabic
? _selectedHospital.descriptionN
: _selectedHospital.description;
else
return
"Riyadh";
// return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital;
return TranslationBase.of(context).selectCity;
// return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital;
}
String getPatientName() {
@ -677,8 +571,6 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
return TranslationBase.of(context).selectFamilyPatientName;
}
//================
//================
}

@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -166,7 +165,7 @@ class ConfirmPaymentPage extends StatelessWidget {
patientID: int.parse(advanceModel.fileNumber),
projectID: advanceModel.hospitalsModel.iD)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal &&
model.state != ViewState.Error) showSMSDialog();
});
@ -218,7 +217,8 @@ class ConfirmPaymentPage extends StatelessWidget {
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
browser);
browser,
false);
}
onBrowserLoadStart(String url) {
@ -277,8 +277,8 @@ class ConfirmPaymentPage extends StatelessWidget {
String paymentReference = res['Fort_id'].toString();
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service
.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'],
res['PaymentMethod'], AppGlobal.context)
.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'],
res['Fort_id'], res['PaymentMethod'], AppGlobal.context)
.then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
@ -315,5 +315,4 @@ class ConfirmPaymentPage extends StatelessWidget {
Future navigateToHome(context) async {
Navigator.of(context).pushNamed(HOME);
}
}

@ -38,7 +38,7 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
});
},
child: ListTile(
title: Text("Male"),
title: Text(TranslationBase.of(context).male),
leading: Radio(
value: Gender.Male,
groupValue: beneficiaryType,
@ -68,7 +68,7 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
});
},
child: ListTile(
title: Text("Female"),
title: Text(TranslationBase.of(context).female),
leading: Radio(
value: Gender.Female,
groupValue: beneficiaryType,

@ -1,55 +1,23 @@
import 'package:diplomaticquarterapp/core/viewModels/TermsConditionsViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_html/flutter_html.dart';
class UserAgreementPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: "User Agreement",
body:
Container(
child:ListView(
scrollDirection: Axis.vertical,
children: <Widget>[
///////////
Column(
children: [
SizedBox(
height: 20,
),
Container(
child:Text("Communication via email, text messages and phone calls",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)),
),
SizedBox(
height: 20,
),
Container(
child:
Text("I understand that the contact number or Email that \n I have provided on registration will be used for communication by HMG.\n I hereby agree to be notified by HMG through SMS, Email or any other method for appointments notifications, current HMGs medical services, and any services introduced by the HMG in the future or any modifications made to the services offered by the HMG. And these messages may be submitted as evidence where the HMG has the right to use at any time whatsoever and as it sees fit.",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)),
),
SizedBox(
height: 20,
),
Container(
child:
Text("I understand the risks of communicating by email and text messages, in particular the privacy risks. \nI understand that HMG cannot guarantee the security and confidentiality of email or text communication. HMG will not be responsible for messages that are not received or delivered due to technical failure, or for disclosure of confidential information unless caused by intentional misconduct.",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)),
),
SizedBox(
height: 20,
),
Container(
child:
Text("\b I hereby agree to receive emails, text messages, phone calls for appointments notifications, special promotions and new features or products introduced by HMG or any third party.",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)),
),
],
)
///////////
])
));
return BaseView<TermsConditionsViewModel>(
onModelReady: (model) => model.getUserTermsAndConditions(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).userAgreement,
body: SingleChildScrollView(
child: Html(
data: model.userAgreementContent,
),
)),
);
}
}

@ -187,27 +187,29 @@ class _BookConfirmState extends State<BookConfirm> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Image.asset(
"assets/images/new-design/icon_hospital.png"),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text(
TranslationBase.of(context).hospital +
": " +
widget.doctor.projectName,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
),
],
),
!widget.isLiveCareAppointment ? Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
margin:
EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Image.asset(
"assets/images/new-design/icon_hospital.png"),
),
Container(
margin:
EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text(
TranslationBase.of(context).hospital +
": " +
widget.doctor.projectName,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
),
],
) : Container(),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
@ -325,7 +327,8 @@ class _BookConfirmState extends State<BookConfirm> {
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(
TranslationBase.of(context).gender + ": " +
TranslationBase.of(context).gender +
": " +
widget.authUser.genderDescription,
style: TextStyle(
fontSize: 12.0,
@ -335,7 +338,9 @@ class _BookConfirmState extends State<BookConfirm> {
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
child: Text(
TranslationBase.of(context).age + ": " + widget.authUser.age.toString(),
TranslationBase.of(context).age +
": " +
widget.authUser.age.toString(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -423,7 +428,8 @@ class _BookConfirmState extends State<BookConfirm> {
context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
AppToast.showSuccessToast(
message: TranslationBase.of(context).bookedSuccess);
print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 500), () {
@ -543,13 +549,13 @@ class _BookConfirmState extends State<BookConfirm> {
getLiveCareAppointmentPatientShare(context, String appointmentNo,
int clinicID, int projectID, DoctorList docObject) {
GifLoaderDialogUtils.hideDialog(context);
widget.service
.getLiveCareAppointmentPatientShare(
appointmentNo, clinicID, projectID, context)
.then((res) {
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
GifLoaderDialogUtils.hideDialog(context);
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);

@ -255,7 +255,7 @@ class _BookSuccessState extends State<BookSuccess> {
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF40ACC9),
color: new Color(0xffc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
@ -318,7 +318,7 @@ class _BookSuccessState extends State<BookSuccess> {
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF40ACC9),
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
@ -637,7 +637,12 @@ class _BookSuccessState extends State<BookSuccess> {
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
widget.browser);
widget.browser,
widget.patientShareResponse.isLiveCareAppointment,
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID,
widget.patientShareResponse.doctorID);
}
}

@ -61,7 +61,7 @@ class DoctorView extends StatelessWidget {
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(this.doctor.clinicName,
child: Text(this.doctor.clinicName != null ? this.doctor.clinicName : "",
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.da
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';
@ -469,9 +470,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
}
bookCovidTestAppointment() {
// Navigator.push(context,
// MaterialPageRoute(builder: (context) => CovidPaymentAlert()));
GifLoaderDialogUtils.showMyDialog(context);
DoctorList docObject = new DoctorList();
docObject.doctorID = widget.selectedDoctorID;
docObject.clinicID = widget.selectedClinicID;
@ -494,11 +493,12 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
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);
});
// Future.delayed(new Duration(milliseconds: 1800), () {
getPatientShare(context, res['AppointmentNo'], docObject.clinicID,
docObject.projectID, docObject);
// });
} else {
GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
@ -529,14 +529,16 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo,
BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
ConfirmDialog.closeAlertDialog(context);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () {
insertAppointmentCovidTest(context, docObject);
});
// Future.delayed(new Duration(milliseconds: 1500), () {
insertAppointmentCovidTest(context, docObject);
// });
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
@ -592,6 +594,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
});
} else {}
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -58,6 +59,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
ProjectViewModel projectViewModel;
AuthenticatedUser user;
VitalSignService _vitalSignService = locator<VitalSignService>();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
var isVaiable = false;
@override
void initState() {
@ -728,6 +731,12 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
authenticatedUserObject.user;
Provider.of<ProjectViewModel>(context, listen: false)
.setUser(authenticatedUserObject.user);
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if(pharmacyModuleViewModel.error.isNotEmpty)
await pharmacyModuleViewModel.createUser();
});
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {

@ -107,7 +107,7 @@ class _AmbulanceReqState extends State<AmbulanceReq>
Container(
width: MediaQuery.of(context).size.width * 0.30,
child: Center(
child: Texts("Orders Log"),
child: Texts(TranslationBase.of(context).ordersLog),
),
),
],

@ -46,7 +46,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@override
Widget build(BuildContext context) {
return AppScaffold(
body: false
body: widget.amRequestViewModel.pickUpRequestPresOrder != null
? Column(
children: [
SizedBox(

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.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/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -45,306 +46,309 @@ class _BillAmountState extends State<BillAmount> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).billAmount),
SizedBox(
height: 10,
),
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 1.0, color: Colors.grey[300]),
outside: BorderSide(width: 1.0, color: Colors.grey[300])),
children: [
TableRow(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
return AppScaffold(
isShowDecPage: false,
isShowAppBar: false,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).billAmount),
SizedBox(
height: 10,
),
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 1.0, color: Colors.grey[300]),
outside: BorderSide(width: 1.0, color: Colors.grey[300])),
children: [
TableRow(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).patientShareB,
textAlign: TextAlign.start,
color: Colors.black,
fontSize: 15,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).patientShareB,
textAlign: TextAlign.start,
color: Colors.black,
fontSize: 15,
),
),
),
),
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}',
color: Colors.black,
textAlign: TextAlign.start,
fontSize: 15,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}',
color: Colors.black,
textAlign: TextAlign.start,
fontSize: 15,
),
),
),
),
],
),
TableRow(
children: [
Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.09,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).patientShareTax,
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
),
),
Container(
height: MediaQuery.of(context).size.height * 0.09,
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
],
),
TableRow(
children: [
Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.09,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).patientShareTax,
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
),
),
),
],
),
TableRow(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
Container(
height: MediaQuery.of(context).size.height * 0.09,
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10.0),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).patientShareTotal,
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
bold: true,
],
),
TableRow(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10.0),
),
),
),
),
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10.0),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).patientShareTotal,
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
bold: true,
),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
),
),
),
],
),
],
),
SizedBox(
height: 10,
),
Texts(TranslationBase.of(context).selectAmbulate,bold: true,),
SizedBox(height: 5,),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Wheelchair;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text(TranslationBase.of(context).wheelchair),
leading: Radio(
value: Ambulate.Wheelchair,
groupValue: _ambulate,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
],
),
],
),
SizedBox(
height: 10,
),
Texts(TranslationBase.of(context).selectAmbulate,bold: true,),
SizedBox(height: 5,),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Wheelchair;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text(TranslationBase.of(context).wheelchair),
leading: Radio(
value: Ambulate.Wheelchair,
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Walker;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text(TranslationBase.of(context).walker),
leading: Radio(
value: Ambulate.Walker,
groupValue: _ambulate,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Walker;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text(TranslationBase.of(context).walker),
leading: Radio(
value: Ambulate.Walker,
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
),
),
),
),
),
],
),
SizedBox(height: 5,),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Stretcher;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text(TranslationBase.of(context).stretcher),
leading: Radio(
value: Ambulate.Stretcher,
groupValue: _ambulate,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
],
),
SizedBox(height: 5,),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Stretcher;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text(TranslationBase.of(context).stretcher),
leading: Radio(
value: Ambulate.Stretcher,
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.None;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text(TranslationBase.of(context).none),
leading: Radio(
value: Ambulate.None,
groupValue: _ambulate,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.None;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text(TranslationBase.of(context).none),
leading: Radio(
value: Ambulate.None,
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
),
),
),
),
),
],
),
SizedBox(height: 12,),
NewTextFields(
hintText: TranslationBase.of(context).notes,
initialValue: note,
onChanged: (value){
setState(() {
note = value;
});
},
),
SizedBox(
height: 15,
),
Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 76,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
],
),
SizedBox(height: 12,),
NewTextFields(
hintText: TranslationBase.of(context).notes,
initialValue: note,
onChanged: (value){
setState(() {
widget.patientER.ambulate = _ambulate;
widget.patientER.requesterNote = note;
widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber();
widget.changeCurrentTab(3);
note = value;
});
},
label: TranslationBase.of(context).next,
),
)
],
SizedBox(
height: 15,
),
],
),
),
),
bottomSheet: Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 90,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientER.ambulate = _ambulate;
widget.patientER.requesterNote = note;
widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber();
widget.changeCurrentTab(3);
});
},
label: TranslationBase.of(context).next,
),
),
);

@ -5,23 +5,20 @@ import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.da
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/Blood/dialogs/SelectHospitalDialog.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/uitl/ProgressDialog.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/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/pickupLocation/PickupLocationFromMap.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import '../AmbulanceReq.dart';
import '../AvailableAppointmentsPage.dart';
enum HaveAppointment { YES, NO }
@ -68,370 +65,397 @@ class _PickupLocationState extends State<PickupLocation> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.patientER.direction == 1)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).pickupLocation),
SizedBox(
height: 15,
),
InkWell(
onTap: (){
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
onPick: (value) {
return AppScaffold(
isShowAppBar: false,
isShowDecPage: false,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.patientER.direction == 1)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).pickupLocation),
SizedBox(
height: 15,
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
onPick: (value) {
setState(() {
_result = value;
});
},
),
),
);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getSelectFromMapName(context))),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
),
),
),
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).pickupSpot),
SizedBox(
height: 5,
),
InkWell(
onTap: () {
setState(() {
_isInsideHome = !_isInsideHome;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).insideHome),
leading: Checkbox(
value: _isInsideHome,
onChanged: (value) {
setState(() {
_result = value;
_isInsideHome = value;
});
},
),
),
);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getSelectFromMapName(context)),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
),
),
),
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).pickupSpot),
SizedBox(
height: 5,
),
InkWell(
onTap: () {
setState(() {
_isInsideHome = !_isInsideHome;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).insideHome),
leading: Checkbox(
activeColor: Colors.red[800],
value: _isInsideHome,
onChanged: (value) {
setState(() {
_isInsideHome = value;
});
},
),
),
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).haveAppo),
SizedBox(
height: 5,
),
),
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).haveAppo),
SizedBox(
height: 5,
),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
if (myAppointment == null) {
getAppointment();
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
if (myAppointment == null) {
getAppointment();
setState(() {
_haveAppointment = HaveAppointment.YES;
});
}
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).yes),
leading: Radio(
value: HaveAppointment.YES,
groupValue: _haveAppointment,
onChanged: (value) {
if (myAppointment == null) {
getAppointment();
setState(() {
_haveAppointment = value;
});
}
},
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_haveAppointment = HaveAppointment.YES;
_haveAppointment = HaveAppointment.NO;
myAppointment = null;
});
}
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).yes),
leading: Radio(
value: HaveAppointment.YES,
groupValue: _haveAppointment,
activeColor: Colors.red[800],
onChanged: (value) {
if (myAppointment == null) {
getAppointment();
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).no),
leading: Radio(
value: HaveAppointment.NO,
groupValue: _haveAppointment,
onChanged: (value) {
setState(() {
_haveAppointment = value;
myAppointment = null;
});
}
},
},
),
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_haveAppointment = HaveAppointment.NO;
myAppointment = null;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).no),
leading: Radio(
value: HaveAppointment.NO,
groupValue: _haveAppointment,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_haveAppointment = value;
myAppointment = null;
});
},
),
),
),
),
),
],
),
if (myAppointment != null)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
AppointmentCard(
appointment: myAppointment,
)
],
),
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).dropoffLocation),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectHospitalDialog(
widget.amRequestViewModel.hospitals);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
if (myAppointment != null)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(getHospitalName(TranslationBase.of(context).pickupLocation)),
Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
SizedBox(
height: 12,
),
AppointmentCard(
appointment: myAppointment,
)
],
),
SizedBox(
height: 12,
),
),
],
),
if (widget.patientER.direction == 0)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).pickupLocation),
SizedBox(
height: 15,
),
InkWell(
onTap: () {
confirmSelectHospitalDialog(
widget.amRequestViewModel.hospitals);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
Texts(TranslationBase.of(context).dropoffLocation),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectHospitalDialog(
widget.amRequestViewModel.hospitals);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getHospitalName(
TranslationBase.of(context).pickupLocation)),
Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
],
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getHospitalName(TranslationBase.of(context).pickupLocation)),
Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
],
),
],
),
if (widget.patientER.direction == 0)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).pickupLocation),
SizedBox(
height: 15,
),
InkWell(
onTap: () {
confirmSelectHospitalDialog(
widget.amRequestViewModel.hospitals);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getHospitalName(
TranslationBase.of(context).pickupLocation)),
Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
],
),
),
),
),
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).dropoffLocation),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
onPick: (value) {
setState(() {
_result = value;
});
},
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).dropoffLocation),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
onPick: (value) {
setState(() {
_result = value;
});
},
),
),
);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getSelectFromMapName(context))),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
),
);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getSelectFromMapName(context)),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
),
),
),
],
],
),
SizedBox(
height: 45,
),
SizedBox(
height: 45,
),
Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 76,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
if (_result == null || _selectedHospital == null)
AppToast.showErrorToast(
message: TranslationBase.of(context).selectAll);
else
setState(() {
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
if (widget.patientER.direction == 0) {
widget.patientER.pickupLocationLattitude = _result.geometry.location.lat.toString();
widget.patientER.pickupLocationLongitude = _result.geometry.location.lng.toString();
widget.patientER.dropoffLocationLattitude = _selectedHospital.latitude;
widget.patientER.dropoffLocationLongitude = _selectedHospital.longitude;
} else {
widget.patientER.pickupLocationLattitude = _selectedHospital.latitude;
widget.patientER.pickupLocationLongitude = _selectedHospital.longitude;
widget.patientER.dropoffLocationLattitude = _result.geometry.location.lat.toString();
widget.patientER.dropoffLocationLongitude = _result.geometry.location.lng.toString();
}
],
),
),
),
bottomSheet: Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 90,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
if (_result == null || _selectedHospital == null)
AppToast.showErrorToast(
message: TranslationBase.of(context).selectAll);
else
setState(() {
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
if (widget.patientER.direction == 0) {
widget.patientER.pickupLocationLattitude =
_result.geometry.location.lat.toString();
widget.patientER.pickupLocationLongitude =
_result.geometry.location.lng.toString();
widget.patientER.dropoffLocationLattitude =
_selectedHospital.latitude;
widget.patientER.dropoffLocationLongitude =
_selectedHospital.longitude;
} else {
widget.patientER.pickupLocationLattitude =
_selectedHospital.latitude;
widget.patientER.pickupLocationLongitude =
_selectedHospital.longitude;
widget.patientER.dropoffLocationLattitude =
_result.geometry.location.lat.toString();
widget.patientER.dropoffLocationLongitude =
_result.geometry.location.lng.toString();
}
widget.patientER.latitude = widget.patientER.pickupLocationLattitude;
widget.patientER.longitude = widget.patientER.pickupLocationLongitude;
widget.patientER.dropoffLocationName = _selectedHospital.name;
widget.patientER.createdBy = widget.amRequestViewModel.user.patientID;
widget.patientER.isOutPatient = widget.amRequestViewModel.user.outSA;
widget.patientER.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo;
widget.patientER.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now());
widget.patientER.pickupLocationName = _result.formattedAddress;
widget.patientER.projectID = widget.amRequestViewModel.user.projectID;
widget.patientER.requesterFileNo = widget.amRequestViewModel.user.patientID;
widget.patientER.requesterIsOutSA = false;
widget.patientER.lineItemNo =0;
widget.patientER.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber;
widget.patientER.latitude =
widget.patientER.pickupLocationLattitude;
widget.patientER.longitude =
widget.patientER.pickupLocationLongitude;
widget.patientER.dropoffLocationName =
_selectedHospital.name;
widget.patientER.createdBy =
widget.amRequestViewModel.user.patientID;
widget.patientER.isOutPatient =
widget.amRequestViewModel.user.outSA;
widget.patientER.patientIdentificationID = widget
.amRequestViewModel.user.patientIdentificationNo;
widget.patientER.pickupDateTime =
DateUtil.convertDateToStringLocation(DateTime.now());
widget.patientER.pickupLocationName =
_result.formattedAddress;
widget.patientER.projectID =
widget.amRequestViewModel.user.projectID;
widget.patientER.requesterFileNo =
widget.amRequestViewModel.user.patientID;
widget.patientER.requesterIsOutSA = false;
widget.patientER.lineItemNo = 0;
widget.patientER.requesterMobileNo =
widget.amRequestViewModel.user.mobileNumber;
if (_haveAppointment == HaveAppointment.YES) {
widget.patientER.appointmentNo = myAppointment.appointmentNo.toString();
widget.patientER.appointmentClinicName = myAppointment.clinicName;
widget.patientER.appointmentDoctorName = myAppointment.doctorNameObj;
widget.patientER.appointmentBranch = myAppointment.projectName;
widget.patientER.appointmentTime = myAppointment.appointmentDate;
widget.patientER.haveAppointment = true;
} else {
widget.patientER.appointmentNo = "0";
widget.patientER.appointmentClinicName = null;
widget.patientER.appointmentDoctorName = null;
widget.patientER.appointmentBranch = null;
widget.patientER.appointmentTime = null;
widget.patientER.haveAppointment = false;
}
if (_haveAppointment == HaveAppointment.YES) {
widget.patientER.appointmentNo =
myAppointment.appointmentNo.toString();
widget.patientER.appointmentClinicName =
myAppointment.clinicName;
widget.patientER.appointmentDoctorName =
myAppointment.doctorNameObj;
widget.patientER.appointmentBranch =
myAppointment.projectName;
widget.patientER.appointmentTime =
myAppointment.appointmentDate;
widget.patientER.haveAppointment = true;
} else {
widget.patientER.appointmentNo = "0";
widget.patientER.appointmentClinicName = null;
widget.patientER.appointmentDoctorName = null;
widget.patientER.appointmentBranch = null;
widget.patientER.appointmentTime = null;
widget.patientER.haveAppointment = false;
}
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
widget.changeCurrentTab(2);
});
},
label: TranslationBase.of(context).next,
),
)
],
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
widget.changeCurrentTab(2);
});
},
label: TranslationBase.of(context).next,
),
),
);
@ -457,11 +481,13 @@ class _PickupLocationState extends State<PickupLocation> {
}
String getSelectFromMapName(context) {
return _result != null ? _result.formattedAddress : TranslationBase.of(context).selectMap;
return _result != null
? _result.formattedAddress
: TranslationBase.of(context).selectMap;
}
getAppointment() {
ProgressDialogUtil.showProgressDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.amRequestViewModel.getAppointmentHistory().then((value) {
if (widget.amRequestViewModel.state == ViewState.Error ||
widget.amRequestViewModel.state == ViewState.ErrorLocal) {
@ -469,7 +495,7 @@ class _PickupLocationState extends State<PickupLocation> {
} else if (widget
.amRequestViewModel.appoitmentAllHistoryResultList.length >
0) {
ProgressDialogUtil.hideProgressDialog(context);
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(
context,
MaterialPageRoute(
@ -491,14 +517,15 @@ class _PickupLocationState extends State<PickupLocation> {
}
});
} else {
ProgressDialogUtil.hideProgressDialog(context);
GifLoaderDialogUtils.hideDialog(context);
setState(() {
_haveAppointment = HaveAppointment.NO;
});
AppToast.showErrorToast(message: TranslationBase.of(context).noAppointment);
AppToast.showErrorToast(
message: TranslationBase.of(context).noAppointment);
}
}).catchError((e) {
ProgressDialogUtil.hideProgressDialog(context);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: e);
});
}

@ -1,15 +1,15 @@
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
enum Direction { ToHospital, FromHospital }
enum Way { OneWay, TwoWays }
@ -58,251 +58,267 @@ class _SelectTransportationMethodState
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).transportHeading),
...List.generate(
widget.amRequestViewModel.amRequestModeList.length,
(index) => InkWell(
onTap: () {
setState(() {
_erTransportationMethod =
widget.amRequestViewModel.amRequestModeList[index];
});
},
child: Container(
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
children: [
Expanded(
flex: 3,
child: ListTile(
title: Text(widget.amRequestViewModel
.amRequestModeList[index].title),
leading: Radio(
value: widget
.amRequestViewModel.amRequestModeList[index],
groupValue: _erTransportationMethod,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_erTransportationMethod = value;
});
},
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: false,
isShowDecPage: false,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).transportHeading),
...List.generate(
widget.amRequestViewModel.amRequestModeList.length,
(index) => InkWell(
onTap: () {
setState(() {
_erTransportationMethod =
widget.amRequestViewModel.amRequestModeList[index];
});
},
child: Container(
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
children: [
Expanded(
flex: 3,
child: ListTile(
title: Texts(projectViewModel.isArabic
? widget.amRequestViewModel
.amRequestModeList[index].titleAR
: widget.amRequestViewModel
.amRequestModeList[index].title),
leading: Radio(
value: widget
.amRequestViewModel.amRequestModeList[index],
groupValue: _erTransportationMethod,
onChanged: (value) {
setState(() {
_erTransportationMethod = value;
});
},
),
),
),
),
Expanded(
flex: 1,
child: Texts(
TranslationBase.of(context).sar+' ${widget.amRequestViewModel.amRequestModeList[index].price}'),
)
],
Expanded(
flex: 1,
child: Texts(TranslationBase.of(context).sar +
' ${widget.amRequestViewModel.amRequestModeList[index].price}'),
)
],
),
),
),
),
),
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).directionHeading),
SizedBox(
height: 5,
),
Container(
width: double.maxFinite,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_direction = Direction.ToHospital;
});
},
child: Container(
width: double.maxFinite,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text(TranslationBase.of(context).toHospital),
leading: Radio(
value: Direction.ToHospital,
groupValue: _direction,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_direction = value;
});
},
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).directionHeading),
SizedBox(
height: 5,
),
Container(
width: double.maxFinite,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_direction = Direction.ToHospital;
});
},
child: Container(
width: double.maxFinite,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).toHospital),
leading: Radio(
value: Direction.ToHospital,
groupValue: _direction,
onChanged: (value) {
setState(() {
_direction = value;
});
},
),
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_direction = Direction.FromHospital;
});
},
child: Container(
width: double.maxFinite,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text(TranslationBase.of(context).fromHospital),
leading: Radio(
value: Direction.FromHospital,
groupValue: _direction,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_direction = value;
});
},
Expanded(
child: InkWell(
onTap: () {
setState(() {
_direction = Direction.FromHospital;
});
},
child: Container(
width: double.maxFinite,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title:
Texts(TranslationBase.of(context).fromHospital),
leading: Radio(
value: Direction.FromHospital,
groupValue: _direction,
onChanged: (value) {
setState(() {
_direction = value;
});
},
),
),
),
),
),
),
],
],
),
),
),
if (_direction == Direction.ToHospital)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 8,
),
Texts(TranslationBase.of(context).directionHeading),
SizedBox(
height: 5,
),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_way = Way.OneWay;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text(TranslationBase.of(context).oneDirec),
leading: Radio(
value: Way.OneWay,
groupValue: _way,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_way = value;
});
},
if (_direction == Direction.ToHospital)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 8,
),
Texts(TranslationBase.of(context).directionHeading),
SizedBox(
height: 5,
),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_way = Way.OneWay;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title:
Texts(TranslationBase.of(context).oneDirec),
leading: Radio(
value: Way.OneWay,
groupValue: _way,
onChanged: (value) {
setState(() {
_way = value;
});
},
),
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_way = Way.TwoWays;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text(TranslationBase.of(context).twoDirec),
leading: Radio(
value: Way.TwoWays,
groupValue: _way,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_way = value;
});
},
Expanded(
child: InkWell(
onTap: () {
setState(() {
_way = Way.TwoWays;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title:
Texts(TranslationBase.of(context).twoDirec),
leading: Radio(
value: Way.TwoWays,
groupValue: _way,
onChanged: (value) {
setState(() {
_way = value;
});
},
),
),
),
),
),
),
],
),
],
),
SizedBox(
height: 15,
),
Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 76,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientER.transportationMethodId =(widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 0;
widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER.patientERTransportationMethod = _erTransportationMethod;
widget.patientER.orderServiceID = _orderService.getIdOrderService();
widget.patientER.pickupUrgency = 1;
widget.patientER.lineItemNo = 1;
widget.patientER.cost = _erTransportationMethod.price;
widget.patientER.vAT = _erTransportationMethod.vAT ?? 0;
widget.patientER.totalPrice = _erTransportationMethod.totalPrice;
widget.changeCurrentTab(1);
});
},
label: TranslationBase.of(context).next,
],
),
],
),
SizedBox(
height: 15,
),
)
],
],
),
),
),
bottomSheet: Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 90,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientER.transportationMethodId = (widget
.amRequestViewModel.amRequestModeList
.indexOf(_erTransportationMethod) +
1);
widget.patientER.direction =
_direction == Direction.ToHospital ? 1 : 0;
widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER.selectedAmbulate = (widget
.amRequestViewModel.amRequestModeList
.indexOf(_erTransportationMethod) +
1);
widget.patientER.patientERTransportationMethod =
_erTransportationMethod;
widget.patientER.orderServiceID =
_orderService.getIdOrderService();
widget.patientER.pickupUrgency = 1;
widget.patientER.lineItemNo = 1;
widget.patientER.cost = _erTransportationMethod.price;
widget.patientER.vAT = _erTransportationMethod.vAT ?? 0;
widget.patientER.totalPrice =
_erTransportationMethod.totalPrice;
widget.changeCurrentTab(1);
});
},
label: TranslationBase.of(context).next,
),
),
);

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.da
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/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
@ -18,89 +19,93 @@ class Summary extends StatefulWidget {
_SummaryState createState() => _SummaryState();
}
//TODO it should be dynamic
class _SummaryState extends State<Summary> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).RRTSummary),
SizedBox(height: 5,),
Container(
width: double.infinity,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,),
Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,),
SizedBox(height: 8,),
return AppScaffold(
isShowDecPage: false,
isShowAppBar: false,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).RRTSummary),
SizedBox(height: 5,),
Container(
width: double.infinity,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,),
Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,),
SizedBox(height: 8,),
Texts(TranslationBase.of(context).directions,color: Colors.grey,),
Texts('From Hospital',bold: true,),
SizedBox(height: 8,),
Texts(TranslationBase.of(context).directions,color: Colors.grey,),
Texts(widget.patientER.direction ==0? TranslationBase.of(context).toHospital:TranslationBase.of(context).fromHospital,bold: true,),
SizedBox(height: 8,),
Texts('Pickup Location',color: Colors.grey,),
Texts('SZR Medical Center',bold: true,),
SizedBox(height: 8,),
Texts(TranslationBase.of(context).pickupLocation,color: Colors.grey,),
Texts('${widget.patientER.pickupLocationName}',bold: true,),
SizedBox(height: 8,),
Texts('Drop off location',color: Colors.grey,),
Texts('6199, Al Ameen wlfn nif',bold: true,),
SizedBox(height: 8,),
Texts(TranslationBase.of(context).dropoffLocation,color: Colors.grey,),
Texts('${widget.patientER.dropoffLocationName}',bold: true,),
SizedBox(height: 8,),
Texts('Select Ambulate',color: Colors.grey,),
Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,),
SizedBox(height: 8,),
Texts(TranslationBase.of(context).selectAmbulate,color: Colors.grey,),
Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,),
SizedBox(height: 8,),
Texts('Note',color: Colors.grey,),
Texts('${widget.patientER.requesterNote?? '---'}',bold: true,),
SizedBox(height: 8,),
],
),
),
SizedBox(height: 20,),
Texts('Bill Amount',textAlign: TextAlign.start,),
SizedBox(height: 5,),
Container(
height: 55,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8)
Texts(TranslationBase.of(context).notes,color: Colors.grey,),
Texts('${widget.patientER.requesterNote?? '---'}',bold: true,),
SizedBox(height: 8,),
],
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts('Total amount payable:'),
Texts('SR ${widget.patientER.patientERTransportationMethod.totalPrice}')
],
SizedBox(height: 20,),
Texts(TranslationBase.of(context).billAmount,textAlign: TextAlign.start,),
SizedBox(height: 5,),
Container(
height: 55,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).patientShareTotal+':'),
Texts(TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}')
],
),
),
),
SizedBox(height: 45,),
Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 76,
child:SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
label: TranslationBase.of(context).send,
onTap: () async {
await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER);
SizedBox(height: 45,),
}
),
)
],
],
),
),
),
bottomSheet: Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 90,
child:SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
label: TranslationBase.of(context).send,
onTap: () async {
await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER);
}
),
),
);

@ -30,28 +30,28 @@ class OrderLogPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
OrderLogItem(
title: 'Request ID',
title: TranslationBase.of(context).reqId,
value: amRequestViewModel.patientAllPresOrdersList[index].iD
.toString(),
),
OrderLogItem(
title: 'Status',
title: TranslationBase.of(context).orderStatus,
value: amRequestViewModel
.patientAllPresOrdersList[index].description,
),
OrderLogItem(
title: 'Pickup Date',
title: TranslationBase.of(context).pickupDate,
value: DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(amRequestViewModel
.patientAllPresOrdersList[index].createdOn)),
),
OrderLogItem(
title: 'Pickup Location',
title: TranslationBase.of(context).pickupLocation,
value: amRequestViewModel
.patientAllPresOrdersList[index].pickupLocationName,
),
OrderLogItem(
title: 'Drop off Location',
title: TranslationBase.of(context).dropoffLocation,
value: amRequestViewModel
.patientAllPresOrdersList[index].dropoffLocationName,
),

@ -13,7 +13,8 @@ class StepsWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return projectViewModel.isArabic? Stack(
return projectViewModel.isArabic?
Stack(
children: [
Container(
height: 50,
@ -29,7 +30,7 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 10,
left: 0,
right: 0,
child: InkWell(
onTap: () => changeCurrentTab(0),
child: Container(
@ -51,7 +52,7 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 10,
left: MediaQuery.of(context).size.width * 0.3,
right: MediaQuery.of(context).size.width * 0.3,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Container(
@ -73,7 +74,7 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 10,
left: MediaQuery.of(context).size.width * 0.6,
right: MediaQuery.of(context).size.width * 0.6,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Container(
@ -95,7 +96,7 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 10,
right: 0,
left: 0,
child: InkWell(
onTap: () => index == 2 ?changeCurrentTab(3):null,
child: Container(
@ -117,7 +118,8 @@ class StepsWidget extends StatelessWidget {
),
),
],
):Stack(
):
Stack(
children: [
Container(
height: 50,
@ -133,7 +135,7 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 10,
right: 0,
left: 0,
child: InkWell(
onTap: () => changeCurrentTab(0),
child: Container(
@ -155,7 +157,7 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 10,
right: MediaQuery.of(context).size.width * 0.3,
left: MediaQuery.of(context).size.width * 0.3,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Container(
@ -177,7 +179,7 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 10,
right: MediaQuery.of(context).size.width * 0.6,
left: MediaQuery.of(context).size.width * 0.6,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Container(
@ -199,7 +201,7 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 10,
left: 0,
right: 0,
child: InkWell(
onTap: () => index == 2 ?changeCurrentTab(3):null,
child: Container(

@ -166,7 +166,7 @@ class _ApointmentCardState extends State<AppointmentCard> {
),
Container(
transform:
Matrix4.translationValues(15.0, -40.0, 0.0),
Matrix4.translationValues(15.0, -40.0, 0.0),
child: projectViewModel.isArabic
? Image.asset(
"assets/images/new-design/arrow_menu_black-ar.png",

@ -13,7 +13,6 @@ import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -26,7 +25,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/countdown_timer_controller.dart';
import 'package:flutter_countdown_timer/current_remaining_time.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
@ -95,249 +93,315 @@ class _ToDoState extends State<ToDo> {
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Row(
children: <Widget>[
Image.asset(
"assets/images/new-design/time_icon.png",
width: 20.0,
height: 20.0),
Container(
margin:
EdgeInsets.only(left: 10.0, right: 10.0),
child: Text(
DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(
widget.appoList[index]
.appointmentDate),
projectViewModel.isArabic
? "ar"
: "en") +
" " +
widget.appoList[index].startTime
.substring(0, 5),
style: TextStyle(fontSize: 10.0)),
),
widget.appoList[index].isLiveCareAppointment
? SvgPicture.asset(
"assets/images/new-design/liveCare_logo_icon.svg",
width: 20.0,
height: 20.0)
: Image.asset(
"assets/images/new-design/hospital_address_icon.png",
width: 20.0,
height: 20.0),
Container(
margin:
EdgeInsets.only(left: 5.0, right: 5.0),
child: widget
.appoList[index].isLiveCareAppointment
? Text(
TranslationBase.of(context)
.liveCareAppo,
style: TextStyle(fontSize: 12.0))
: Text(
widget.appoList[index].projectName !=
null
? widget
.appoList[index].projectName
: "-",
overflow: TextOverflow.clip,
maxLines: 2,
style: TextStyle(fontSize: 10.0)),
),
],
),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Divider(
color: Colors.grey[500],
),
child: Column(
children: [
Container(
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
height: MediaQuery.of(context).size.height *
0.1,
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Row(
children: <Widget>[
Image.asset(
"assets/images/new-design/time_icon.png",
width: 20.0,
height: 20.0),
Container(
margin: EdgeInsets.only(
left: 10.0, right: 10.0),
child: Text(
DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(
widget.appoList[index]
.appointmentDate),
projectViewModel.isArabic
? "ar"
: "en") +
" " +
widget.appoList[index].startTime
.substring(0, 5),
style: TextStyle(fontSize: 10.0)),
),
!widget.appoList[index]
.isLiveCareAppointment
? Image.asset(
"assets/images/new-design/hospital_address_icon.png",
width: 20.0,
height: 20.0)
: Container(),
Container(
margin: EdgeInsets.only(
left: 5.0, right: 5.0),
child: widget.appoList[index]
.isLiveCareAppointment
? Container()
: Text(
widget.appoList[index]
.projectName !=
null
? widget.appoList[index]
.projectName
: "-",
overflow: TextOverflow.clip,
maxLines: 2,
style:
TextStyle(fontSize: 10.0)),
),
],
),
Container(
margin: EdgeInsets.only(top: 5.0),
child: ClipRRect(
borderRadius:
BorderRadius.circular(100.0),
child: Image.network(
widget.appoList[index].doctorImageURL,
fit: BoxFit.fill),
child: Divider(
color: Colors.grey[500],
),
),
),
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 10.0, left: 20.0, right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.appoList[index].doctorTitle +
" " +
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
height: MediaQuery.of(context)
.size
.height *
0.1,
margin: EdgeInsets.only(top: 5.0),
child: ClipRRect(
borderRadius:
BorderRadius.circular(100.0),
child: Image.network(
widget.appoList[index]
.doctorNameObj,
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight: FontWeight.bold,
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(
top: 3.0, bottom: 3.0),
child: Text(
getDoctorSpeciality(widget
.appoList[index]
.doctorSpeciality)
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
.doctorImageURL,
fit: BoxFit.fill),
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: widget
.appoList[index]
.actualDoctorRate
.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
],
),
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 10.0,
left: 20.0,
right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.appoList[index]
.doctorTitle +
" " +
widget.appoList[index]
.doctorNameObj,
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight:
FontWeight.bold,
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(
top: 3.0, bottom: 3.0),
child: Text(
getDoctorSpeciality(widget
.appoList[index]
.doctorSpeciality)
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: widget
.appoList[index]
.actualDoctorRate
.toDouble(),
size: 20.0,
filledColor:
Colors.yellow[700],
emptyColor:
Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon:
Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
],
),
Container(
child: CountdownTimer(
controller: new CountdownTimerController(
endTime: DateTime.now()
.millisecondsSinceEpoch +
(widget
.appoList[
index]
.remaniningHoursTocanPay *
1000) *
60),
widgetBuilder: (_,
CurrentRemainingTime
time) {
return time != null
? Text(
'${time.days != null ? time.days : "0"}:${time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours}:${time.min}:${time.sec} ' +
TranslationBase.of(
context)
.upcomingTimeLeft,
style: TextStyle(
fontSize: 12.0,
color: Color(
0xff40ACC9)))
: Container();
},
),
),
],
),
),
Container(
child: CountdownTimer(
controller: new CountdownTimerController(
endTime: DateTime.now()
.millisecondsSinceEpoch +
(widget.appoList[index]
.remaniningHoursTocanPay *
1000) *
60),
widgetBuilder:
(_, CurrentRemainingTime time) {
return time != null
? Text(
'${time.days}:${time.hours}:${time.min}:${time.sec} ' +
TranslationBase.of(
context)
.upcomingTimeLeft,
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => performNextAction(
widget.appoList[index]),
child: Container(
margin: EdgeInsets.only(top: 20.0),
child: Column(
children: <Widget>[
Image.asset(
getNextActionImage(widget
.appoList[index]
.nextAction),
width: 50.0,
height: 50.0),
Container(
margin:
EdgeInsets.only(top: 5.0),
child: Text(
getNextActionText(widget
.appoList[index]
.nextAction),
textAlign:
TextAlign.center,
style: TextStyle(
fontSize: 12.0,
color: Color(
0xff40ACC9)))
: Container();
},
fontSize: 12.0)),
)
],
),
),
),
],
),
)
],
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => performNextAction(
widget.appoList[index]),
child: Container(
margin: EdgeInsets.only(top: 20.0),
child: Column(
children: <Widget>[
Image.asset(
getNextActionImage(widget
Divider(
color: Colors.grey[500],
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 2,
child: Container(
child: Text(
getNextActionDescription(widget
.appoList[index].nextAction),
width: 50.0,
height: 50.0),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(
getNextActionText(widget
.appoList[index]
.nextAction),
textAlign: TextAlign.center,
style:
TextStyle(fontSize: 12.0)),
)
],
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[700])),
),
),
),
Expanded(
flex: 1,
child: GestureDetector(
onTap: () {
navigateToAppointmentDetails(
context,
widget.appoList[index]);
},
child: Container(
child: Text(
TranslationBase.of(context)
.upcomingDetails,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12.0,
color:
new Color(0xFF40ACC9),
decoration: TextDecoration
.underline)),
),
),
)
],
),
)
],
),
Divider(
color: Colors.grey[500],
],
),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 2,
child: Container(
child: Text(
getNextActionDescription(
widget.appoList[index].nextAction),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[700])),
),
),
Expanded(
flex: 1,
child: GestureDetector(
onTap: () {
navigateToAppointmentDetails(
context, widget.appoList[index]);
},
child: Container(
child: Text(
TranslationBase.of(context)
.upcomingDetails,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12.0,
color: new Color(0xFF40ACC9),
decoration:
TextDecoration.underline)),
),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10.0),
bottomRight: Radius.circular(10.0)),
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),
transform: Matrix4.translationValues(0.0, -8.0, 0.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
widget.appoList[index].isLiveCareAppointment
? Container(
margin: EdgeInsets.fromLTRB(
5.0, 0.0, 5.0, 0.0),
child: Image.asset(
"assets/images/new-design/video.png"),
)
: Container(
margin: EdgeInsets.fromLTRB(
5.0, 0.0, 5.0, 0.0),
child: Image.asset(
"assets/images/new-design/walkin.png"),
),
),
)
],
),
],
widget.appoList[index].isLiveCareAppointment
? Container(
child: Text(TranslationBase.of(context).videoAppo,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
)
: Container(
child: Text(TranslationBase.of(context).walkinAppo,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
)
],
),
),
),
],
),
);
},
@ -567,12 +631,34 @@ class _ToDoState extends State<ToDo> {
}
getPatientShare(context, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
if (appo.isLiveCareAppointment) {
getLiveCareAppointmentPatientShare(context, service, appo);
} else {
GifLoaderDialogUtils.showMyDialog(context);
service
.getPatientShare(appo.appointmentNo.toString(), appo.clinicID,
appo.projectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
}
getLiveCareAppointmentPatientShare(context, DoctorsListService service,
AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
service
.getPatientShare(appo.appointmentNo.toString(), appo.clinicID,
appo.projectID, context)
.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(),
appo.clinicID, appo.projectID, context)
.then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse);
@ -674,7 +760,12 @@ class _ToDoState extends State<ToDo> {
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
widget.browser);
widget.browser,
appo.isLiveCareAppointment,
appo.appointmentDate,
appo.appointmentNo,
appo.clinicID,
appo.doctorID);
}
onBrowserLoadStart(String url) {

@ -197,7 +197,7 @@ class _TodoListCardState extends State<TodoListCard> {
),
)
],
)
),
],
),
),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart';
@ -421,7 +422,7 @@ class _HomePageState extends State<HomePage> {
Navigator.push(
context,
FadePage(
page: HomeHealthCareIndexPage(),
page: HomeHealthCarePage(),
),
);
},
@ -436,10 +437,10 @@ class _HomePageState extends State<HomePage> {
height: 50,
),
SizedBox(
height: 3,
height: 10,
),
Texts(
TranslationBase.of(context).homeHealthCareService,
TranslationBase.of(context).cmcHeading,
textAlign: TextAlign.center,
color: Colors.white,
fontWeight: FontWeight.w700,
@ -505,7 +506,7 @@ class _HomePageState extends State<HomePage> {
height: 50,
),
SizedBox(
height: 3,
height:10,
),
Texts(
TranslationBase.of(context).emergencyService,

@ -326,6 +326,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
Permission.notification,
Permission.accessMediaLocation,
Permission.calendar,
Permission.activityRecognition
].request();
var permissionsGranted = await deviceCalendarPlugin.hasPermissions();
@ -606,6 +607,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return TranslationBase.of(context).medicalProfile;
case 2:
return TranslationBase.of(context).bookAppo;
case 5:
return TranslationBase.of(context).bookAppo;
case 3:
return TranslationBase.of(context).services;
case 4:

@ -1,19 +1,29 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:barcode_scan_fix/barcode_scan.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/parent_categorise_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/medicine_search_screen.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';
import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart';
import 'package:diplomaticquarterapp/pages/search_products_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart';
import '../offers_categorise_page.dart';
class LandingPagePharmacy extends StatefulWidget {
@override
_LandingPagePharmacyState createState() => _LandingPagePharmacyState();
@ -39,105 +49,107 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: currentTab == 0 || currentTab == 1
? 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,
)
],
),
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,
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SearchProductsPage()),
);
},
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',
),
),
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',
),
),
);
},
);
},
),
actions: [
IconButton(
// iconSize: 70,
icon: Image.asset(
'assets/images/new-design/qr-code.png',
),
actions: [
// IconButton(
// iconSize: 70,
// icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
// height: 100, width: 100, fit: BoxFit.cover),
// onPressed: () {
// triggerRobot();
// } //do something,
// )
],
centerTitle: true,
)
: currentTab == 4
? null
: AppBar(
backgroundColor: Color(0xff5AB145),
elevation: 0,
textTheme: TextTheme(
headline6: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text(getText(currentTab).toUpperCase()),
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.arrow_back),
color: Colors.white,
onPressed: () => Scaffold.of(context).openDrawer(),
);
},
),
actions: [
// IconButton(
// iconSize: 70,
// icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
// height: 100, width: 100, fit: BoxFit.cover),
// onPressed: () {
// triggerRobot();
// } //do something,
// )
],
centerTitle: true,
),
onPressed: _scanQrAndGetProduct //do something,
)
],
centerTitle: true,
),
// : currentTab == 4
// ? null:null,
// : AppBar(
// backgroundColor: Color(0xff5AB145),
// elevation: 0,
// textTheme: TextTheme(
// headline6: TextStyle(
// color: Colors.white, fontWeight: FontWeight.bold),
// ),
// title: Text(getText(currentTab).toUpperCase()),
// leading: Builder(
// builder: (BuildContext context) {
// return IconButton(
// icon: Icon(Icons.arrow_back),
// color: Colors.white,
// onPressed: () => Scaffold.of(context).openDrawer(),
// );
// },
// ),
// actions: [
// // IconButton(
// // iconSize: 70,
// // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
// // height: 100, width: 100, fit: BoxFit.cover),
// // onPressed: () {
// // triggerRobot();
// // } //do something,
// // )
// ],
// centerTitle: true,
// ),
extendBody: false,
body: PageView(
physics: NeverScrollableScrollPhysics(),
@ -162,6 +174,29 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
);
}
void _scanQrAndGetProduct() async {
try {
String result = await BarcodeScanner.scan();
try {
String barcode = result;
GifLoaderDialogUtils.showMyDialog(context);
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);
Navigator.push(context, FadePage(page: ProductDetailPage(product)));
}, onFailure: (String error, int statusCode) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "Product not found");
});
} catch (apiEx) {
AppToast.showErrorToast(
message: "Something went wrong, please try again");
}
} catch (barcodeEx) {}
}
getText(currentTab) {
switch (currentTab) {
case 2:

@ -49,6 +49,7 @@ class _LiveCareHomeState extends State<LiveCareHome>
child: Column(children: [
/// this is will not colored with theme data
TabBar(
labelColor: Colors.black,
tabs: [
Tab(text: TranslationBase.of(context).consultation),
Tab(text: TranslationBase.of(context).logs),

@ -21,7 +21,7 @@ class _ScheduleClinicCardState extends State<ScheduleClinicCard> {
return Container(
child: Card(
margin: EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 8.0),
color: widget.isSelected ? Colors.blue : Colors.white,
color: widget.isSelected ? Color(0xff06b806) : Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
@ -35,8 +35,8 @@ class _ScheduleClinicCardState extends State<ScheduleClinicCard> {
Container(
child: Text(
widget.languageID == 'ar'
? widget.clinicsHaveScheduleList.clinicDescN
: widget.clinicsHaveScheduleList.clinicDesc,
? widget.clinicsHaveScheduleList.clinicDescN != null ? widget.clinicsHaveScheduleList.clinicDescN: ""
: widget.clinicsHaveScheduleList.clinicDesc != null ? widget.clinicsHaveScheduleList.clinicDesc: "Dermatology",
style: TextStyle(
fontSize: 16.0,
color:

@ -42,10 +42,11 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
),
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * 0.22,
// height: MediaQuery.of(context).size.height * 0.22,
padding: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text("Requested date:",
style:

@ -283,7 +283,8 @@ class _clinic_listState extends State<ClinicList> {
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
browser);
browser,
false);
}
onBrowserLoadStart(String url) {

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
@ -21,6 +22,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
@ -44,6 +46,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
var sharedPref = new AppSharedPreferences();
bool authenticated;
final authService = new AuthProvider();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
int mobileNumber;
String errorMsg = '';
SelectDeviceIMEIRES user;
@ -109,11 +112,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/DQ/dq_logo_icon.png',
'assets/images/DQ/logo.png',
height: 90,
width: 90,
),
AppText(
Texts(
TranslationBase.of(context).welcomeBack +
' ' +
user.name,
@ -122,7 +125,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
SizedBox(
height: 20,
),
AppText(
Texts(
TranslationBase.of(context).accountInfo,
fontSize: SizeConfig.textMultiplier * 2.5,
),
@ -173,17 +176,17 @@ class _ConfirmLogin extends State<ConfirmLogin> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/DQ/dq_logo_icon.png',
'assets/images/DQ/logo.png',
height: 90,
width: 90,
),
this.onlySMSBox == false
? AppText(
? Texts(
TranslationBase.of(context).verifyLoginWith,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
)
: AppText(
: Texts(
TranslationBase.of(context)
.verifyFingerprint2,
fontSize: SizeConfig.textMultiplier * 2.5,
@ -591,6 +594,13 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Provider.of<ProjectViewModel>(context, listen: false)
.setUser(authenticatedUserObject.user);
getToDoCount();
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if(pharmacyModuleViewModel.error.isNotEmpty)
await pharmacyModuleViewModel.createUser();
});
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {
@ -634,7 +644,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return InkWell(
onTap: () => {authenticateUser(4, true)},
child: RoundedContainer(
height: 140,
height: 150,
borderColor: Colors.grey,
showBorder: true,
child: Padding(
@ -649,7 +659,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
SizedBox(
height: 20,
),
AppText(
Texts(
TranslationBase.of(context).verifyWhatsApp,
fontSize: SizeConfig.textMultiplier * 2,
)
@ -661,7 +671,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return InkWell(
onTap: () => {authenticateUser(1, true)},
child: RoundedContainer(
height: 140,
height: 150,
borderColor: Colors.grey,
showBorder: true,
child: Padding(
@ -681,7 +691,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
: SizedBox(
height: 20,
),
AppText(
Texts(
TranslationBase.of(context).verifySMS,
fontSize: projectViewModel.isArabic
? SizeConfig.textMultiplier * 1.8
@ -696,7 +706,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return InkWell(
onTap: () => {authenticateUser(2, BiometricType.fingerprint.index)},
child: RoundedContainer(
height: 140,
height: 150,
backgroundColor: BiometricType.fingerprint.index == 1
? Colors.white
: Colors.white.withOpacity(.7),
@ -714,7 +724,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
SizedBox(
height: 20,
),
AppText(
Texts(
TranslationBase.of(context).verifyFingerprint,
fontSize: SizeConfig.textMultiplier * 2,
)
@ -726,7 +736,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return InkWell(
onTap: () => {authenticateUser(3, BiometricType.face.index)},
child: RoundedContainer(
height: 140,
height: 150,
backgroundColor: checkIfBiometricAvailable(BiometricType.face)
? Colors.white
: Colors.white.withOpacity(.7),
@ -745,7 +755,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
SizedBox(
height: 20,
),
AppText(
Texts(
TranslationBase.of(context).verifyFaceID,
fontSize: SizeConfig.textMultiplier * 2,
)
@ -762,7 +772,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
})
},
child: RoundedContainer(
height: 140,
height: 150,
backgroundColor: BiometricType.fingerprint.index == 1
? Colors.white
: Colors.white.withOpacity(.7),
@ -774,7 +784,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
children: <Widget>[
Image.asset(
'assets/images/login/more_icon.png',
height: SizeConfig.imageSizeMultiplier * 13,
height: 45,
width: SizeConfig.imageSizeMultiplier * 16,
),
projectViewModel.isArabic
@ -784,9 +794,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
: SizedBox(
height: 10,
),
AppText(
Texts(
TranslationBase.of(context).moreVerification,
fontSize: SizeConfig.textMultiplier * 2,
fontSize: SizeConfig.textMultiplier * 1.8,
textAlign: TextAlign.center,
)
],

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
@ -18,6 +19,7 @@ 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/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
@ -29,6 +31,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../Constants.dart';
class Login extends StatefulWidget {
@override
_Login createState() => _Login();
@ -44,11 +48,10 @@ class _Login extends State<Login> {
final authService = new AuthProvider();
var sharedPref = new AppSharedPreferences();
bool isLoading = false;
AppointmentRateViewModel appointmentRateViewModel =
locator<AppointmentRateViewModel>();
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
ProjectViewModel projectViewModel;
ToDoCountProviderModel toDoProvider;
@ -82,7 +85,7 @@ class _Login extends State<Login> {
children: <Widget>[
Expanded(
flex: 2,
child: AppText(
child: Texts(
TranslationBase.of(context).enterNationalId,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.start,
@ -92,7 +95,9 @@ class _Login extends State<Login> {
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
Directionality(
textDirection: TextDirection.ltr,
child: MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value)),
Directionality(
textDirection: TextDirection.ltr,
child: Container(
@ -105,7 +110,7 @@ class _Login extends State<Login> {
loginType == 1
? Icons.chrome_reader_mode
: Icons.receipt,
color: Color(0xFF40ACC9)),
color: secondaryColor),
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
hintText: loginType == 1
@ -133,9 +138,7 @@ class _Login extends State<Login> {
child: DefaultButton(
TranslationBase.of(context).login,
() => {this.startLogin()},
color: isButtonDisabled == true
? Colors.grey
: Colors.grey[900],
color: isButtonDisabled == true ? Colors.grey : Colors.grey[900],
textColor: Colors.white,
))
],
@ -156,8 +159,7 @@ class _Login extends State<Login> {
}
void validateForm() {
if (util.validateIDBox(nationalIDorFile.text, loginType) == true &&
util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) {
if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) {
setState(() {
isButtonDisabled = false;
});
@ -242,50 +244,55 @@ class _Login extends State<Login> {
this.authService.checkActivationCode(request, code).then((result) async {
sharedPref.remove(FAMILY_FILE);
// Register GeoZones after login
registerGeoZones();
projectViewModel.setPrivilege(privilegeList: result);
result = CheckActivationCode.fromJson(result);
result.list.isFamily = false;
// this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']),
this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(MAIN_USER, result.list);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID);
await authenticatedUserObject.getUser(getUser: true);
authenticatedUserObject.isLogin = true;
appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true;
projectViewModel.user = authenticatedUserObject.user;
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {
getToDoCount(),
GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: RateAppointmentDoctor(),
),
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
}
})
.catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
});
registerGeoZones();
projectViewModel.setPrivilege(privilegeList: result);
result = CheckActivationCode.fromJson(result);
result.list.isFamily = false;
// this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']),
this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(MAIN_USER, result.list);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID);
await authenticatedUserObject.getUser(getUser: true);
authenticatedUserObject.isLogin = true;
appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true;
projectViewModel.user = authenticatedUserObject.user;
});
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if(pharmacyModuleViewModel.error.isNotEmpty)
await pharmacyModuleViewModel.createUser();
});
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {
getToDoCount(),
GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: RateAppointmentDoctor(),
),
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
}
})
.catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
});
});
}
getToDoCount() {

@ -225,7 +225,8 @@ class ConfirmPaymentPage extends StatelessWidget {
advanceModel.patientName,
advanceModel.fileNumber,
authenticatedUser,
browser);
browser,
false);
}
onBrowserLoadStart(String url) {

@ -1,9 +1,11 @@
//import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class SelectCiteisDialog extends StatefulWidget {
final List<CitiesModel> hospitals;
@ -12,6 +14,7 @@ class SelectCiteisDialog extends StatefulWidget {
SelectCiteisDialog(
{Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
@override
_SelectCiteisDialogState createState() => _SelectCiteisDialogState();
}
@ -24,9 +27,10 @@ class _SelectCiteisDialogState extends State<SelectCiteisDialog> {
widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0];
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return SimpleDialog(
children: [
Column(
@ -34,7 +38,7 @@ class _SelectCiteisDialogState extends State<SelectCiteisDialog> {
Divider(),
...List.generate(
widget.hospitals.length,
(index) => Column(
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
@ -53,7 +57,9 @@ class _SelectCiteisDialogState extends State<SelectCiteisDialog> {
child: ListTile(
// title: Text(widget.hospitals[index].description +
// ' ${widget.hospitals[index].distanceInKilometers} KM'),
title: Text(widget.hospitals[index].description),
title: Text(projectProvider.isArabic
? widget.hospitals[index].descriptionN
: widget.hospitals[index].description),
leading: Radio(
value: widget.hospitals[index],
groupValue: widget.selectedHospital,
@ -116,9 +122,9 @@ class _SelectCiteisDialogState extends State<SelectCiteisDialog> {
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
),
),
),

@ -54,15 +54,19 @@ class MedicalProfilePage extends StatefulWidget {
class _MedicalProfilePageState extends State<MedicalProfilePage> {
var authProvider = new AuthProvider();
List<Medical> medical=List();
List<Medical> medical = List();
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel,context: context,count: appoCountProvider.count,isLogin: projectViewModel.isLogin);
return BaseView<MedicalViewModel>(
List<Widget> myMedicalList = Utils.myMedicalList(
projectViewModel: projectViewModel,
context: context,
count: appoCountProvider.count,
isLogin: projectViewModel.isLogin);
return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget) => AppScaffold(
isShowDecPage: false,
@ -97,25 +101,30 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
itemCount: model
.appoitmentAllHistoryResultList.length,
scrollDirection: Axis.horizontal,
reverse: !projectViewModel.isArabic,
reverse: projectViewModel.isArabic,
),
],
),
),
SizedBox(height: 50,),
SizedBox(
height: 50,
),
Padding(
padding: EdgeInsets.symmetric(vertical: 5.0),
child: GridView.builder(
shrinkWrap: true,
primary: false,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: MediaQuery.of(context).size.width / (MediaQuery.of(context).size.height / 2.40),
childAspectRatio: MediaQuery.of(context)
.size
.width /
(MediaQuery.of(context).size.height / 2.40),
),
itemCount: myMedicalList.length,
itemBuilder: (BuildContext context, int index) {
return myMedicalList[index];
},
),
@ -123,8 +132,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
],
),
SizedBox(
height:
MediaQuery.of(context).size.height * 0.12,
height: MediaQuery.of(context).size.height * 0.12,
),
if (model.user != null && model.isLogin)
Positioned(
@ -135,7 +143,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
width: double.infinity,
height: 80,
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
color: Colors.grey[500],
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent, width: 0.5),
@ -187,20 +195,13 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
),
);
}
fullMedicalData(){
if(projectViewModel.havePrivilege(5))
{}
}
}
class Medical{
final String title;
final String imagePath;
final String subTitle;
final Widget page;
Medical({this.title, this.imagePath, this.subTitle, this.page});
class Medical {
final String title;
final String imagePath;
final String subTitle;
final Widget page;
Medical({this.title, this.imagePath, this.subTitle, this.page});
}

@ -1,188 +1,283 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:feather_icons_flutter/feather_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:provider/provider.dart';
class AddWeightPage extends StatefulWidget {
final WeightPressureViewModel model;
final bool isUpdate;
final DateTime dayWeightDate;
final int lineItemNo;
final String weightValue;
final String measureTimeSelectedType;
final int weightUnit;
AddWeightPage(
{Key key,
this.model,
this.isUpdate = false,
this.dayWeightDate,
this.lineItemNo,
this.weightValue,
this.measureTimeSelectedType,
this.weightUnit})
: super(key: key);
@override
_AddWeightPageState createState() => _AddWeightPageState();
}
class _AddWeightPageState extends State<AddWeightPage> {
TextEditingController _weightValueController = TextEditingController();
DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now();
DateTime dayWeightDate = DateTime.now();
DateTime timeWeightDate = DateTime.now();
int weightUnit = 1;
final List<String> measureUnitEnList = [
'Kg',
'Pound',
];
final List<String> measureUnitArList = [
'Kg',
'Pound',
];
String measureTimeSelectedType = 'Kg';
final List<String> measureUnitArList = ["كيلو جرام", "باوند"];
String measureTimeSelectedType;
@override
void initState() {
super.initState();
if (widget.isUpdate) {
dayWeightDate = widget.dayWeightDate;
timeWeightDate = widget.dayWeightDate;
measureTimeSelectedType = widget.measureTimeSelectedType;
if (measureUnitEnList.contains(widget.measureTimeSelectedType))
weightUnit = measureUnitEnList.indexOf(widget.measureTimeSelectedType);
else if (measureUnitArList.contains(widget.measureTimeSelectedType))
weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType);
_weightValueController.text = widget.weightValue;
}
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<WeightPressureViewMode>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: 'Add',
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.all(15),
child: Column(
children: [
SizedBox(
height: 15,
),
NewTextFields(
hintText: 'Enter Weight Value',
controller: _weightValueController,
keyboardType: TextInputType.number,
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic
? measureUnitEnList
: measureUnitArList);
return AppScaffold(
isShowAppBar: true,
appBarTitle: widget.isUpdate
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
appBarIcons:widget.isUpdate? [
IconButton(
icon: Icon(Icons.delete),
color: Colors.white,
onPressed: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.deleteWeightResult(lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(
message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(
message: widget.model.error);
});
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureTimeSelectedType),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
),
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
]:null,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.all(15),
child: Column(
children: [
SizedBox(
height: 15,
),
NewTextFields(
hintText: TranslationBase.of(context).weightAdd,
controller: _weightValueController,
keyboardType: TextInputType.number,
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic
? measureUnitArList
: measureUnitEnList);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureTimeSelectedType ??
TranslationBase.of(context).other),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(), onConfirm: (date) {
print('confirm $date');
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
setState(() {
bloodSugarDate = date;
dayWeightDate = date;
});
},
currentTime: bloodSugarDate,
locale: projectViewModel.localeType);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts('Date'),
Texts(getDate()),
],
),
currentTime: dayWeightDate,
locale: projectViewModel.localeType,
);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).date),
Texts(getDate()),
],
),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true,
onConfirm: (date) {
print('confirm $date');
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showTimePicker(
context,
showTitleActions: true,
onConfirm: (date) {
setState(() {
timeSugarDate = date;
timeWeightDate = date;
});
},
currentTime: timeSugarDate,
locale: projectViewModel.localeType);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts('Time'), Texts(getTime())],
),
currentTime: timeWeightDate,
locale: projectViewModel.localeType,
);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
),
),
],
),
),
],
),
),
bottomSheet: Container(
color: Colors.transparent,
width: double.infinity,
height: MediaQuery.of(context).size.width * 0.2,
child: Padding(
padding: const EdgeInsets.all(15.0),
child: SecondaryButton(
loading: model.state == ViewState.BusyLocal,
label: 'SAVE',
textColor: Colors.white,
onTap: () {
if (_weightValueController.text.isNotEmpty ) {
model.addWeightResult(
weightDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
),
bottomSheet: Container(
color: Colors.transparent,
width: double.infinity,
height: MediaQuery.of(context).size.width * 0.2,
child: Padding(
padding: const EdgeInsets.all(15.0),
child: SecondaryButton(
loading: widget.model.state == ViewState.BusyLocal,
label: TranslationBase.of(context).save.toUpperCase(),
textColor: Colors.white,
onTap: () {
if (_weightValueController.text.isNotEmpty) {
if (widget.isUpdate) {
GifLoaderDialogUtils.showMyDialog(context);
widget.model.updateWeightResult(
weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit,
);
}
}),
),
lineItemNo: widget.lineItemNo
)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
});
} else
widget.model.addWeightResult(
weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit,
)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
});
}
}),
),
),
);
}
String getDate() {
return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}";
return "${DateUtil.getMonth(dayWeightDate.month)} ${dayWeightDate.day}, ${dayWeightDate.year}";
}
String getTime() {
return " ${timeSugarDate.hour}:${timeSugarDate.minute}";
return " ${timeWeightDate.hour}:${timeWeightDate.minute}";
}
void confirmSelectMeasureTimeDialog(List<String> list) {
@ -190,7 +285,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
context: context,
child: RadioStringDialog(
radioList: list,
title: 'Measure unit',
title: TranslationBase.of(context).measureUnit,
selectedValue: measureTimeSelectedType,
onValueSelected: (value) {
setState(() {

@ -1,12 +1,15 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/TabBarWidget.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_send_email_dialog.dart';
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:hexcolor/hexcolor.dart';
import 'AddWeightPage.dart';
import 'WeightMonthlyPage.dart';
import 'WeightYeaPage.dart';
@ -35,73 +38,42 @@ class _WeightHomePageState extends State<WeightHomePage>
@override
Widget build(BuildContext context) {
return BaseView<WeightPressureViewMode>(
return BaseView<WeightPressureViewModel>(
onModelReady: (model) => model.getWeight(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: 'Weight',
appBarTitle: TranslationBase.of(context).weight,
appBarIcons: [IconButton(
icon: Icon(Icons.email),
color: Colors.white,
onPressed: () {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () async{
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context);
if(model.state == ViewState.ErrorLocal){
AppToast.showErrorToast(message: model.error);
}else{
AppToast.showSuccessToast(message:TranslationBase.of(context).emailSentSuccessfully, );
}
}).catchError((e){
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error);
});
},
),
);
},
),],
baseViewModel: model,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(60.0),
child: Stack(
children: <Widget>[
Positioned(
bottom: 1,
left: 0,
right: 0,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Container(
color: Theme.of(context)
.scaffoldBackgroundColor
.withOpacity(0.8),
height: 70.0,
),
),
),
Center(
child: Container(
height: 55.0,
color: Colors.white,
child: Center(
child: TabBar(
isScrollable: true,
controller: _tabController,
indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding:
EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.27,
child: Center(
child: Texts('Weekly'),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.27,
child: Center(
child: Texts('Monthly'),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.27,
child: Center(
child: Texts('Yearly'),
),
),
],
),
),
),
),
],
),
appBar: TabBarWidget(
tabController: _tabController,
),
body: Column(
children: <Widget>[
@ -111,16 +83,13 @@ class _WeightHomePageState extends State<WeightHomePage>
controller: _tabController,
children: <Widget>[
WeightWeeklyPage(
data: model.getWeightWeeklySeries(),
diabtecPatientResult: model.weekWeightMeasurementResult,
model: model,
),
WeightMonthlyPage(
data: model.getWeightMonthlyTimeSeriesSales(),
diabtecPatientResult: model.monthWeightMeasurementResult,
model: model,
),
WeightYearPage(
data: model.getWeightYearTimeSeriesSales(),
diabtecPatientResult: model.yearWeightMeasurementResult,
model: model,
)
],
),
@ -129,13 +98,15 @@ class _WeightHomePageState extends State<WeightHomePage>
),
floatingActionButton: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: AddWeightPage()));
Navigator.push(context, FadePage(page: AddWeightPage(model: model,)));
},
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle, color: HexColor('515B5D')),
shape: BoxShape.circle,
color: Theme.of(context).primaryColor,
),
child: Center(
child: Icon(
Icons.add,

@ -3,41 +3,48 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPa
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class WeightMonthlyPage extends StatelessWidget {
final List<charts.Series<YearMonthlyChartDate, int>> data;
final List<WeightMeasurementResult> diabtecPatientResult;
final WeightPressureViewModel model;
const WeightMonthlyPage({Key key, this.data, this.diabtecPatientResult})
: super(key: key);
const WeightMonthlyPage({
Key key,
this.model,
}) : super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body: ListView(
body: model.weighMonthTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView(
children: [
Container(
width: double.maxFinite,
height: 180,
color: Colors.white,
child: charts.LineChart(data,
//animate: animate,
defaultRenderer:
new charts.LineRendererConfig(includePoints: true)),
),
width: double.maxFinite,
color: Colors.white,
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts('Details'),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
@ -49,7 +56,7 @@ class WeightMonthlyPage extends StatelessWidget {
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(),
children: fullData(context, projectViewModel, model),
),
],
),
@ -59,21 +66,27 @@ class WeightMonthlyPage extends StatelessWidget {
);
}
List<TableRow> fullData() {
List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
children: [
Container(
decoration: BoxDecoration(
color: HexColor('#515B5D'),
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
),
),
child: Center(
child: Texts(
'Date',
TranslationBase.of(context).date,
color: Colors.white,
fontSize: 15,
),
@ -82,11 +95,11 @@ class WeightMonthlyPage extends StatelessWidget {
),
Container(
decoration: BoxDecoration(
color: HexColor('#515B5D'),
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
'Time',
TranslationBase.of(context).time,
color: Colors.white,
fontSize: 15,
),
@ -94,11 +107,19 @@ class WeightMonthlyPage extends StatelessWidget {
height: 40),
Container(
decoration: BoxDecoration(
color: HexColor('#515B5D'),
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
),
),
child: Center(
child: Texts(
'Value',
TranslationBase.of(context).value,
color: Colors.white,
fontSize: 15,
),
@ -107,7 +128,7 @@ class WeightMonthlyPage extends StatelessWidget {
],
),
);
diabtecPatientResult.forEach(
model.monthWeightMeasurementResult.forEach(
(diabtec) {
tableRow.add(
TableRow(
@ -119,7 +140,7 @@ class WeightMonthlyPage extends StatelessWidget {
color: Colors.white,
child: Center(
child: Texts(
'${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ',
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ',
textAlign: TextAlign.center,
fontSize: 12,
),

@ -1,32 +1,41 @@
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'AddWeightPage.dart';
class WeightWeeklyPage extends StatelessWidget {
final List<charts.Series<WeekChartDate, DateTime>> data;
final List<WeightMeasurementResult> diabtecPatientResult;
final WeightPressureViewModel model;
const WeightWeeklyPage({Key key, this.data, this.diabtecPatientResult})
: super(key: key);
const WeightWeeklyPage({Key key, this.model}) : super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body: ListView(
body: model.weightWeekTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView(
children: [
Container(
width: double.maxFinite,
height: 180,
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
child: charts.TimeSeriesChart(
data,
dateTimeFactory: const charts.LocalDateTimeFactory(),
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5,
),
),
SizedBox(
@ -34,7 +43,7 @@ class WeightWeeklyPage extends StatelessWidget {
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts('Details'),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
@ -46,7 +55,7 @@ class WeightWeeklyPage extends StatelessWidget {
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(),
children: fullData(context, projectViewModel, model),
),
],
),
@ -56,21 +65,27 @@ class WeightWeeklyPage extends StatelessWidget {
);
}
List<TableRow> fullData() {
List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
children: [
Container(
decoration: BoxDecoration(
color: HexColor('#515B5D'),
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
),
),
child: Center(
child: Texts(
'Date',
TranslationBase.of(context).date,
color: Colors.white,
fontSize: 15,
),
@ -79,11 +94,11 @@ class WeightWeeklyPage extends StatelessWidget {
),
Container(
decoration: BoxDecoration(
color: HexColor('#515B5D'),
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
'Time',
TranslationBase.of(context).time,
color: Colors.white,
fontSize: 15,
),
@ -91,37 +106,40 @@ class WeightWeeklyPage extends StatelessWidget {
height: 40),
Container(
decoration: BoxDecoration(
color: HexColor('#515B5D'),
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
'Value',
TranslationBase.of(context).value,
color: Colors.white,
fontSize: 15,
),
),
height: 40),
Container(
child: Container(
decoration: BoxDecoration(
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
),
child: Center(
child: Texts(
'Edit',
color: Colors.white,
fontSize: 15,
),
),
child: Center(
child: Texts(
TranslationBase.of(context).edit,
color: Colors.white,
fontSize: 15,
),
height: 40),
),
),
height: 40),
],
),
);
diabtecPatientResult.forEach(
model.weekWeightMeasurementResult.forEach(
(diabtec) {
tableRow.add(
TableRow(
@ -133,7 +151,7 @@ class WeightWeeklyPage extends StatelessWidget {
color: Colors.white,
child: Center(
child: Texts(
'${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ',
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ',
textAlign: TextAlign.center,
fontSize: 12,
),
@ -166,12 +184,30 @@ class WeightWeeklyPage extends StatelessWidget {
),
),
),
Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Icon(Icons.edit),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: AddWeightPage(
isUpdate: true,
dayWeightDate: diabtec.weightDate,
measureTimeSelectedType: 'Kg',
weightValue: diabtec.weightMeasured.toString(),
lineItemNo: diabtec.lineItemNo,
weightUnit: int.parse(diabtec.unit),
model: model,
),
),
);
},
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Icon(Icons.edit),
),
),
),
],

@ -2,41 +2,48 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPr
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class WeightYearPage extends StatelessWidget {
final List<charts.Series<WeekChartDate, DateTime>> data;
final List<WeightMeasurementResult> diabtecPatientResult;
final WeightPressureViewModel model;
const WeightYearPage({Key key, this.data, this.diabtecPatientResult})
const WeightYearPage({Key key, this.model, })
: super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body: ListView(
body: model.weightYearTimeSeriesData.isEmpty ? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),) : ListView(
children: [
Container(
width: double.maxFinite,
height: 180,
color: Colors.white,
child: charts.TimeSeriesChart(
data,
dateTimeFactory: const charts.LocalDateTimeFactory(),
),
width: double.maxFinite,
color: Colors.white,
child: LineChartCurved(
horizontalInterval: 2.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData,
indexes: model.weightYearTimeSeriesData.length ~/ 5.5,
)
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts('Details'),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
@ -48,7 +55,7 @@ class WeightYearPage extends StatelessWidget {
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(),
children: fullData(context, projectViewModel, model),
),
],
),
@ -58,21 +65,27 @@ class WeightYearPage extends StatelessWidget {
);
}
List<TableRow> fullData() {
List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
children: [
Container(
decoration: BoxDecoration(
color: HexColor('#515B5D'),
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
),
),
child: Center(
child: Texts(
'Date',
TranslationBase.of(context).date,
color: Colors.white,
fontSize: 15,
),
@ -81,11 +94,11 @@ class WeightYearPage extends StatelessWidget {
),
Container(
decoration: BoxDecoration(
color: HexColor('#515B5D'),
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(
'Time',
TranslationBase.of(context).time,
color: Colors.white,
fontSize: 15,
),
@ -93,11 +106,19 @@ class WeightYearPage extends StatelessWidget {
height: 40),
Container(
decoration: BoxDecoration(
color: HexColor('#515B5D'),
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
),
),
child: Center(
child: Texts(
'Value',
TranslationBase.of(context).value,
color: Colors.white,
fontSize: 15,
),
@ -106,8 +127,8 @@ class WeightYearPage extends StatelessWidget {
],
),
);
diabtecPatientResult.forEach(
(diabtec) {
model.yearWeightMeasurementResult.forEach(
(diabtec) {
tableRow.add(
TableRow(
children: [
@ -118,7 +139,7 @@ class WeightYearPage extends StatelessWidget {
color: Colors.white,
child: Center(
child: Texts(
'${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ',
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ',
textAlign: TextAlign.center,
fontSize: 12,
),

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

Loading…
Cancel
Save