diff --git a/ios/Podfile.lock b/ios/Podfile.lock index fdb971fd..1df50aa4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,461 +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.3): - - Firebase/CoreOnly (~> 6.33.0) - - Flutter - - firebase_core_web (0.1.0): - - Flutter - - firebase_messaging (7.0.3): - - Firebase/CoreOnly (~> 6.33.0) - - Firebase/Messaging (~> 6.33.0) - - firebase_core - - Flutter - - FirebaseCore (6.10.3): - - FirebaseCoreDiagnostics (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - FirebaseCoreDiagnostics (1.7.0): - - GoogleDataTransport (~> 7.4) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - nanopb (~> 1.30906.0) - - FirebaseInstallations (1.7.0): - - FirebaseCore (~> 6.10) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - PromisesObjC (~> 1.2) - - FirebaseInstanceID (4.8.0): - - FirebaseCore (~> 6.10) - - FirebaseInstallations (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - FirebaseMessaging (4.7.1): - - FirebaseCore (~> 6.10) - - FirebaseInstanceID (~> 4.7) - - GoogleUtilities/AppDelegateSwizzler (~> 6.7) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Reachability (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - Protobuf (>= 3.9.2, ~> 3.9) - Flutter (1.0.0) - - flutter_email_sender (0.0.1): - - Flutter - - flutter_flexible_toast (0.0.1): - - Flutter - - flutter_inappwebview (0.0.1): - - Flutter - - flutter_local_notifications (0.0.1): - - Flutter - - flutter_plugin_android_lifecycle (0.0.1): - - Flutter - - flutter_tts (0.0.1): - - Flutter - - geolocator (6.1.9): - - Flutter - - google_maps_flutter (0.0.1): - - Flutter - - GoogleMaps (< 3.10) - - GoogleDataTransport (7.5.1): - - nanopb (~> 1.30906.0) - - GoogleMaps (3.9.0): - - GoogleMaps/Maps (= 3.9.0) - - GoogleMaps/Base (3.9.0) - - GoogleMaps/Maps (3.9.0): - - GoogleMaps/Base - - GoogleUtilities/AppDelegateSwizzler (6.7.2): - - GoogleUtilities/Environment - - GoogleUtilities/Logger - - GoogleUtilities/Network - - GoogleUtilities/Environment (6.7.2): - - PromisesObjC (~> 1.2) - - GoogleUtilities/Logger (6.7.2): - - GoogleUtilities/Environment - - GoogleUtilities/Network (6.7.2): - - GoogleUtilities/Logger - - "GoogleUtilities/NSData+zlib" - - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (6.7.2)" - - GoogleUtilities/Reachability (6.7.2): - - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (6.7.2): - - GoogleUtilities/Logger - - hexcolor (0.0.1): - - Flutter - - image_cropper (0.0.3): - - Flutter - - TOCropViewController (~> 2.5.4) - - image_picker (0.0.1): - - Flutter - - just_audio (0.0.1): - - Flutter - - local_auth (0.0.1): - - Flutter - - location (0.0.1): - - Flutter - - manage_calendar_events (0.0.1): - - Flutter - - map_launcher (0.0.1): - - Flutter - - maps_launcher (0.0.1): - - Flutter - - MTBBarcodeScanner (5.0.11) - - nanopb (1.30906.0): - - nanopb/decode (= 1.30906.0) - - nanopb/encode (= 1.30906.0) - - nanopb/decode (1.30906.0) - - nanopb/encode (1.30906.0) - - native_device_orientation (0.0.1): - - Flutter - - native_progress_hud (0.0.1): - - Flutter - NVActivityIndicatorView (5.1.1): - NVActivityIndicatorView/Base (= 5.1.1) - NVActivityIndicatorView/Base (5.1.1) - - path_provider (0.0.1): - - Flutter - - path_provider_linux (0.0.1): - - Flutter - - path_provider_macos (0.0.1): - - Flutter - - path_provider_windows (0.0.1): - - Flutter - - "permission_handler (5.0.1+1)": - - Flutter - - PromisesObjC (1.2.11) - - Protobuf (3.13.0) - - Reachability (3.2) - - screen (0.0.1): - - Flutter - - shared_preferences (0.0.1): - - Flutter - - shared_preferences_linux (0.0.1): - - Flutter - - shared_preferences_macos (0.0.1): - - Flutter - - shared_preferences_web (0.0.1): - - Flutter - - shared_preferences_windows (0.0.1): - - Flutter - - speech_to_text (0.0.1): - - Flutter - - Try - - TOCropViewController (2.5.5) - - Try (2.1.1) - - "twilio_programmable_video (0.5.0+4)": - - Flutter - - TwilioVideo (~> 3.4) - - TwilioVideo (3.8.0) - - url_launcher (0.0.1): - - Flutter - - url_launcher_linux (0.0.1): - - Flutter - - url_launcher_macos (0.0.1): - - Flutter - - url_launcher_web (0.0.1): - - Flutter - - url_launcher_windows (0.0.1): - - Flutter - - vibration (1.7.3): - - Flutter - - vibration_web (1.6.2): - - Flutter - - video_player (0.0.1): - - Flutter - - video_player_web (0.0.1): - - Flutter - - wakelock (0.0.1): - - Flutter - - webview_flutter (0.0.1): - - Flutter - - wifi (0.0.1): - - Flutter DEPENDENCIES: - - android_intent (from `.symlinks/plugins/android_intent/ios`) - - barcode_scan_fix (from `.symlinks/plugins/barcode_scan_fix/ios`) - - connectivity (from `.symlinks/plugins/connectivity/ios`) - - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) - - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) - - device_calendar (from `.symlinks/plugins/device_calendar/ios`) - - device_info (from `.symlinks/plugins/device_info/ios`) - - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) - - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - Flutter (from `Flutter`) - - flutter_email_sender (from `.symlinks/plugins/flutter_email_sender/ios`) - - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) - - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) - - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) - - flutter_tts (from `.symlinks/plugins/flutter_tts/ios`) - - geolocator (from `.symlinks/plugins/geolocator/ios`) - - google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`) - - hexcolor (from `.symlinks/plugins/hexcolor/ios`) - - image_cropper (from `.symlinks/plugins/image_cropper/ios`) - - image_picker (from `.symlinks/plugins/image_picker/ios`) - - just_audio (from `.symlinks/plugins/just_audio/ios`) - - local_auth (from `.symlinks/plugins/local_auth/ios`) - - location (from `.symlinks/plugins/location/ios`) - - manage_calendar_events (from `.symlinks/plugins/manage_calendar_events/ios`) - - map_launcher (from `.symlinks/plugins/map_launcher/ios`) - - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`) - - native_device_orientation (from `.symlinks/plugins/native_device_orientation/ios`) - - native_progress_hud (from `.symlinks/plugins/native_progress_hud/ios`) - NVActivityIndicatorView - - path_provider (from `.symlinks/plugins/path_provider/ios`) - - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) - - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`) - - path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`) - - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - - screen (from `.symlinks/plugins/screen/ios`) - - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`) - - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) - - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) - - shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`) - - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`) - - twilio_programmable_video (from `.symlinks/plugins/twilio_programmable_video/ios`) - - url_launcher (from `.symlinks/plugins/url_launcher/ios`) - - url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`) - - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) - - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) - - url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`) - - vibration (from `.symlinks/plugins/vibration/ios`) - - vibration_web (from `.symlinks/plugins/vibration_web/ios`) - - video_player (from `.symlinks/plugins/video_player/ios`) - - video_player_web (from `.symlinks/plugins/video_player_web/ios`) - - wakelock (from `.symlinks/plugins/wakelock/ios`) - - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) - - wifi (from `.symlinks/plugins/wifi/ios`) SPEC REPOS: trunk: - - Firebase - - FirebaseCore - - FirebaseCoreDiagnostics - - FirebaseInstallations - - FirebaseInstanceID - - FirebaseMessaging - - GoogleDataTransport - - GoogleMaps - - GoogleUtilities - - MTBBarcodeScanner - - nanopb - NVActivityIndicatorView - - PromisesObjC - - Protobuf - - Reachability - - TOCropViewController - - Try - - TwilioVideo EXTERNAL SOURCES: - android_intent: - :path: ".symlinks/plugins/android_intent/ios" - barcode_scan_fix: - :path: ".symlinks/plugins/barcode_scan_fix/ios" - connectivity: - :path: ".symlinks/plugins/connectivity/ios" - connectivity_for_web: - :path: ".symlinks/plugins/connectivity_for_web/ios" - connectivity_macos: - :path: ".symlinks/plugins/connectivity_macos/ios" - device_calendar: - :path: ".symlinks/plugins/device_calendar/ios" - device_info: - :path: ".symlinks/plugins/device_info/ios" - firebase_core: - :path: ".symlinks/plugins/firebase_core/ios" - firebase_core_web: - :path: ".symlinks/plugins/firebase_core_web/ios" - firebase_messaging: - :path: ".symlinks/plugins/firebase_messaging/ios" Flutter: :path: Flutter - flutter_email_sender: - :path: ".symlinks/plugins/flutter_email_sender/ios" - flutter_flexible_toast: - :path: ".symlinks/plugins/flutter_flexible_toast/ios" - flutter_inappwebview: - :path: ".symlinks/plugins/flutter_inappwebview/ios" - flutter_local_notifications: - :path: ".symlinks/plugins/flutter_local_notifications/ios" - flutter_plugin_android_lifecycle: - :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios" - flutter_tts: - :path: ".symlinks/plugins/flutter_tts/ios" - geolocator: - :path: ".symlinks/plugins/geolocator/ios" - google_maps_flutter: - :path: ".symlinks/plugins/google_maps_flutter/ios" - hexcolor: - :path: ".symlinks/plugins/hexcolor/ios" - image_cropper: - :path: ".symlinks/plugins/image_cropper/ios" - image_picker: - :path: ".symlinks/plugins/image_picker/ios" - just_audio: - :path: ".symlinks/plugins/just_audio/ios" - local_auth: - :path: ".symlinks/plugins/local_auth/ios" - location: - :path: ".symlinks/plugins/location/ios" - manage_calendar_events: - :path: ".symlinks/plugins/manage_calendar_events/ios" - map_launcher: - :path: ".symlinks/plugins/map_launcher/ios" - maps_launcher: - :path: ".symlinks/plugins/maps_launcher/ios" - native_device_orientation: - :path: ".symlinks/plugins/native_device_orientation/ios" - native_progress_hud: - :path: ".symlinks/plugins/native_progress_hud/ios" - path_provider: - :path: ".symlinks/plugins/path_provider/ios" - path_provider_linux: - :path: ".symlinks/plugins/path_provider_linux/ios" - path_provider_macos: - :path: ".symlinks/plugins/path_provider_macos/ios" - path_provider_windows: - :path: ".symlinks/plugins/path_provider_windows/ios" - permission_handler: - :path: ".symlinks/plugins/permission_handler/ios" - screen: - :path: ".symlinks/plugins/screen/ios" - shared_preferences: - :path: ".symlinks/plugins/shared_preferences/ios" - shared_preferences_linux: - :path: ".symlinks/plugins/shared_preferences_linux/ios" - shared_preferences_macos: - :path: ".symlinks/plugins/shared_preferences_macos/ios" - shared_preferences_web: - :path: ".symlinks/plugins/shared_preferences_web/ios" - shared_preferences_windows: - :path: ".symlinks/plugins/shared_preferences_windows/ios" - speech_to_text: - :path: ".symlinks/plugins/speech_to_text/ios" - twilio_programmable_video: - :path: ".symlinks/plugins/twilio_programmable_video/ios" - url_launcher: - :path: ".symlinks/plugins/url_launcher/ios" - url_launcher_linux: - :path: ".symlinks/plugins/url_launcher_linux/ios" - url_launcher_macos: - :path: ".symlinks/plugins/url_launcher_macos/ios" - url_launcher_web: - :path: ".symlinks/plugins/url_launcher_web/ios" - url_launcher_windows: - :path: ".symlinks/plugins/url_launcher_windows/ios" - vibration: - :path: ".symlinks/plugins/vibration/ios" - vibration_web: - :path: ".symlinks/plugins/vibration_web/ios" - video_player: - :path: ".symlinks/plugins/video_player/ios" - video_player_web: - :path: ".symlinks/plugins/video_player_web/ios" - wakelock: - :path: ".symlinks/plugins/wakelock/ios" - webview_flutter: - :path: ".symlinks/plugins/webview_flutter/ios" - wifi: - :path: ".symlinks/plugins/wifi/ios" SPEC CHECKSUMS: - android_intent: 367df2f1277a74e4a90e14a8ab3df3112d087052 - barcode_scan_fix: 80dd65de55f27eec6591dd077c8b85f2b79e31f1 - connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 - connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b - connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 - device_calendar: 23b28a5f1ab3bf77e34542fb1167e1b8b29a98f5 - device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 - Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 - firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 - firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 - firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 - FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd - FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 - FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 - FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 - FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a Flutter: 0e3d915762c693b495b44d77113d4970485de6ec - flutter_email_sender: f787522d0e82f50e5766c1213dbffff22fdcf009 - flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 - flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189 - flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186 - flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 - flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d - geolocator: 057a0c63a43e9c5296d8ad845a3ac8e6df23d899 - google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619 - GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 - GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac - GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 - hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 - image_cropper: c8f9b4157933c7bb965a66d1c5e6c8fd408c6eb4 - image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09 - just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa - local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd - location: 3a2eed4dd2fab25e7b7baf2a9efefe82b512d740 - manage_calendar_events: 0338d505ea26cdfd20cd883279bc28afa11eca34 - map_launcher: e325db1261d029ff33e08e03baccffe09593ffea - maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 - MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb - nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc - native_device_orientation: e24d00be281de72996640885d80e706142707660 - native_progress_hud: f95f5529742b36a3c7fdecfa88dc018319e39bf9 NVActivityIndicatorView: 1f6c5687f1171810aa27a3296814dc2d7dec3667 - path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c - path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 - path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 - path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b - permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6 - PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f - Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 - Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 - screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0 - shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d - shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 - shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 - shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 - shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae - speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe - TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe - Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 - twilio_programmable_video: 6a41593640f3d86af60b22541fd457b22deaae7f - TwilioVideo: c13a51ceca375e91620eb7578d2573c90cf53b46 - url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef - url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 - url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 - url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c - url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5 - vibration: b5a33e764c3f609a975b9dca73dce20fdde627dc - vibration_web: 0ba303d92469ba34d71c612a228b315908d7fcd9 - video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e - video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7 - wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4 - webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 - wifi: d7d77c94109e36c4175d845f0a5964eadba71060 -PODFILE CHECKSUM: 5a17be3f8af73a757fa4439c77cf6ab2db29a6e7 +PODFILE CHECKSUM: d94bd40f28772938199c67fcced06ffe96096c14 -COCOAPODS: 1.10.0 +COCOAPODS: 1.10.1 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index ade2e0aa..366647c0 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -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; diff --git a/lib/config/config.dart b/lib/config/config.dart index 6b45a9d0..b471df55 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -401,7 +401,6 @@ const UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult'; const DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus'; - const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; @@ -413,6 +412,12 @@ const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; +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_UNDO_USER_ACTIVITY = + "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity"; //E_Referral Services const GET_ALL_RELATIONSHIP_TYPES = @@ -429,14 +434,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"; @@ -445,11 +453,10 @@ 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"; @@ -515,28 +522,28 @@ const GET_CUSTOMER_INFO = //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/'; + '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 = - '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='; + '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 = - '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='; + '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; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a7c7d23e..325f2b49 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -293,6 +293,7 @@ const Map localizedValues = { 'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى' }, "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, + "success": {"en": "Done successfully", "ar": "تم تنفذ الطلب بنجاح"}, "EmailSentSuccessfully": { "en": "Email Sent Successfully", "ar": "تم إرسال البريد الإلكتروني بنجاح" @@ -365,7 +366,8 @@ const Map localizedValues = { 'weight': {'en': 'Weight', 'ar': 'الوزن'}, 'height': {'en': 'Height', 'ar': 'الطول'}, 'heart': {'en': 'Heart', 'ar': 'قلب'}, - + "heightUnit": {"en": "height unit", "ar": "وحدة الطول"}, + "weightUnit": {"en": "Weight Unit", "ar": "وحدة الوزن"}, "request": {"en": "Request", "ar": "طلبات الاضافة"}, "member-name": {"en": "Member Name", "ar": "اسم العضو"}, "switch-login": {"en": "Switch User", "ar": "تغير المستخدم"}, @@ -608,6 +610,14 @@ const Map localizedValues = { "DepositorName": {"en": "Depositor Name", "ar": "اسم المودع *"}, "MobileNumber": {"en": "Mobile Number", "ar": "رقم الجوال"}, "Ok": {"en": "Ok", "ar": "حسنا"}, + "WaterConsumedInWeek": { + "en": "Water consumed in a week", + "ar": "معدل شرب الماء خلال الاسبوع" + }, + "WaterConsumedInMonth": { + "en": "Water consumed in a month", + "ar": "معدل شرب الماء خلال الشهر" + }, "TheVerificationCodeExpiresIn": { "en": "The Verification Code Expires In", "ar": "تنتهي صلاحية رمز التحقق في" @@ -706,6 +716,7 @@ const Map localizedValues = { "order": {"en": "My Order", "ar": " طلباتي"}, "delivered": {"en": "Delivered", "ar": " تم التوصيل"}, "pending": {"en": "Pending", "ar": " معلقة "}, + "enterNameHere": {"en": "Enter the name here", "ar": " أدخل الاسم هنا "}, "processing": {"en": "Processing", "ar": " تحت المعالجة"}, "cancelled": {"en": "Cancelled", "ar": " ملغي"}, "writeReview": {"en": "Write Review", "ar": " اكتب تقييمك"}, @@ -1073,7 +1084,10 @@ const Map localizedValues = { "DailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, "Period": {"en": "Period", "ar": "الفترة"}, "cm": {"en": "CM", "ar": "سم"}, + "ft": {"en": "ft", "ar": "قدم"}, "kg": {"en": "kg", "ar": "كجم"}, + "lb": {"en": "lb", "ar": "رطل"}, + "birth_date": {"en": "Birth Date", "ar": "تاريخ الميلاد"}, "mass": {"en": "Mass", "ar": "كتلة"}, "temp-c": {"en": "°C", "ar": "°س"}, "bpm": {"en": "bpm", "ar": "نبضة"}, @@ -1290,7 +1304,8 @@ const Map localizedValues = { "child-vaccine": {"en": "Child Vaccines", "ar": "تطعيمات الأطفال"}, "calculators": {"en": "Health Calculators", "ar": "الحاسبات الصحية"}, "converters": {"en": "Health Converter", "ar": "تحويل القياسات"}, - "h2o": {"en": "Water Tracker", "ar": "حساب كمية الماء"}, + "waterTracker": {"en": "Water Tracker", "ar": "حساب كمية الماء"}, + "h2o": {"en": "H2O", "ar": "استهلاك"}, "v-tour": {"en": "Virtual Tour", "ar": "جولة إفتراضية"}, "hmg-news": {"en": "HMG News", "ar": "أخبار المجموعة"}, "blood-d": {"en": "Blood Donation", "ar": "تبرع بالدم"}, @@ -1613,6 +1628,7 @@ const Map localizedValues = { "en": "Send the child's schedule to the email", "ar": "أرسل جدول الطفل إلى البريد الإلكتروني" }, + "vaccination-add-child-msg": { "en": "Add the child's information below to receive the schedule of vaccinations.", @@ -1677,10 +1693,96 @@ const Map localizedValues = { "en": "Hospital Visit Appointment", "ar": "موعد زيارة للمستشفى" }, + "videoAppo": {"en": "Video Call Appointment", "ar": "موعد اتصال فيديو"}, // "visit": {"en" : "Visit", "ar": "الزيارة"}, "weight-add": {"en": "Enter Weight Value", "ar": "أدخل الوزن "}, "systolic-add": {"en": "Enter Systolic Value", "ar": "أدخل قيمة الإنقباض "}, "diastolic-add": {"en": "Enter Diastolic Value", "ar": "أدخل قيمة الإنبساط "}, "cmc-heading": {"en": "Comprehensive Medical Checkup", "ar": "فحص طبي شامل"}, + "today": {"en": "Today", "ar": "اليوم"}, + "week": {"en": "Week", "ar": "أسبوع"}, + "month": {"en": "Month", "ar": "شهر"}, + "h2o-amount-of-water": { + "en": "Enter the amount of water:", + "ar": "ادخل كمية الماء:" + }, + "update-user": {"en": "Update Information", "ar": "تحديث بيانات"}, + "editname": {"en": "Enter the name here", "ar": "أدخل الاسم هنا"}, + "activity-level": {"en": "Activity Level", "ar": "مستوى النشاط"}, + "light-active": {"en": "Lightly Active", "ar": " قليل النشاط"}, + "mod-active": {"en": "Moderately Active", "ar": "متوسط النشاط"}, + "reminder-label": { + "en": "Activate the reminder of drink water?", + "ar": "تفعيل خاصية تذكير شرب الماء؟" + }, + "reminder-times-label": { + "en": "How many times do you want to be reminded?", + "ar": "عدد مرات التذكير" + }, + "times": {"en": "Times", "ar": "مرات"}, + "WaterCalculate": {"en": "Save", "ar": "حفظ"}, + "notif-title": {"en": "Water Reminder", "ar": "تذكير"}, + "notif-text": { + "en": " Don't forget to drink water.", + "ar": "لا تنسى شرب الماء" + }, + "custom": {"en": "Custom", "ar": "خاص"}, + "undo": {"en": "Undo", "ar": "تراجع"}, + "drinking": {"en": "Drinkning", "ar": "الشرب"}, + "remaining": {"en": "Remaining", "ar": "المتبقي"}, + "taken": {"en": "Taken", "ar": " مأخوذ"}, + "ml": {"en": "ml", "ar": "مل"}, + "l": {"en": "L", "ar": "لتر"}, + "custom-label": {"en": "Enter amount", "ar": "أدخل كمية الماء"}, + "custom-label-in-litres": { + "en": "Enter amount in liters", + "ar": "أدخل الكمية باللتر" + }, + "custom-label-in-mililitres": { + "en": "Enter amount in millilitres", + "ar": "أدخل الكمية بالملليتر" + }, + "amount": {"en": "Amount", "ar": "الكمية"}, + "target-reach": { + "en": "You have reached the target for the day!", + "ar": "لقد حققت هدفك اليومي! مبروك" + }, + "week-header": { + "en": "Water consumed in a week", + "ar": "معدل شرب الماء خلال الاسبوع" + }, + "month-header": { + "en": "Water consumed in a month", + "ar": "معدل شرب الماء خلال الشهر" + }, + "notif-permission-title": { + "en": "Could not set the water reminders", + "ar": "لا يمكن ضبط اشعار شرب الماء" + }, + "notif-permission-msg": { + "en": + "To recieve water reminders, please turn on notifications in the system settings", + "ar": "الرجاء تفعيل الاشعارات في الاعدادات" + }, + "verification_message_code": { + "en": "Please enter verification code", + "ar": "الرجاء إدخال رمز التحقق" + }, + "sms_code": {"en": "Enter SMS Code here", "ar": "أدخل رمز التحقق هنا"}, + "code_failure": { + "en": "Didn’t received the code", + "ar": "لم أستلم رمز التحقق" + }, + "resend": {"en": "Resend", "ar": "إعادة إرسال"}, + "submitncontinue": {"en": "Submit and continue", "ar": "إرسال ومتابعة"}, + "areyousure": { + "en": "Are you sure you want to Add", + "ar": "هل أنت متأكد أنك تريد إضافة" + }, + "preferredunit": { + "en": "Select the preferred unit", + "ar": "اختر الوحدة المفضلة" + }, + "select-unit": {"en": "Select unit", "ar": "اختر وحدة القياس"} }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 4f7b2646..caada21f 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -28,3 +28,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'; diff --git a/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart new file mode 100644 index 00000000..bb100219 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart @@ -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 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 toJson() { + final Map data = new Map(); + 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; + } +} diff --git a/lib/core/model/AlHabibMedicalService/H2O/user_detail_request_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_detail_request_model.dart new file mode 100644 index 00000000..9d23d383 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/H2O/user_detail_request_model.dart @@ -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 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 toJson() { + final Map data = new Map(); + 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; + } +} \ No newline at end of file diff --git a/lib/core/service/AlHabibMedicalService/H2O_service.dart b/lib/core/service/AlHabibMedicalService/H2O_service.dart index c65221c5..9483bc31 100644 --- a/lib/core/service/AlHabibMedicalService/H2O_service.dart +++ b/lib/core/service/AlHabibMedicalService/H2O_service.dart @@ -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 userProgressForTodayDataList = List(); List userProgressForWeekDataList = List(); List 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()); } } diff --git a/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart b/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart index da12b48b..803a80f0 100644 --- a/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart +++ b/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart @@ -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) { diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 3788cf98..849bcee7 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -198,7 +198,7 @@ class BaseAppClient { get(String endPoint, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, - Map queryParams, + Map queryParams, bool isExternal = false}) async { String url; if (isExternal) { @@ -239,19 +239,40 @@ class BaseAppClient { {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, bool isAllowAny = false, - Map queryParams}) async { - String url = PHARMACY_BASE_URL + endPoint; + bool isExternal = false, + Map 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"); diff --git a/lib/core/service/offers_service.dart b/lib/core/service/offers_service.dart index 2247c833..8007007b 100644 --- a/lib/core/service/offers_service.dart +++ b/lib/core/service/offers_service.dart @@ -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) { diff --git a/lib/core/service/parmacyModule/order-preview-service.dart b/lib/core/service/parmacyModule/order-preview-service.dart index 5648ff6d..18cfa87e 100644 --- a/lib/core/service/parmacyModule/order-preview-service.dart +++ b/lib/core/service/parmacyModule/order-preview-service.dart @@ -21,7 +21,7 @@ class OrderPreviewService extends BaseService { Map 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) { diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index 7f0a1050..c400d788 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -6,27 +6,23 @@ 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 bannerItems = List(); List manufacturerList = List(); List bestSellerProducts = List(); List lastVisitedProducts = List(); - - Future makeVerifyCustomer(dynamic data) async { Map queryParams = {'FileNumber': data['PatientID'].toString()}; hasError = false; try { - await baseAppClient.get(PHARMACY_VERIFY_CUSTOMER, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) { if (response['UserName'] != null) { sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString()); print(response); @@ -58,9 +54,29 @@ class PharmacyModuleService extends BaseService { }; hasError = false; try { - await baseAppClient.get(PHARMACY_CREATE_CUSTOMER, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.get(PHARMACY_CREATE_CUSTOMER, 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 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; @@ -73,8 +89,7 @@ class PharmacyModuleService extends BaseService { Future getBannerListList() async { hasError = false; try { - await baseAppClient.get(GET_PHARMACY_BANNER, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.getPharmacy(GET_PHARMACY_BANNER, onSuccess: (dynamic response, int statusCode) { bannerItems.clear(); response['images'].forEach((item) { bannerItems.add(PharmacyImageObject.fromJson(item)); @@ -91,12 +106,11 @@ class PharmacyModuleService extends BaseService { Future getTopManufacturerList() async { Map queryParams = {'page': '1', 'limit': '8'}; try { - await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER, - onSuccess: (dynamic response, int statusCode) { + 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)); } }); @@ -115,8 +129,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, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT, onSuccess: (dynamic response, int statusCode) { bestSellerProducts.clear(); response['products'].forEach((item) { bestSellerProducts.add(PharmacyProduct.fromJson(item)); @@ -132,13 +145,10 @@ class PharmacyModuleService extends BaseService { Future getLastVisitedProducts() async { String lastVisited = ""; - if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != - null) { - lastVisited = - await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS); + if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != null) { + 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)); @@ -152,5 +162,4 @@ class PharmacyModuleService extends BaseService { } } } - } diff --git a/lib/core/service/parmacyModule/prescription_service.dart b/lib/core/service/parmacyModule/prescription_service.dart index 7aafc9d3..33c2cfd7 100644 --- a/lib/core/service/parmacyModule/prescription_service.dart +++ b/lib/core/service/parmacyModule/prescription_service.dart @@ -21,7 +21,7 @@ class PrescriptionService extends BaseService { hasError = false; url = PRESCRIPTION; print("Print PRESCRIPTION url" + url); - await baseAppClient.get(url, + await baseAppClient.post(url, onSuccess: (dynamic response, int statusCode) { _prescriptionsList.clear(); response['PatientPrescriptionList'].forEach((item) { diff --git a/lib/core/service/pharmacy_categorise_service.dart b/lib/core/service/pharmacy_categorise_service.dart index b55a755d..0082cc49 100644 --- a/lib/core/service/pharmacy_categorise_service.dart +++ b/lib/core/service/pharmacy_categorise_service.dart @@ -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) { diff --git a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart index 15b00e37..a89ec799 100644 --- a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart @@ -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(); List userProgressForWeekDataSeries; List 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> createUserProgressForWeekDataSeries() { - List globalData = [ - ]; - _h2OService.userProgressForWeekDataList.forEach(( - UserProgressForWeekDataModel data) { + List> createUserProgressForWeekDataSeries() { + List globalData = []; + _h2OService.userProgressForWeekDataList.forEach((UserProgressForWeekDataModel data) { globalData.add(new ChartSeries(data.dayName, data.percentageConsumed)); }); return [ @@ -77,12 +101,9 @@ class H2OViewModel extends BaseViewModel { ]; } - List> createUserProgressForMonthDataSeries() { - List globalData = [ - ]; - _h2OService.userProgressForMonthDataList.forEach(( - UserProgressForMonthDataModel data) { + List> createUserProgressForMonthDataSeries() { + List 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; diff --git a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart index bee7f654..303dab9e 100644 --- a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart @@ -51,6 +51,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(); diff --git a/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart b/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart index 47a3bb11..e3a6255e 100644 --- a/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart @@ -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); diff --git a/lib/core/viewModels/pharmacy_categorise_view_model.dart b/lib/core/viewModels/pharmacy_categorise_view_model.dart index 5e1f4f9f..d26d860d 100644 --- a/lib/core/viewModels/pharmacy_categorise_view_model.dart +++ b/lib/core/viewModels/pharmacy_categorise_view_model.dart @@ -16,30 +16,22 @@ import 'base_view_model.dart'; class PharmacyCategoriseViewModel extends BaseViewModel { bool hasError = false; - PharmacyCategoriseService _pharmacyCategoriseService = - locator(); + PharmacyCategoriseService _pharmacyCategoriseService = locator(); - List get categorise => - _pharmacyCategoriseService.categoriseList; + List get categorise => _pharmacyCategoriseService.categoriseList; - List get categoriseParent => - _pharmacyCategoriseService.parentCategoriseList; + List get categoriseParent => _pharmacyCategoriseService.parentCategoriseList; - List get parentProducts => - _pharmacyCategoriseService.parentProductsList; + List get parentProducts => _pharmacyCategoriseService.parentProductsList; - List get subCategorise => - _pharmacyCategoriseService.subCategoriseList; + List get subCategorise => _pharmacyCategoriseService.subCategoriseList; - List get subProducts => - _pharmacyCategoriseService.subProductsList; + List get subProducts => _pharmacyCategoriseService.subProductsList; - List get finalProducts => - _pharmacyCategoriseService.finalProducts; + List get finalProducts => _pharmacyCategoriseService.finalProducts; List get brandsList => _pharmacyCategoriseService.brandsList; - List get searchList => - _pharmacyCategoriseService.searchList; + List get searchList => _pharmacyCategoriseService.searchList; List get scanList => _pharmacyCategoriseService.scanList; diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 3c3c18c1..d81fe78f 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -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 { @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 { 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 { 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 { 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 { ), ), ), - 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { }); } else { setState(() { - weather = - data != null ? data['Temperature'].toString() + '\u2103' : '--'; + weather = data != null ? data['Temperature'].toString() + '\u2103' : '--'; }); } } diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart index 90386827..1558b8c7 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart @@ -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 { @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 { 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 { 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 { 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, + )), ), ), ), ], - ) + ), ], ) ], ); } } - - - diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart index d70aec4e..2df90419 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart @@ -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 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 { + List 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 { 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 { 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 { 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 { ); } } + class AmountModel { String name; String nameAr; @@ -151,7 +164,3 @@ class AmountModel { return data; } } - - - - diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/setting_page_radio_button_list_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/setting_page_radio_button_list_dialog.dart new file mode 100644 index 00000000..580207d8 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/setting_page_radio_button_list_dialog.dart @@ -0,0 +1,101 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +class CommonRadioButtonDialog extends StatefulWidget { + final List 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 { + 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), + ), + ) + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart b/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart index 036ed186..2b22a100 100644 --- a/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart +++ b/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart @@ -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 { 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 { 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 { ), 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; } diff --git a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart new file mode 100644 index 00000000..4295558a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart @@ -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 { + 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 _activityLevelListEng = []; + List _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); + } +} diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index 8ac7b437..b4d39682 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -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 @override Widget build(BuildContext context) { return BaseView( + 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 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 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: [ Expanded( diff --git a/lib/pages/AlHabibMedicalService/h2o/month_page.dart b/lib/pages/AlHabibMedicalService/h2o/month_page.dart index f0baf34d..e0118495 100644 --- a/lib/pages/AlHabibMedicalService/h2o/month_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/month_page.dart @@ -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), + ], + ), ), ), ); diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index b92efc9e..33383287 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -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), ) ], ) diff --git a/lib/pages/AlHabibMedicalService/h2o/week_page.dart b/lib/pages/AlHabibMedicalService/h2o/week_page.dart index e42eb19b..34e365e6 100644 --- a/lib/pages/AlHabibMedicalService/h2o/week_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/week_page.dart @@ -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), + ], + ), ), ), ); } } - - - diff --git a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart index 7eaed1a8..b692e6ba 100644 --- a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart +++ b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart @@ -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 with TickerProviderStateMixin { +class _H20FloatingActionButtonState extends State with TickerProviderStateMixin { AnimationController _controller; @override void initState() { @@ -37,15 +32,20 @@ class _H20FloatingActionButtonState extends State 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 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 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 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 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 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), ), ); } diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index b161c6e0..a2312220 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -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'; @@ -56,6 +57,8 @@ class _MyFamily extends State with TickerProviderStateMixin { ProjectViewModel projectViewModel; AuthenticatedUser user; VitalSignService _vitalSignService = locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = locator(); + var isVaiable = false; @override void initState() { @@ -727,6 +730,12 @@ class _MyFamily extends State with TickerProviderStateMixin { authenticatedUserObject.user; Provider.of(context, listen: false) .setUser(authenticatedUserObject.user); + + await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { + if(pharmacyModuleViewModel.error.isNotEmpty) + await pharmacyModuleViewModel.createUser(); + }); + appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index fda83fc2..3a46f45c 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -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 { @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 { ); } + 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: diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 44adc10e..dd749e98 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -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,8 @@ class _ConfirmLogin extends State { var sharedPref = new AppSharedPreferences(); bool authenticated; final authService = new AuthProvider(); + PharmacyModuleViewModel pharmacyModuleViewModel = + locator(); int mobileNumber; String errorMsg = ''; SelectDeviceIMEIRES user; @@ -113,7 +117,7 @@ class _ConfirmLogin extends State { height: 90, width: 90, ), - AppText( + Texts( TranslationBase.of(context).welcomeBack + ' ' + user.name, @@ -122,7 +126,7 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).accountInfo, fontSize: SizeConfig.textMultiplier * 2.5, ), @@ -178,12 +182,12 @@ class _ConfirmLogin extends State { 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, @@ -589,6 +593,12 @@ class _ConfirmLogin extends State { Provider.of(context, listen: false) .setUser(authenticatedUserObject.user); getToDoCount(); + + pharmacyModuleViewModel.generatePharmacyToken().then((value) async { + if (pharmacyModuleViewModel.error.isNotEmpty) + await pharmacyModuleViewModel.createUser(); + }); + appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { @@ -632,6 +642,7 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(4, true)}, child: RoundedContainer( + height: 150, borderColor: Colors.grey, showBorder: true, child: Padding( @@ -646,7 +657,7 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).verifyWhatsApp, fontSize: SizeConfig.textMultiplier * 2, ) @@ -658,6 +669,7 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(1, true)}, child: RoundedContainer( + height: 150, borderColor: Colors.grey, showBorder: true, child: Padding( @@ -677,7 +689,7 @@ class _ConfirmLogin extends State { : SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).verifySMS, fontSize: SizeConfig.textMultiplier * 2, textAlign: TextAlign.center, @@ -690,6 +702,7 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(2, BiometricType.fingerprint.index)}, child: RoundedContainer( + height: 150, backgroundColor: BiometricType.fingerprint.index == 1 ? Colors.white : Colors.white.withOpacity(.7), @@ -707,7 +720,7 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).verifyFingerprint, fontSize: SizeConfig.textMultiplier * 2, ) @@ -719,6 +732,7 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(3, BiometricType.face.index)}, child: RoundedContainer( + height: 150, backgroundColor: checkIfBiometricAvailable(BiometricType.face) ? Colors.white : Colors.white.withOpacity(.7), @@ -737,7 +751,7 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).verifyFaceID, fontSize: SizeConfig.textMultiplier * 2, ) @@ -754,6 +768,7 @@ class _ConfirmLogin extends State { }) }, child: RoundedContainer( + height: 150, backgroundColor: BiometricType.fingerprint.index == 1 ? Colors.white : Colors.white.withOpacity(.7), @@ -765,7 +780,7 @@ class _ConfirmLogin extends State { children: [ Image.asset( 'assets/images/login/more_icon.png', - height: SizeConfig.imageSizeMultiplier * 13, + height: 45, width: SizeConfig.imageSizeMultiplier * 16, ), projectViewModel.isArabic @@ -775,9 +790,9 @@ class _ConfirmLogin extends State { : SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).moreVerification, - fontSize: SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 1.8, textAlign: TextAlign.center, ) ], diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index c2a943d2..44be9a6d 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -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 { final authService = new AuthProvider(); var sharedPref = new AppSharedPreferences(); bool isLoading = false; - AppointmentRateViewModel appointmentRateViewModel = - locator(); + AppointmentRateViewModel appointmentRateViewModel = locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = locator(); - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); ProjectViewModel projectViewModel; ToDoCountProviderModel toDoProvider; @@ -82,7 +85,7 @@ class _Login extends State { children: [ 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 { child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - 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 { 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 { 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 { } 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 { 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() { diff --git a/lib/pages/pharmacies/product_detail.dart b/lib/pages/pharmacies/product_detail.dart index ebb7fe39..6cd3a7d1 100644 --- a/lib/pages/pharmacies/product_detail.dart +++ b/lib/pages/pharmacies/product_detail.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/login/welcome.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -38,7 +39,7 @@ class __ProductDetailPageState extends State { dynamic wishlistItems; void initState() { - price = 0; + price = 1; specificationData = widget.product; setState(() { customerId = userInfo(widget.product.id, widget.product); @@ -79,18 +80,12 @@ class __ProductDetailPageState extends State { alignment: Alignment.centerRight, child: languageID == 'ar' ? Text( - widget.product - .discountDescriptionn, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 17), + widget.product.discountDescriptionn, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17), ) : Text( - widget.product - .discountDescription, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 17), + widget.product.discountDescription, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17), ), ), ), @@ -101,8 +96,7 @@ class __ProductDetailPageState extends State { flex: 0, child: Container( child: Image( - image: AssetImage( - 'assets/images/offer.png'), + image: AssetImage('assets/images/offer.png'), ), ), ), @@ -180,9 +174,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).details, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), color: Colors.white, ), @@ -210,9 +202,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).reviews, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), color: Colors.white, ), @@ -240,9 +230,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).availability, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), color: Colors.white, ), @@ -270,10 +258,7 @@ class __ProductDetailPageState extends State { Container( child: Text( TranslationBase.of(context).description, - style: TextStyle( - fontSize: 17, - color: Colors.grey, - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600), ), ), SizedBox( @@ -281,12 +266,8 @@ class __ProductDetailPageState extends State { ), Container( child: Text( - languageID == 'ar' - ? widget.product.shortDescriptionn - : widget.product.shortDescription, - style: TextStyle( - fontSize: 16, - fontFamily: 'WorkSans-Regular'), + languageID == 'ar' ? widget.product.shortDescriptionn : widget.product.shortDescription ?? "", + style: TextStyle(fontSize: 16, fontFamily: 'WorkSans-Regular'), ), ), SizedBox( @@ -295,10 +276,7 @@ class __ProductDetailPageState extends State { Container( child: Text( TranslationBase.of(context).howToUse, - style: TextStyle( - fontSize: 17, - color: Colors.grey, - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600), ), ), SizedBox( @@ -306,12 +284,8 @@ class __ProductDetailPageState extends State { ), Container( child: Text( - languageID == 'ar' - ? widget.product.fullDescriptionn - : widget.product.fullDescription, - style: TextStyle( - fontSize: 16, - fontFamily: 'WorkSans-Regular'), + languageID == 'ar' ? widget.product.fullDescriptionn : widget.product.fullDescription, + style: TextStyle(fontSize: 16, fontFamily: 'WorkSans-Regular'), ), ), ], @@ -319,162 +293,98 @@ class __ProductDetailPageState extends State { ) : isReviews ? BaseView( - onModelReady: (model) => - model.getProductReviewsData( - widget.product.id), - builder: (_, model, wi) => model - .productDetailService - .length != - 0 && - model.productDetailService[0] - .reviews.length != - 0 - ? ListView.builder( - physics: ScrollPhysics(), - itemCount: model - .productDetailService[0] - .reviews - .length, - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemBuilder: (BuildContext context, - int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - child: Row( - children: [ - Container( - child: Text( - model - .productDetailService[ - 0] - .reviews[ - index] - .customerId - .toString(), - style: TextStyle( - fontSize: 17, - color: Colors - .grey, - fontWeight: - FontWeight - .w600), - ), + onModelReady: (model) => model.getProductReviewsData(widget.product.id), + builder: (_, model, wi) => + model.productDetailService.length != 0 && model.productDetailService[0].reviews.length != 0 + ? ListView.builder( + physics: ScrollPhysics(), + itemCount: model.productDetailService[0].reviews.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Row( + children: [ + Container( + child: Text( + model.productDetailService[0].reviews[index].customerId.toString(), + style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600), + ), + ), + Container( + margin: EdgeInsets.only(left: 210), + child: RatingBar.readOnly( + initialRating: model.productDetailService[0].reviews[index].rating.toDouble(), + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ], ), - Container( - margin: - EdgeInsets.only( - left: 210), - child: RatingBar - .readOnly( - initialRating: model - .productDetailService[ - 0] - .reviews[ - index] - .rating - .toDouble(), - size: 15.0, - filledColor: - Colors.yellow[ - 700], - emptyColor: Colors - .grey[500], - isHalfAllowed: - true, - halfFilledIcon: - Icons - .star_half, - filledIcon: - Icons.star, - emptyIcon: - Icons.star, - ), + ), + SizedBox( + height: 10, + ), + Container( + child: Text( + model.productDetailService[0].reviews[index].reviewText, + style: TextStyle(fontSize: 20), ), - ], - ), - ), - SizedBox( - height: 10, - ), - Container( - child: Text( - model - .productDetailService[ - 0] - .reviews[index] - .reviewText, - style: TextStyle( - fontSize: 20), - ), - ), - SizedBox( - height: 50, + ), + SizedBox( + height: 50, + ), + Divider(height: 1, color: Colors.grey), + ], ), - Divider( - height: 1, - color: Colors.grey), - ], - ), - ); - }, - ) - : Container( - padding: EdgeInsets.all(15), - alignment: Alignment.center, - child: Text('No Reviews Available'), - ), + ); + }, + ) + : Container( + padding: EdgeInsets.all(15), + alignment: Alignment.center, + child: Text('No Reviews Available'), + ), ) : isAvailabilty ? BaseView( - onModelReady: (model) => - model.getProductLocationData(), - builder: (_, model, wi) => model - .productLocationService - .length == - 0 + onModelReady: (model) => model.getProductLocationData(), + builder: (_, model, wi) => model.productLocationService.length == 0 ? Container( padding: EdgeInsets.all(15), alignment: Alignment.center, - child: Text( - 'No location Available'), + child: Text('No location Available'), ) : ListView.builder( physics: ScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model - .productLocationService - .length, - itemBuilder: - (BuildContext context, - int index) { + itemCount: model.productLocationService.length, + itemBuilder: (BuildContext context, int index) { return Padding( - padding: - EdgeInsets.all(8.0), + padding: EdgeInsets.all(8.0), child: Column( // crossAxisAlignment: CrossAxisAlignment.start, // mainAxisAlignment: MainAxisAlignment.start, children: [ Row( // crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment - .start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( flex: 1, - child: Image.network(model - .productLocationService[ - index] - .projectImageUrl), + child: Image.network(model.productLocationService[index].projectImageUrl), ), SizedBox( width: 10, @@ -482,48 +392,31 @@ class __ProductDetailPageState extends State { Expanded( flex: 4, child: Text( - model - .productLocationService[ - index] - .locationDescription + + model.productLocationService[index].locationDescription + "\n" + - fixingString(model - .productLocationService[ - 0] - .cityName - .toString()), - style: TextStyle( - fontSize: - 12), + fixingString(model.productLocationService[0].cityName.toString()), + style: TextStyle(fontSize: 12), ), ), Expanded( flex: 1, child: IconButton( - icon: Icon(Icons - .location_on), - color: - Colors.red, - onPressed: - () {}, + icon: Icon(Icons.location_on), + color: Colors.red, + onPressed: () {}, ), ), Expanded( flex: 1, child: IconButton( - icon: Icon(Icons - .phone), - color: - Colors.red, - onPressed: - () {}, + icon: Icon(Icons.phone), + color: Colors.red, + onPressed: () {}, ), ), ], ), - Divider( - height: 1.2, - color: Colors.grey) + Divider(height: 1.2, color: Colors.grey) ], ), ); @@ -538,12 +431,8 @@ class __ProductDetailPageState extends State { ], ), ), - bottomSheet: footerWidget( - widget.product.stockAvailability != 'Out of stock', - widget.product.orderMaximumQuantity, - widget.product.orderMinimumQuantity, - widget.product.stockQuantity, - widget.product), + bottomSheet: footerWidget(widget.product.stockAvailability != 'Out of stock', widget.product.orderMaximumQuantity, + widget.product.orderMinimumQuantity, widget.product.stockQuantity, widget.product), ) : AppScaffold( appBarTitle: 'product detail page', @@ -576,18 +465,12 @@ class __ProductDetailPageState extends State { alignment: Alignment.centerRight, child: languageID == 'ar' ? Text( - widget.product - .discountDescriptionn, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 17), + widget.product.discountDescriptionn, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17), ) : Text( - widget.product - .discountDescription, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 17), + widget.product.discountDescription, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17), ), ), ), @@ -598,8 +481,7 @@ class __ProductDetailPageState extends State { flex: 0, child: Container( child: Image( - image: AssetImage( - 'assets/images/offer.png'), + image: AssetImage('assets/images/offer.png'), ), ), ), @@ -669,9 +551,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).details, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), color: Colors.white, ), @@ -699,9 +579,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).reviews, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), color: Colors.white, ), @@ -729,9 +607,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).availability, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), color: Colors.white, ), @@ -759,10 +635,7 @@ class __ProductDetailPageState extends State { Container( child: Text( TranslationBase.of(context).description, - style: TextStyle( - fontSize: 17, - color: Colors.grey, - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600), ), ), SizedBox( @@ -770,12 +643,8 @@ class __ProductDetailPageState extends State { ), Container( child: Text( - languageID == 'ar' - ? widget.product.fullDescriptionn - : widget.product.fullDescription, - style: TextStyle( - fontSize: 16, - fontFamily: 'WorkSans-Regular'), + languageID == 'ar' ? widget.product.fullDescriptionn : widget.product.fullDescription, + style: TextStyle(fontSize: 16, fontFamily: 'WorkSans-Regular'), ), ), ], @@ -783,132 +652,79 @@ class __ProductDetailPageState extends State { ) : isReviews ? BaseView( - onModelReady: (model) => - model.getProductReviewsData( - widget.product.id), - builder: (_, model, wi) => model - .productDetailService - .length != - 0 && - model.productDetailService[0] - .reviews.length != - 0 - ? ListView.builder( - physics: ScrollPhysics(), - itemCount: model - .productDetailService[0] - .reviews - .length, - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemBuilder: (BuildContext context, - int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - child: Row( - children: [ - Container( - child: Text( - model - .productDetailService[ - 0] - .reviews[ - index] - .customerId - .toString(), - style: TextStyle( - fontSize: 17, - color: Colors - .grey, - fontWeight: - FontWeight - .w600), - ), + onModelReady: (model) => model.getProductReviewsData(widget.product.id), + builder: (_, model, wi) => + model.productDetailService.length != 0 && model.productDetailService[0].reviews.length != 0 + ? ListView.builder( + physics: ScrollPhysics(), + itemCount: model.productDetailService[0].reviews.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Row( + children: [ + Container( + child: Text( + model.productDetailService[0].reviews[index].customerId.toString(), + style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600), + ), + ), + Container( + margin: EdgeInsets.only(left: 210), + child: RatingBar.readOnly( + initialRating: model.productDetailService[0].reviews[index].rating.toDouble(), + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ], ), - Container( - margin: - EdgeInsets.only( - left: 210), - child: RatingBar - .readOnly( - initialRating: model - .productDetailService[ - 0] - .reviews[ - index] - .rating - .toDouble(), - size: 15.0, - filledColor: - Colors.yellow[ - 700], - emptyColor: Colors - .grey[500], - isHalfAllowed: - true, - halfFilledIcon: - Icons - .star_half, - filledIcon: - Icons.star, - emptyIcon: - Icons.star, - ), + ), + SizedBox( + height: 10, + ), + Container( + child: Text( + model.productDetailService[0].reviews[index].reviewText, + style: TextStyle(fontSize: 20), ), - ], - ), - ), - SizedBox( - height: 10, - ), - Container( - child: Text( - model - .productDetailService[ - 0] - .reviews[index] - .reviewText, - style: TextStyle( - fontSize: 20), - ), - ), - SizedBox( - height: 50, + ), + SizedBox( + height: 50, + ), + Divider(height: 1, color: Colors.grey), + ], ), - Divider( - height: 1, - color: Colors.grey), - ], - ), - ); - }, - ) - : Container( - padding: EdgeInsets.all(15), - alignment: Alignment.center, - child: Text('No Reviews Available'), - ), + ); + }, + ) + : Container( + padding: EdgeInsets.all(15), + alignment: Alignment.center, + child: Text('No Reviews Available'), + ), ) : isAvailabilty ? BaseView( - onModelReady: (model) => - model.getProductLocationData(), - builder: (_, model, wi) => - ListView.builder( + onModelReady: (model) => model.getProductLocationData(), + builder: (_, model, wi) => ListView.builder( physics: ScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model - .productLocationService.length, - itemBuilder: (BuildContext context, - int index) { + itemCount: model.productLocationService.length, + itemBuilder: (BuildContext context, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Column( @@ -917,15 +733,11 @@ class __ProductDetailPageState extends State { children: [ Row( // crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( flex: 1, - child: Image.network(model - .productLocationService[ - index] - .projectImageUrl), + child: Image.network(model.productLocationService[index].projectImageUrl), ), SizedBox( width: 10, @@ -933,25 +745,16 @@ class __ProductDetailPageState extends State { Expanded( flex: 4, child: Text( - model - .productLocationService[ - index] - .locationDescription + + model.productLocationService[index].locationDescription + "\n" + - fixingString(model - .productLocationService[ - 0] - .cityName - .toString()), - style: TextStyle( - fontSize: 12), + fixingString(model.productLocationService[0].cityName.toString()), + style: TextStyle(fontSize: 12), ), ), Expanded( flex: 1, child: IconButton( - icon: Icon(Icons - .location_on), + icon: Icon(Icons.location_on), color: Colors.red, onPressed: () {}, ), @@ -959,17 +762,14 @@ class __ProductDetailPageState extends State { Expanded( flex: 1, child: IconButton( - icon: - Icon(Icons.phone), + icon: Icon(Icons.phone), color: Colors.red, onPressed: () {}, ), ), ], ), - Divider( - height: 1.2, - color: Colors.grey) + Divider(height: 1.2, color: Colors.grey) ], ), ); @@ -984,12 +784,8 @@ class __ProductDetailPageState extends State { ], ), ), - bottomSheet: footerWidget( - widget.product.stockAvailability != 'Out of stock', - widget.product.orderMaximumQuantity, - widget.product.orderMinimumQuantity, - widget.product.stockQuantity, - widget.product), + bottomSheet: footerWidget(widget.product.stockAvailability != 'Out of stock', widget.product.orderMaximumQuantity, + widget.product.orderMinimumQuantity, widget.product.stockQuantity, widget.product), ); } } @@ -1000,8 +796,7 @@ class footerWidget extends StatefulWidget { final int minQuantity; final int quantityLimit; final PharmacyProduct item; - footerWidget(this.isAvailble, this.maxQuantity, this.minQuantity, - this.quantityLimit, this.item); + footerWidget(this.isAvailble, this.maxQuantity, this.minQuantity, this.quantityLimit, this.item); @override _footerWidgetState createState() => _footerWidgetState(); } @@ -1031,8 +826,7 @@ class _footerWidgetState extends State { padding: const EdgeInsets.all(8.0), child: Text( TranslationBase.of(context).quantity, - style: TextStyle( - fontSize: 15, fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold), ), ), // ListView( @@ -1054,9 +848,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '1', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1081,9 +873,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '2', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1108,9 +898,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '3', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1135,9 +923,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '4', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1162,9 +948,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '5', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1189,9 +973,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '6', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1216,9 +998,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '7', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1243,9 +1023,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '8', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1270,9 +1048,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '9', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1297,9 +1073,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '10', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1320,8 +1094,7 @@ class _footerWidgetState extends State { Container( width: 50.0, child: TextField( - decoration: - InputDecoration(labelText: 'quantity #'), + decoration: InputDecoration(labelText: 'quantity #'), onChanged: (text) { print(price); print(widget.quantityLimit); @@ -1400,10 +1173,7 @@ class _footerWidgetState extends State { alignment: Alignment.center, child: Text( TranslationBase.of(context).addToCart, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 15), + style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15), ), ), ) @@ -1418,10 +1188,7 @@ class _footerWidgetState extends State { color: Colors.green, child: Text( TranslationBase.of(context).addToCart, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 15), + style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15), ), ), ), @@ -1437,10 +1204,7 @@ class _footerWidgetState extends State { alignment: Alignment.center, child: Text( TranslationBase.of(context).buyNow, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 15), + style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15), ), ), ) @@ -1450,8 +1214,7 @@ class _footerWidgetState extends State { addToCartFunction(price, widget.item.id); Navigator.push( context, - MaterialPageRoute( - builder: (context) => CartOrderPage()), + MaterialPageRoute(builder: (context) => CartOrderPage()), ); }, child: Container( @@ -1461,10 +1224,7 @@ class _footerWidgetState extends State { color: Colors.blue, child: Text( TranslationBase.of(context).buyNow, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 15), + style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15), ), ), ), @@ -1505,57 +1265,57 @@ class _productNameAndPriceState extends State { widget.item.stockAvailability, style: widget.item.stockAvailability == 'Out of stock' ? TextStyle(fontWeight: FontWeight.bold, color: Colors.red) - : TextStyle( - fontWeight: FontWeight.bold, color: Colors.green), + : TextStyle(fontWeight: FontWeight.bold, color: Colors.green), ), SizedBox(width: 20), - widget.item.stockAvailability == 'Out of stock' - ? Text( - TranslationBase.of(context).notifyMe, - style: TextStyle( - color: Colors.blue, - decoration: TextDecoration.underline, - ), - ) - : Container(), - widget.item.stockAvailability == 'Out of stock' - ? Icon( - FontAwesomeIcons.bell, - color: Colors.blue, - size: 15.0, + widget.item.stockAvailability == 'Out of stock' && customerId != null + ? InkWell( + onTap: () => notifyMeWhenAvailable(context, widget.item.id), + child: Row(children: [ + Text( + TranslationBase.of(context).notifyMe, + style: TextStyle( + color: Colors.blue, + decoration: TextDecoration.underline, + ), + ), + SizedBox(width: 4), + Icon( + FontAwesomeIcons.bell, + color: Colors.blue, + size: 15.0, + ) + ]), ) - : Container(), - Container( - margin: languageID == 'ar' - ? EdgeInsets.only(right: 25) - : EdgeInsets.only(left: 25), - width: 40, - height: 40, - decoration: BoxDecoration( - color: Colors.grey, - borderRadius: BorderRadius.circular(30), - ), - child: !isInWishlit - ? IconButton( - icon: Icon(Icons.favorite_border), - color: Colors.white, - onPressed: () { - setState(() { - addToWishlistFunction(widget.item.id); - }); + : Container( + margin: languageID == 'ar' ? EdgeInsets.only(right: 25) : EdgeInsets.only(left: 25), + width: 40, + height: 40, + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(30), + ), + child: !isInWishlit + ? IconButton( + icon: Icon(Icons.favorite_border), + color: Colors.white, + onPressed: () { + setState(() { + addToWishlistFunction(widget.item.id); + }); // MyStatelessWidget(); - }, - ) - : IconButton( - icon: Icon(Icons.favorite), - color: Colors.red, - onPressed: () { - setState(() { - deleteFromWishlistFunction(widget.item.id); - }); + }, + ) + : IconButton( + icon: Icon(Icons.favorite), + color: Colors.red, + onPressed: () { + setState(() { + deleteFromWishlistFunction(widget.item.id); + }); // MyStatelessWidget(); - }, - )), + }, + )), ], ), ), @@ -1564,12 +1324,9 @@ class _productNameAndPriceState extends State { child: Container( margin: EdgeInsets.only(left: 5), child: Align( - alignment: - languageID == 'ar' ? Alignment.topRight : Alignment.topLeft, + alignment: languageID == 'ar' ? Alignment.topRight : Alignment.topLeft, child: Text( - languageID == 'ar' - ? widget.item.fullDescriptionn - : widget.item.fullDescription, + languageID == 'ar' ? widget.item.fullDescriptionn : widget.item.fullDescription, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15), ), ), @@ -1601,9 +1358,7 @@ class _productNameAndPriceState extends State { child: Container( child: widget.item.rxMessage != null ? Text( - languageID == 'ar' - ? widget.item.rxMessagen.toString() - : widget.item.rxMessage.toString(), + languageID == 'ar' ? widget.item.rxMessagen.toString() : widget.item.rxMessage.toString(), style: TextStyle(color: Colors.red, fontSize: 10), ) : Container()), @@ -1769,9 +1524,7 @@ slideDetail() { ), color: Colors.white, ), - child: const Text('1', - textAlign: TextAlign.center, - style: TextStyle(color: Color(0xFF000000))), + child: const Text('1', textAlign: TextAlign.center, style: TextStyle(color: Color(0xFF000000))), ), ) ], @@ -1801,6 +1554,11 @@ addToCartFunction(quantity, itemID) async { await x.addToCartData(quantity, itemID); } +notifyMeWhenAvailable(context, itemId) async { + ProductDetailViewModel x = new ProductDetailViewModel(); + await x.notifyMe(customerId, itemId); +} + addToWishlistFunction(itemID) async { ProductDetailViewModel x = new ProductDetailViewModel(); isInWishlit = true; @@ -1848,13 +1606,7 @@ settingModalBottomSheet(context) { leading: new Icon(Icons.shopping_cart), title: new Text('Add to cart'), onTap: () => { - if (price > 0) - {addToCartFunction(price, itemID)} - else - { - AppToast.showErrorToast( - message: "you should add quantity") - } + if (price > 0) {addToCartFunction(price, itemID)} else {AppToast.showErrorToast(message: "you should add quantity")} }), new ListTile( leading: new Icon(Icons.favorite_border), @@ -1865,8 +1617,7 @@ settingModalBottomSheet(context) { leading: new Icon(Icons.compare), title: new Text('Compare'), onTap: () => { - Provider.of(context, listen: false) - .addItem(specificationData), + Provider.of(context, listen: false).addItem(specificationData), }, ), ], @@ -1875,13 +1626,14 @@ settingModalBottomSheet(context) { }); } -userInfo(id, product) async { +Future userInfo(id, product) async { customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); if (customerId != null) { itemID = id; product = product; checkWishlist(); } + print("customerId:$customerId"); return customerId; // getSpecificationData(itemID); } diff --git a/lib/pages/pharmacies/screens/cart-order-page.dart b/lib/pages/pharmacies/screens/cart-order-page.dart index cca6c1df..6926f9f4 100644 --- a/lib/pages/pharmacies/screens/cart-order-page.dart +++ b/lib/pages/pharmacies/screens/cart-order-page.dart @@ -27,7 +27,7 @@ class CartOrderPage extends StatelessWidget { value: model.cartResponse, child: AppScaffold( appBarTitle: TranslationBase.of(context).shoppingCart, - isShowAppBar: true, + isShowAppBar: false, isPharmacy: true, baseViewModel: model, backgroundColor: Colors.white, diff --git a/lib/pages/pharmacies/widgets/BannerPager.dart b/lib/pages/pharmacies/widgets/BannerPager.dart index 989c7557..b088eefb 100644 --- a/lib/pages/pharmacies/widgets/BannerPager.dart +++ b/lib/pages/pharmacies/widgets/BannerPager.dart @@ -1,5 +1,7 @@ import 'package:carousel_slider/carousel_slider.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; +import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -39,20 +41,25 @@ class _BannerPagerState extends State { items: widget._model .getBannerImagesUrl() .mapIndexed( - (item, index) => Container( - margin: EdgeInsets.symmetric(horizontal: 1.0), - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5.0)), - child: Center( - child: index == 0 - ? Image.asset( - item, - fit: BoxFit.cover, - ) - : Image.network( - item, - fit: BoxFit.cover, - ), + (item, index) => InkWell( + onTap: () { + Navigator.push(context, FadePage(page: OffersCategorisePage())); + }, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 1.0), + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + child: Center( + child: index == 0 + ? Image.asset( + item, + fit: BoxFit.cover, + ) + : Image.network( + item, + fit: BoxFit.cover, + ), + ), ), ), ), diff --git a/lib/pages/pharmacy_categorise.dart b/lib/pages/pharmacy_categorise.dart index 06bba8c3..f0062a1c 100644 --- a/lib/pages/pharmacy_categorise.dart +++ b/lib/pages/pharmacy_categorise.dart @@ -29,9 +29,7 @@ class _PharmacyCategorisePageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getCategorise(), - builder: (BuildContext context, PharmacyCategoriseViewModel model, - Widget child) => - AppScaffold( + builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => AppScaffold( isShowDecPage: false, baseViewModel: model, body: Column( @@ -59,9 +57,7 @@ class _PharmacyCategorisePageState extends State { child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic - ? model.categorise[index].namen - : model.categorise[index].name, + projectViewModel.isArabic ? model.categorise[index].namen : model.categorise[index].name, fontWeight: FontWeight.w600, ), ), @@ -70,15 +66,14 @@ class _PharmacyCategorisePageState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - model.categorise[index].id != '12' - ? ParentCategorisePage( - id: model.categorise[index].id, - titleName: model.categorise[index].name, - ) - : FinalProductsPage( - id: model.categorise[index].id, - ), + builder: (context) => model.categorise[index].id != '12' + ? ParentCategorisePage( + id: model.categorise[index].id, + titleName: model.categorise[index].name, + ) + : FinalProductsPage( + id: model.categorise[index].id, + ), ), ), }, @@ -91,10 +86,7 @@ class _PharmacyCategorisePageState extends State { height: 140, child: Column( children: [ - Divider( - height: 2.0, - thickness: 1.0, - color: Colors.black12.withOpacity(0.14)), + Divider(height: 2.0, thickness: 1.0, color: Colors.black12.withOpacity(0.14)), SizedBox( height: 10.0, ), @@ -103,20 +95,21 @@ class _PharmacyCategorisePageState extends State { Expanded( child: Padding( padding: EdgeInsets.all(4.0), - child: Container( - height: 50.0, - width: 55.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - color: Colors.green.shade300.withOpacity(0.34), - ), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.0), - child: Texts( - projectViewModel.isArabic - ? 'الاكثر مبيعا' - : 'Best Sellers', - fontWeight: FontWeight.w600, + child: InkWell( + onTap: () {}, + child: Container( + height: 50.0, + width: 55.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + color: Colors.green.shade300.withOpacity(0.34), + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.0), + child: Texts( + projectViewModel.isArabic ? 'الاكثر مبيعا' : 'Best Sellers', + fontWeight: FontWeight.w600, + ), ), ), ), @@ -129,16 +122,13 @@ class _PharmacyCategorisePageState extends State { height: 50.0, width: 55.0, decoration: BoxDecoration( - color: Colors.orangeAccent.shade200 - .withOpacity(0.34), + color: Colors.orangeAccent.shade200.withOpacity(0.34), borderRadius: BorderRadius.circular(5.0), ), child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic - ? 'الاكثر مشاهدة' - : 'Most Viewed', + projectViewModel.isArabic ? 'الاكثر مشاهدة' : 'Most Viewed', fontWeight: FontWeight.w600, ), ), @@ -162,9 +152,7 @@ class _PharmacyCategorisePageState extends State { child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic - ? 'منتجات جديدة' - : 'New Products', + projectViewModel.isArabic ? 'منتجات جديدة' : 'New Products', fontWeight: FontWeight.w600, ), ), @@ -182,17 +170,13 @@ class _PharmacyCategorisePageState extends State { height: 50.0, width: 55.0, decoration: BoxDecoration( - color: - Colors.purple.shade200.withOpacity(0.34), + color: Colors.purple.shade200.withOpacity(0.34), borderRadius: BorderRadius.circular(5.0), ), child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 10.0), + padding: EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic - ? 'شوهد مؤخرا' - : 'Recently Viewed', + projectViewModel.isArabic ? 'شوهد مؤخرا' : 'Recently Viewed', fontWeight: FontWeight.w600, ), ), @@ -220,7 +204,7 @@ class _PharmacyCategorisePageState extends State { /// int patientID = get from qr result String result = await BarcodeScanner.scan(); var data = json.decode(result); - if (data!=null) { + if (data != null) { var qRParkingID = data['QRParkingID']; await model.scanQr(); if (model.state == ViewState.ErrorLocal) { diff --git a/lib/services/pharmacy_services/pharmacyAddress_service.dart b/lib/services/pharmacy_services/pharmacyAddress_service.dart index 1bb6571c..592359ca 100644 --- a/lib/services/pharmacy_services/pharmacyAddress_service.dart +++ b/lib/services/pharmacy_services/pharmacyAddress_service.dart @@ -16,7 +16,7 @@ class PharmacyAddressService extends BaseService { hasError = false; Addresses selectedAddress; try { - await baseAppClient.get("$GET_CUSTOMERS_ADDRESSES$customerId", + await baseAppClient.getPharmacy("$GET_CUSTOMERS_ADDRESSES$customerId", onSuccess: (dynamic response, int statusCode) async { addresses.clear(); var savedAddress = @@ -45,7 +45,7 @@ class PharmacyAddressService extends BaseService { Future getCountries(String countryName) async { hasError = false; try { - await baseAppClient.get("$PHARMACY_GET_COUNTRY", + await baseAppClient.getPharmacy("$PHARMACY_GET_COUNTRY", onSuccess: (dynamic response, int statusCode) { // countries.clear(); response['countries'].forEach((item) { diff --git a/lib/services/pharmacy_services/product_detail_service.dart b/lib/services/pharmacy_services/product_detail_service.dart index 7a2947b0..e3e8403e 100644 --- a/lib/services/pharmacy_services/product_detail_service.dart +++ b/lib/services/pharmacy_services/product_detail_service.dart @@ -102,20 +102,24 @@ class ProductDetailService extends BaseService { }, body: request); } + Future notifyMe(customerId, itemID) async { + hasError = false; + await baseAppClient.getPharmacy(SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID", onSuccess: (dynamic response, int statusCode) { + AppToast.showSuccessToast(message: 'You will be notified when product available'); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + AppToast.showErrorToast(message: 'something went wrong please try again'); + }); + } + Future addToWishlist(itemID) async { var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); hasError = false; Map request; request = { - "shopping_cart_item": - { - "quantity": 1, - "shopping_cart_type": "Wishlist", - "product_id": itemID, - "customer_id": customerId, - "language_id": 1 - } + "shopping_cart_item": {"quantity": 1, "shopping_cart_type": "Wishlist", "product_id": itemID, "customer_id": customerId, "language_id": 1} }; await baseAppClient.post(GET_SHOPPING_CART, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 11e85b0d..4e37317d 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -392,7 +392,8 @@ class TranslationBase { String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; String get height => localizedValues['height'][locale.languageCode]; - + String get heightUnit => localizedValues['heightUnit'][locale.languageCode]; + String get weightUnit => localizedValues['weightUnit'][locale.languageCode]; String get temperature => localizedValues['temperature'][locale.languageCode]; String get pulse => localizedValues['pulse'][locale.languageCode]; @@ -658,6 +659,10 @@ class TranslationBase { String get mobileNumber => localizedValues['MobileNumber'][locale.languageCode]; String get ok => localizedValues['Ok'][locale.languageCode]; + String get waterConsumedInWeek => + localizedValues['WaterConsumedInWeek'][locale.languageCode]; + String get waterConsumedInMonth => + localizedValues['WaterConsumedInMonth'][locale.languageCode]; String get theVerificationCodeExpiresIn => localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; String get pleaseEnterTheVerificationCode => @@ -979,6 +984,8 @@ class TranslationBase { String get period => localizedValues['Period'][locale.languageCode]; String get cm => localizedValues['cm'][locale.languageCode]; String get kg => localizedValues['kg'][locale.languageCode]; + String get lb => localizedValues['lb'][locale.languageCode]; + String get birth_date => localizedValues['birth_date'][locale.languageCode]; String get mass => localizedValues['mass'][locale.languageCode]; String get tempC => localizedValues['temp-c'][locale.languageCode]; String get bpm => localizedValues['bpm'][locale.languageCode]; @@ -1032,6 +1039,7 @@ class TranslationBase { localizedValues['enablingWifi'][locale.languageCode]; String get offerAndPackages => localizedValues['offerAndPackages'][locale.languageCode]; + String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode]; String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; @@ -1169,6 +1177,9 @@ class TranslationBase { String get calculators => localizedValues['calculators'][locale.languageCode]; String get converters => localizedValues['converters'][locale.languageCode]; String get h2o => localizedValues['h2o'][locale.languageCode]; + String get waterTracker => + localizedValues['waterTracker'][locale.languageCode]; + String get ft => localizedValues['ft'][locale.languageCode]; String get vTour => localizedValues['v-tour'][locale.languageCode]; String get hmgNews => localizedValues['hmg-news'][locale.languageCode]; String get bloodD => localizedValues['blood-d'][locale.languageCode]; @@ -1200,6 +1211,7 @@ class TranslationBase { localizedValues['instructions-pharmacies'][locale.languageCode]; String get selectHospitalDec => localizedValues['select-hospital'][locale.languageCode]; + String get start => localizedValues['start'][locale.languageCode]; String get infoChat => localizedValues['info-chat'][locale.languageCode]; @@ -1397,6 +1409,65 @@ class TranslationBase { String get diastolicAdd => localizedValues["systolic-add"][locale.languageCode]; String get cmcHeading => localizedValues["cmc-heading"][locale.languageCode]; + + String get today => localizedValues["today"][locale.languageCode]; + String get week => localizedValues["week"][locale.languageCode]; + String get h2oAmountOfWater => + localizedValues["h2o-amount-of-water"][locale.languageCode]; + String get updateUser => localizedValues["update-user"][locale.languageCode]; + String get editname => localizedValues["editname"][locale.languageCode]; + String get activityLevel => + localizedValues["activity-level"][locale.languageCode]; + String get success => localizedValues["success"][locale.languageCode]; + String get enterNameHere => + localizedValues["enterNameHere"][locale.languageCode]; + String get lightActive => + localizedValues["light-active"][locale.languageCode]; + String get modActive => localizedValues["mod-active"][locale.languageCode]; + String get reminderLabel => + localizedValues["reminder-label"][locale.languageCode]; + String get reminderTimesLabel => + localizedValues["reminder-times-label"][locale.languageCode]; + String get times => localizedValues["times"][locale.languageCode]; + String get WaterCalculate => + localizedValues["WaterCalculate"][locale.languageCode]; + String get notifTitle => localizedValues["notif-title"][locale.languageCode]; + String get notifText => localizedValues["notif-text"][locale.languageCode]; + String get custom => localizedValues["custom"][locale.languageCode]; + String get undo => localizedValues["undo"][locale.languageCode]; + String get drinking => localizedValues["drinking"][locale.languageCode]; + String get remaining => localizedValues["remaining"][locale.languageCode]; + String get taken => localizedValues["taken"][locale.languageCode]; + String get ml => localizedValues["ml"][locale.languageCode]; + String get l => localizedValues["l"][locale.languageCode]; + String get customLabel => + localizedValues["custom-label"][locale.languageCode]; + String get selectUnit => localizedValues["select-unit"][locale.languageCode]; + String get customLabelInLitres => + localizedValues["custom-label-in-litres"][locale.languageCode]; + String get customLabelInMililitres => + localizedValues["custom-label-in-mililitres"][locale.languageCode]; + String get amount_ => localizedValues["amount"][locale.languageCode]; + String get targetReach => + localizedValues["target-reach"][locale.languageCode]; + String get weekHeader => localizedValues["week-header"][locale.languageCode]; + String get monthHeader => + localizedValues["month-header"][locale.languageCode]; + String get notifPermissionTitle => + localizedValues["notif-permission-title"][locale.languageCode]; + String get notifPermissionMsg => + localizedValues["notif-permission-msg"][locale.languageCode]; + String get verification_message_code => + localizedValues["verification_message_code"][locale.languageCode]; + String get sms_code => localizedValues["sms_code"][locale.languageCode]; + String get code_failure => + localizedValues["code_failure"][locale.languageCode]; + String get resend => localizedValues["resend"][locale.languageCode]; + String get submitncontinue => + localizedValues["submitncontinue"][locale.languageCode]; + String get areyousure => localizedValues["areyousure"][locale.languageCode]; + String get preferredunit => + localizedValues["preferredunit"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart index 98ef3cfa..439d5ae9 100644 --- a/lib/widgets/charts/app_bar_chart.dart +++ b/lib/widgets/charts/app_bar_chart.dart @@ -13,30 +13,38 @@ class AppBarChart extends StatelessWidget { Widget build(BuildContext context) { return Container( height: 400, - margin: EdgeInsets.only(top: 60), + //margin: EdgeInsets.only(top: 60), child: charts.BarChart( seriesList, // animate: animate, + domainAxis: charts.OrdinalAxisSpec( + renderSpec: charts.GridlineRendererSpec( + labelAnchor: charts.TickLabelAnchor.after, + labelRotation: -30, + labelOffsetFromAxisPx: 30, + labelOffsetFromTickPx: 15, + labelJustification: charts.TickLabelJustification.inside, + ), + ), /// Customize the primary measure axis using a small tick renderer. /// Use String instead of num for ordinal domain axis /// (typically bar charts). primaryMeasureAxis: new charts.NumericAxisSpec( renderSpec: new charts.GridlineRendererSpec( - // Display the measure axis labels below the gridline. - // - // 'Before' & 'after' follow the axis value direction. - // Vertical axes draw 'before' below & 'after' above the tick. - // Horizontal axes draw 'before' left & 'after' right the tick. - labelAnchor: charts.TickLabelAnchor.before, + // Display the measure axis labels below the gridline. + // + // 'Before' & 'after' follow the axis value direction. + // Vertical axes draw 'before' below & 'after' above the tick. + // Horizontal axes draw 'before' left & 'after' right the tick. + labelAnchor: charts.TickLabelAnchor.before, - // Left justify the text in the axis. - // - // Note: outside means that the secondary measure axis would right - // justify. - labelJustification: - charts.TickLabelJustification.outside, - )), + // Left justify the text in the axis. + // + // Note: outside means that the secondary measure axis would right + // justify. + labelJustification: charts.TickLabelJustification.outside, + )), ), ); } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 081021cb..5eb62069 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -2,6 +2,8 @@ import 'dart:io'; import 'package:diplomaticquarterapp/config/shared_pref_kay.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/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; @@ -38,6 +40,8 @@ class _AppDrawerState extends State { ProjectViewModel projectProvider; var sharedPref = new AppSharedPreferences(); var familyFileProvider = FamilyFilesProvider(); + PharmacyModuleViewModel pharmacyModuleViewModel = + locator(); AuthenticatedUser user; AuthenticatedUser mainUser; AuthenticatedUserObject authenticatedUserObject = diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart index 5b963b1f..d088586b 100644 --- a/lib/widgets/mobile-no/mobile_no.dart +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -3,6 +3,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../Constants.dart'; + // OWNER : Ibrahim albitar // DATE : 12-04-2020 // DESCRIPTION : Customization for Texts in app @@ -102,7 +104,7 @@ class _MobileNo extends State { flex: 1, child: Icon( Icons.phone, - color: Color(0xFF40ACC9), + color: secondaryColor, )), Expanded( flex: 1, diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 0ce115e0..c540ff56 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -47,6 +47,7 @@ class AppScaffold extends StatelessWidget { final List infoList; final Color backgroundColor; final double preferredSize; + final bool showHomeAppBarIcon; final List appBarIcons; final List imagesInfo; final bool isHelp; @@ -73,6 +74,7 @@ class AppScaffold extends StatelessWidget { this.appBarIcons, this.infoList, this.isHelp = false, + this.showHomeAppBarIcon = true, this.imagesInfo}); @override @@ -85,6 +87,7 @@ class AppScaffold extends StatelessWidget { ? AppBarWidget( appBarTitle: appBarTitle, appBarIcons: appBarIcons, + showHomeAppBarIcon: showHomeAppBarIcon, isPharmacy: isPharmacy, isShowDecPage: isShowDecPage, ) @@ -122,12 +125,14 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget { locator(); final String appBarTitle; + final bool showHomeAppBarIcon; final List appBarIcons; final bool isPharmacy; final bool isShowDecPage; AppBarWidget( {this.appBarTitle, + this.showHomeAppBarIcon, this.appBarIcons, this.isPharmacy = true, this.isShowDecPage = true}); diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index 4bda58a4..88f6cfde 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -20,17 +20,17 @@ class NotAutPage extends StatefulWidget { final List infoList; final List imagesInfo; - NotAutPage({@required this.title, @required this.description, this.infoList, this.imagesInfo}); + NotAutPage( + {@required this.title, + @required this.description, + this.infoList, + this.imagesInfo}); @override _NotAutPageState createState() => _NotAutPageState(); } class _NotAutPageState extends State { - - int _current = 0; - - @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -47,7 +47,6 @@ class _NotAutPageState extends State { bold: true, color: Color(0xff60686b), ), - SizedBox( height: 12, ), @@ -63,7 +62,7 @@ class _NotAutPageState extends State { if (widget.infoList != null) ...List.generate( widget.infoList.length, - (index) => Container( + (index) => Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -76,14 +75,21 @@ class _NotAutPageState extends State { borderRadius: BorderRadius.circular(20), color: Theme.of(context).primaryColor), child: Center( - child: Texts('${index+1}',color: Colors.white,), + child: Texts( + '${index + 1}', + color: Colors.white, + ), ), ), - SizedBox(width: 6,), + SizedBox( + width: 6, + ), Expanded(child: Texts('${widget.infoList[index]}')) ], ), - SizedBox(height: 12,), + SizedBox( + height: 12, + ), ], ), ), @@ -91,34 +97,40 @@ class _NotAutPageState extends State { SizedBox( height: 22, ), - if(!projectViewModel.isInternetConnection) - Center( - child: SizedBox( - height: MediaQuery.of(context).size.height * 0.55, - width: MediaQuery.of(context).size.width * 0.50, - child: Image.asset(projectViewModel.isArabic - ? 'assets/images/Wifi-AR.png' - : 'assets/images/wifi-EN.png'), + if (!projectViewModel.isInternetConnection) + Center( + child: SizedBox( + height: MediaQuery.of(context).size.height * 0.55, + width: MediaQuery.of(context).size.width * 0.50, + child: Image.asset(projectViewModel.isArabic + ? 'assets/images/Wifi-AR.png' + : 'assets/images/wifi-EN.png'), + ), ), - ), - if(projectViewModel.isInternetConnection && widget.imagesInfo!=null) + if (projectViewModel.isInternetConnection && + widget.imagesInfo != null) CarouselSlider( items: widget.imagesInfo.map((image) { return Builder( - builder: (BuildContext context){ + builder: (BuildContext context) { return SizedBox( width: MediaQuery.of(context).size.width * 0.50, - child: image.isAsset? Image.asset(projectViewModel.isArabic ? image.imageAr : image.imageEn) : Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn)); + child: image.isAsset + ? Image.asset(projectViewModel.isArabic + ? image.imageAr + : image.imageEn) + : Image.network(projectViewModel.isArabic + ? image.imageAr + : image.imageEn)); }, ); }).toList(), options: CarouselOptions( height: MediaQuery.of(context).size.height * 0.55, - autoPlay: widget.imagesInfo.length>1, + autoPlay: widget.imagesInfo.length > 1, viewportFraction: 1.0, ), ), - SizedBox( height: 77, ), @@ -133,7 +145,7 @@ class _NotAutPageState extends State { Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( - onTap: (){ + onTap: () { loginCheck(context); }, label: TranslationBase.of(context).serviceInformationButton, @@ -145,7 +157,7 @@ class _NotAutPageState extends State { ); } - loginCheck(context) async{ + loginCheck(context) async { var data = await sharedPref.getObject(IMEI_USER_DATA); sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); if (data != null) {