From 4239124f1ac52c2a89123b51334bbde0aac2d173 Mon Sep 17 00:00:00 2001 From: Salman Afzal Date: Thu, 4 Jun 2020 11:05:57 +0300 Subject: [PATCH 01/10] dashboard icon updated --- .../dashboard_icon/discharge_patient.svg | 37 +++++ assets/images/dashboard_icon/home_icon.svg | 3 + .../dashboard_icon/home_icon_active.svg | 3 + .../dashboard_icon/in_patient_white.svg | 6 + assets/images/dashboard_icon/lab_results.svg | 20 +++ assets/images/dashboard_icon/menu_icon.svg | 22 +++ .../dashboard_icon/menu_icon_active.svg | 22 +++ assets/images/dashboard_icon/message_icon.svg | 7 + .../dashboard_icon/message_icon_active.svg | 7 + assets/images/dashboard_icon/operations.svg | 15 +++ assets/images/dashboard_icon/out_patient.svg | 5 + assets/images/dashboard_icon/patient.svg | 8 ++ assets/images/dashboard_icon/radiology.svg | 27 ++++ assets/images/dashboard_icon/referral.svg | 6 + .../dashboard_icon/scdedule_icon_active.svg | 7 + .../images/dashboard_icon/schedule_icon.svg | 5 + .../images/dashboard_icon/search_patient.svg | 32 +++++ ios/Flutter/Debug.xcconfig | 1 + ios/Flutter/Release.xcconfig | 1 + ios/Podfile | 90 +++++++++++++ ios/Podfile.lock | 127 ++++++++++++++++++ ios/Runner.xcodeproj/project.pbxproj | 95 ++++++++++--- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++ .../xcshareddata/xcschemes/Runner.xcscheme | 8 +- .../contents.xcworkspacedata | 3 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++ ios/Runner/Info.plist | 10 +- lib/presentation/doctor_app_icons.dart | 55 +++++--- lib/screens/dashboard_screen.dart | 32 ++--- .../dashboard/dashboard_item_icons_texts.dart | 15 ++- lib/widgets/home/home_item.dart | 30 ++--- pubspec.yaml | 27 ++-- ssh_key | 8 ++ ssh_key.pub | 1 + 34 files changed, 649 insertions(+), 102 deletions(-) create mode 100644 assets/images/dashboard_icon/discharge_patient.svg create mode 100644 assets/images/dashboard_icon/home_icon.svg create mode 100644 assets/images/dashboard_icon/home_icon_active.svg create mode 100644 assets/images/dashboard_icon/in_patient_white.svg create mode 100644 assets/images/dashboard_icon/lab_results.svg create mode 100644 assets/images/dashboard_icon/menu_icon.svg create mode 100644 assets/images/dashboard_icon/menu_icon_active.svg create mode 100644 assets/images/dashboard_icon/message_icon.svg create mode 100644 assets/images/dashboard_icon/message_icon_active.svg create mode 100644 assets/images/dashboard_icon/operations.svg create mode 100644 assets/images/dashboard_icon/out_patient.svg create mode 100644 assets/images/dashboard_icon/patient.svg create mode 100644 assets/images/dashboard_icon/radiology.svg create mode 100644 assets/images/dashboard_icon/referral.svg create mode 100644 assets/images/dashboard_icon/scdedule_icon_active.svg create mode 100644 assets/images/dashboard_icon/schedule_icon.svg create mode 100644 assets/images/dashboard_icon/search_patient.svg create mode 100644 ios/Podfile create mode 100644 ios/Podfile.lock create mode 100644 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 ssh_key create mode 100644 ssh_key.pub diff --git a/assets/images/dashboard_icon/discharge_patient.svg b/assets/images/dashboard_icon/discharge_patient.svg new file mode 100644 index 00000000..68186c51 --- /dev/null +++ b/assets/images/dashboard_icon/discharge_patient.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/dashboard_icon/home_icon.svg b/assets/images/dashboard_icon/home_icon.svg new file mode 100644 index 00000000..32597a47 --- /dev/null +++ b/assets/images/dashboard_icon/home_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/dashboard_icon/home_icon_active.svg b/assets/images/dashboard_icon/home_icon_active.svg new file mode 100644 index 00000000..31b47d99 --- /dev/null +++ b/assets/images/dashboard_icon/home_icon_active.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/dashboard_icon/in_patient_white.svg b/assets/images/dashboard_icon/in_patient_white.svg new file mode 100644 index 00000000..d648f62c --- /dev/null +++ b/assets/images/dashboard_icon/in_patient_white.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/dashboard_icon/lab_results.svg b/assets/images/dashboard_icon/lab_results.svg new file mode 100644 index 00000000..353c6a19 --- /dev/null +++ b/assets/images/dashboard_icon/lab_results.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/dashboard_icon/menu_icon.svg b/assets/images/dashboard_icon/menu_icon.svg new file mode 100644 index 00000000..0a62759b --- /dev/null +++ b/assets/images/dashboard_icon/menu_icon.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/dashboard_icon/menu_icon_active.svg b/assets/images/dashboard_icon/menu_icon_active.svg new file mode 100644 index 00000000..b565b40a --- /dev/null +++ b/assets/images/dashboard_icon/menu_icon_active.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/dashboard_icon/message_icon.svg b/assets/images/dashboard_icon/message_icon.svg new file mode 100644 index 00000000..d200320b --- /dev/null +++ b/assets/images/dashboard_icon/message_icon.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/dashboard_icon/message_icon_active.svg b/assets/images/dashboard_icon/message_icon_active.svg new file mode 100644 index 00000000..87759ec7 --- /dev/null +++ b/assets/images/dashboard_icon/message_icon_active.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/dashboard_icon/operations.svg b/assets/images/dashboard_icon/operations.svg new file mode 100644 index 00000000..1dc283cc --- /dev/null +++ b/assets/images/dashboard_icon/operations.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/images/dashboard_icon/out_patient.svg b/assets/images/dashboard_icon/out_patient.svg new file mode 100644 index 00000000..bc0a7a9b --- /dev/null +++ b/assets/images/dashboard_icon/out_patient.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/dashboard_icon/patient.svg b/assets/images/dashboard_icon/patient.svg new file mode 100644 index 00000000..40082dcc --- /dev/null +++ b/assets/images/dashboard_icon/patient.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/dashboard_icon/radiology.svg b/assets/images/dashboard_icon/radiology.svg new file mode 100644 index 00000000..e8e45723 --- /dev/null +++ b/assets/images/dashboard_icon/radiology.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/dashboard_icon/referral.svg b/assets/images/dashboard_icon/referral.svg new file mode 100644 index 00000000..bdf4d096 --- /dev/null +++ b/assets/images/dashboard_icon/referral.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/dashboard_icon/scdedule_icon_active.svg b/assets/images/dashboard_icon/scdedule_icon_active.svg new file mode 100644 index 00000000..5c3fc7ae --- /dev/null +++ b/assets/images/dashboard_icon/scdedule_icon_active.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/dashboard_icon/schedule_icon.svg b/assets/images/dashboard_icon/schedule_icon.svg new file mode 100644 index 00000000..10b78b14 --- /dev/null +++ b/assets/images/dashboard_icon/schedule_icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/dashboard_icon/search_patient.svg b/assets/images/dashboard_icon/search_patient.svg new file mode 100644 index 00000000..92c1ca4b --- /dev/null +++ b/assets/images/dashboard_icon/search_patient.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee8..e8efba11 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee8..399e9340 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 00000000..b30a428b --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,90 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def parse_KV_file(file, separator='=') + file_abs_path = File.expand_path(file) + if !File.exists? file_abs_path + return []; + end + generated_key_values = {} + skip_line_start_symbols = ["#", "/"] + File.foreach(file_abs_path) do |line| + next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } + plugin = line.split(pattern=separator) + if plugin.length == 2 + podname = plugin[0].strip() + path = plugin[1].strip() + podpath = File.expand_path("#{path}", file_abs_path) + generated_key_values[podname] = podpath + else + puts "Invalid plugin specification: #{line}" + end + end + generated_key_values +end + +target 'Runner' do + use_frameworks! + use_modular_headers! + + # Flutter Pod + + copied_flutter_dir = File.join(__dir__, 'Flutter') + copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') + copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') + unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) + # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. + # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. + # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. + + generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') + unless File.exist?(generated_xcode_build_settings_path) + raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) + cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; + + unless File.exist?(copied_framework_path) + FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) + end + unless File.exist?(copied_podspec_path) + FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) + end + end + + # Keep pod path relative so it can be checked into Podfile.lock. + pod 'Flutter', :path => 'Flutter' + + # Plugin Pods + + # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock + # referring to absolute paths on developers' machines. + system('rm -rf .symlinks') + system('mkdir -p .symlinks/plugins') + plugin_pods = parse_KV_file('../.flutter-plugins') + plugin_pods.each do |name, path| + symlink = File.join('.symlinks', 'plugins', name) + File.symlink(path, symlink) + pod name, :path => File.join(symlink, 'ios') + end +end + +# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. +install! 'cocoapods', :disable_input_output_paths => true + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['ENABLE_BITCODE'] = 'NO' + end + end +end diff --git a/ios/Podfile.lock b/ios/Podfile.lock new file mode 100644 index 00000000..392290a0 --- /dev/null +++ b/ios/Podfile.lock @@ -0,0 +1,127 @@ +PODS: + - barcode_scan (0.0.1): + - Flutter + - MTBBarcodeScanner + - SwiftProtobuf + - connectivity (0.0.1): + - Flutter + - Reachability + - connectivity_macos (0.0.1): + - Flutter + - device_info (0.0.1): + - Flutter + - Flutter (1.0.0) + - flutter_flexible_toast (0.0.1): + - Flutter + - flutter_plugin_android_lifecycle (0.0.1): + - Flutter + - hexcolor (0.0.1): + - Flutter + - imei_plugin (0.0.1): + - Flutter + - local_auth (0.0.1): + - Flutter + - MTBBarcodeScanner (5.0.11) + - "permission_handler (5.0.0+hotfix.5)": + - Flutter + - Reachability (3.2) + - shared_preferences (0.0.1): + - Flutter + - shared_preferences_macos (0.0.1): + - Flutter + - shared_preferences_web (0.0.1): + - Flutter + - SwiftProtobuf (1.9.0) + - url_launcher (0.0.1): + - Flutter + - url_launcher_macos (0.0.1): + - Flutter + - url_launcher_web (0.0.1): + - Flutter + +DEPENDENCIES: + - barcode_scan (from `.symlinks/plugins/barcode_scan/ios`) + - connectivity (from `.symlinks/plugins/connectivity/ios`) + - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) + - device_info (from `.symlinks/plugins/device_info/ios`) + - Flutter (from `Flutter`) + - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) + - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) + - hexcolor (from `.symlinks/plugins/hexcolor/ios`) + - imei_plugin (from `.symlinks/plugins/imei_plugin/ios`) + - local_auth (from `.symlinks/plugins/local_auth/ios`) + - permission_handler (from `.symlinks/plugins/permission_handler/ios`) + - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) + - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) + - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) + - url_launcher (from `.symlinks/plugins/url_launcher/ios`) + - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) + - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) + +SPEC REPOS: + https://cdn.cocoapods.org/: + - MTBBarcodeScanner + - Reachability + - SwiftProtobuf + +EXTERNAL SOURCES: + barcode_scan: + :path: ".symlinks/plugins/barcode_scan/ios" + connectivity: + :path: ".symlinks/plugins/connectivity/ios" + connectivity_macos: + :path: ".symlinks/plugins/connectivity_macos/ios" + device_info: + :path: ".symlinks/plugins/device_info/ios" + Flutter: + :path: Flutter + flutter_flexible_toast: + :path: ".symlinks/plugins/flutter_flexible_toast/ios" + flutter_plugin_android_lifecycle: + :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios" + hexcolor: + :path: ".symlinks/plugins/hexcolor/ios" + imei_plugin: + :path: ".symlinks/plugins/imei_plugin/ios" + local_auth: + :path: ".symlinks/plugins/local_auth/ios" + permission_handler: + :path: ".symlinks/plugins/permission_handler/ios" + shared_preferences: + :path: ".symlinks/plugins/shared_preferences/ios" + shared_preferences_macos: + :path: ".symlinks/plugins/shared_preferences_macos/ios" + shared_preferences_web: + :path: ".symlinks/plugins/shared_preferences_web/ios" + url_launcher: + :path: ".symlinks/plugins/url_launcher/ios" + url_launcher_macos: + :path: ".symlinks/plugins/url_launcher_macos/ios" + url_launcher_web: + :path: ".symlinks/plugins/url_launcher_web/ios" + +SPEC CHECKSUMS: + barcode_scan: a5c27959edfafaa0c771905bad0b29d6d39e4479 + connectivity: 6e94255659cc86dcbef1d452ad3e0491bb1b3e75 + connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 + device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 + Flutter: 0e3d915762c693b495b44d77113d4970485de6ec + flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 + flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 + hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 + imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd + local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd + MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb + permission_handler: 6226fcb78b97c7c7458a95c7346a11d5184fec12 + Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 + shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d + shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 + shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 + SwiftProtobuf: ecbec1be9036d15655f6b3443a1c4ea693c97932 + url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef + url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 + url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c + +PODFILE CHECKSUM: 1b66dae606f75376c5f2135a8290850eeb09ae83 + +COCOAPODS: 1.9.3 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index bfb59352..8548667e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -9,14 +9,11 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + B650DC3076E9D70CB188286A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93A5F83B23AB032D1E096663 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -26,8 +23,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -38,18 +33,20 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 75DD06875D42C7903A76DF9F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 93A5F83B23AB032D1E096663 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9D4B7DB43C6A6C849D2387CE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + E698D7B14B12DF768FE47A1A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -57,20 +54,27 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, + B650DC3076E9D70CB188286A /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 7D66D387293CE5376A07EC5F /* Pods */ = { + isa = PBXGroup; + children = ( + E698D7B14B12DF768FE47A1A /* Pods-Runner.debug.xcconfig */, + 75DD06875D42C7903A76DF9F /* Pods-Runner.release.xcconfig */, + 9D4B7DB43C6A6C849D2387CE /* Pods-Runner.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( - 3B80C3931E831B6300D905FE /* App.framework */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, @@ -84,6 +88,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 7D66D387293CE5376A07EC5F /* Pods */, + F984EB986238F1809678CD84 /* Frameworks */, ); sourceTree = ""; }; @@ -118,6 +124,14 @@ name = "Supporting Files"; sourceTree = ""; }; + F984EB986238F1809678CD84 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 93A5F83B23AB032D1E096663 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -125,12 +139,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 986D76F6694E0D6D8C5CDAAB /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 08568E6EE9BA48E55B7C3865 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -152,6 +168,7 @@ TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; + DevelopmentTeam = 3A359E86ZF; LastSwiftMigration = 1100; }; }; @@ -189,6 +206,21 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 08568E6EE9BA48E55B7C3865 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -201,7 +233,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; @@ -217,6 +249,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + 986D76F6694E0D6D8C5CDAAB /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -309,6 +363,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -320,8 +375,8 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.doctorAppFlutter; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_BUNDLE_IDENTIFIER = com.hmg.doctorApp; + PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -443,6 +498,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -454,8 +510,8 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.doctorAppFlutter; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_BUNDLE_IDENTIFIER = com.hmg.doctorApp; + PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -470,6 +526,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -481,8 +538,8 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.doctorAppFlutter; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_BUNDLE_IDENTIFIER = com.hmg.doctorApp; + PRODUCT_NAME = Runner; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140cf..fb2dffc4 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -27,8 +27,6 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - - - + + - - + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 31708450..4c18587e 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -11,7 +11,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - doctor_app_flutter + Doctor App CFBundlePackageType APPL CFBundleShortVersionString @@ -22,12 +22,14 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + NSCameraUsageDescription + Camera permission is required for barcode scanning. + NSFaceIDUsageDescription + Why is my app authenticating using face id? UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main - NSFaceIDUsageDescription - Why is my app authenticating using face id? UISupportedInterfaceOrientations UIInterfaceOrientationPortrait @@ -43,7 +45,5 @@ UIViewControllerBasedStatusBarAppearance - NSCameraUsageDescription - Camera permission is required for barcode scanning. diff --git a/lib/presentation/doctor_app_icons.dart b/lib/presentation/doctor_app_icons.dart index 1ee49644..a795a081 100644 --- a/lib/presentation/doctor_app_icons.dart +++ b/lib/presentation/doctor_app_icons.dart @@ -11,7 +11,7 @@ /// fonts: /// - asset: fonts/DoctorApp.ttf /// -/// +/// /// import 'package:flutter/widgets.dart'; @@ -21,21 +21,40 @@ class DoctorApp { static const _kFontFam = 'DoctorApp'; static const _kFontPkg = null; - static const IconData discharge_patient = const IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon = const IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon_active = const IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData in_patient_white = const IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData lab_results = const IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon = const IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon_active = const IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon = const IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon_active = const IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData out_patient = const IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData radiology = const IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referral = const IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData scdedule_icon_active = const IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_patient = const IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData schedule_icon = const IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData image2vector = const IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_bar_icon = const IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge_patient = + const IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon = + const IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon_active = + const IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData in_patient_white = + const IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData lab_results = + const IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon = + const IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon_active = + const IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon = + const IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon_active = + const IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData out_patient = + const IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData radiology = + const IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral = + const IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData scdedule_icon_active = + const IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient = + const IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData schedule_icon = + const IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData image2vector = + const IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_bar_icon = + const IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static Image labResultSVG = + Image.asset('assets/images/dashboard-icon/lab_result.png'); } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 79c492a8..2368eff3 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -26,7 +26,7 @@ class DashboardScreen extends StatefulWidget { DashboardScreen({Key key, this.title}) : super(key: key); final String title; - + final String iconURL = 'assets/images/dashboard_icon/'; @override _DashboardScreenState createState() => _DashboardScreenState(); } @@ -146,7 +146,7 @@ class _DashboardScreenState extends State { Expanded( flex: 2, child: new DashboardItemIconText( - DoctorApp.home_icon, + widget.iconURL + 'lab_results.svg', "08", "Lab Result", backgroundColor: Colors.black45, @@ -158,7 +158,7 @@ class _DashboardScreenState extends State { Expanded( flex: 2, child: new DashboardItemIconText( - DoctorApp.home_icon, + widget.iconURL + 'radiology.svg', "10", "Radiology", backgroundColor: Colors.black45, @@ -169,7 +169,7 @@ class _DashboardScreenState extends State { Expanded( flex: 2, child: new DashboardItemIconText( - DoctorApp.home_icon, + widget.iconURL + 'referral.svg', "05", "Referral", backgroundColor: Colors.black45, @@ -188,17 +188,17 @@ class _DashboardScreenState extends State { Expanded( flex: 2, child: new DashboardItemIconText( - DoctorApp.home_icon, - "23", - "In-Patient", - showBorder: true, - backgroundColor: Colors.red[900], - ), + widget.iconURL + 'in_patient_white.svg', + "23", + "In-Patient", + showBorder: true, + backgroundColor: Colors.red[900], + iconColor: Colors.white), ), Expanded( flex: 2, child: new DashboardItemIconText( - DoctorApp.home_icon, + widget.iconURL + 'operations.svg', "23", "Operations", showBorder: true, @@ -227,7 +227,7 @@ class _DashboardScreenState extends State { flex: 2, child: InkWell( child: DashboardItemIconText( - DoctorApp.home_icon, + widget.iconURL + 'search_patient.svg', "", "Search Patient", showBorder: true, @@ -257,7 +257,7 @@ class _DashboardScreenState extends State { ); }, child: DashboardItemIconText( - DoctorApp.home_icon, + widget.iconURL + 'message_icon.svg', "", "Doctor Reply", showBorder: true, @@ -281,7 +281,7 @@ class _DashboardScreenState extends State { flex: 1, child: InkWell( child: DashboardItemIconText( - DoctorApp.home_icon, + widget.iconURL + 'search_patient.svg', "", "Search Medicine", showBorder: true, @@ -319,7 +319,7 @@ class _DashboardScreenState extends State { ); }, child: DashboardItemIconText( - DoctorApp.home_icon, + widget.iconURL + 'referral.svg', "", "My Referral Patient", showBorder: true, @@ -354,7 +354,7 @@ class _DashboardScreenState extends State { ); }, child: DashboardItemIconText( - DoctorApp.home_icon, + widget.iconURL + 'referral.svg', "", "My Referred Patient", showBorder: true, diff --git a/lib/widgets/dashboard/dashboard_item_icons_texts.dart b/lib/widgets/dashboard/dashboard_item_icons_texts.dart index fc9e27c4..76e84e13 100644 --- a/lib/widgets/dashboard/dashboard_item_icons_texts.dart +++ b/lib/widgets/dashboard/dashboard_item_icons_texts.dart @@ -1,11 +1,13 @@ import 'dart:ffi'; +import 'package:flutter_svg/svg.dart'; + import '../shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import '../shared/app_texts_widget.dart'; class DashboardItemIconText extends StatefulWidget { - final IconData icon; + final String icon; final String value; final String label; final Color backgroundColor; @@ -43,12 +45,11 @@ class _DashboardItemTextsState extends State { Align( alignment: FractionalOffset.topLeft, child: Container( - margin: EdgeInsets.all(10), - child: Icon( - widget.icon, - color: widget.iconColor, - ), - )), + margin: EdgeInsets.all(10), + child: SvgPicture.asset( + widget.icon, + color: widget.iconColor, + ))), Align( alignment: FractionalOffset.bottomRight, child: Container( diff --git a/lib/widgets/home/home_item.dart b/lib/widgets/home/home_item.dart index 59e606d8..0de07d7b 100644 --- a/lib/widgets/home/home_item.dart +++ b/lib/widgets/home/home_item.dart @@ -6,7 +6,7 @@ class HomeItem extends StatelessWidget { final String image; final String link; - HomeItem(this.id, this.title, this.image,this.link); + HomeItem(this.id, this.title, this.image, this.link); @override Widget build(BuildContext context) { return InkWell( @@ -22,21 +22,21 @@ class HomeItem extends StatelessWidget { child: Column( children: [ Container( - // decoration: BoxDecoration(color:Colors.red), - width: 10000, - height: 60, + // decoration: BoxDecoration(color:Colors.red), + width: 10000, + height: 60, child: CircleAvatar( - backgroundColor: Colors.white, - child: Container( - child: Image.asset( - image, - // width 50, - scale: 0.6, - color: Theme.of(context).primaryColor, - fit: BoxFit.cover, - ), - ), - )), + backgroundColor: Colors.white, + child: Container( + child: Image.asset( + image, + // width 50, + scale: 0.6, + color: Theme.of(context).primaryColor, + fit: BoxFit.cover, + ), + ), + )), Text( title, style: TextStyle(fontSize: 16), diff --git a/pubspec.yaml b/pubspec.yaml index 4336bacd..92593a05 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,7 +23,7 @@ dependencies: flutter_localizations: sdk: flutter flutter_device_type: ^0.2.0 - intl: ^0.16.1 + intl: ^0.16.0 http: ^0.12.0+4 provider: ^4.0.5+1 shared_preferences: ^0.5.6+3 @@ -37,15 +37,13 @@ dependencies: url_launcher: ^5.4.5 charts_flutter: ^0.9.0 eva_icons_flutter: ^2.0.0 - + # Qr code Scanner barcode_scan: ^3.0.1 # permissions permission_handler: ^5.0.0+hotfix.3 device_info: ^0.4.2+4 - - # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.2 @@ -59,23 +57,20 @@ dev_dependencies: build_runner: any build_web_compilers: any - # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. uses-material-design: true - # To add assets to your application, add an assets section, like this: assets: - - assets/images/ - + - assets/images/ + - assets/images/dashboard_icon/ # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see @@ -95,14 +90,14 @@ flutter: - asset: assets/fonts/Work_Sans/WorkSans-Regular.ttf - asset: assets/fonts/Work_Sans/WorkSans-Bold.ttf weight: 700 - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - - family: DoctorApp + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + - family: DoctorApp fonts: - - asset: fonts/DoctorApp.ttf + - asset: fonts/DoctorApp.ttf # # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages diff --git a/ssh_key b/ssh_key new file mode 100644 index 00000000..b2bfd464 --- /dev/null +++ b/ssh_key @@ -0,0 +1,8 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABDdAHzw+C +qTVdRkviTeVAj7AAAAEAAAAAEAAAAzAAAAC3NzaC1lZDI1NTE5AAAAIGnX/M1OFtZvGTEI +h5/B9u+eQwjzRJpanfljungMbc+VAAAAkPGJXHVNFeKLXK+aQFiTKx8EU48dQGLBQVIq4G +1SOgNvOaK2UfnQwSbZzhMAOmA1RCUbpQH9cGr9B/uSI88sdghcTEkNgVAtVF/NHNeKMahf +3hdVQ7ER6Au4FEIhpvUTzF+0G+8QBTabpNQx3UdLUxFAOulX6nIYG2phQIS08V/DdS70IG +luo6vY2w/qnXDsWQ== +-----END OPENSSH PRIVATE KEY----- diff --git a/ssh_key.pub b/ssh_key.pub new file mode 100644 index 00000000..1d1ef8f5 --- /dev/null +++ b/ssh_key.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGnX/M1OFtZvGTEIh5/B9u+eQwjzRJpanfljungMbc+V sultan From 5f6e9104d02667143f6033720d4afa83b7dd887b Mon Sep 17 00:00:00 2001 From: Salman Afzal Date: Thu, 4 Jun 2020 16:52:42 +0300 Subject: [PATCH 02/10] scroll change --- lib/screens/dashboard_screen.dart | 4 +- .../profile/patient_profile_widget.dart | 93 ++++++++------ .../profile/profile_medical_info_widget.dart | 114 +++++++++--------- 3 files changed, 111 insertions(+), 100 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index c9f5d910..04591962 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -65,7 +65,7 @@ class _DashboardScreenState extends State { flex: 2, child: RoundedContainer( child: CircularPercentIndicator( - radius: 100.0, + radius: 100, animation: true, animationDuration: 1200, lineWidth: 7.0, @@ -78,7 +78,7 @@ class _DashboardScreenState extends State { fontSize: SizeConfig.textMultiplier * 4), AppText("Out-Patients", fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 1.2, + fontSize: SizeConfig.textMultiplier * 1.1, color: Colors.grey[800]), ], ), diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 171d1256..0ef50d81 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -32,46 +32,61 @@ class PatientProfileWidget extends StatelessWidget { // ProfileStatusInfoWidget() // ]); - return Container( - child: Column(children: [ - Expanded( - flex: 1, - child: - Row(mainAxisAlignment: MainAxisAlignment.center, children: [ - Column(children: [ - Container( - padding: EdgeInsets.only(top: 20), - child: ProfileImageWidget( - url: - "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", - name: patient.firstName + ' ' + patient.lastName, - fontsize: 24.0, - color: Colors.black, - ), + return CustomScrollView(primary: false, slivers: [ + SliverList( + delegate: SliverChildListDelegate( + [ + Expanded( + flex: 1, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Column(children: [ + Container( + padding: EdgeInsets.only(top: 20), + child: ProfileImageWidget( + url: + "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", + name: patient.firstName + ' ' + patient.lastName, + fontsize: 24.0, + color: Colors.black, + ), + ), + Container( + child: Column( + children: [ + AppText( + 'File No: ' + patient.patientId.toString(), + fontWeight: FontWeight.normal, + fontSize: 16, + ), + AppText( + patient.genderDescription.toString() + + ', ' + + patient.age, + fontWeight: FontWeight.normal, + fontSize: 16, + ) + ], + ), + ) + ]), + ]), ), - Container( - child: Column( - children: [ - AppText( - 'File No: ' + patient.patientId.toString(), - fontWeight: FontWeight.normal, - fontSize: 16, - ), - AppText( - patient.genderDescription.toString() + ', ' + patient.age, - fontWeight: FontWeight.normal, - fontSize: 16, - ) - ], - ), - ) - ]), - ]), + ], + ), ), - Expanded( - flex: 2, - child: ProfileMedicalInfoWidget(patient: patient), - ) - ])); + SliverPadding( + padding: const EdgeInsets.fromLTRB(20, 30, 15, 10), + sliver: ProfileMedicalInfoWidget()) + ]); + + // Container( + // child: Column(children: [ + // Expanded( + // flex: 2, + // child: , + // ) + // ])); } } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 85a8e140..3ac66f2e 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -23,65 +23,61 @@ class ProfileMedicalInfoWidget extends StatelessWidget { Widget build(BuildContext context) { // final double contWidth = SizeConfig.realScreenWidth * 0.70; // final double contHeight = SizeConfig.screenHeight * 0.30; - return CustomScrollView(primary: false, slivers: [ - SliverPadding( - padding: const EdgeInsets.fromLTRB(20, 30, 15, 10), - sliver: SliverGrid.count( - crossAxisSpacing: 10, - mainAxisSpacing: 20, - crossAxisCount: 2, - childAspectRatio: 1.5, - children: [ - PatientProfileButton( - key: key, - patient: patient, - name: 'Vital Sign', - route: VITAL_SIGN_DETAILS, - icon: 'heartbeat.png'), - PatientProfileButton( - key: key, - patient: patient, - route: LAB_ORDERS, - name: 'Lab Order', - icon: 'lab.png'), - PatientProfileButton( - key: key, - patient: patient, - route: PRESCRIPTIONS, - name: 'Prescription', - icon: 'note.png'), - PatientProfileButton( - key: key, - patient: patient, - route: RADIOLOGY, - name: 'Radiology', - icon: 'radiology-1.png'), - PatientProfileButton( - key: key, - patient: patient, - route: PROGRESS_NOTE, - name: 'Progress Notes', - icon: 'heartbeat.png'), - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_INSURANCE_APPROVALS, - name: 'Insurance Aprovals', - icon: 'lab.png'), - PatientProfileButton( - key: key, - patient: patient, - route: PRESCRIPTIONS, - name: 'Refer Patient', - icon: 'note.png'), - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_ORDERS, - name: 'Orders', - icon: 'radiology-1.png'), - ])) - ]); + return SliverGrid.count( + crossAxisSpacing: 10, + mainAxisSpacing: 20, + crossAxisCount: 2, + childAspectRatio: 1.5, + children: [ + PatientProfileButton( + key: key, + patient: patient, + name: 'Vital Sign', + route: VITAL_SIGN_DETAILS, + icon: 'heartbeat.png'), + PatientProfileButton( + key: key, + patient: patient, + route: LAB_ORDERS, + name: 'Lab Order', + icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PRESCRIPTIONS, + name: 'Prescription', + icon: 'note.png'), + PatientProfileButton( + key: key, + patient: patient, + route: RADIOLOGY, + name: 'Radiology', + icon: 'radiology-1.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PROGRESS_NOTE, + name: 'Progress Notes', + icon: 'heartbeat.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_INSURANCE_APPROVALS, + name: 'Insurance Aprovals', + icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PRESCRIPTIONS, + name: 'Refer Patient', + icon: 'note.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_ORDERS, + name: 'Orders', + icon: 'radiology-1.png'), + ]); // child: ListView( // children: [ // Padding( From 480c64d25a38c07586aaecac9908cf04b31a8c60 Mon Sep 17 00:00:00 2001 From: ibrahim albitar Date: Tue, 9 Jun 2020 17:44:21 +0300 Subject: [PATCH 03/10] complete refer patient --- .../patient/refer_to_doctor_request.dart | 34 +- lib/providers/patients_provider.dart | 120 ++-- .../profile/refer_patient_screen.dart | 580 ++++++++++++------ 3 files changed, 475 insertions(+), 259 deletions(-) diff --git a/lib/models/patient/refer_to_doctor_request.dart b/lib/models/patient/refer_to_doctor_request.dart index 11229596..28eb488b 100644 --- a/lib/models/patient/refer_to_doctor_request.dart +++ b/lib/models/patient/refer_to_doctor_request.dart @@ -1,3 +1,5 @@ +import 'package:flutter/cupertino.dart'; + class ReferToDoctorRequest { /* @@ -64,27 +66,27 @@ class ReferToDoctorRequest { */ ReferToDoctorRequest( - {this.projectID, - this.admissionNo, - this.roomID = "ISO-6", - this.referralClinic, - this.referralDoctor , - this.createdBy, - this.editedBy , - this.patientID, - this.patientTypeID = 1, - this.referringClinic, - this.referringDoctor, - this.referringDoctorRemarks, - this.priority , - this.frequency, - this.extension, + {@required this.projectID, + @required this.admissionNo, + @required this.roomID , + @required this.referralClinic, + @required this.referralDoctor , + @required this.createdBy, + @required this.editedBy , + @required this.patientID, + @required this.patientTypeID, + @required this.referringClinic, + @required this.referringDoctor, + @required this.referringDoctorRemarks, + @required this.priority , + @required this.frequency, + @required this.extension, this.languageID = 2, this.stamp = "2020-06-03T11:26:42.358Z", this.iPAdress = "11.11.11.11", this.versionID = 1.2, this.channel = 9, - this.tokenID, + @required this.tokenID, this.sessionID = "JBXRsDl37L", this.isLoginForDoctorApp = true, this.patientOutSA = false}); diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index e93c2ceb..9af3879d 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -68,7 +68,7 @@ class PatientsProvider with ChangeNotifier { ReferToDoctorRequest _referToDoctorRequest = ReferToDoctorRequest(); Client client = - HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); + HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); PatiantInformtion _selectedPatient; @@ -239,7 +239,7 @@ class PatientsProvider with ChangeNotifier { try { if (await Helpers.checkConnection()) { final response = - await AppClient.post(GET_PRESCRIPTION, body: json.encode(patient)); + await AppClient.post(GET_PRESCRIPTION, body: json.encode(patient)); final int statusCode = response.statusCode; isLoading = false; @@ -302,22 +302,20 @@ class PatientsProvider with ChangeNotifier { } } - getPrescriptionReport(prescriptionReqModel) async{ + getPrescriptionReport(prescriptionReqModel) async { prescriptionReport = []; isLoading = true; isError = false; error = ""; notifyListeners(); - await BaseAppClient.post( - 'Patients.svc/REST/GetPrescriptionReport', + await BaseAppClient.post('Patients.svc/REST/GetPrescriptionReport', onSuccess: (dynamic response, int statusCode) { - response['ListPRM'].forEach((v) { - prescriptionReport - .add(PrescriptionReport.fromJson(v)); - }); - isError = false; - isLoading = false; - }, onFailure: (String error, int statusCode) { + response['ListPRM'].forEach((v) { + prescriptionReport.add(PrescriptionReport.fromJson(v)); + }); + isError = false; + isLoading = false; + }, onFailure: (String error, int statusCode) { isError = true; isLoading = false; this.error = error; @@ -626,66 +624,70 @@ class PatientsProvider with ChangeNotifier { *@desc: referToDoctor */ referToDoctor( - int selectedDoctorID, - int selectedClinicID, - String selectedReferralFrequancyID, + {String selectedDoctorID, + String selectedClinicID, int admissionNo, String extension, - String doctorRemark) async { - String token = await sharedPref.getString(TOKEN); - int projectID = await sharedPref.getInt(PROJECT_ID); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - int doctorID = doctorProfile.doctorID; - int clinicId = doctorProfile.clinicID; + String priority, + String frequency, + String referringDoctorRemarks, + int patientID, + int patientTypeID, + String roomID, + int projectID}) async { setBasicData(); try { if (await Helpers.checkConnection()) { - // _referToDoctorRequest.tokenID = token; - // _referToDoctorRequest.admissionNo = admissionNo; - // _referToDoctorRequest.projectID = projectID; - // _referToDoctorRequest.tokenID = token; - // _referToDoctorRequest.extension = extension; - // _referToDoctorRequest.frequency = selectedReferralFrequancyID; - // _referToDoctorRequest.patientID = - // _referToDoctorRequest.priority = - // _referToDoctorRequest.referralClinic = - // _referToDoctorRequest.referralDoctor = - // _referToDoctorRequest.referringDoctorRemarks = - // _referToDoctorRequest.roomID = - // _referToDoctorRequest.referringClinic = - // _referToDoctorRequest.referringDoctor = + String token = await sharedPref.getString(TOKEN); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = + new DoctorProfileModel.fromJson(profile); + int doctorID = doctorProfile.doctorID; + int clinicId = doctorProfile.clinicID; + _referToDoctorRequest = ReferToDoctorRequest( + projectID: projectID, + admissionNo: admissionNo, + roomID: roomID, + referralClinic: selectedClinicID.toString(), + referralDoctor: selectedDoctorID.toString(), + createdBy: doctorID, + editedBy: doctorID, + patientID: patientID, + patientTypeID: patientTypeID, + referringClinic: clinicId, + referringDoctor: doctorID, + referringDoctorRemarks: referringDoctorRemarks, + priority: priority, + frequency: frequency, + extension: extension, + tokenID: token); final response = await AppClient.post(PATIENT_REFER_TO_DOCTOR_URL, - body: json.encode(_referralFrequencyRequest)); + body: json.encode(_referToDoctorRequest)); final int statusCode = response.statusCode; isLoading = false; - if (statusCode < 200 || statusCode >= 400 || json == null) { - isError = true; - error = 'Error While Fetching data'; + if (statusCode < 200 || statusCode >= 400 || json == null) { + isError = true; + error = 'Error While Fetching data'; + } else { + var res = json.decode(response.body); + print('$res'); + if (res['MessageStatus'] == 1) { + print('Done : /n $res'); } else { - var res = json.decode(response.body); - print('$res'); - if (res['MessageStatus'] == 1) { - patientProgressNoteList = res['List_GetPregressNoteForInPatient']; - } else { - isError = true; - error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; - } + isError = true; + error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; } - } else { - isLoading = false; - isError = true; - error = 'Please Check The Internet Connection'; } - notifyListeners(); - } catch (err) { - handelCatchErrorCase(err); + } else { + isLoading = false; + isError = true; + error = 'Please Check The Internet Connection'; } + notifyListeners(); + } catch (err) { + handelCatchErrorCase(err); } - - - - + } } diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart index 1781867c..23f7f159 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -1,6 +1,13 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; import '../../../config/size_config.dart'; import '../../../providers/patients_provider.dart'; @@ -29,13 +36,22 @@ class _ReferPatientState extends State { var doctorsList; var clinicsList; var referralFrequancyList; - final _controller = TextEditingController(); + final _remarksController = TextEditingController(); + final _extController = TextEditingController(); var _isInit = true; + var clinicId; + var doctorId; + var freqId; + String _selectedClinic; String _selectedDoctor; String _selectedReferralFrequancy; + List _priorities = ['Very Urgent', 'Urgent', 'Routine']; + int _activePriority = 2; + String _priorityTime; + @override void didChangeDependencies() { super.didChangeDependencies(); @@ -54,214 +70,410 @@ class _ReferPatientState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Progress Note", + appBarTitle: "Refer Patient", body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError ? DrAppEmbeddedError(error: patientsProv.error) : clinicsList == null ? DrAppEmbeddedError( - error: 'You don\'t have any Progress Note') - : Column( - children: [ - RoundedContainer( - margin: 0, - showBorder: true, - raduis: 30, - borderColor: Color(0xff707070), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButton( - isExpanded: true, - value: _selectedClinic, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return patientsProv + error: 'Something Wrong!') + : SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Clinic", + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + RoundedContainer( + margin: 10, + showBorder: true, + raduis: 30, + borderColor: Color(0xff707070), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButton( + isExpanded: true, + value: _selectedClinic, + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return patientsProv + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + _selectedDoctor = null; + _selectedClinic = newValue; + var clinicInfo = + clinicsList.singleWhere((i) => + i['ClinicDescription'] + .toString() + .contains(_selectedClinic)); + clinicId = + clinicInfo['ClinicID'].toString(); + patientsProv.getDoctorsList(clinicId); + }) + }, + items: patientsProv .getClinicNameList() .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, + ), ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - _selectedDoctor = null; - _selectedClinic = newValue; - var clinicInfo = - clinicsList.singleWhere((i) => - i['ClinicDescription'] - .toString() - .contains(_selectedClinic)); - var clinicId = - clinicInfo['ClinicID'].toString(); - patientsProv.getDoctorsList(clinicId); - }) - }, - items: patientsProv - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), + }).toList(), + ), ), - ), - ], + ], + ), ), ), - ), - //--------------------------------------------------------------------// - RoundedContainer( - margin: 0, - showBorder: true, - raduis: 30, - borderColor: Color(0xff707070), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButton( - isExpanded: true, - value: _selectedDoctor, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return patientsProv + //--------------------------------------------------------------------// + AppText( + "Doctor", + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + + RoundedContainer( + margin: 10, + showBorder: true, + raduis: 30, + borderColor: Color(0xff707070), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButton( + isExpanded: true, + value: _selectedDoctor, + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return patientsProv + .getDoctorNameList() + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + _selectedDoctor = newValue; + var doctorInfo = + doctorsList.singleWhere((i) => + i['DoctorName'] + .toString() + .contains(_selectedDoctor)); + doctorId = + doctorInfo['DoctorID'].toString(); + }) + }, + items: patientsProv .getDoctorNameList() .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, + ), ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - _selectedDoctor = newValue; - }) - }, - items: patientsProv - .getDoctorNameList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), + }).toList(), + ), ), - ), - ], + ], + ), + ), + ), //-----------------------------/// + AppText( + "Ext#", + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: AppTextFormField( + hintText: "Ext#", + controller: _extController, + inputFormatter: ONLY_NUMBERS, + textInputType: TextInputType.number, + onChanged: (value) => {}, ), ), - ), //-----------------------------/// - RoundedContainer( - margin: 0, - showBorder: true, - raduis: 30, - borderColor: Color(0xff707070), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButton( - isExpanded: true, - value: _selectedReferralFrequancy, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return patientsProv + AppText( + "Priority", + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + + priorityBar(context), + + AppText( + "Replay Before: " + getPriority(), + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + + AppText( + "Referral Frequency", + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + RoundedContainer( + margin: 10, + showBorder: true, + raduis: 30, + borderColor: Color(0xff707070), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButton( + isExpanded: true, + value: _selectedReferralFrequancy, + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return patientsProv + .getReferralNamesList() + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + _selectedReferralFrequancy = newValue; + var freqInfo = + referralFrequancyList.singleWhere((i) => + i['Description'] + .toString() + .contains(_selectedReferralFrequancy)); + freqId = + freqInfo['ParameterCode'].toString(); + }) + }, + items: patientsProv .getReferralNamesList() .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, + ), ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - _selectedReferralFrequancy = newValue; - }) - }, - items: patientsProv - .getReferralNamesList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), + }).toList(), + ), ), - ), - ], + ], + ), ), ), + AppText( + "Clinical Details and Remarks", + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: AppTextFormField( + hintText: "Remarks", + controller: _remarksController, + inputFormatter: ONLY_LETTERS, + textInputType: TextInputType.text, + onChanged: (value) => {}, + ), + ), + Padding( + padding: const EdgeInsets.all(20.0), + child: AppButton(title: "Send", color: Color(PRIMARY_COLOR),onPressed: ()=>{ + referToDoctor() + },), + ) + ], + ), + ), + ); + } + + Widget priorityBar(BuildContext _context) { + return Container( + height: MediaQuery.of(context).size.height * 0.065, + width: SizeConfig.screenWidth * 0.9, + margin: EdgeInsets.only(top: 10), + decoration: BoxDecoration( + color: Color(0Xffffffff), borderRadius: BorderRadius.circular(20)), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _priorities.map((item) { + bool _isActive = _priorities[_activePriority] == item ? true : false; + return Column(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + child: Center( + child: Container( + height: 40, + width: 90, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(50), + color: _isActive ? Hexcolor("#B8382B") : Colors.white, + ), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + // backgroundColor:_isActive + // ? Hexcolor("#B8382B") + // : Colors.white,//sideColor, + + fontWeight: FontWeight.bold, + ), ), - ], - ), + )), + ), + onTap: () { + print(_priorities.indexOf(item)); + setState(() { + _activePriority = _priorities.indexOf(item); + }); + }), + _isActive + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white), + alignment: Alignment.center, + height: 3, + width: 90, + ) + : Container() + ]); + }).toList(), + ), ); } + + String getPriority() { + DateTime date = DateTime.now(); + switch (_activePriority) { + case 0: + date = date.add(new Duration(hours: 3)); + break; + case 1: + date = date.add(new Duration(hours: 6)); + break; + case 2: + date = date.add(new Duration(days: 1)); + break; + } + var format = DateFormat('yyyy/mm/dd HH:mm a'); + var time = format.format(date); + print(time); + return time; + } + + void referToDoctor(){ + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + patientsProv.referToDoctor( + extension: _extController.value.text, + admissionNo:int.parse( patient.admissionNo), + referringDoctorRemarks: _remarksController.value.text, + frequency: freqId, + patientID: patient.patientId, + patientTypeID: patient.patientType, + priority: (_activePriority + 1).toString(), + roomID: patient.roomId, + selectedClinicID: clinicId.toString(), + selectedDoctorID: doctorId.toString(), + projectID: patient.projectId + ); + } } From 937f8ecd6a2306783917a217b63196dda7453908 Mon Sep 17 00:00:00 2001 From: ibrahim albitar Date: Wed, 10 Jun 2020 14:44:31 +0300 Subject: [PATCH 04/10] fix --- lib/providers/patients_provider.dart | 14 ++++--- .../profile/refer_patient_screen.dart | 39 +++++++++---------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index 9af3879d..754af77b 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -65,8 +65,7 @@ class PatientsProvider with ChangeNotifier { STPReferralFrequencyRequest(); ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); - ReferToDoctorRequest _referToDoctorRequest = ReferToDoctorRequest(); - + ReferToDoctorRequest _referToDoctorRequest ; Client client = HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); @@ -493,19 +492,22 @@ class PatientsProvider with ChangeNotifier { final response = await AppClient.post(PATIENT_GET_DOCTOR_BY_CLINIC_URL, body: json.encode(_doctorsByClinicIdRequest)); final int statusCode = response.statusCode; - isLoading = false; + if (statusCode < 200 || statusCode >= 400 || json == null) { isError = true; error = 'Error While Fetching data'; + isLoading = false; } else { var res = json.decode(response.body); print('$res'); if (res['MessageStatus'] == 1) { doctorsList = res['List_Doctors_All']; + isLoading = false; } else { isError = true; error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; + isLoading = false; } } } else { @@ -516,6 +518,7 @@ class PatientsProvider with ChangeNotifier { notifyListeners(); } catch (err) { handelCatchErrorCase(err); + isLoading = false; } } @@ -623,7 +626,7 @@ class PatientsProvider with ChangeNotifier { *@Date:3/6/2020 *@desc: referToDoctor */ - referToDoctor( + referToDoctor(context, {String selectedDoctorID, String selectedClinicID, int admissionNo, @@ -674,7 +677,8 @@ class PatientsProvider with ChangeNotifier { var res = json.decode(response.body); print('$res'); if (res['MessageStatus'] == 1) { - print('Done : /n $res'); + print('Done : \n $res'); + Navigator.pop(context); } else { isError = true; error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart index 23f7f159..24146ca5 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -34,8 +34,6 @@ class ReferPatientScreen extends StatefulWidget { class _ReferPatientState extends State { PatientsProvider patientsProv; var doctorsList; - var clinicsList; - var referralFrequancyList; final _remarksController = TextEditingController(); final _extController = TextEditingController(); var _isInit = true; @@ -50,19 +48,15 @@ class _ReferPatientState extends State { List _priorities = ['Very Urgent', 'Urgent', 'Routine']; int _activePriority = 2; - String _priorityTime; @override void didChangeDependencies() { super.didChangeDependencies(); if (_isInit) { + doctorsList = null; patientsProv = Provider.of(context); patientsProv.getClinicsList(); - patientsProv.getReferralFrequancyList(); - setState(() { - clinicsList = patientsProv.clinicsList; - referralFrequancyList = patientsProv.referalFrequancyList; - }); + patientsProv.getReferralFrequancyList(); } _isInit = false; } @@ -75,7 +69,7 @@ class _ReferPatientState extends State { ? DrAppCircularProgressIndeicator() : patientsProv.isError ? DrAppEmbeddedError(error: patientsProv.error) - : clinicsList == null + : patientsProv.clinicsList == null ? DrAppEmbeddedError( error: 'Something Wrong!') : SingleChildScrollView( @@ -134,13 +128,14 @@ class _ReferPatientState extends State { setState(() { _selectedDoctor = null; _selectedClinic = newValue; - var clinicInfo = - clinicsList.singleWhere((i) => + var clinicInfo = patientsProv.clinicsList.where((i) => i['ClinicDescription'] .toString() - .contains(_selectedClinic)); + .contains(_selectedClinic)).toList(); + clinicId = - clinicInfo['ClinicID'].toString(); + clinicInfo[0]['ClinicID'].toString(); + patientsProv.getDoctorsList(clinicId); }) }, @@ -213,13 +208,15 @@ class _ReferPatientState extends State { onChanged: (newValue) => { setState(() { _selectedDoctor = newValue; + doctorsList = patientsProv.doctorsList; + var doctorInfo = - doctorsList.singleWhere((i) => + doctorsList.where((i) => i['DoctorName'] .toString() - .contains(_selectedDoctor)); - doctorId = - doctorInfo['DoctorID'].toString(); + .contains(_selectedDoctor)).toList(); + doctorId = doctorInfo[0]['DoctorID'].toString(); + }) }, items: patientsProv @@ -324,7 +321,7 @@ class _ReferPatientState extends State { setState(() { _selectedReferralFrequancy = newValue; var freqInfo = - referralFrequancyList.singleWhere((i) => + patientsProv.referalFrequancyList.singleWhere((i) => i['Description'] .toString() .contains(_selectedReferralFrequancy)); @@ -369,7 +366,7 @@ class _ReferPatientState extends State { Padding( padding: const EdgeInsets.all(20.0), child: AppButton(title: "Send", color: Color(PRIMARY_COLOR),onPressed: ()=>{ - referToDoctor() + referToDoctor(context) },), ) ], @@ -459,10 +456,10 @@ class _ReferPatientState extends State { return time; } - void referToDoctor(){ + void referToDoctor(context){ final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - patientsProv.referToDoctor( + patientsProv.referToDoctor(context, extension: _extController.value.text, admissionNo:int.parse( patient.admissionNo), referringDoctorRemarks: _remarksController.value.text, From 4638ba56a2b30367d5c079f2055714386729898f Mon Sep 17 00:00:00 2001 From: ibrahim albitar Date: Thu, 11 Jun 2020 09:23:44 +0300 Subject: [PATCH 05/10] jira fixes --- lib/config/config.dart | 2 +- .../medicine/medicine_search_screen.dart | 8 +- .../medicine/pharmacies_list_screen.dart | 168 ++++++++++++------ .../medicine/medicine_item_widget.dart | 4 - 4 files changed, 116 insertions(+), 66 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 5fd2c67c..d199986c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -1,6 +1,6 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; -const ONLY_LETTERS = "[a-zA-Z]"; +const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL = 'https://hmgwebservices.com/Services/'; //const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 1add0181..2b14edeb 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -11,7 +11,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '../../util/extenstions.dart'; @@ -61,9 +60,6 @@ class _MedicineSearchState extends State { hintText: 'Search Medicine Name Here..', controller: myController, onSaved: (value) {}, - // validator: (value) { - // return TextValidator().validateName(value); - // }, inputFormatter: ONLY_LETTERS), ), @@ -99,7 +95,7 @@ class _MedicineSearchState extends State { ), Expanded( child: Container( - width: SizeConfig.screenWidth * 0.80, + width: SizeConfig.screenWidth * 0.97, child: !_medicineProvider.isFinished ? DrAppCircularProgressIndeicator() : _medicineProvider.hasError @@ -127,7 +123,7 @@ class _MedicineSearchState extends State { builder: (context) => ChangeNotifierProvider( create: (_) => MedicineProvider(), child: PharmaciesListScreen( - itemID: data[index]["ItemID"]), + itemID: data[index]["ItemID"], url: data[index]["ProductImageBase64"]), ), ), ); diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 4c682cea..60f24862 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -1,11 +1,10 @@ -import 'package:doctor_app_flutter/config/config.dart'; +import 'dart:convert'; +import 'dart:typed_data'; + import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/pharmacies_List_request_model.dart'; import 'package:doctor_app_flutter/providers/medicine_provider.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; @@ -20,8 +19,11 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class PharmaciesListScreen extends StatefulWidget { final int itemID; + final String url; + // In the constructor, require a item id. - PharmaciesListScreen({Key key, @required this.itemID}) : super(key: key); + PharmaciesListScreen({Key key, @required this.itemID, this.url}) + : super(key: key); @override _PharmaciesListState createState() => _PharmaciesListState(); @@ -61,44 +63,77 @@ class _PharmaciesListState extends State { TextStyle(color: Theme.of(context).errorColor), ), ) - : Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - AppText( - "Description", - margin: 10, - fontWeight: FontWeight.bold, - ), - AppText( - _data[0]["ItemDescription"], - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - AppText( - "Price", - margin: 10, - fontWeight: FontWeight.bold, - ), - AppText( - _data[0]["SellingPrice"].toString(), - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - ], - )), + : StreamBuilder( + stream: null, + builder: (context, snapshot) { + return Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(7)), + child: Image.memory( + dataFromBase64String(widget.url), + height: SizeConfig.imageSizeMultiplier * 21, + width: SizeConfig.imageSizeMultiplier * 20, + fit: BoxFit.cover, + ), + ), + ), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + AppText( + "Description", + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + _data[0]["ItemDescription"], + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + AppText( + "Price", + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + _data[0]["SellingPrice"].toString(), + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + ], + ), + ) + ], + ); + })), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.only(top:SizeConfig.widthMultiplier * 2, + bottom: SizeConfig.widthMultiplier * 2, + right: SizeConfig.widthMultiplier * 4, + left: SizeConfig.widthMultiplier * 4,), child: Align( alignment: Alignment.centerLeft, child: AppText( "You can Find it in", fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 3, ))), Expanded( child: Container( @@ -114,7 +149,8 @@ class _PharmaciesListState extends State { Expanded( flex: 1, child: ClipRRect( - borderRadius:BorderRadius.all(Radius.circular(7)), + borderRadius: + BorderRadius.all(Radius.circular(7)), child: Image.network( _data[index]["ProjectImageURL"], height: SizeConfig.imageSizeMultiplier * 15, @@ -138,25 +174,36 @@ class _PharmaciesListState extends State { crossAxisAlignment: WrapCrossAlignment.end, children: [ Padding( - padding: EdgeInsets.all(5), - child: InkWell(child: Icon(Icons.call, color: Colors.red,),onTap: ()=>launch( - "tel://" + _data[index]["PhoneNumber"]),), - ), -Padding( - padding: EdgeInsets.all(5), - child: InkWell(child: Icon(Icons.pin_drop, color: Colors.red,),onTap: () { - MapsLauncher.launchCoordinates( - double.parse(_data[index]["Latitude"]), - double.parse(_data[index]["Longitude"]), - _data[index]["LocationDescription"]); - },), - ), + padding: EdgeInsets.all(5), + child: InkWell( + child: Icon( + Icons.call, + color: Colors.red, + ), + onTap: () => launch( + "tel://" + _data[index]["PhoneNumber"]), + ), + ), + Padding( + padding: EdgeInsets.all(5), + child: InkWell( + child: Icon( + Icons.pin_drop, + color: Colors.red, + ), + onTap: () { + MapsLauncher.launchCoordinates( + double.parse( + _data[index]["Latitude"]), + double.parse( + _data[index]["Longitude"]), + _data[index]["LocationDescription"]); + }, + ), + ), ], - ), ), - - ], ), ); @@ -170,9 +217,20 @@ Padding( _medicineProvider.getPharmaciesList(widget.itemID).then((result) { this.setState(() { _data = _medicineProvider.pharmaciesList; - //if(_data == null || _data.length == 0) }); }); return true; } + + Image imageFromBase64String(String base64String) { + return Image.memory(base64Decode(base64String)); + } + + Uint8List dataFromBase64String(String base64String) { + return base64Decode(base64String); + } + + String base64String(Uint8List data) { + return base64Encode(data); + } } diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index 1d606793..3998adc6 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -1,10 +1,6 @@ import 'dart:convert'; import 'dart:typed_data'; - -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart'; - import '../shared/rounded_container_widget.dart'; import '../shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; From 3eeac2734bde8a0c15329769617cb892256520cc Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Thu, 11 Jun 2020 12:16:51 +0300 Subject: [PATCH 06/10] Modify Patiant screen List style --- lib/screens/patients/profile/progress_note_screen.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/profile/progress_note_screen.dart b/lib/screens/patients/profile/progress_note_screen.dart index 07f0ff88..f9d8be44 100644 --- a/lib/screens/patients/profile/progress_note_screen.dart +++ b/lib/screens/patients/profile/progress_note_screen.dart @@ -20,7 +20,7 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); /* *@author: ibrahim albitar *@Date:15/5/2020 - *@param: + *@param: ' *@return: *@desc: */ @@ -182,7 +182,7 @@ class _ProgressNoteState extends State { if (strExist) { filteredNotesList = null; - filteredNotesList = notesList + filteredNotesList = patientsProv.patientProgressNoteList .where((note) => note["DoctorName"].toString().contains(str.toUpperCase())) .toList(); From e0b841a4c13e50d19948e27a64ee0024bf75391f Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Thu, 11 Jun 2020 12:24:41 +0300 Subject: [PATCH 07/10] change font size --- lib/screens/dashboard_screen.dart | 4 ++-- lib/widgets/patients/dynamic_elements.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index a00471df..20557aeb 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -238,7 +238,7 @@ class _DashboardScreenState extends State { valueFontColor: Colors.black, titleFontColor: Colors.black, iconColor: Colors.black, - titleFontSize: 16, + titleFontSize: 14, ), onTap: () { Navigator.of(context).pushNamed(PATIENT_SEARCH); @@ -268,7 +268,7 @@ class _DashboardScreenState extends State { valueFontColor: Colors.black, titleFontColor: Colors.black, iconColor: Colors.black, - titleFontSize: 16, + titleFontSize: 14, ), ), ), diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart index 8b6fc5a8..be66e88e 100644 --- a/lib/widgets/patients/dynamic_elements.dart +++ b/lib/widgets/patients/dynamic_elements.dart @@ -50,7 +50,7 @@ class _DynamicElementsState extends State { AppTextFormField( textInputType: TextInputType.number, hintText: 'From', - controller: _fromDateController, //_fromDateController, + controller: _fromDateController, inputFormatter: ONLY_DATE, onTap: () { @@ -83,7 +83,7 @@ class _DynamicElementsState extends State { AppTextFormField( textInputType: TextInputType.number, hintText: 'TO', - controller: _fromDateController, //_toDateController, + controller: _toDateController, onTap: () { _presentDatePicker('_selectedToDate'); }, From 3d8f8680b32aed28d92a3ca54daa3bc2178e592a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 11 Jun 2020 12:27:55 +0300 Subject: [PATCH 08/10] DA-115:add Authentication Type to verfiy account screen --- lib/widgets/auth/verfiy_account.dart | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 0448c838..611bd315 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -191,20 +191,13 @@ class _VerifyAccountState extends State { validator: validateCodeDigit)) ], ), - // buildSizedBox(40), buildSizedBox(20), buildText(), - // buildSizedBox(10.0), - // Text() - buildSizedBox(40), - - // buildSizedBox(), RaisedButton( onPressed: () { verifyAccount( authProv, widget.changeLoadingStata); - // Navigator.of(context).pushNamed(HOME); }, elevation: 0.0, child: Container( @@ -293,6 +286,16 @@ class _VerifyAccountState extends State { *@desc: buildText */ RichText buildText() { + String medthodName; + switch (model['OTP_SendType']) { + case 1: + medthodName = 'SMS'; + break; + case 2: + medthodName = 'WhatsApp'; + break; + default: + } var text = RichText( text: new TextSpan( style: new TextStyle( @@ -302,7 +305,7 @@ class _VerifyAccountState extends State { new TextSpan( text: 'Login Code ', style: TextStyle(fontWeight: FontWeight.w700)), - new TextSpan(text: 'By SMS, Please enter the code') + new TextSpan(text: 'By ${medthodName}, Please enter the code') ])); return text; } From 692674fac0571d1f67df6f2793ddec9acf708188 Mon Sep 17 00:00:00 2001 From: Mohammad ALjammal Date: Thu, 11 Jun 2020 17:09:08 +0300 Subject: [PATCH 09/10] merge ibrahim --- lib/client/base_app_client.dart | 59 ++- lib/config/config.dart | 4 + lib/providers/auth_provider.dart | 108 ++-- lib/providers/hospital_provider.dart | 24 +- lib/providers/patients_provider.dart | 448 ++++++---------- lib/screens/QR_reader_screen.dart | 134 ++--- lib/screens/auth/login_screen.dart | 46 +- lib/screens/doctor/my_schedule_screen.dart | 73 +-- .../profile/radiology/radiology_screen.dart | 210 ++++---- lib/widgets/auth/login_form.dart | 79 +-- lib/widgets/auth/verfiy_account.dart | 78 +-- lib/widgets/auth/verification_methods.dart | 33 +- .../doctor/my_referral_patient_widget.dart | 492 +++++++++--------- .../patients/profile/large_avatar.dart | 36 +- 14 files changed, 889 insertions(+), 935 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 0d57b9dd..25b2450c 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -2,10 +2,18 @@ import 'dart:convert'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/interceptor/http_interceptor.dart'; import 'package:doctor_app_flutter/models/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:http/http.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'package:http_interceptor/http_methods.dart'; +import 'package:http_interceptor/models/request_data.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); +Helpers helpers = new Helpers(); /* *@author: Mohammad Aljammal @@ -14,6 +22,7 @@ import 'package:http/http.dart'; *@return: *@desc: */ + ///Example /* await BaseAppClient.post('', @@ -22,24 +31,28 @@ import 'package:http/http.dart'; body: null); * */ class BaseAppClient { - static Client client = HttpInterceptor().getClient(); - static post( - String endPoint, { - Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - }) async { + String endPoint, { + Map body, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + }) async { String url = BASE_URL + endPoint; + RequestData data = RequestData(body: body,baseUrl: url,method: Method.POST); + + try { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - body['DoctorID'] = doctorProfile.doctorID; - body['EditedBy'] = doctorProfile.doctorID; - body['ProjectID'] = doctorProfile.projectID; - body['ClinicID'] = doctorProfile.clinicID; - body['TokenID'] = token; + if (profile != null) { + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + body['DoctorID'] = doctorProfile?.doctorID; + body['EditedBy'] = doctorProfile?.doctorID; + body['ProjectID'] = doctorProfile?.projectID; + // if (!body.containsKey('ClinicID')) + body['ClinicID'] = doctorProfile?.clinicID; + } + body['TokenID'] = token ?? ''; body['LanguageID'] = LANGUAGE_ID; body['stamp'] = STAMP; body['IPAdress'] = IP_ADDRESS; @@ -48,15 +61,25 @@ class BaseAppClient { body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = PATIENT_OUT_SA; + print("URL : $url"); + print("Body : ${json.encode(body)}"); - if (await Helpers.checkConnection()) { - final response = await client.post(url, body: json.encode(body)); + if (await Helpers.checkConnection()) { + final response = await http.post(url, + body: json.encode(body), + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }); final int statusCode = response.statusCode; if (statusCode < 200 || statusCode >= 400 || json == null) { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); - if (parsed['MessageStatus'] == 1) { + if (!parsed['IsAuthenticated']) { + Navigator.of(AppGlobal.CONTEX).pushNamed(LOGIN); + helpers.showErrorToast('Your session expired Please login agian'); + } else if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); } else { onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], diff --git a/lib/config/config.dart b/lib/config/config.dart index d199986c..3c7b107b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -68,3 +68,7 @@ const PATIENT_OUT_SA = false; /// Timer Info const TIMER_MIN =10; +class AppGlobal{ +static var CONTEX; +} + diff --git a/lib/providers/auth_provider.dart b/lib/providers/auth_provider.dart index af93c837..e79192ae 100644 --- a/lib/providers/auth_provider.dart +++ b/lib/providers/auth_provider.dart @@ -1,27 +1,31 @@ -import 'dart:convert'; -import 'package:doctor_app_flutter/client/app_client.dart'; +import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:flutter/cupertino.dart'; + import '../models/user_model.dart'; -const LOGIN_URL = - 'Sentry.svc/REST/MemberLogIN_New'; -const INSERT_DEVICE_IMEI = - 'Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; +const LOGIN_URL = 'Sentry.svc/REST/MemberLogIN_New'; +const INSERT_DEVICE_IMEI = 'Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; const SELECT_DEVICE_IMEI = 'Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; -const MEMBER_CHECK_ACTIVATION_CODE_NEW ='Sentry.svc/REST/MemberCheckActivationCode_New'; +const MEMBER_CHECK_ACTIVATION_CODE_NEW = + 'Sentry.svc/REST/MemberCheckActivationCode_New'; const GET_DOC_PROFILES = 'Doctors.svc/REST/GetDocProfiles'; -class AuthProvider with ChangeNotifier { - Future login(UserModel userInfo) async { - const url = LOGIN_URL; +class AuthProvider with ChangeNotifier { + Future login(UserModel userInfo) async { try { - final response = await AppClient.post(url, - body: json.encode({ + dynamic localRes; + + await BaseAppClient.post(LOGIN_URL, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: { "UserID": userInfo.UserID, "Password": userInfo.Password, "ProjectID": userInfo.ProjectID, @@ -30,76 +34,98 @@ class AuthProvider with ChangeNotifier { "VersionID": userInfo.VersionID, "Channel": userInfo.Channel, "SessionID": userInfo.SessionID - })); - return Future.value(json.decode(response.body)); + }); + + return Future.value(localRes); } catch (error) { print(error); throw error; } } - Future insertDeviceImei(imei) async { - const url = INSERT_DEVICE_IMEI; - + Future insertDeviceImei(imei) async { try { - final response = await AppClient.post(url, body: json.encode(imei)); - return Future.value(json.decode(response.body)); + dynamic localRes; + + await BaseAppClient.post(INSERT_DEVICE_IMEI, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: imei); + return Future.value(localRes); } catch (error) { print(error); throw error; } } - Future selectDeviceImei(imei) async { - const url = SELECT_DEVICE_IMEI; - + Future selectDeviceImei(imei) async { try { - final response = await AppClient.post(url, body: json.encode(imei)); - return Future.value(json.decode(response.body)); + dynamic localRes; + await BaseAppClient.post(SELECT_DEVICE_IMEI, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: imei); + return Future.value(localRes); } catch (error) { print(error); throw error; } } - Future sendActivationCodeByOtpNotificationType( + Future sendActivationCodeByOtpNotificationType( activationCodeModel) async { - const url = SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE; - try { - final response = await AppClient.post(url, body: json.encode(activationCodeModel)); - return Future.value(json.decode(response.body)); + var localRes; + await BaseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: activationCodeModel); + return Future.value(localRes); } catch (error) { print(error); throw error; } } - Future memberCheckActivationCodeNew(activationCodeModel) async { - const url = MEMBER_CHECK_ACTIVATION_CODE_NEW; - + Future memberCheckActivationCodeNew(activationCodeModel) async { try { - final response = await AppClient.post(url, body: json.encode(activationCodeModel)); - return Future.value(json.decode(response.body)); + dynamic localRes; + await BaseAppClient.post(MEMBER_CHECK_ACTIVATION_CODE_NEW, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: activationCodeModel); + return Future.value(localRes); } catch (error) { print(error); throw error; } } - /* - *@author: Elham Rababah + /* + *@author: Elham Rababah *@Date:17/5/2020 *@param: docInfo *@return:Future *@desc: getDocProfiles */ - Future getDocProfiles(docInfo) async { - const url = GET_DOC_PROFILES; - + Future getDocProfiles(docInfo) async { try { - final response = await AppClient.post(url, body: json.encode(docInfo)); - return Future.value(json.decode(response.body)); + dynamic localRes; + await BaseAppClient.post(GET_DOC_PROFILES, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: docInfo); + return Future.value(localRes); } catch (error) { print(error); throw error; diff --git a/lib/providers/hospital_provider.dart b/lib/providers/hospital_provider.dart index abf758a2..547bffe2 100644 --- a/lib/providers/hospital_provider.dart +++ b/lib/providers/hospital_provider.dart @@ -1,11 +1,8 @@ -import 'dart:convert'; - -import 'package:doctor_app_flutter/client/app_client.dart'; +import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:flutter/cupertino.dart'; class HospitalProvider with ChangeNotifier { - Future getProjectsList() async { const url = GET_PROJECTS; var info = { @@ -18,12 +15,17 @@ class HospitalProvider with ChangeNotifier { "SessionID": "i1UJwCTSqt", "IsLoginForDoctorApp": true }; - try { - final response = await AppClient.post(url, body: json.encode(info)); - return Future.value(json.decode(response.body)); - } catch (error) { - throw error; - // print('error'); - } + dynamic localRes ; + + await BaseAppClient.post(url, + onSuccess: ( response, statusCode) async { + localRes= response; + }, + onFailure: (String error, int statusCode) { + throw error; + }, + body: info); + return Future.value(localRes); + } } diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index 754af77b..6da89e74 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -16,13 +16,10 @@ import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart'; import 'package:doctor_app_flutter/models/patient/radiology_res_model.dart'; import 'package:doctor_app_flutter/models/patient/refer_to_doctor_request.dart'; import 'package:doctor_app_flutter/models/prescription_report.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:flutter/cupertino.dart'; -import 'package:http/http.dart'; -import 'package:http_interceptor/http_client_with_interceptor.dart'; -import '../client/app_client.dart'; import '../config/config.dart'; -import '../interceptor/http_interceptor.dart'; import '../models/patient/lab_orders_res_model.dart'; import '../models/patient/patiant_info_model.dart'; import '../models/patient/patient_model.dart'; @@ -32,6 +29,7 @@ import '../models/patient/vital_sign_res_model.dart'; import '../util/helpers.dart'; Helpers helpers = Helpers(); +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class PatientsProvider with ChangeNotifier { bool isLoading = false; @@ -60,31 +58,26 @@ class PatientsProvider with ChangeNotifier { var referalFrequancyList = []; DoctorsByClinicIdRequest _doctorsByClinicIdRequest = - DoctorsByClinicIdRequest(); + DoctorsByClinicIdRequest(); STPReferralFrequencyRequest _referralFrequencyRequest = - STPReferralFrequencyRequest(); + STPReferralFrequencyRequest(); ClinicByProjectIdRequest _clinicByProjectIdRequest = - ClinicByProjectIdRequest(); - ReferToDoctorRequest _referToDoctorRequest ; - Client client = - HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); + ClinicByProjectIdRequest(); + ReferToDoctorRequest _referToDoctorRequest = ReferToDoctorRequest(); PatiantInformtion _selectedPatient; - Future getPatientList(PatientModel patient, patientType) async { - /* const url = - BASE_URL+'DoctorApplication.svc/REST/GetMyInPatient';*/ - + Future getPatientList(PatientModel patient, patientType) async { int val = int.parse(patientType); - //**********Modify url by amjad amireh for patiant type********* - - final url = - BASE_URL + "DoctorApplication.svc/REST/" + SERVICES_PATIANT[val]; - // print("a===========$url=======a"); try { - final response = await client.post(url, - body: json.encode({ + dynamic localRes; + await BaseAppClient.post('DoctorApplication.svc/REST/' + SERVICES_PATIANT[val], + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: { "ProjectID": patient.ProjectID, "ClinicID": patient.ClinicID, "DoctorID": patient.DoctorID, @@ -105,13 +98,12 @@ class PatientsProvider with ChangeNotifier { "SessionID": patient.SessionID, "IsLoginForDoctorApp": patient.IsLoginForDoctorApp, "PatientOutSA": patient.PatientOutSA - })); -//********************** -//*********************** + }); - return Future.value(json.decode(response.body)); - } catch (err) { - throw err; + return Future.value(localRes); + } catch (error) { + print(error); + throw error; } } @@ -133,21 +125,10 @@ class PatientsProvider with ChangeNotifier { setBasicData(); try { - if (await Helpers.checkConnection()) { - final response = await AppClient.post(GET_PATIENT_VITAL_SIGN, - body: json.encode(patient)); - final int statusCode = response.statusCode; - isLoading = false; - - if (statusCode < 200 || statusCode >= 400 || json == null) { - isError = true; - error = 'Error While Fetching data'; - } else { - var res = json.decode(response.body); - print('$res'); - if (res['MessageStatus'] == 1) { + await BaseAppClient.post(GET_PATIENT_VITAL_SIGN, + onSuccess: (dynamic response, int statusCode) { patientVitalSignList = []; - res['List_DoctorPatientVitalSign'].forEach((v) { + response['List_DoctorPatientVitalSign'].forEach((v) { patientVitalSignList.add(new VitalSignResModel.fromJson(v)); }); @@ -160,21 +141,22 @@ class PatientsProvider with ChangeNotifier { a.vitalSignDate.microsecondsSinceEpoch; }); patientVitalSignOrderdSubList.clear(); - for (int x = 0; x < 20; x++) { + int length = patientVitalSignOrderdSubListTemp.length >= 20 + ? 20 + : patientVitalSignOrderdSubListTemp.length; + for (int x = 0; x < length; x++) { patientVitalSignOrderdSubList .add(patientVitalSignOrderdSubListTemp[x]); } } - } else { + isLoading = false; + isError = false; + this.error = ''; + }, onFailure: (String error, int statusCode) { + isLoading = false; isError = true; - error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; - } - } - } else { - isLoading = false; - isError = true; - error = 'Please Check The Internet Connection'; - } + this.error = error; + }, body: patient); notifyListeners(); } catch (err) { handelCatchErrorCase(err); @@ -193,33 +175,20 @@ class PatientsProvider with ChangeNotifier { setBasicData(); try { - if (await Helpers.checkConnection()) { - final response = await AppClient.post(GET_PATIENT_LAB_OREDERS, - body: json.encode(patient)); - final int statusCode = response.statusCode; - isLoading = false; - - if (statusCode < 200 || statusCode >= 400 || json == null) { - isError = true; - error = 'Error While Fetching data'; - } else { - var res = json.decode(response.body); - print('$res'); - if (res['MessageStatus'] == 1) { + await BaseAppClient.post(GET_PATIENT_LAB_OREDERS, + onSuccess: (dynamic response, int statusCode) { patientLabResultOrdersList = []; - res['List_GetLabOreders'].forEach((v) { + response['List_GetLabOreders'].forEach((v) { patientLabResultOrdersList.add(new LabOrdersResModel.fromJson(v)); }); - } else { + isLoading = false; + isError = false; + this.error = ''; + }, onFailure: (String error, int statusCode) { + isLoading = false; isError = true; - error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; - } - } - } else { - isLoading = false; - isError = true; - error = 'Please Check The Internet Connection'; - } + this.error = error; + }, body: patient); notifyListeners(); } catch (err) { handelCatchErrorCase(err); @@ -234,36 +203,21 @@ class PatientsProvider with ChangeNotifier { */ getOutPatientPrescriptions(patient) async { setBasicData(); - try { - if (await Helpers.checkConnection()) { - final response = - await AppClient.post(GET_PRESCRIPTION, body: json.encode(patient)); - final int statusCode = response.statusCode; - isLoading = false; - - if (statusCode < 200 || statusCode >= 400 || json == null) { - isError = true; - error = 'Error While Fetching data'; - } else { - var res = json.decode(response.body); - print('$res'); - if (res['MessageStatus'] == 1) { + await BaseAppClient.post(GET_PRESCRIPTION, + onSuccess: (dynamic response, int statusCode) { patientPrescriptionsList = []; - res['PatientPrescriptionList'].forEach((v) { - patientPrescriptionsList - .add(new PrescriptionResModel.fromJson(v)); + response['PatientPrescriptionList'].forEach((v) { + patientPrescriptionsList.add(new PrescriptionResModel.fromJson(v)); }); - } else { + isLoading = false; + isError = false; + this.error = ''; + }, onFailure: (String error, int statusCode) { + isLoading = false; isError = true; - error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; - } - } - } else { - isLoading = false; - isError = true; - error = 'Please Check The Internet Connection'; - } + this.error = error; + }, body: patient); notifyListeners(); } catch (err) { handelCatchErrorCase(err); @@ -284,13 +238,13 @@ class PatientsProvider with ChangeNotifier { await BaseAppClient.post( 'DoctorApplication.svc/REST/GetPrescriptionReportForInPatient', onSuccess: (dynamic response, int statusCode) { - response['List_PrescriptionReportForInPatient'].forEach((v) { - prescriptionReportForInPatientList - .add(PrescriptionReportForInPatient.fromJson(v)); - }); - isError = false; - isLoading = false; - }, onFailure: (String error, int statusCode) { + response['List_PrescriptionReportForInPatient'].forEach((v) { + prescriptionReportForInPatientList + .add(PrescriptionReportForInPatient.fromJson(v)); + }); + isError = false; + isLoading = false; + }, onFailure: (String error, int statusCode) { isError = true; isLoading = false; this.error = error; @@ -309,16 +263,16 @@ class PatientsProvider with ChangeNotifier { notifyListeners(); await BaseAppClient.post('Patients.svc/REST/GetPrescriptionReport', onSuccess: (dynamic response, int statusCode) { - response['ListPRM'].forEach((v) { - prescriptionReport.add(PrescriptionReport.fromJson(v)); - }); - isError = false; - isLoading = false; - }, onFailure: (String error, int statusCode) { - isError = true; - isLoading = false; - this.error = error; - }, body: prescriptionReqModel); + response['ListPRM'].forEach((v) { + prescriptionReport.add(PrescriptionReport.fromJson(v)); + }); + isError = false; + isLoading = false; + }, onFailure: (String error, int statusCode) { + isError = true; + isLoading = false; + this.error = error; + }, body: prescriptionReqModel); notifyListeners(); } @@ -347,33 +301,20 @@ class PatientsProvider with ChangeNotifier { // notifyListeners(); setBasicData(); try { - if (await Helpers.checkConnection()) { - final response = - await AppClient.post(GET_RADIOLOGY, body: json.encode(patient)); - final int statusCode = response.statusCode; - isLoading = false; - - if (statusCode < 200 || statusCode >= 400 || json == null) { - isError = true; - error = 'Error While Fetching data'; - } else { - var res = json.decode(response.body); - print('$res'); - if (res['MessageStatus'] == 1) { + await BaseAppClient.post(GET_RADIOLOGY, + onSuccess: (dynamic response, int statusCode) { patientRadiologyList = []; - res['List_GetRadOreders'].forEach((v) { + response['List_GetRadOreders'].forEach((v) { patientRadiologyList.add(new RadiologyResModel.fromJson(v)); }); - } else { + isLoading = false; + isError = false; + this.error = ''; + }, onFailure: (String error, int statusCode) { + isLoading = false; isError = true; - error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; - } - } - } else { - isLoading = false; - isError = true; - error = 'Please Check The Internet Connection'; - } + this.error = error; + }, body: patient); notifyListeners(); } catch (err) { handelCatchErrorCase(err); @@ -391,47 +332,33 @@ class PatientsProvider with ChangeNotifier { requestLabResult.patientTypeID = labOrdersResModel.patientType; await BaseAppClient.post('DoctorApplication.svc/REST/GetPatientLabResults', onSuccess: (dynamic response, int statusCode) { - isError = false; - isLoading = false; - response['List_GetLabNormal'].forEach((v) { - labResultList.add(new LabResult.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - isError = true; - isLoading = false; - this.error = error; - }, body: requestLabResult.toJson()); + isError = false; + isLoading = false; + response['List_GetLabNormal'].forEach((v) { + labResultList.add(new LabResult.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + isError = true; + isLoading = false; + this.error = error; + }, body: requestLabResult.toJson()); notifyListeners(); } getPatientInsuranceApprovals(patient) async { setBasicData(); try { - if (await Helpers.checkConnection()) { - final response = await AppClient.post(PATIENT_INSURANCE_APPROVALS_URL, - body: json.encode(patient)); - final int statusCode = response.statusCode; - isLoading = false; - - if (statusCode < 200 || statusCode >= 400 || json == null) { - isError = true; - error = 'Error While Fetching data'; - } else { - var res = json.decode(response.body); - print('$res'); - if (res['MessageStatus'] == 1) { - //patientRadiologyList = []; - insuranceApporvalsList = res['List_ApprovalMain_InPatient']; - } else { + await BaseAppClient.post(PATIENT_INSURANCE_APPROVALS_URL, + onSuccess: (dynamic response, int statusCode) { + insuranceApporvalsList = response['List_ApprovalMain_InPatient']; + isLoading = false; + isError = false; + this.error = ''; + }, onFailure: (String error, int statusCode) { + isLoading = false; isError = true; - error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; - } - } - } else { - isLoading = false; - isError = true; - error = 'Please Check The Internet Connection'; - } + this.error = error; + }, body: patient); notifyListeners(); } catch (err) { handelCatchErrorCase(err); @@ -445,30 +372,17 @@ class PatientsProvider with ChangeNotifier { getPatientProgressNote(patient) async { setBasicData(); try { - if (await Helpers.checkConnection()) { - final response = await AppClient.post(PATIENT_PROGRESS_NOTE_URL, - body: json.encode(patient)); - final int statusCode = response.statusCode; - isLoading = false; - - if (statusCode < 200 || statusCode >= 400 || json == null) { - isError = true; - error = 'Error While Fetching data'; - } else { - var res = json.decode(response.body); - print('$res'); - if (res['MessageStatus'] == 1) { - patientProgressNoteList = res['List_GetPregressNoteForInPatient']; - } else { + await BaseAppClient.post(PATIENT_PROGRESS_NOTE_URL, + onSuccess: (dynamic response, int statusCode) { + patientProgressNoteList = response['List_GetPregressNoteForInPatient']; + isLoading = false; + isError = false; + this.error = ''; + }, onFailure: (String error, int statusCode) { + isLoading = false; isError = true; - error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; - } - } - } else { - isLoading = false; - isError = true; - error = 'Please Check The Internet Connection'; - } + this.error = error; + }, body: patient); notifyListeners(); } catch (err) { handelCatchErrorCase(err); @@ -480,51 +394,29 @@ class PatientsProvider with ChangeNotifier { *@desc: getDoctorsList */ getDoctorsList(String clinicId) async { - String token = await sharedPref.getString(TOKEN); - int projectID = await sharedPref.getInt(PROJECT_ID); setBasicData(); try { - if (await Helpers.checkConnection()) { - _doctorsByClinicIdRequest.projectID = projectID; - _doctorsByClinicIdRequest.clinicID = clinicId; - _doctorsByClinicIdRequest.tokenID = token; - - final response = await AppClient.post(PATIENT_GET_DOCTOR_BY_CLINIC_URL, - body: json.encode(_doctorsByClinicIdRequest)); - final int statusCode = response.statusCode; - - - if (statusCode < 200 || statusCode >= 400 || json == null) { - isError = true; - error = 'Error While Fetching data'; - isLoading = false; - } else { - var res = json.decode(response.body); - print('$res'); - if (res['MessageStatus'] == 1) { - doctorsList = res['List_Doctors_All']; - isLoading = false; - } else { + _doctorsByClinicIdRequest.clinicID = clinicId; + await BaseAppClient.post(PATIENT_GET_DOCTOR_BY_CLINIC_URL, + onSuccess: (dynamic response, int statusCode) { + doctorsList = response['List_Doctors_All']; + isLoading = false; + isError = false; + this.error = ''; + }, onFailure: (String error, int statusCode) { + isLoading = false; isError = true; - error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; - isLoading = false; - } - } - } else { - isLoading = false; - isError = true; - error = 'Please Check The Internet Connection'; - } + this.error = error; + }, body: _doctorsByClinicIdRequest.toJson()); notifyListeners(); } catch (err) { handelCatchErrorCase(err); - isLoading = false; } } List getDoctorNameList() { var doctorNamelist = - doctorsList.map((value) => value['DoctorName'].toString()).toList(); + doctorsList.map((value) => value['DoctorName'].toString()).toList(); return doctorNamelist; } @@ -533,37 +425,19 @@ class PatientsProvider with ChangeNotifier { *@desc: getClinicsList */ getClinicsList() async { - String token = await sharedPref.getString(TOKEN); setBasicData(); try { - if (await Helpers.checkConnection()) { - int projectID = await sharedPref.getInt(PROJECT_ID); - _clinicByProjectIdRequest.projectID = projectID; - _clinicByProjectIdRequest.tokenID = token; - - final response = await AppClient.post(PATIENT_GET_CLINIC_BY_PROJECT_URL, - body: json.encode(_clinicByProjectIdRequest)); - final int statusCode = response.statusCode; - isLoading = false; - - if (statusCode < 200 || statusCode >= 400 || json == null) { - isError = true; - error = 'Error While Fetching data'; - } else { - var res = json.decode(response.body); - print('$res'); - if (res['MessageStatus'] == 1) { - clinicsList = res['List_Clinic_All']; - } else { + await BaseAppClient.post(PATIENT_GET_CLINIC_BY_PROJECT_URL, + onSuccess: (dynamic response, int statusCode) { + clinicsList = response['List_Clinic_All']; + isLoading = false; + isError = false; + this.error = ''; + }, onFailure: (String error, int statusCode) { + isLoading = false; isError = true; - error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; - } - } - } else { - isLoading = false; - isError = true; - error = 'Please Check The Internet Connection'; - } + this.error = error; + }, body: _clinicByProjectIdRequest.toJson()); notifyListeners(); } catch (err) { handelCatchErrorCase(err); @@ -582,33 +456,19 @@ class PatientsProvider with ChangeNotifier { *@desc: getReferralFrequancyList */ getReferralFrequancyList() async { - String token = await sharedPref.getString(TOKEN); setBasicData(); try { - if (await Helpers.checkConnection()) { - _referralFrequencyRequest.tokenID = token; - final response = await AppClient.post(PATIENT_GET_LIST_REFERAL_URL, - body: json.encode(_referralFrequencyRequest)); - final int statusCode = response.statusCode; - isLoading = false; - if (statusCode < 200 || statusCode >= 400 || json == null) { - isError = true; - error = 'Error While Fetching data'; - } else { - var res = json.decode(response.body); - print('$res'); - if (res['MessageStatus'] == 1) { - referalFrequancyList = res['list_STPReferralFrequency']; - } else { + await BaseAppClient.post(PATIENT_GET_LIST_REFERAL_URL, + onSuccess: (dynamic response, int statusCode) { + referalFrequancyList = response['list_STPReferralFrequency']; + isLoading = false; + isError = false; + this.error = ''; + }, onFailure: (String error, int statusCode) { + isLoading = false; isError = true; - error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; - } - } - } else { - isLoading = false; - isError = true; - error = 'Please Check The Internet Connection'; - } + this.error = error; + }, body: _referralFrequencyRequest.toJson()); notifyListeners(); } catch (err) { handelCatchErrorCase(err); @@ -628,23 +488,23 @@ class PatientsProvider with ChangeNotifier { */ referToDoctor(context, {String selectedDoctorID, - String selectedClinicID, - int admissionNo, - String extension, - String priority, - String frequency, - String referringDoctorRemarks, - int patientID, - int patientTypeID, - String roomID, - int projectID}) async { + String selectedClinicID, + int admissionNo, + String extension, + String priority, + String frequency, + String referringDoctorRemarks, + int patientID, + int patientTypeID, + String roomID, + int projectID}) async { setBasicData(); try { if (await Helpers.checkConnection()) { String token = await sharedPref.getString(TOKEN); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = - new DoctorProfileModel.fromJson(profile); + new DoctorProfileModel.fromJson(profile); int doctorID = doctorProfile.doctorID; int clinicId = doctorProfile.clinicID; _referToDoctorRequest = ReferToDoctorRequest( diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index bbbe327a..27afd2ee 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/providers/patients_provider.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -23,7 +24,7 @@ class QrReaderScreen extends StatefulWidget { } class _QrReaderScreenState extends State { -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); bool isLoading = false; bool isError = false; @@ -72,9 +73,9 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); height: 7, ), AppText( - 'scan Qr code to retrieve patient profile', - fontSize: 14, - fontWeight: FontWeight.w400, + 'scan Qr code to retrieve patient profile', + fontSize: 14, + fontWeight: FontWeight.w400, textAlign: TextAlign.center ), SizedBox( @@ -123,15 +124,15 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); /// var result = await BarcodeScanner.scan(); /// int patientID = get from qr result var result = await BarcodeScanner.scan(); - // if (result.rawContent == "") { - List listOfParams = result.rawContent.split(','); - String patientType = "1"; - setState(() { - isLoading = true; - isError = false; - patientList = []; - }); - String token = await sharedPref.getString(TOKEN); + // if (result.rawContent == "") { + List listOfParams = result.rawContent.split(','); + String patientType = "1"; + setState(() { + isLoading = true; + isError = false; + patientList = []; + }); + String token = await sharedPref.getString(TOKEN); // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); // DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); // patient.PatientID = 8808; @@ -140,57 +141,64 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); // patient.setClinicID = doctorProfile.clinicID; // patient.setProjectID = doctorProfile.projectID; // Provider.of(context, listen: false); - patient.PatientID = 8808; - patient.TokenID = token; - Provider.of(context, listen: false) - .getPatientList(patient, "1") - .then((response) { - if (response['MessageStatus'] == 1) { - switch (patientType) { - case "0": - if (response['List_MyOutPatient'] != null) { - setState(() { - patientList = ModelResponse.fromJson(response['List_MyOutPatient']).list; - isLoading = false; - }); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": patientList[0], - }); - } else { - setState(() { - isError = true; - error = 'No patient'; - isLoading = false; - }); - } + patient.PatientID = 8808; + patient.TokenID = token; + Provider.of(context, listen: false) + .getPatientList(patient, "1") + .then((response) { + if (response['MessageStatus'] == 1) { + switch (patientType) { + case "0": + if (response['List_MyOutPatient'] != null) { + setState(() { + patientList = ModelResponse.fromJson(response['List_MyOutPatient']).list; + isLoading = false; + }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patientList[0], + }); + } else { + setState(() { + isError = true; + isLoading = false; + }); + DrAppToastMsg.showErrorToast('No patient'); + } + break; + case "1": + if (response['List_MyInPatient'] != null) { + setState(() { + patientList = ModelResponse.fromJson(response['List_MyInPatient']).list; + isLoading = false; + error = ""; + }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patientList[0], + }); + } else { + setState(() { + isError = true; + isLoading = false; + }); + DrAppToastMsg.showErrorToast('No patient'); break; - case "1": - if (response['List_MyInPatient'] != null) { - setState(() { - patientList = ModelResponse.fromJson(response['List_MyInPatient']).list; - isLoading = false; - error = ""; - }); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": patientList[0], - }); - } else { - setState(() { - error = 'No patient'; - isError = true; - isLoading = false; - }); - break; - } - } - } else { - setState(() { - error = response['ErrorEndUserMessage'] ?? response['ErrorMessage'] ; - isLoading = false; - isError = true; - }); + } } + } else { + setState(() { + isLoading = false; + isError = true; + }); + DrAppToastMsg.showErrorToast(response['ErrorEndUserMessage'] ?? response['ErrorMessage']); + + } + }).catchError((error){ + setState(() { + isLoading = false; }); - } - // } + helpers.showErrorToast(error); + //DrAppToastMsg.showErrorToast(error); + }); + } +// } } diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 8b25d21d..38c81cc3 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -11,8 +12,8 @@ import '../../widgets/auth/login_form.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class Loginsreen extends StatefulWidget { @override _LoginsreenState createState() => _LoginsreenState(); @@ -40,10 +41,10 @@ class _LoginsreenState extends State { }); } -/* - *@author: Elham Rababah - *@Date:19/4/2020 - *@param: isLoading +/* + *@author: Elham Rababah + *@Date:19/4/2020 + *@param: isLoading *@return: *@desc: Change Isloading attribute in order to show or hide loader */ @@ -55,6 +56,7 @@ class _LoginsreenState extends State { @override Widget build(BuildContext context) { + getSharedPref(); return AppScaffold( isLoading: _isLoading, @@ -78,24 +80,24 @@ class _LoginsreenState extends State { children: [ (platformImei == null) ? Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AuthHeader(loginType.knownUser), - LoginForm( - changeLoadingStata: - changeLoadingStata, - ), - ], - ) + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AuthHeader(loginType.knownUser), + LoginForm( + changeLoadingStata: + changeLoadingStata, + ), + ], + ) : Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AuthHeader(loginType.unknownUser), - KnownUserLogin(), - ], - ), + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AuthHeader(loginType.unknownUser), + KnownUserLogin(), + ], + ), ])); } } diff --git a/lib/screens/doctor/my_schedule_screen.dart b/lib/screens/doctor/my_schedule_screen.dart index f7b9d444..cef7e881 100644 --- a/lib/screens/doctor/my_schedule_screen.dart +++ b/lib/screens/doctor/my_schedule_screen.dart @@ -15,46 +15,47 @@ class MyScheduleScreen extends StatelessWidget { @override Widget build(BuildContext context) { scheduleProvider = Provider.of(context); - return Scaffold( + return AppScaffold( + appBarTitle: TranslationBase.of(context).mySchedule, body: scheduleProvider.isLoading ? DrAppCircularProgressIndeicator() : scheduleProvider.isError - ? Center( - child: AppText( - scheduleProvider.error, - color: Theme.of(context).errorColor, - ), - ) - : scheduleProvider.listDoctorWorkingHoursTable.length == 0 - ? Center( - child: AppText( - TranslationBase.of(context).errorNoSchedule, - color: Theme.of(context).errorColor, - ), - ) - : Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: ListView( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 20, - ), - - scheduleListByDate(), - // scheduleListByDate('Wednesday, 8 April '), - ], - ), - ], - ), - ], - ), + ? Center( + child: AppText( + scheduleProvider.error, + color: Theme.of(context).errorColor, + ), + ) + : scheduleProvider.listDoctorWorkingHoursTable.length == 0 + ? Center( + child: AppText( + TranslationBase.of(context).errorNoSchedule, + color: Theme.of(context).errorColor, + ), + ) + : Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: ListView( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, ), + + scheduleListByDate(), + // scheduleListByDate('Wednesday, 8 April '), + ], + ), + ], + ), + ], + ), + ), ); } diff --git a/lib/screens/patients/profile/radiology/radiology_screen.dart b/lib/screens/patients/profile/radiology/radiology_screen.dart index 1ddf944e..4b47956c 100644 --- a/lib/screens/patients/profile/radiology/radiology_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_screen.dart @@ -79,116 +79,112 @@ class _RadiologyScreenState extends State { body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError - ? DrAppEmbeddedError(error: patientsProv.error) - : patientsProv.patientRadiologyList.length == 0 - ? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign') - : Container( - margin: EdgeInsets.fromLTRB( - SizeConfig.realScreenWidth * 0.05, - 0, - SizeConfig.realScreenWidth * 0.05, - 0), - child: Container( - margin: EdgeInsets.symmetric(vertical: 10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(20.0), - ), - ), - child: ListView.builder( - itemCount: patientsProv.patientRadiologyList.length, - itemBuilder: (BuildContext context, int index) { - return InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => RadiologyReportScreen(reportData: patientsProv.patientRadiologyList[index].reportData,)),); - }, - child: Container( - padding: EdgeInsets.all(10), - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(10)), - border: Border( - bottom: BorderSide( - color: Colors.grey, width: 0.5), - top: BorderSide( - color: Colors.grey, width: 0.5), - left: BorderSide( - color: Colors.grey, width: 0.5), - right: BorderSide( - color: Colors.grey, width: 0.5), + ? DrAppEmbeddedError(error: patientsProv.error) + : patientsProv.patientRadiologyList.length == 0 + ? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign') + : Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: Container( + margin: EdgeInsets.symmetric(vertical: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(20.0), + ), + ), + child: ListView.builder( + itemCount: patientsProv.patientRadiologyList.length, + itemBuilder: (BuildContext context, int index) { + return InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => RadiologyReportScreen(reportData: patientsProv.patientRadiologyList[index].reportData,)),); + }, + child: Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(10)), + border: Border( + bottom: BorderSide( + color: Colors.grey, width: 0.5), + top: BorderSide( + color: Colors.grey, width: 0.5), + left: BorderSide( + color: Colors.grey, width: 0.5), + right: BorderSide( + color: Colors.grey, width: 0.5), + ), + ), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + LargeAvatar( + url: patientsProv + .patientRadiologyList[index] + .doctorImageURL, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.fromLTRB( + 8, 0, 0, 0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + '${patientsProv.patientRadiologyList[index].doctorName}', + fontSize: 2.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold), + SizedBox( + height: 8, + ), + AppText( + 'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}', + fontSize: 2 * + SizeConfig + .textMultiplier, + ), + SizedBox( + height: 8, ), - ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - LargeAvatar( - url: patientsProv - .patientRadiologyList[index] - .doctorImageURL, - name: patientsProv - .patientLabResultOrdersList[ - index] - .doctorName, - ), - Expanded( - child: Padding( - padding: - const EdgeInsets.fromLTRB( - 8, 0, 0, 0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - '${patientsProv.patientRadiologyList[index].doctorName}', - fontSize: 2.5 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight.bold), - SizedBox( - height: 8, - ), - AppText( - 'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}', - fontSize: 2 * - SizeConfig - .textMultiplier, - ), - SizedBox( - height: 8, - ), - AppText( - ' ${patientsProv.patientRadiologyList[index].clinicName}', - fontSize: 2 * - SizeConfig - .textMultiplier, - color: Theme.of(context) - .primaryColor, - ), - SizedBox( - height: 8, - ), - ], - ), - ), - ) - ], - ), - ], - ), + AppText( + ' ${patientsProv.patientRadiologyList[index].clinicName}', + fontSize: 2 * + SizeConfig + .textMultiplier, + color: Theme.of(context) + .primaryColor, + ), + SizedBox( + height: 8, + ), + ], ), - ); - }), - ), + ), + ) + ], + ), + ], ), + ), + ); + }), + ), + ), ); } } diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index b93bfafa..ce6d8a95 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -36,7 +36,7 @@ class _LoginFormState extends State { String _platformImei = 'Unknown'; String uniqueId = "Unknown"; var projectsList = []; - + bool _isInit = true; FocusNode focusPass; FocusNode focusProject; @@ -56,14 +56,22 @@ class _LoginFormState extends State { initPlatformState(); } + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_isInit) { + if (projectsList.length == 0) { + getProjectsList(); + } + } + _isInit = false; + } + @override Widget build(BuildContext context) { final focusPass = FocusNode(); final focusProject = FocusNode(); - if (projectsList.length == 0) { - getProjectsList(); - } AuthProvider authProv = Provider.of(context); return Form( @@ -89,8 +97,9 @@ class _LoginFormState extends State { userInfo.UserID = value.trim(); }, onFieldSubmitted: (_) { - FocusScope.of(context).requestFocus(focusPass); + FocusScope.of(context).nextFocus(); }, + autofocus: false, ), buildSizedBox(), TextFormField( @@ -109,7 +118,7 @@ class _LoginFormState extends State { userInfo.Password = value; }, onFieldSubmitted: (_) { - FocusScope.of(context).requestFocus(focusProject); + FocusScope.of(context).nextFocus(); helpers.showCupertinoPicker( context, projectsList, 'Name', onSelectProject); }, @@ -134,22 +143,8 @@ class _LoginFormState extends State { }), buildSizedBox(), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.end, children: [ - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Checkbox( - value: true, - activeColor: Theme.of(context).primaryColor, - onChanged: (bool newValue) {}), - Text("Remember me", - style: TextStyle( - fontSize: 2 * SizeConfig.textMultiplier)), - ], - ), - ), RaisedButton( onPressed: () { login(context, authProv, widget.changeLoadingStata); @@ -194,17 +189,26 @@ class _LoginFormState extends State { */ InputDecoration buildInputDecoration(BuildContext context, hint, asset) { return InputDecoration( - prefixIcon: Image.asset(asset), - hintText: hint, - hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: Hexcolor('#CCCCCC')), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).primaryColor), - )); + prefixIcon: Image.asset(asset), + hintText: hint, + hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(20)), + borderSide: BorderSide(color: Hexcolor('#CCCCCC')), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Theme.of(context).primaryColor), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + ); } SizedBox buildSizedBox() { @@ -214,6 +218,11 @@ class _LoginFormState extends State { } login(context, AuthProvider authProv, Function changeLoadingStata) { + FocusScopeNode currentFocus = FocusScope.of(context); + + // if (!currentFocus.hasPrimaryFocus) { + // currentFocus.unfocus(); + // } changeLoadingStata(true); if (loginFormKey.currentState.validate()) { loginFormKey.currentState.save(); @@ -227,7 +236,7 @@ class _LoginFormState extends State { sharedPref.setString(TOKEN, res['LogInTokenID']); print("token" + res['LogInTokenID']); - Navigator.of(context).pushNamed(VERIFICATION_METHODS); + Navigator.of(context).pushReplacementNamed(VERIFICATION_METHODS); } else { // handel error // widget.showCenterShortLoadingToast("watting"); @@ -237,7 +246,7 @@ class _LoginFormState extends State { }).catchError((err) { print('$err'); changeLoadingStata(false); - helpers.showErrorToast(); + helpers.showErrorToast(err); }); } else { changeLoadingStata(false); @@ -285,7 +294,7 @@ class _LoginFormState extends State { // Platform messages may fail, so we use a try/catch PlatformException. try { platformImei = - await ImeiPlugin.getImei(shouldShowRequestPermissionRationale: false); + await ImeiPlugin.getImei(shouldShowRequestPermissionRationale: false); idunique = await ImeiPlugin.getId(); } on PlatformException { platformImei = 'Failed to get platform version.'; diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index feae82ce..ca7a9aa8 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -93,7 +93,7 @@ class _VerifyAccountState extends State { buildSizedBox(30), Row( mainAxisAlignment: - MainAxisAlignment.spaceAround, + MainAxisAlignment.spaceAround, children: [ Container( width: SizeConfig.realScreenWidth * 0.20, @@ -131,7 +131,7 @@ class _VerifyAccountState extends State { style: buildTextStyle(), keyboardType: TextInputType.number, decoration: - buildInputDecoration(context), + buildInputDecoration(context), onSaved: (val) { verifyAccountFormValue['digit2'] = val; @@ -158,7 +158,7 @@ class _VerifyAccountState extends State { style: buildTextStyle(), keyboardType: TextInputType.number, decoration: - buildInputDecoration(context), + buildInputDecoration(context), onSaved: (val) { verifyAccountFormValue['digit3'] = val; @@ -183,7 +183,7 @@ class _VerifyAccountState extends State { style: buildTextStyle(), keyboardType: TextInputType.number, decoration: - buildInputDecoration(context), + buildInputDecoration(context), onSaved: (val) { verifyAccountFormValue['digit4'] = val; @@ -191,20 +191,13 @@ class _VerifyAccountState extends State { validator: validateCodeDigit)) ], ), - // buildSizedBox(40), buildSizedBox(20), buildText(), - // buildSizedBox(10.0), - // Text() - buildSizedBox(40), - - // buildSizedBox(), RaisedButton( onPressed: () { verifyAccount( authProv, widget.changeLoadingStata); - // Navigator.of(context).pushNamed(HOME); }, elevation: 0.0, child: Container( @@ -216,7 +209,7 @@ class _VerifyAccountState extends State { style: TextStyle( color: Colors.white, fontSize: - 3 * SizeConfig.textMultiplier), + 3 * SizeConfig.textMultiplier), ), ), ), @@ -264,16 +257,25 @@ class _VerifyAccountState extends State { */ InputDecoration buildInputDecoration(BuildContext context) { return InputDecoration( - // ts/images/password_icon.png - contentPadding: EdgeInsets.only(top: 30, bottom: 30), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.black), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).primaryColor), - )); + // ts/images/password_icon.png + contentPadding: EdgeInsets.only(top: 30, bottom: 30), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10)), + borderSide: BorderSide(color: Colors.black), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Theme.of(context).primaryColor), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + ); } /* @@ -284,17 +286,27 @@ class _VerifyAccountState extends State { *@desc: buildText */ RichText buildText() { + String medthodName; + switch (model['OTP_SendType']) { + case 1: + medthodName = 'SMS'; + break; + case 2: + medthodName = 'WhatsApp'; + break; + default: + } var text = RichText( text: new TextSpan( style: new TextStyle( fontSize: 3.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ - new TextSpan(text: 'You will receive a '), - new TextSpan( - text: 'Login Code ', - style: TextStyle(fontWeight: FontWeight.w700)), - new TextSpan(text: 'By SMS, Please enter the code') - ])); + new TextSpan(text: 'You will receive a '), + new TextSpan( + text: 'Login Code ', + style: TextStyle(fontWeight: FontWeight.w700)), + new TextSpan(text: 'By ${medthodName}, Please enter the code') + ])); return text; } @@ -322,7 +334,7 @@ class _VerifyAccountState extends State { verifyAccountFormValue['digit4']; print(activationCode); int projectID = await sharedPref.getInt(PROJECT_ID); - Map model = { + Map model = { "activationCode": activationCode, "DoctorID": _loggedUser['DoctorID'], "LogInTokenID": _loggedUser['LogInTokenID'], @@ -348,7 +360,7 @@ class _VerifyAccountState extends State { res['List_DoctorProfile'][0], changeLoadingStata); } else { _asyncSimpleDialog(context, res['List_DoctorsClinic'], 'ClinicName', - 'Please Select Clinic') + 'Please Select Clinic') .then((clinicInfo) { ClinicModel clinic = ClinicModel.fromJson(clinicInfo); print(clinicInfo); @@ -381,7 +393,7 @@ class _VerifyAccountState extends State { Map profile, Function changeLoadingStata) { changeLoadingStata(false); sharedPref.setObj(DOCTOR_PROFILE, profile); - Navigator.of(context).pushNamed(HOME); + Navigator.of(context).pushReplacementNamed(HOME); } Future _asyncSimpleDialog( @@ -407,7 +419,7 @@ class _VerifyAccountState extends State { } /* - *@author: Elham Rababah + *@author: Elham Rababah *@Date:17/5/2020 *@param: ClinicModel clinicInfo, Function changeLoadingStata *@return: @@ -421,7 +433,7 @@ class _VerifyAccountState extends State { projectID: clinicInfo.projectID, tokenID: '', languageID: 2); - authProv.getDocProfiles(docInfo).then((res) { + authProv.getDocProfiles(docInfo.toJson()).then((res) { if (res['MessageStatus'] == 1) { print("DoctorProfileList ${res['DoctorProfileList'][0]}"); loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata); diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 3a7fa482..8c996556 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -50,7 +50,7 @@ class _VerificationMethodsState extends State { super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; verificationMethod = - routeArgs != null ? routeArgs['verificationMethod'] : null; + routeArgs != null ? routeArgs['verificationMethod'] : null; } @override @@ -101,17 +101,17 @@ class _VerificationMethodsState extends State { child: buildFingerprintMethod( context, authProv), replacement: - buildWhatsAppMethod(context, authProv), + buildWhatsAppMethod(context, authProv), ), Visibility( visible: hideSilentMethods() ? false : true, child: buildFaceIDMethod(context, authProv), replacement: - buildSMSMethod(context, authProv), + buildSMSMethod(context, authProv), ), Visibility( visible: - hideSilentMethods() ? false : true, + hideSilentMethods() ? false : true, child: buildWhatsAppMethod( context, authProv)), Visibility( @@ -126,8 +126,8 @@ class _VerificationMethodsState extends State { // height: 500, ), SizedBox( - // height: 20, - ) + // height: 20, + ) ], ), ); @@ -136,7 +136,7 @@ class _VerificationMethodsState extends State { }); } - /* + /* *@author: Elham Rababah *@Date:28/5/2020 *@param: BuildContext context, AuthProvider authProv @@ -149,7 +149,7 @@ class _VerificationMethodsState extends State { sendActivationCodeByOtpNotificationType(1, authProv); }); } - /* + /* *@author: Elham Rababah *@Date:28/5/2020 *@param: BuildContext context, AuthProvider authProv @@ -159,9 +159,9 @@ class _VerificationMethodsState extends State { Center buildWhatsAppMethod(BuildContext context, AuthProvider authProv) { return buildVerificationMethod( context, 'assets/images/verification_whatsapp_icon.png', 'WhatsApp', - () { - sendActivationCodeByOtpNotificationType(2, authProv); - }); + () { + sendActivationCodeByOtpNotificationType(2, authProv); + }); } /* *@author: Elham Rababah @@ -186,8 +186,8 @@ class _VerificationMethodsState extends State { Center buildFingerprintMethod(BuildContext context, AuthProvider authProv) { return buildVerificationMethod(context, 'assets/images/verification_fingerprint_icon.png', 'Fingerprint', () { - sendActivationCodeByOtpNotificationType(4, authProv); - }); + sendActivationCodeByOtpNotificationType(4, authProv); + }); } /* @@ -212,7 +212,7 @@ class _VerificationMethodsState extends State { width: 1, color: Hexcolor( '#CCCCCC') // <--- border width here - ), + ), borderRadius: BorderRadius.all(Radius.circular(10))), child: Column( children: [ @@ -251,11 +251,12 @@ class _VerificationMethodsState extends State { *@desc: send Activation Code By Otp Notification Type */ sendActivationCodeByOtpNotificationType(oTPSendType, AuthProvider authProv) { + // TODO : build enum for verfication method if (oTPSendType == 1 || oTPSendType == 2) { widget.changeLoadingStata(true); - Map model = { + Map model = { "LogInTokenID": _loggedUser['LogInTokenID'], "Channel": 9, "MobileNumber": _loggedUser['MobileNumber'], @@ -270,7 +271,7 @@ class _VerificationMethodsState extends State { widget.changeLoadingStata(false); if (res['MessageStatus'] == 1) { - Navigator.of(context).pushNamed(VERIFY_ACCOUNT, arguments: {'model':model}); + Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT, arguments: {'model':model}); } else { print(res['ErrorEndUserMessage']); helpers.showErrorToast(res['ErrorEndUserMessage']); diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index 02d3f10a..f30de7cb 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -42,269 +42,277 @@ class _MyReferralPatientWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - '${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.lastName}', - fontSize: 2.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - InkWell( - onTap: () { - setState(() { - _showDetails = !_showDetails; - }); - }, - child: Icon(_showDetails - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)), - ], + InkWell( + onTap: () { + setState(() { + _showDetails = !_showDetails; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + '${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.lastName}', + fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + Icon(_showDetails + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down), + + ], + ), ), !_showDetails ? Container() : AnimatedContainer( - duration: Duration(milliseconds: 200), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 5,), - Divider(color: Color(0xFF000000),height: 0.5,), - Table( - border: TableBorder.symmetric(inside: BorderSide(width: 0.5),), + duration: Duration(milliseconds: 200), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 5,), + Divider(color: Color(0xFF000000),height: 0.5,), + Table( + border: TableBorder.symmetric(inside: BorderSide(width: 0.5),), + children: [ + TableRow( children: [ - TableRow( - children: [ - Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'File No', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.myReferralPatientModel.referringDoctor}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'File No', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), - ), - Container( - margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Referring Doctor', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - widget.myReferralPatientModel - .referringClinicDescription, - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], + SizedBox(height: 5,), + AppText( + '${widget.myReferralPatientModel.referringDoctor}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Referring Doctor', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), - ), - ] + SizedBox(height: 5,), + AppText( + widget.myReferralPatientModel + .referringClinicDescription, + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), ), - TableRow( - children: [ - Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Referring Clinic', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.myReferralPatientModel.referringClinicDescription}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), + ] + ), + TableRow( + children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Referring Clinic', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), - Container( - margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Frequency', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - widget.myReferralPatientModel - .frequencyDescription, - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), + SizedBox(height: 5,), + AppText( + '${widget.myReferralPatientModel.referringClinicDescription}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, ) - ] + ], + ), ), - TableRow( - children: [ - Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Priority', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.myReferralPatientModel.priorityDescription}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], + Container( + margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Frequency', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), + SizedBox(height: 5,), + AppText( + widget.myReferralPatientModel + .frequencyDescription, + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ) + ] + ), + TableRow( + children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Priority', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), - Container( - margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Max Response Time', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - Helpers.getDateFormatted(widget - .myReferralPatientModel - .mAXResponseTime), - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), + SizedBox(height: 5,), + AppText( + '${widget.myReferralPatientModel.priorityDescription}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, ) ], ), + ), + Container( + margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Max Response Time', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + SizedBox(height: 5,), + AppText( + Helpers.getDateFormatted(widget + .myReferralPatientModel + .mAXResponseTime), + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ) + ], + ), - ], - ), - Divider(color: Color(0xFF000000),height: 0.5,), - SizedBox( - height: 5, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Clinic Details and Remarks', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - textAlign: TextAlign.start,), - Texts( - '${widget.myReferralPatientModel.referringDoctorRemarks}', - style: "bodyText1", - readMore: true, - textAlign: TextAlign.start, - maxLength: 100) - ], - ), - SizedBox( - height: 5, - ), - AppText( - 'Answer/Suggestions', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + ], + ), + Divider(color: Color(0xFF000000),height: 0.5,), + SizedBox( + height: 5, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Clinic Details and Remarks', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + textAlign: TextAlign.start,), + Texts( + '${widget.myReferralPatientModel.referringDoctorRemarks}', + style: "bodyText1", + readMore: true, textAlign: TextAlign.start, - ), - SizedBox( - height: 5, - ), - Form( - key: _formKey, - child: TextFields( - maxLines: 2, - minLines: 2, - hintText: 'Answer the patient', - fontWeight: FontWeight.normal, - initialValue: widget.myReferralPatientModel.referredDoctorRemarks ?? '', - readOnly: _isLoading, - validator: (value) { - if (value.isEmpty) - return "please enter answer"; - else - return null; - }, - ), - ), - SizedBox(height: 10.0), - SizedBox(height: 10.0), - Container( - width: double.infinity, - margin: EdgeInsets.only(left: 10,right: 10), - child: Button( - onTap: () async { - final form = _formKey.currentState; - if (form.validate()) { - setState(() { - _isLoading = true; - }); - try { - await Provider.of(context, listen: false).replay(answerController.text.toString(), widget.myReferralPatientModel); - setState(() { - _isLoading = false; - }); - DrAppToastMsg.showSuccesToast('Reply Successfully'); + maxLength: 100) + ], + ), + SizedBox( + height: 5, + ), + AppText( + 'Answer/Suggestions', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + textAlign: TextAlign.start, + ), + SizedBox( + height: 5, + ), + Form( + key: _formKey, + child: TextFields( + maxLines: 2, + minLines: 2, + hintText: 'Answer the patient', + fontWeight: FontWeight.normal, + initialValue: widget.myReferralPatientModel.referredDoctorRemarks ?? '', + readOnly: _isLoading, + validator: (value) { + if (value.isEmpty) + return "please enter answer"; + else + return null; + }, + ), + ), + SizedBox(height: 10.0), + SizedBox(height: 10.0), + Container( + width: double.infinity, + margin: EdgeInsets.only(left: 10,right: 10), + child: Button( + onTap: () async { + final form = _formKey.currentState; + if (form.validate()) { + setState(() { + _isLoading = true; + }); + try { + await Provider.of(context, listen: false).replay(answerController.text.toString(), widget.myReferralPatientModel); + setState(() { + _isLoading = false; + }); + DrAppToastMsg.showSuccesToast('Reply Successfully'); - } catch (e) { - setState(() { - _isLoading = false; - }); - DrAppToastMsg.showErrorToast(e); - } - } - }, - title: 'Reply', - loading: _isLoading, - ), - ) - ], + } catch (e) { + setState(() { + _isLoading = false; + }); + DrAppToastMsg.showErrorToast(e); + } + } + }, + title: 'Reply', + loading: _isLoading, ), ) + ], + ), + ) ], ), ), diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index 54cbcb30..45e4c793 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -7,12 +7,12 @@ import 'avatar_gradients.dart'; class LargeAvatar extends StatelessWidget { LargeAvatar( {Key key, - this.name, - this.url, - this.disableProfileView: false, - this.radius = 60.0, - this.width = 90, - this.height = 90}) + this.name, + this.url, + this.disableProfileView: false, + this.radius = 60.0, + this.width = 90, + this.height = 90}) : super(key: key); final String name; @@ -35,31 +35,33 @@ class LargeAvatar extends StatelessWidget { ), ), ); - } else if (name == null || name.isEmpty) { + } else if (name != null || name.isNotEmpty) { return Center( child: AppText( - 'DR', - color: Colors.white, - )); + name[0].toUpperCase(), + color: Colors.white, + fontSize: 18, + fontWeight: FontWeight.bold, + )); } else { return Center( child: AppText( - name[0].toUpperCase(), - color: Colors.white, - fontSize: 18, - fontWeight: FontWeight.bold, - )); + 'DR', + color: Colors.white, + )); } } @override Widget build(BuildContext context) { + var vlr = name; + var asd; return InkWell( onTap: disableProfileView ? null : () { - //TODO when we need that - }, + //TODO when we need that + }, child: Container( decoration: BoxDecoration( gradient: LinearGradient( From a3730e4efb78bd70dbd39018a5c6644548e051cb Mon Sep 17 00:00:00 2001 From: Mohammad ALjammal Date: Fri, 12 Jun 2020 09:57:29 +0300 Subject: [PATCH 10/10] fix issues with sultan branch --- lib/client/base_app_client.dart | 27 +++---- lib/config/config.dart | 4 +- lib/landing_page.dart | 9 +-- lib/screens/doctor/my_schedule_screen.dart | 75 +++++++++---------- lib/util/dr_app_shared_pref.dart | 10 +++ lib/util/helpers.dart | 36 +++++---- lib/widgets/doctor/doctor_reply_widget.dart | 24 +++++- lib/widgets/doctor/my_schedule_widget.dart | 2 + .../patients/profile/large_avatar.dart | 34 ++++----- lib/widgets/shared/app_drawer_widget.dart | 17 +---- .../shared/app_expandable_notifier.dart | 1 + lib/widgets/shared/app_scaffold_widget.dart | 16 ++-- 12 files changed, 133 insertions(+), 122 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 25b2450c..27fcb103 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -3,14 +3,9 @@ import 'dart:convert'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; -import 'package:http_interceptor/http_methods.dart'; -import 'package:http_interceptor/models/request_data.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = new Helpers(); @@ -32,15 +27,12 @@ Helpers helpers = new Helpers(); * */ class BaseAppClient { static post( - String endPoint, { - Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - }) async { + String endPoint, { + Map body, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + }) async { String url = BASE_URL + endPoint; - RequestData data = RequestData(body: body,baseUrl: url,method: Method.POST); - - try { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); @@ -49,8 +41,8 @@ class BaseAppClient { body['DoctorID'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID; body['ProjectID'] = doctorProfile?.projectID; - // if (!body.containsKey('ClinicID')) - body['ClinicID'] = doctorProfile?.clinicID; + // if (!body.containsKey('ClinicID')) + body['ClinicID'] = doctorProfile?.clinicID; } body['TokenID'] = token ?? ''; body['LanguageID'] = LANGUAGE_ID; @@ -64,7 +56,7 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - if (await Helpers.checkConnection()) { + if (await Helpers.checkConnection()) { final response = await http.post(url, body: json.encode(body), headers: { @@ -77,7 +69,8 @@ class BaseAppClient { } else { var parsed = json.decode(response.body.toString()); if (!parsed['IsAuthenticated']) { - Navigator.of(AppGlobal.CONTEX).pushNamed(LOGIN); + await helpers.logout(); + helpers.showErrorToast('Your session expired Please login agian'); } else if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); diff --git a/lib/config/config.dart b/lib/config/config.dart index 3ed6f076..2bd1256d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -2,8 +2,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -//const BASE_URL = 'https://hmgwebservices.com/Services/'; -const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; +const BASE_URL = 'https://hmgwebservices.com/Services/'; +//const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems_Region"; const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/landing_page.dart b/lib/landing_page.dart index a9f844f8..174a38ab 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -51,14 +51,7 @@ class _LandingPageState extends State { }, ), centerTitle: true, - actions: [ - ProfileImageWidget( - height: 50, - width: 50, - url: - "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", - ) - ], + ), drawer: Theme( data: Theme.of(context).copyWith( diff --git a/lib/screens/doctor/my_schedule_screen.dart b/lib/screens/doctor/my_schedule_screen.dart index cef7e881..36b449a7 100644 --- a/lib/screens/doctor/my_schedule_screen.dart +++ b/lib/screens/doctor/my_schedule_screen.dart @@ -6,8 +6,6 @@ import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indei import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../../config/size_config.dart'; -import '../../widgets/shared/app_scaffold_widget.dart'; class MyScheduleScreen extends StatelessWidget { ScheduleProvider scheduleProvider; @@ -15,47 +13,46 @@ class MyScheduleScreen extends StatelessWidget { @override Widget build(BuildContext context) { scheduleProvider = Provider.of(context); - return AppScaffold( - appBarTitle: TranslationBase.of(context).mySchedule, + return Scaffold( body: scheduleProvider.isLoading ? DrAppCircularProgressIndeicator() : scheduleProvider.isError - ? Center( - child: AppText( - scheduleProvider.error, - color: Theme.of(context).errorColor, - ), - ) - : scheduleProvider.listDoctorWorkingHoursTable.length == 0 - ? Center( - child: AppText( - TranslationBase.of(context).errorNoSchedule, - color: Theme.of(context).errorColor, - ), - ) - : Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: ListView( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 20, - ), + ? Center( + child: AppText( + scheduleProvider.error, + color: Theme.of(context).errorColor, + ), + ) + : scheduleProvider.listDoctorWorkingHoursTable.length == 0 + ? Center( + child: AppText( + TranslationBase.of(context).errorNoSchedule, + color: Theme.of(context).errorColor, + ), + ) + : Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: ListView( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), - scheduleListByDate(), - // scheduleListByDate('Wednesday, 8 April '), - ], - ), - ], - ), - ], - ), - ), + scheduleListByDate(), + // scheduleListByDate('Wednesday, 8 April '), + ], + ), + ], + ), + ], + ), + ), ); } diff --git a/lib/util/dr_app_shared_pref.dart b/lib/util/dr_app_shared_pref.dart index f75c171e..54c8cc45 100644 --- a/lib/util/dr_app_shared_pref.dart +++ b/lib/util/dr_app_shared_pref.dart @@ -82,4 +82,14 @@ class DrAppSharedPreferances { } return json.decode(string); } + + clear() async { + final SharedPreferences prefs = await _prefs; + prefs.clear(); + } + + remove(String key) async { + final SharedPreferences prefs = await _prefs; + prefs.remove(key); + } } diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index e05f0d74..ebcf817c 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -1,12 +1,16 @@ import 'package:doctor_app_flutter/models/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:doctor_app_flutter/config/config.dart'; import '../config/size_config.dart'; import '../util/dr_app_toast_msg.dart'; import 'package:connectivity/connectivity.dart'; +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); /* *@author: Elham Rababah @@ -48,10 +52,6 @@ class Helpers { onPressed: () { Navigator.pop(context); }, - // padding: const EdgeInsets.symmetric( - // horizontal: 16.0, - // vertical: 5.0, - // ), ), CupertinoButton( child: Text( @@ -97,7 +97,7 @@ class Helpers { children: items.map((item) { return Text( '${item["$decKey"]}', - style: TextStyle(fontSize: SizeConfig.textMultiplier * 3), + style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), ); }).toList(), @@ -164,14 +164,15 @@ class Helpers { ), ); } - /* + + /* *@author: Amjad Amireh *@Date:5/5/2020 *@param: checkDate *@return: DateTime *@desc: convert String to DateTime */ -static String checkDate(String dateString) { + static String checkDate(String dateString) { DateTime checkedTime = DateTime.parse(dateString); DateTime currentTime = DateTime.now(); @@ -257,6 +258,7 @@ static String checkDate(String dateString) { return "Sunday"; } } + /* *@author: Mohammad Aljammal *@Date:26/5/2020 @@ -275,6 +277,7 @@ static String checkDate(String dateString) { else return ""; } + /* *@author: Mohammad Aljammal *@Date:26/5/2020 @@ -301,13 +304,14 @@ static String checkDate(String dateString) { *@return: List *@desc: convert workingHours string to List */ - static List getWorkingHours(String workingHours ){ - List myWorkingHours =[]; + static List getWorkingHours(String workingHours) { + List myWorkingHours = []; List listOfHours = workingHours.split('a'); listOfHours.forEach((element) { WorkingHours workingHours = WorkingHours(); - var from = element.substring(element.indexOf('m ') + 2 , element.indexOf('To')-2); + var from = element.substring( + element.indexOf('m ') + 2, element.indexOf('To') - 2); workingHours.from = from.trim(); var to = element.substring(element.indexOf('To') + 2); workingHours.to = to.trim(); @@ -316,9 +320,6 @@ static String checkDate(String dateString) { return myWorkingHours; } - - - /* *@author: Elham Rababah *@Date:12/5/2020 @@ -333,4 +334,13 @@ static String checkDate(String dateString) { } return localMsg; } + + clearSharedPref() async { + await sharedPref.clear(); + } + + logout() async { + await clearSharedPref(); + Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); + } } diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index 5ec30858..6fc9ec66 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/list_gt_my_pationents_question_model.dart'; +import 'package:doctor_app_flutter/presentation/doctor_app_icons.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; @@ -42,7 +43,28 @@ class _DoctorReplyWidgetState extends State { child: Row( children: [ SizedBox(width: 5,), - LargeAvatar(name: widget.reply.patientName,url: '',), + //LargeAvatar(icon: widget.reply.gender == 0 ? DoctorApp.male : DoctorApp.femaleicon ,), + Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment(-1, -1), + end: Alignment(1, 1), + colors: [ + Colors.grey[100], + Colors.grey[200], + ]), + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(50.0)), + ), + width: 80, + height: 80, + child: Icon(widget.reply.gender == 1 ? DoctorApp.male : DoctorApp.femaleicon,size: 80,)), + SizedBox(width: 15,), Expanded( child: Container( diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index c37d09ad..48f70d7c 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -45,6 +45,7 @@ class MyScheduleWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText('From',fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.bold,), + SizedBox(height: 5,), AppText(work.from,fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,) ], ), @@ -56,6 +57,7 @@ class MyScheduleWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText('To',fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.bold,), + SizedBox(height: 5,), AppText(work.to,fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,) ], ), diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index 45e4c793..d18fdf3d 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -7,12 +7,12 @@ import 'avatar_gradients.dart'; class LargeAvatar extends StatelessWidget { LargeAvatar( {Key key, - this.name, - this.url, - this.disableProfileView: false, - this.radius = 60.0, - this.width = 90, - this.height = 90}) + this.name, + this.url, + this.disableProfileView: false, + this.radius = 60.0, + this.width = 90, + this.height = 90}) : super(key: key); final String name; @@ -35,20 +35,20 @@ class LargeAvatar extends StatelessWidget { ), ), ); - } else if (name != null || name.isNotEmpty) { + } else if (name == null || name.isEmpty) { return Center( child: AppText( - name[0].toUpperCase(), - color: Colors.white, - fontSize: 18, - fontWeight: FontWeight.bold, - )); + 'DR', + color: Colors.white, + )); } else { return Center( child: AppText( - 'DR', - color: Colors.white, - )); + name[0].toUpperCase(), + color: Colors.white, + fontSize: 18, + fontWeight: FontWeight.bold, + )); } } @@ -60,8 +60,8 @@ class LargeAvatar extends StatelessWidget { onTap: disableProfileView ? null : () { - //TODO when we need that - }, + //TODO when we need that + }, child: Container( decoration: BoxDecoration( gradient: LinearGradient( diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 53228c97..919dc939 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -89,35 +89,24 @@ class _AppDrawerState extends State { }, ), ), - InkWell( - child: DrawerItem("My Schedule", Icons.table_chart), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ChangeNotifierProvider( - create: (_) => ScheduleProvider(), - child: MyScheduleScreen(), - ), - ), - ); - }, - ), InkWell( child: DrawerItem("Settings", Icons.settings), onTap: () { + Navigator.pop(context); Navigator.of(context).pushNamed(SETTINGS); }, ), InkWell( child: DrawerItem("QR Reader", Icons.search), onTap: () { + Navigator.pop(context); Navigator.of(context).pushNamed(QR_READER); }, ), InkWell( child: DrawerItem("lOGOUT", Icons.exit_to_app), onTap: () { + Navigator.pop(context); Navigator.of(context).pushNamed(LOGIN); }, ), diff --git a/lib/widgets/shared/app_expandable_notifier.dart b/lib/widgets/shared/app_expandable_notifier.dart index ca3edd09..4ae87e8a 100644 --- a/lib/widgets/shared/app_expandable_notifier.dart +++ b/lib/widgets/shared/app_expandable_notifier.dart @@ -30,6 +30,7 @@ class AppExpandableNotifier extends StatelessWidget { padding: EdgeInsets.all(10), child: Text( "See Graph Details", + style: TextStyle(fontWeight: FontWeight.bold), )), collapsed: Text(''), expanded: bodyWid, diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 1e6da3fc..263e3848 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -1,13 +1,8 @@ import 'package:doctor_app_flutter/routes.dart'; -import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; - -import '../../config/size_config.dart'; import '../../presentation/doctor_app_icons.dart'; -import '../../widgets/shared/app_drawer_widget.dart'; import '../../widgets/shared/app_loader_widget.dart'; -import '../../widgets/shared/custom_shape_clipper.dart'; class AppScaffold extends StatelessWidget { String appBarTitle; @@ -37,12 +32,11 @@ class AppScaffold extends StatelessWidget { }), centerTitle: true, actions: [ - ProfileImageWidget( - height: 50, - width: 50, - url: - "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", - ) + IconButton( + icon: Icon(DoctorApp.home_icon_active), + color: Colors.white, //Colors.black, + onPressed: () => Navigator.pushReplacementNamed(context, HOME), + ), ], ) : null,