diff --git a/android/app/build.gradle b/android/app/build.gradle index 5d196986..faff5fa6 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,6 +26,12 @@ apply plugin: 'kotlin-android' apply plugin: 'com.google.gms.google-services' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('key.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + android { compileSdkVersion 30 @@ -34,7 +40,9 @@ android { } lintOptions { - disable 'InvalidPackage' +// disable 'InvalidPackage' + checkReleaseBuilds false + abortOnError false } defaultConfig { @@ -48,21 +56,35 @@ android { } + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword keystoreProperties['storePassword'] + } + } + buildTypes { debug {} release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - staging { - // Specifies a sorted list of fallback build types that the - // plugin should try to use when a dependency does not include a - // "staging" build type. You may specify as many fallbacks as you - // like, and the plugin selects the first build type that's - // available in the dependency. - matchingFallbacks = ['debug', 'qa', 'release'] +// signingConfig signingConfigs.debug +// useProguard true + +// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + + signingConfigs.release } +// staging { +// // Specifies a sorted list of fallback build types that the +// // plugin should try to use when a dependency does not include a +// // "staging" build type. You may specify as many fallbacks as you +// // like, and the plugin selects the first build type that's +// // available in the dependency. +// matchingFallbacks = ['debug', 'qa', 'release'] +// } } } diff --git a/android/app/google-services.json b/android/app/google-services.json index f86832ad..a4655794 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -1,39 +1,37 @@ { "project_info": { - "project_number": "815750722565", - "firebase_url": "https://api-project-815750722565.firebaseio.com", - "project_id": "api-project-815750722565", - "storage_bucket": "api-project-815750722565.appspot.com" + "project_number": "864393916058", + "firebase_url": "https://diplomaticquarter-d2385.firebaseio.com", + "project_id": "diplomaticquarter-d2385", + "storage_bucket": "diplomaticquarter-d2385.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063", + "mobilesdk_app_id": "1:864393916058:android:5b5a65cd6d8c18b4b97923", "android_client_info": { "package_name": "com.cloud.diplomaticquarterapp" } }, "oauth_client": [ { - "client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com", + "client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyDUfg6AKM1-00WyzpvLImUBC46wFrq9-qw" + "current_key": "AIzaSyBdV3mos1BPhUzNKCj2KANJtiO3o2zh9IM" } ], "services": { - "analytics_service": { - "status": 1 - }, "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 + "other_platform_oauth_client": [ + { + "client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com", + "client_type": 3 + } + ] } } } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d0751535..12ced804 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -24,7 +24,7 @@ android:name="io.flutter.app.FlutterApplication" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true" - android:label="diplomaticquarterapp"> + android:label="Dr. Alhabib MC"> CFBundleVersion 1.0 MinimumOSVersion - 8.0 + 9.0 diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist deleted file mode 100644 index 0c093a2a..00000000 --- a/ios/GoogleService-Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CLIENT_ID - 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r - API_KEY - AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs - GCM_SENDER_ID - 864393916058 - PLIST_VERSION - 1 - BUNDLE_ID - com.cloud.diplomaticquarterapp - PROJECT_ID - diplomaticquarter-d2385 - STORAGE_BUCKET - diplomaticquarter-d2385.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:864393916058:ios:13f787bbfe6051f8b97923 - DATABASE_URL - https://diplomaticquarter-d2385.firebaseio.com - - \ No newline at end of file diff --git a/ios/Podfile b/ios/Podfile index c2702b3e..1d1a003e 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '11.0' +platform :ios, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -10,82 +10,32 @@ project 'Runner', { 'Release' => :release, } -# pod 'FBSDKCoreKit' -# pod 'FBSDKLoginKit' - -def parse_KV_file(file, separator='=') - file_abs_path = File.expand_path(file) - if !File.exists? file_abs_path - return []; +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 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 + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches end - generated_key_values + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + 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 + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end post_install do |installer| installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' - end + flutter_additional_ios_build_settings(target) end -end - +end \ No newline at end of file diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140cf..31d8d1f5 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - - - - + + - - + DisableBuildSystemDeprecationWarning + PreviewsEnabled diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index 23dd69b8..70693e4a 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -1,6 +1,5 @@ import UIKit import Flutter -import GoogleMaps @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { @@ -8,7 +7,6 @@ import GoogleMaps _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8") GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index d36b1fab..65b74d7e 100644 --- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,122 +1 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} +{"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"72x72","expected-size":"72","filename":"72.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"76x76","expected-size":"152","filename":"152.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"50x50","expected-size":"100","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"76x76","expected-size":"76","filename":"76.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"50x50","expected-size":"50","filename":"50.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"72x72","expected-size":"144","filename":"144.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"40x40","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"83.5x83.5","expected-size":"167","filename":"167.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"20x20","expected-size":"20","filename":"20.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"}]} \ No newline at end of file diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada47..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd96..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde1211..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd96..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b860..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b860..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d3..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f585..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2f..00000000 --- a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eac..00000000 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eac..00000000 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eac..00000000 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b..00000000 --- a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard index 00abc512..f3c28516 100644 --- a/ios/Runner/Base.lproj/Main.storyboard +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -1,10 +1,8 @@ - - - + + - - + @@ -16,14 +14,13 @@ - + - + - diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index 0c093a2a..00000000 --- a/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CLIENT_ID - 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r - API_KEY - AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs - GCM_SENDER_ID - 864393916058 - PLIST_VERSION - 1 - BUNDLE_ID - com.cloud.diplomaticquarterapp - PROJECT_ID - diplomaticquarter-d2385 - STORAGE_BUCKET - diplomaticquarter-d2385.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:864393916058:ios:13f787bbfe6051f8b97923 - DATABASE_URL - https://diplomaticquarter-d2385.firebaseio.com - - \ No newline at end of file diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index b807d9c6..6a2a87ce 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Dr. Alhabib MC CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -11,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - diplomaticquarterapp + DiplomaticQuarter CFBundlePackageType APPL CFBundleShortVersionString @@ -22,27 +24,47 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS - io.flutter.embedded_views_preview - + NSBluetoothAlwaysUsageDescription + This App requires access to Bluetooth to connect blood pressure & blood sugar devices with the app to analyze the data. + NSBluetoothPeripheralUsageDescription + This App requires access to Bluetooth to connect blood pressure & blood sugar devices with the app to analyze the data. + NSCalendarsUsageDescription + This app requires calendar access to set reminders for Virtual & Normal Appointments. + NSCameraUsageDescription + This app requires camera access to enable virtual consultation between patient & doctor + NSContactsUsageDescription + This app requires contacts access to show incoming virtual consultation request. + NSFaceIDUsageDescription + This app requires Face ID to allow biometric authentication for app login. + NSLocationAlwaysAndWhenInUseUsageDescription + This App requires access to your location to show the nearest hospitals & ER Locations from your location. + NSLocationAlwaysUsageDescription + This App requires access to your location to show the nearest hospitals from your location. + NSLocationWhenInUseUsageDescription + This App requires access to your location to show the nearest hospitals from your location. + NSMicrophoneUsageDescription + This app requires microphone access to enable virtual consultation between patient & doctor + NSMotionUsageDescription + This app requires motion detection access to function properly. + NSPhotoLibraryUsageDescription + This app requires photo library access to select image as document & upload it. + NSRemindersUsageDescription + This app requires calendar access to set reminders for Virtual & Normal Appointments. + NSSpeechRecognitionUsageDescription + This app requires access to speech recognition to identify which words are spoken into the microphone. + NSAppleMusicUsageDescription + Required usage description for a Flutter dependency + UIBackgroundModes + + remote-notification + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main - NSMicrophoneUsageDescription - Need microphone access for uploading videos - NSCameraUsageDescription - Need camera access for uploading images - NSLocationUsageDescription - Need location access for updating nearby friends - NSLocationWhenInUseUsageDescription - This app will use your location to show cool stuffs near you. - NSPhotoLibraryUsageDescription - Need photo library access for uploading images UISupportedInterfaceOrientations UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad @@ -53,5 +75,7 @@ UIViewControllerBasedStatusBarAppearance + io.flutter.embedded_views_preview + diff --git a/key.properties b/key.properties index 01c8cbe8..eec491b8 100644 --- a/key.properties +++ b/key.properties @@ -1,4 +1,4 @@ storePassword=HmGsa123 keyPassword=HmGsa123 -keyAlias=DQKey +keyAlias=key storeFile=DQKey.jks \ No newline at end of file diff --git a/lib/config/config.dart b/lib/config/config.dart index ebca956b..81c5f2e4 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,15 +6,21 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; const MAX_SMALL_SCREEN = 660; - - const BASE_URL = 'https://uat.hmgwebservices.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; +//weather +const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; + ///Doctor const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; +const GET_DOCTOR_RATING_NOTES = + 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; +const GET_DOCTOR_RATING_DETAILS = + 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; ///Prescriptions @@ -251,7 +257,7 @@ const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; var DEVICE_TOKEN = ""; var DeviceTypeID = Platform.isIOS ? 1 : 2; -const LANGUAGE_ID = 2; +const LANGUAGE_ID = 1; const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const GET_PAtIENTS_INSURANCE = @@ -259,8 +265,7 @@ const GET_PAtIENTS_INSURANCE = const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; -const INSURANCE_DETAILS = - "Services/Patients.svc/REST/Get_InsuranceCheckList"; +const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f0ae09c5..2891da6c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -111,10 +111,7 @@ const Map localizedValues = { 'login': {'en': 'Login', 'ar': 'تسجيل الدخول'}, 'loginregister': {'en': 'Login / Register', 'ar': 'تسجيل الدخول'}, 'poweredBy': {'en': 'Powered By', 'ar': 'مشغل بواسطة'}, - "welcome": { - "en": "Welcome", - "ar": "مرحبا" - }, + "welcome": {"en": "Welcome", "ar": "مرحبا"}, "welcome_text": { "en": "Dr. Sulaiman Al Habib Mobile Application", "ar": "الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك" @@ -130,12 +127,11 @@ const Map localizedValues = { "ar": "اختر من الخيارات أدناه لتسجيل الدخول إلى ملفك الطبي." }, "registernow": {"en": "Register Now", "ar": "تسجيل الان"}, - "nationalID": { "en": "Enter the Identification Number", - "ar": "أدخل رقم الهوية الوطنية او الاقامة"}, - "national-id": { - "en": "National ID", - "ar": "رقم الهوية" + "nationalID": { + "en": "Enter the Identification Number", + "ar": "أدخل رقم الهوية الوطنية او الاقامة" }, + "national-id": {"en": "National ID", "ar": "رقم الهوية"}, "fileNo": {"en": "File Number", "ar": "رقم الملف"}, "fileno": {"en": "File No", "ar": "رقم الملف"}, "forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"}, @@ -191,8 +187,8 @@ const Map localizedValues = { 'ar': 'الرجائ ادخال اسم الدواء' }, "verification_message": { - "en": "Please enter verification code", - "ar": "الرجاء إدخال رمز التحقق" + "en": "Please enter the Verification Code sent to", + "ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى" }, "validation_message": { "en": "The verification code expires in", @@ -526,11 +522,11 @@ const Map localizedValues = { "PaymentOnline": {"en": "Service", "ar": "الالكتروني"}, "OnlineCheckIn": {"en": "Online Check-In", "ar": "مدفوعات معلقة"}, "MyBalances": {"en": "My Balances", "ar": "رصيدي"}, - "BalanceAmount": {"en": "Balance Amount", "ar": "رصيدالحساب"}, - "TotalBalance": {"en": "Total Balance", "ar": "الرصيد الكلي"}, + "BalanceAmount": { "en": "Wallet Amount", "ar": "مبلغ المحفظة"}, + "TotalBalance": { "en": "Total Amount", "ar": "المبلغ الإجمالي"}, "CreateAdvancedPayment": { - "en": "Create Advanced Payment", - "ar": "إنشاء دفعة مقدمة" + "en": "Recharge Wallet", + "ar": "إعادة شحن المحفظة" }, "AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"}, "AdvancePaymentLabel": { @@ -912,8 +908,14 @@ const Map localizedValues = { "LiveChat": {"en": "Live Chat", "ar": "محادثة مباشرة"}, "Service": {"en": "Service", "ar": "خدمة"}, "HMGServiceLabel": {"en": "HMG Service", 'ar': 'خدمات الحبيب'}, - "HealthWeatherIndicators": {"en": "Health Weather Indicators", 'ar': ' مؤشرات الطقس الصحية '}, - "HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية على أساس الطقس الحالي '}, + "HealthWeatherIndicators": { + "en": "Health Weather Indicators", + 'ar': ' مؤشرات الطقس الصحية ' + }, + "HealthTipsBasedOnCurrentWeather": { + "en": "Health Tips Based On Current Weather", + 'ar': ' نصائح صحية على أساس الطقس الحالي ' + }, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, "ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"}, @@ -922,154 +924,281 @@ const Map localizedValues = { "Average": {"en": "Average", "ar": "المعدل"}, "DailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, "Period": {"en": "Period", "ar": "الفترة"}, - "cm": { - "en": "CM", - "ar": "سم" + "cm": {"en": "CM", "ar": "سم"}, + "kg": {"en": "kg", "ar": "كجم"}, + "mass": {"en": "Mass", "ar": "كتلة"}, + "temp-c": {"en": "°C", "ar": "°س"}, + "bpm": {"en": "bpm", "ar": "نبضة"}, + "respiration-signs": {"en": "Respiration", "ar": "تنفس"}, + "sys-dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"}, + "body": {"en": "Body \n Mass", "ar": "كتلة\nالجسم"}, + "feedback": {"en": "Feedback", "ar": "رأيك يهمنا"}, + "send": {"en": "Send", "ar": "أرسل"}, + "status": {"en": "Status", "ar": "الحالة"}, + "like-to-hear": { + "en": + "We would love to hear the feedback, concerns on healthcare services and eServices experience. Please use the below form", + "ar": + "يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة" }, - "kg": { - "en": "kg", - "ar": "كجم" + "subject": {"en": "Subject", "ar": "الموضوع"}, + "message": {"en": "Message", "ar": "رسالة"}, + "empty-subject": { + "en": "Please enter the subject", + "ar": "يرجى ادخال الموضوع" }, - "mass": { - "en": "Mass", - "ar": "كتلة" + "empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"}, + "select-attachment": {"en": "Select Attachment", "ar": "إختر المرفق"}, + "complain-appo": {"en": "Complaint for appointment", "ar": "شكوى على موعد"}, + "complain-without-appo": { + "en": "Complaint without appointment", + "ar": "شكوى بدون موعد" }, - "temp-c": { - "en": "°C", - "ar": "°س" + "question": {"en": "Question", "ar": "سؤال"}, + "message-type": {"en": "Message Type", "ar": "نوع الرسالة"}, + "compliment": {"en": "compliment", "ar": "ثناء"}, + "suggestion": {"en": "Suggestion", "ar": "إقتراح"}, + "your-feedback": {"en": "Your feedback was sent", "ar": "إقتراح"}, + "select-part": { + "en": "Please select the part that complain about", + "ar": "يرجى تحديد الجزء الذي تشكو منه" }, - "bpm": { - "en": "bpm", - "ar": "نبضة" + "number": {"en": "Number", "ar": "الرقم"}, + "not-classified": {"en": "Not classified", "ar": "غير محدد"}, + "selectClinic": {"en": "Select Clinic", "ar": " بحث بالعيادة"}, + "reviews": {"en": "Reviews", "ar": "تقييمات"}, + "searchItemError": { + "en": "Item name should be more than 3 character ", + "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف" }, - "respiration-signs": { - "en": "Respiration", - "ar": "تنفس" + "YouCanFind": {"en": "You Can Find ", "ar": "باستطاعتك العثور على "}, + "ItemInSearch": {"en": " Item In Search", "ar": " عنصر في البحث "}, + "InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"}, + "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, + "GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"}, + "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, + + "value": {"en": "Value", "ar": "القيمة"}, + "range": {"en": "Range", "ar": "المدى"}, + "out-patient": {"en": "Out Patient", "ar": "عيادات خارجية"}, + "in-patient": {"en": "In Patient", "ar": "تنويم"}, + "report": {"en": "Radiology Report", "ar": "تقرير الاشعة"}, + "open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"}, + "send-copy": {"en": "Email the Report", "ar": "أرسل التقرير"}, + "appoSurvey": {"en": "Survey", "ar": "إستبيان"}, + "appoSurveySubtitle": {"en": "Survey", "ar": "إستبيان"}, + "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, + "doctorRating": {"en": "Doctor Rating", "ar": "تقييم الطبيب"}, + "good": {"en": "Good", "ar": "جيد"}, + "v-good": {"en": "Very Good", "ar": "جيد جدا"}, + "excellent": {"en": "Excellent", "ar": "ممتاز"}, + "average": {"en": "Average", "ar": "متوسط"}, + "below-average": {"en": "Below Average", "ar": "أقل من المتوسط"}, + "info-signs": { + "en": + "This service allows you to view all vital signs were performed in the Habib Medical Group, e.x (height, weight, body mass index, heart rate, etc.) as well shows some statistics charts.", + "ar": + "خدمة المؤشرات الحيوية: هذه الخدمة تمكنك من الاطلاع على جميع المؤشرات الحيوية على سبيل المثال (الطول، الوزن، مؤشر كتلة الجسم، معدل نبضات القلب الخ..) التي تمت في مجموعة الحبيب الطبية وكذلك رسوم بيانية على مستوى المؤشر." }, - "sys-dias": { - "en": "SBP/DBP", - "ar": "إنقباض/إنبساط" + "info-advance-payment": { + "en": + "This service designed so that you can deposit an amount in advance either in your account or in someone else's account with Al Habib Medical Group.", + "ar": + "تم تصميم هذه الخدمة حتى تتمكن من دفع مبلغ مقدما او تحت الحساب سواء في حسابك او في حساب شخص اخر لدى مجموعة الحبيب الطبية." }, - "body": { - "en": "Body \n Mass", - "ar": "كتلة\nالجسم" + "info-my-balance": { + "en": "This service allows you to check your balance in all branchs", + "ar": "هذه الخدمه تتيح لك الاطلاع رصيدك في كل الفروع" }, - "feedback": { - "en": "Feedback", - "ar": "رأيك يهمنا" + "er-contant": { + "en": + "This service displays nearest branch among all the branches of Al Habib Medical Group based on your current location.", + "ar": + "تعرض هذه الخدمة أقرب فرع من بين جميع فروع مجموعة الحبيب الطبية بناءً على موقعك الحالي." }, - "send": { - "en": "Send", - "ar": "أرسل" + "er": {"en": "ER", "ar": "الطوارىء"}, + "transportation-Service": {"en": "Ambulance Request", "ar": "طلب نقل اسعاف"}, + "info-ambulance": { + "en": + "Through this service, you can request evacuation by ambulance, whether from home or to home, in addition to a set of other services", + "ar": + "عن طريق هذه الخدمة يمكنك طلب اخلاء بواسطة سيارة اسعاف سواء من المزل او الى المنزل بالاضافة الى مجموعة من الخدمات الاخرى" + }, + "RRT-transport-heading": { + "en": "Select Transportation Method", + "ar": "حدد طريقة النقل" + }, + "sar": {"en": "SR", "ar": "ر.س"}, + "RRT-direction-heading": {"en": "Select Direction", "ar": "حدد الاتجاه"}, + "to-hospital": {"en": "To Hospital", "ar": "الى المستشفى"}, + "from-hospital": {"en": "From Hospital", "ar": "من المستشفى"}, + "one-direc": {"en": "One Way", "ar": "ذهاب"}, + "two-direc": {"en": "Two Ways", "ar": "ذهاب وعودة"}, + "pickup-location": {"en": "Pickup Location", "ar": "نقطة الانطلاق"}, + "pickup-spot": {"en": "Pickup Spot", "ar": "نقطة اللقاء"}, + "inside-home": {"en": "Inside Home", "ar": "داخل المنزل"}, + "have-appo": {"en": "Do you have an appointment?", "ar": "هل لديك موعد؟"}, + "dropoff-location": {"en": "Dropoff Location", "ar": "نقطة الوصول"}, + "select-all": { + "en": "Please select all fields", + "ar": "يرجى تحديد جميع الحقول" + }, + "select-map": {"en": "Select From Map", "ar": "حدد من الخريطة"}, + "no-appointment": { + "en": "You don't have any appointments yet", + "ar": "ليس لديك أي مواعيد حتى الآن" + }, + "patient-share": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"}, + "patient-share-tax": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"}, + "patient-share-total": { + "en": "Total amount payable: ", + "ar": "المبلغ الإجمالي المستحق:" }, - "status": { - "en": "Status", - "ar": "الحالة" + "select-ambulate": {"en": "Select Ambulate", "ar": "بحاجة للتنقل بواسطة"}, + "wheelchair": {"en": "Wheelchair", "ar": "كرسي متحرك"}, + "walker": {"en": "Walker", "ar": "مشاية"}, + "stretcher": {"en": "Stretcher", "ar": "نقالة"}, + "none": {"en": "None", "ar": "لا شيء"}, + "RRT-Summary": {"en": "Summary", "ar": "ملخص الطلب"}, + "bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"}, + "transport-method": {"en": "Transportation Method", "ar": "طريقة النقل"}, + "directions": {"en": "Directions", "ar": "الاتجاهات"}, + "info-my-appointments": { + "en": + "This service allows you to see all the appointment you have visited in Al Habib Medical Group, and through this service:", + "ar": + "خدمة مواعيدي: هذه الخدمة تمكنك من الاطلاع على جميع المواعيد التي قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" }, - "like-to-hear": { - "en": "We would love to hear the feedback, concerns on healthcare services and eServices experience. Please use the below form", - "ar": "يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة" + "info-todo": { + "en": + "This service is designed to enable you to have a quick link to the list of tasks that need to be done", + "ar": + "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها" }, - "subject": { - "en": "Subject", - "ar": "الموضوع" + "family-info": { + "en": + "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", + "ar": + "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." }, - "message": { - "en": "Message", - "ar": "رسالة" + "dental-complains": { + "en": "Symptoms", + "ar": "الأعراض" }, - "empty-subject": { - "en": "Please enter the subject", - "ar": "يرجى ادخال الموضوع" + "empty-result": { + "en": "There is no search results found", + "ar": "لايوجد نتائج" }, - "empty-message": { - "en": "Please enter message", - "ar": "يرجى ادخال الموضوع" + + "no-booked-appointment": { + "en": "No booked appointments", + "ar": "لا يوجد مواعيد محجوزة" }, - "select-attachment": { - "en": "Select Attachment", - "ar": "إختر المرفق" + "no-confirmed-appointment": { + "en": "No confirmed appointments", + "ar": "لا توجد مواعيد مؤكدة" }, - "complain-appo": { - "en": "Complaint for appointment", - "ar": "شكوى على موعد" + "no-arrived-appointment": { + "en": "No arrived appointments", + "ar": "لا يوجد مواعيد" }, - "complain-without-appo": { - "en": "Complaint without appointment", - "ar": "شكوى بدون موعد" + "upcoming-empty": { + "en": "You do not have any Todo actions yet.", + "ar": "ليس لديك أي إجراءات الآن." }, - "question": { - "en": "Question", - "ar": "سؤال" + "upcoming-timeLeft": { + "en": "time left for appointment", + "ar": "الوقت المتبقي للموعد" }, - "message-type": { - "en": "Message Type", - "ar": "نوع الرسالة" + "covid-test-all-services": { + "en": "Covid-19 Drive-Thru Test", + "ar": "فحص كورونا من داخل السيارة" }, - "compliment": { - "en": "compliment", - "ar": "ثناء" + "pharmacy": { + "en": "Pharmacy", + "ar": "الصيدلية" }, - "suggestion": { - "en": "Suggestion", - "ar": "إقتراح" + "ereferral": { + "en": "E-Referral", + "ar": "طلب التحويل" }, - "your-feedback": { - "en": "Your feedback was sent", - "ar": "إقتراح" + "child-vaccine": { + "en": "Child Vaccines", + "ar": "تطعيمات الأطفال" }, - "select-part": { - "en": "Please select the part that complain about", - "ar": "يرجى تحديد الجزء الذي تشكو منه" + "calculators": { + "en": "Health Calculators", + "ar": "الحاسبات الصحية" }, - "number": { - "en": "Number", - "ar": "الرقم" + "converters": { + "en": "Health Converter", + "ar": "تحويل القياسات" }, - "not-classified": { - "en": "Not classified", - "ar": "غير محدد" + "h2o": { + "en": "Water Tracker", + "ar": "حساب كمية الماء" }, - "selectClinic": {"en": "Select Clinic", "ar": " بحث بالعيادة"}, - "reviews": {"en": "Reviews", "ar": "تقييمات"}, - "searchItemError": {"en": "Item name should be more than 3 character ", "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف"}, - "YouCanFind": {"en": "YouCanFind", "ar": "باستطاعتك العثور على "}, - "ItemInSearch": {"en": " Item In Search", "ar": " عنصر في البحث "}, - "InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"}, - "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, - "GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"}, - "show-more-btn": { - "en": "Flow Chart", - "ar": "النتائج التراكمية" + "v-tour": { + "en": "Virtual Tour", + "ar": "جولة إفتراضية" }, - - "value": { - "en": "Value", - "ar": "القيمة" + "hmg-news": { + "en": "HMG News", + "ar": "أخبار المجموعة" + }, + "blood-d": { + "en": "Blood Donation", + "ar": "تبرع بالدم" }, - "range": { - "en": "Range", - "ar": "المدى" + "symptomCheckerTitle": { + "en": "Symptom Checker", + "ar": "مدقق الأعراض" }, - "out-patient": { - "en": "Out Patient", - "ar": "عيادات خارجية" + "latest-news": { + "en": "Latest News", + "ar": "أحدث الأخبار" }, - "in-patient": { - "en": "In Patient", - "ar": "تنويم" + "our-location": { + "en": "Our Locations", + "ar": "موقعنا" }, - "report": { - "en": "Radiology Report", - "ar": "تقرير الاشعة" + "pharmacies": { + "en": "Pharmacies", + "ar": "الصيدليات" }, - "open-rad": { - "en": "Open Image", - "ar": "فتح صور الاشعة" + "hospitals": { + "en": "Hospitals", + "ar": "المستشفيات" }, - "send-copy": { - "en": "Email the Report", - "ar": "أرسل التقرير" + "wallet": { + "en": "Wallet", + "ar": "محفظة نقود" + }, + "hmg": { + "en": "Al Habib", + "ar": "الحبيب" + }, + + "requested": { + "en": "Requested", + "ar": "مطلوب" + }, + "ready": { + "en": "Ready", + "ar": "جاهز" + }, + "completed": { + "en": "Completed", + "ar": "مكتمل" + }, + "cancelled": { + "en": "Cancelled", + "ar": "ملغى" + }, + + "request-medical-report": { + "en": "Request medical report", + "ar": "طلب تقرير طبي" }, "vaccination": { diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index b79edb08..e5c5c965 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -19,4 +19,5 @@ const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment'; const IS_VIBRATION = 'is_vibration'; const THEME_VALUE = 'is_vibration'; const MAIN_USER = 'main-user'; +const WEATHER = 'weather'; const PHARMACY_LAST_VISITED_PRODUCTS = 'last-visited'; diff --git a/lib/core/model/ImagesInfo.dart b/lib/core/model/ImagesInfo.dart new file mode 100644 index 00000000..5ab48fb3 --- /dev/null +++ b/lib/core/model/ImagesInfo.dart @@ -0,0 +1,6 @@ +class ImagesInfo { + final String imageAr; + final String imageEn; + + ImagesInfo({this.imageAr, this.imageEn}); +} diff --git a/lib/core/model/pharmacies/pharmacies_list_model.dart b/lib/core/model/pharmacies/pharmacies_list_model.dart index 01a43a0a..a10389b5 100644 --- a/lib/core/model/pharmacies/pharmacies_list_model.dart +++ b/lib/core/model/pharmacies/pharmacies_list_model.dart @@ -4,7 +4,7 @@ class PharmaciesListModel { int languageID; String stamp; String iPAdress; - double versionID; + dynamic versionID; String tokenID; String sessionID; bool isLoginForDoctorApp; @@ -14,7 +14,7 @@ class PharmaciesListModel { int editedBy; int projectID; int clinicID; - double price; + dynamic price; String imageLocation; String desLocation; String itemDes; diff --git a/lib/core/model/weahter/weather_model.dart b/lib/core/model/weahter/weather_model.dart new file mode 100644 index 00000000..7ee84bac --- /dev/null +++ b/lib/core/model/weahter/weather_model.dart @@ -0,0 +1,266 @@ +class WeatherIndicatorModel { + Null date; + int languageID; + int serviceName; + Null time; + Null androidLink; + Null authenticationTokenID; + Null data; + bool dataw; + int dietType; + Null errorCode; + Null errorEndUserMessage; + Null errorEndUserMessageN; + Null errorMessage; + int errorType; + int foodCategory; + Null iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + Null patientBlodType; + Null successMsg; + Null successMsgN; + Null citiesList; + Null cityName; + Null get5DaysWeatherForecastList; + List getCityInfoList; + Null getTodayWeatherForecastList; + Null iniciesList; + + WeatherIndicatorModel( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.citiesList, + this.cityName, + this.get5DaysWeatherForecastList, + this.getCityInfoList, + this.getTodayWeatherForecastList, + this.iniciesList}); + + WeatherIndicatorModel.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + citiesList = json['CitiesList']; + cityName = json['CityName']; + get5DaysWeatherForecastList = json['Get5DaysWeatherForecastList']; + if (json['GetCityInfo_List'] != null) { + getCityInfoList = new List(); + json['GetCityInfo_List'].forEach((v) { + getCityInfoList.add(new GetCityInfoList.fromJson(v)); + }); + } + getTodayWeatherForecastList = json['GetTodayWeatherForecastList']; + iniciesList = json['IniciesList']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['CitiesList'] = this.citiesList; + data['CityName'] = this.cityName; + data['Get5DaysWeatherForecastList'] = this.get5DaysWeatherForecastList; + if (this.getCityInfoList != null) { + data['GetCityInfo_List'] = + this.getCityInfoList.map((v) => v.toJson()).toList(); + } + data['GetTodayWeatherForecastList'] = this.getTodayWeatherForecastList; + data['IniciesList'] = this.iniciesList; + return data; + } +} + +class GetCityInfoList { + CategoriesNames categoriesNames; + String category; + String categoryValue; + int cityID; + String cityName; + String cityNameN; + String colorName; + String createdOn; + String iD; + int iniceID; + bool isOrderEmpty; + bool isValuesReversed; + bool language; + double latitude; + double longitude; + String name; + int orderNum; + double temperature; + String value; + + GetCityInfoList( + {this.categoriesNames, + this.category, + this.categoryValue, + this.cityID, + this.cityName, + this.cityNameN, + this.colorName, + this.createdOn, + this.iD, + this.iniceID, + this.isOrderEmpty, + this.isValuesReversed, + this.language, + this.latitude, + this.longitude, + this.name, + this.orderNum, + this.temperature, + this.value}); + + GetCityInfoList.fromJson(Map json) { + categoriesNames = json['CategoriesNames'] != null + ? new CategoriesNames.fromJson(json['CategoriesNames']) + : null; + category = json['Category']; + categoryValue = json['CategoryValue']; + cityID = json['CityID']; + cityName = json['CityName']; + cityNameN = json['CityNameN']; + colorName = json['ColorName']; + createdOn = json['CreatedOn']; + iD = json['ID']; + iniceID = json['IniceID']; + isOrderEmpty = json['IsOrderEmpty']; + isValuesReversed = json['IsValuesReversed']; + language = json['Language']; + latitude = json['Latitude']; + longitude = json['Longitude']; + name = json['Name']; + orderNum = json['OrderNum']; + temperature = json['Temperature']; + value = json['Value']; + } + + Map toJson() { + final Map data = new Map(); + if (this.categoriesNames != null) { + data['CategoriesNames'] = this.categoriesNames.toJson(); + } + data['Category'] = this.category; + data['CategoryValue'] = this.categoryValue; + data['CityID'] = this.cityID; + data['CityName'] = this.cityName; + data['CityNameN'] = this.cityNameN; + data['ColorName'] = this.colorName; + data['CreatedOn'] = this.createdOn; + data['ID'] = this.iD; + data['IniceID'] = this.iniceID; + data['IsOrderEmpty'] = this.isOrderEmpty; + data['IsValuesReversed'] = this.isValuesReversed; + data['Language'] = this.language; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['Name'] = this.name; + data['OrderNum'] = this.orderNum; + data['Temperature'] = this.temperature; + data['Value'] = this.value; + return data; + } +} + +class CategoriesNames { + String category1; + String category2; + String category3; + String category4; + String category5; + + CategoriesNames( + {this.category1, + this.category2, + this.category3, + this.category4, + this.category5}); + + CategoriesNames.fromJson(Map json) { + category1 = json['Category1']; + category2 = json['Category2']; + category3 = json['Category3']; + category4 = json['Category4']; + category5 = json['Category5']; + } + + Map toJson() { + final Map data = new Map(); + data['Category1'] = this.category1; + data['Category2'] = this.category2; + data['Category3'] = this.category3; + data['Category4'] = this.category4; + data['Category5'] = this.category5; + return data; + } +} diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index afa3bd05..e7d69a31 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -45,7 +45,7 @@ class BaseAppClient { //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (!isExternal) { String token = await sharedPref.getString(TOKEN); - var languageID = await sharedPref.getString(APP_LANGUAGE); + var languageID = await sharedPref.getString(APP_LANGUAGE)?? 'ar'; var user = await sharedPref.getObject(USER_PROFILE); if (body.containsKey('SetupID')) { body['SetupID'] = body.containsKey('SetupID') @@ -174,7 +174,8 @@ class BaseAppClient { } } catch (e) { print(e); - onFailure(e.toString(), -1); + onFailure('Failed to connect to the server', -1); + // onFailure(e.toString(), -1); } } diff --git a/lib/core/service/weather_service.dart b/lib/core/service/weather_service.dart new file mode 100644 index 00000000..b2dcf0ef --- /dev/null +++ b/lib/core/service/weather_service.dart @@ -0,0 +1,37 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class WeatherService extends BaseService { + List weatherIndicatorData = List(); + + Map body = Map(); + String Latitude = ""; + String Longitude = ""; + String PhoneNumber = ""; + + Future getWeatherData() async { + hasError = false; + + var lat = await sharedPref.getDouble(USER_LAT); + var long = await sharedPref.getDouble(USER_LONG); + body['Latitude'] = lat ?? 0; + body['Longitude'] = long ?? 0; + + await baseAppClient.post(WEATHER_INDICATOR, + onSuccess: (dynamic response, int statusCode) { + + + response['GetCityInfo_List'].forEach((data) { + weatherIndicatorData.add(GetCityInfoList.fromJson(data)); + }); + print(weatherIndicatorData); + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + await this.sharedPref.setObject(WEATHER,weatherIndicatorData[0]); + } +} diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index 4cf22b23..e98ca341 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -1,14 +1,20 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + import '../../locator.dart'; class DashboardViewModel extends BaseViewModel { VitalSignService _vitalSignService = locator(); - String get weightKg => _vitalSignService.weightKg; - String get heightCm => _vitalSignService.heightCm; + + String get weightKg => _vitalSignService.weightKg; + + String get heightCm => _vitalSignService.heightCm; String bloadType = ""; + // ToDoCountProviderModel toDoProvider = + // Provider.of(AppGlobal.context); + getPatientRadOrders() async { if (isLogin && _vitalSignService.weightKg.isEmpty) { setState(ViewState.Busy); @@ -17,7 +23,21 @@ class DashboardViewModel extends BaseViewModel { error = _vitalSignService.error; setState(ViewState.Error); } else - setState(ViewState.Idle); + setState(ViewState.Idle); + // getToDoCount(); } } + +// getToDoCount() { +// toDoProvider.setState(0); +// ClinicListService service = new ClinicListService(); +// service.getActiveAppointmentNo(AppGlobal.context).then((res) { +// print(res['AppointmentActiveNumber']); +// if (res['MessageStatus'] == 1) { +// toDoProvider.setState(res['AppointmentActiveNumber']); +// } else {} +// }).catchError((err) { +// print(err); +// }); +// } } diff --git a/lib/core/viewModels/weather/weather_view_model.dart b/lib/core/viewModels/weather/weather_view_model.dart new file mode 100644 index 00000000..bb201843 --- /dev/null +++ b/lib/core/viewModels/weather/weather_view_model.dart @@ -0,0 +1,31 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; +import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart'; + +import 'package:diplomaticquarterapp/core/service/er/er_service.dart'; +import 'package:diplomaticquarterapp/core/service/weather_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; + +import '../../../locator.dart'; + +class WeatherViewModel extends BaseViewModel { + WeatherService _weatherService = locator(); + List get weatherIndicatorData => + _weatherService.weatherIndicatorData; + getWeatherData() async { + setState(ViewState.Busy); + + // if (id != null && projectID != null) { + // await _erService.getProjectAvgERWaitingTimeOrders( + // id: id, projectID: projectID); + // } else { + await _weatherService.getWeatherData(); + // } + if (_weatherService.hasError) { + error = _weatherService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index d02d647f..8e5f7dde 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,9 +1,11 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; import 'package:diplomaticquarterapp/core/service/qr_service.dart'; +import 'package:diplomaticquarterapp/core/service/weather_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; @@ -138,6 +140,7 @@ void setupLocator() { locator.registerLazySingleton(() => DeleteBabyService()); locator.registerLazySingleton(() => VaccinationTableService()); locator.registerLazySingleton(() => NotificationService()); + locator.registerLazySingleton(() => WeatherService()); locator.registerLazySingleton(() => PharmacyModuleService()); locator.registerLazySingleton(() => OrderPreviewService()); locator.registerLazySingleton(() => CustomerAddressesService()); @@ -161,6 +164,7 @@ void setupLocator() { locator.registerFactory(() => QrViewModel()); locator.registerFactory(() => ReportsMonthlyViewModel()); locator.registerFactory(() => NearHospitalViewModel()); + locator.registerFactory(() => WeatherViewModel()); locator.registerFactory(() => AmRequestViewModel()); locator.registerFactory(() => PatientSickLeaveViewMode()); locator.registerFactory(() => MyBalanceViewModel()); diff --git a/lib/models/Appointments/DoctorRateDetails.dart b/lib/models/Appointments/DoctorRateDetails.dart new file mode 100644 index 00000000..b29a5db9 --- /dev/null +++ b/lib/models/Appointments/DoctorRateDetails.dart @@ -0,0 +1,32 @@ +class DoctorRateDetails { + dynamic doctorID; + dynamic projectID; + dynamic clinicID; + dynamic rate; + dynamic patientNumber; + + DoctorRateDetails( + {this.doctorID, + this.projectID, + this.clinicID, + this.rate, + this.patientNumber}); + + DoctorRateDetails.fromJson(Map json) { + doctorID = json['DoctorID']; + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + rate = json['Rate']; + patientNumber = json['PatientNumber']; + } + + Map toJson() { + final Map data = new Map(); + data['DoctorID'] = this.doctorID; + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['Rate'] = this.rate; + data['PatientNumber'] = this.patientNumber; + return data; + } +} diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index ea699381..1faffd22 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20hea import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_index_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/my_web_view.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; @@ -21,10 +22,12 @@ import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -220,7 +223,7 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/new-design/family_menu_icon_red.png', - title: 'My Family', + title: TranslationBase.of(context).family, ), ServicesContainer( onTap: () => Navigator.push( @@ -313,20 +316,23 @@ class _AllHabibMedicalServiceState extends State { "https://hmgwebservices.com/vt_mobile/html/index.html"), imageLocation: 'assets/images/new-design/virtual_tour_icon.png', - title: 'Virtual Tour', + title: TranslationBase.of(context).vTour, ), ServicesContainer( onTap: () { - Navigator.of(context).push(MaterialPageRoute( + Navigator.of(context).push( + MaterialPageRoute( builder: (BuildContext context) => MyWebView( - title: "HMG News", - selectedUrl: - "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", - ))); + title: TranslationBase.of(context).hmgNews, + selectedUrl: + "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + ), + ), + ); }, imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png', - title: 'Latest News', + title: TranslationBase.of(context).latestNews, ), ServicesContainer( onTap: () => Navigator.push( @@ -336,7 +342,7 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: 'assets/images/new-design/find_us_icon.png', - title: 'Find Us', + title: TranslationBase.of(context).findUs, ), ], ), diff --git a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart new file mode 100644 index 00000000..343c6e3e --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart @@ -0,0 +1,137 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/weather_slider/weather_slider.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; + +class HealthWeatherIndicator extends StatefulWidget { + @override + _HospitalsPageState createState() => _HospitalsPageState(); +} + +class _HospitalsPageState extends State { + var data; + LocationUtils locationUtils; + AppSharedPreferences sharedPref = AppSharedPreferences(); + var weather = '--'; + @override + void initState() { + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance + .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + getWeather(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getWeatherData(), + allowAny: true, + builder: (_, mode, widget) => AppScaffold( + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).healthWeatherIndicators, + isShowAppBar: true, + body: mode.weatherIndicatorData.length > 0 + ? SingleChildScrollView( + child: Column(children: [ + Container( + margin: EdgeInsets.all(8), + width: double.infinity, + height: 150, + decoration: BoxDecoration( + image: DecorationImage( + image: + ExactAssetImage('assets/images/Weather_img.png'), + fit: BoxFit.cover, + ), + borderRadius: BorderRadius.circular(8.0)), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.0), + child: Row( + children: [ + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .healthWeatherIndicators, + color: Colors.white, + fontWeight: FontWeight.w600, + ), + AppText( + TranslationBase.of(context) + .healthTipsBasedOnCurrentWeather, + color: Colors.white, + fontSize: 14, + ), + ], + )), + Expanded( + flex: 2, + child: InkWell( + onTap: () {}, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/Weather_ico.png', + width: 60, + height: 60, + ), + AppText(weather, + fontSize: 22, color: Colors.white) + ], + ), + ], + )), + ) + ], + ), + ), + ), + Padding( + padding: EdgeInsets.all(15), + child: AppText( + projectViewModel.isArabic + ? mode.weatherIndicatorData[0].cityNameN + : mode.weatherIndicatorData[0].cityName, + fontSize: 24, + fontWeight: FontWeight.bold, + )), + Padding( + padding: EdgeInsets.all(15), + child: Column( + children: mode.weatherIndicatorData.map((data) { + return WeatherSlider(data); + }).toList())) + ])) + : Center(child: AppCircularProgressIndicator())), + ); + } + + getWeather() async { + var data = await this.sharedPref.getObject(WEATHER); + setState(() { + weather = data['Temperature'].toString() + '\u2103' ?? '--'; + }); + } +} diff --git a/lib/pages/AlHabibMedicalService/parking_page.dart b/lib/pages/AlHabibMedicalService/parking_page.dart index 82c390ea..a49a4b20 100644 --- a/lib/pages/AlHabibMedicalService/parking_page.dart +++ b/lib/pages/AlHabibMedicalService/parking_page.dart @@ -18,6 +18,7 @@ class ParkingPage extends StatelessWidget { onModelReady: (model) => model.getIsSaveParking(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, + isShowDecPage: false, appBarTitle: TranslationBase.of(context).parking, body: SingleChildScrollView( padding: EdgeInsets.all(12), diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 99e5242e..ad1d8785 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -27,7 +27,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:giffy_dialog/giffy_dialog.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; //import '../../../core/model/my_balance/AdvanceModel.dart'; import 'confirm_payment_page.dart'; diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index 9ad6d68f..75282190 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; @@ -18,7 +20,6 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'dialogs/ConfirmSMSDialog.dart'; import 'new_text_Field.dart'; @@ -159,16 +160,16 @@ class ConfirmPaymentPage extends StatelessWidget { label: TranslationBase.of(context).confirm.toUpperCase(), disabled: model.state == ViewState.Busy, onTap: () { + GifLoaderDialogUtils.showMyDialog(context); model .sendActivationCodeForAdvancePayment( patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD) .then((value) { + GifLoaderDialogUtils.hideDialog(context); if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(); - }).showProgressBar( - text: "Loading", - backgroundColor: Colors.blue.withOpacity(0.6)); + }); }, ), ), @@ -248,12 +249,14 @@ class ConfirmPaymentPage extends StatelessWidget { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); service .checkPaymentStatus( Utils.getAppointmentTransID( appo.projectID, appo.clinicID, appo.appointmentNo), AppGlobal.context) .then((res) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; @@ -263,18 +266,21 @@ class ConfirmPaymentPage extends StatelessWidget { AppToast.showErrorToast(message: res['Response_Message']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); service .createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context) .then((res) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); addAdvancedNumberRequest( res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), @@ -282,24 +288,28 @@ class ConfirmPaymentPage extends StatelessWidget { appo.appointmentNo.toString(), appo); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } addAdvancedNumberRequest(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); service .addAdvancedNumberRequest( advanceNumber, paymentReference, appointmentID, AppGlobal.context) .then((res) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); print(res); navigateToHome(AppGlobal.context); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Future navigateToHome(context) async { diff --git a/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart index d165a895..e08d2f28 100644 --- a/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart +++ b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart @@ -8,13 +8,13 @@ import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobi import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class ConfirmSMSDialog extends StatefulWidget { final String phoneNumber; @@ -112,32 +112,31 @@ class _ConfirmSMSDialogState extends State { height: 40, color: Theme.of(context).primaryColor, child: Stack( - children: [ Center( - child: Texts( - 'SMS', - color: Colors.white, - textAlign: TextAlign.center, - ), - ), - Positioned(child: Container( - child: InkWell( - onTap: () => Navigator.pop(context), - child: Container( - decoration: BoxDecoration( - shape: BoxShape.circle, color: Colors.white), - child: Icon( - Icons.clear, - color: Colors.grey[900], - )), + child: Texts( + 'SMS', + color: Colors.white, + textAlign: TextAlign.center, ), ), - left: projectViewModel.isArabic? 2:0, - right: projectViewModel.isArabic? 0:2, + Positioned( + child: Container( + child: InkWell( + onTap: () => Navigator.pop(context), + child: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.white), + child: Icon( + Icons.clear, + color: Colors.grey[900], + )), + ), + ), + left: projectViewModel.isArabic ? 2 : 0, + right: projectViewModel.isArabic ? 0 : 2, ) ], - ), ), Image.asset( @@ -334,15 +333,14 @@ class _ConfirmSMSDialogState extends State { } void submit(MyBalanceViewModel model) { + GifLoaderDialogUtils.showMyDialog(context); if (verifyAccountForm.currentState.validate()) { final activationCode = digit1.text + digit2.text + digit3.text + digit4.text; model .checkActivationCodeForAdvancePayment(activationCode: activationCode) - .then((value) {}) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) .then((value) { + GifLoaderDialogUtils.hideDialog(context); Navigator.pop(context, true); }); } diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index fa69d913..7a247b78 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -2,9 +2,11 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -14,8 +16,8 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'BookSuccess.dart'; @@ -43,6 +45,8 @@ class BookConfirm extends StatefulWidget { } class _BookConfirmState extends State { + ToDoCountProviderModel toDoProvider; + @override void initState() { widget.authUser = new AuthenticatedUser(); @@ -54,6 +58,7 @@ class _BookConfirmState extends State { @override Widget build(BuildContext context) { + toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, isShowAppBar: true, @@ -421,9 +426,10 @@ class _BookConfirmState extends State { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); print(res['AppointmentNo']); - Future.delayed(new Duration(milliseconds: 1800), () { + Future.delayed(new Duration(milliseconds: 500), () { getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); + getToDoCount(); }); } else { GifLoaderDialogUtils.hideDialog(context); @@ -471,9 +477,10 @@ class _BookConfirmState extends State { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); print(res['AppointmentNo']); - Future.delayed(new Duration(milliseconds: 1800), () { + Future.delayed(new Duration(milliseconds: 500), () { getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); + getToDoCount(); }); } else { GifLoaderDialogUtils.hideDialog(context); @@ -499,10 +506,23 @@ class _BookConfirmState extends State { dialog.showAlertDialog(context); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); + } + + getToDoCount() { + toDoProvider.setState(0); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber']); + } else {} + }).catchError((err) { + print(err); + }); } getPatientShare(context, String appointmentNo, int clinicID, int projectID, diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 82248560..70a5b1fb 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'QRCode.dart'; @@ -349,36 +348,37 @@ class _BookSuccessState extends State { confirmAppointment(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service .confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context) .then((res) { - if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - if (appo.isLiveCareAppointment) { - insertLiveCareVIDARequest(appo); - } else { - navigateToHome(context); - } - }); + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + if (appo.isLiveCareAppointment) { + insertLiveCareVIDARequest(appo); + } else { + navigateToHome(context); + } + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); } insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); navigateToHome(context); @@ -386,9 +386,10 @@ class _BookSuccessState extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Widget _getPayNowAppo() { @@ -554,7 +555,7 @@ class _BookSuccessState extends State { AppoitmentAllHistoryResultList appo) async { if (paymentMethod == "ApplePay") { await widget.chromeBrowser.open( - url: "https://flutter.dev/", + url: "https://applepay-datatrans-sample.herokuapp.com/", options: ChromeSafariBrowserClassOptions( android: AndroidChromeCustomTabsOptions( addDefaultShareMenuItem: false), @@ -633,6 +634,7 @@ class _BookSuccessState extends State { } getApplePayAPQ(AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service .checkPaymentStatus( @@ -640,6 +642,7 @@ class _BookSuccessState extends State { appo.projectID, appo.clinicID, appo.appointmentNo), context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; @@ -649,9 +652,10 @@ class _BookSuccessState extends State { AppToast.showErrorToast(message: res['Response_Message']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { diff --git a/lib/pages/BookAppointment/BookingOptions.dart b/lib/pages/BookAppointment/BookingOptions.dart index 83af454f..b90c3b34 100644 --- a/lib/pages/BookAppointment/BookingOptions.dart +++ b/lib/pages/BookAppointment/BookingOptions.dart @@ -52,11 +52,10 @@ class _BookingOptionsState extends State { children: [ Expanded( child: CardCommon( - image: 'assets/images/new-design/search_by_clinic.png', - text: TranslationBase.of(context).clinic, - subText: TranslationBase.of(context).name, - type: 0, - ), + image: 'assets/images/new-design/search_by_clinic.png', + text: TranslationBase.of(context).clinic, + subText: TranslationBase.of(context).name, + type: 0), ), Expanded( child: CardCommon( diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 34a7e1e1..043eaff1 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -2,12 +2,13 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart'; -import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class DentalComplaints extends StatefulWidget { SearchInfo searchInfo; @@ -35,7 +36,8 @@ class _DentalComplaintsState extends State { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: "Symptoms", + appBarTitle: TranslationBase.of(context).dentalComplaints, + isShowDecPage: false, body: Container( margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), child: ListView.builder( @@ -59,12 +61,14 @@ class _DentalComplaintsState extends State { } getChiefComplaintsList() { + GifLoaderDialogUtils.showMyDialog(context); getLanguageID(); ClinicListService service = new ClinicListService(); service .getChiefComplaintsList( widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res['List_DentalChiefComplain']); setState(() { @@ -73,10 +77,13 @@ class _DentalComplaintsState extends State { }); print(complaintsList.length); }); - } else {} + } else { + + } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } } diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 6864e6b1..20e4ae09 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -1,11 +1,14 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -42,6 +45,8 @@ class _DoctorProfileState extends State AppSharedPreferences sharedPref = AppSharedPreferences(); + List doctorDetailsList = List(); + @override void initState() { _tabController = new TabController( @@ -150,19 +155,26 @@ class _DoctorProfileState extends State emptyIcon: Icons.star, ), ), - Container( - margin: EdgeInsets.only(top: 5.0), - alignment: Alignment.center, - child: Text( - "(" + - widget.doctor.noOfPatientsRate.toString() + - " " + TranslationBase.of(context).reviews + ")", - style: TextStyle( - fontSize: 14.0, - color: Colors.blue[800], - letterSpacing: 1.0, - decoration: TextDecoration.underline, - )), + InkWell( + onTap: () { + getDoctorRatingsDetails(); + }, + child: Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: Text( + "(" + + widget.doctor.noOfPatientsRate.toString() + + " " + + TranslationBase.of(context).reviews + + ")", + style: TextStyle( + fontSize: 14.0, + color: Colors.blue[800], + letterSpacing: 1.0, + decoration: TextDecoration.underline, + )), + ), ), Container( margin: EdgeInsets.only(top: 10.0), @@ -213,6 +225,281 @@ class _DoctorProfileState extends State ); } + getDoctorRatings() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.getDoctorsRating(widget.doctor.doctorID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + print(res['NotesDoctorRatingList']); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + getDoctorRatingsDetails() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .getDoctorsRatingDetails(widget.doctor.doctorID, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + doctorDetailsList.clear(); + res['DoctorRatingDetailsList'].forEach((v) { + doctorDetailsList.add(new DoctorRateDetails.fromJson(v)); + }); + showRatingDialog(doctorDetailsList); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + void showRatingDialog(List doctorDetailsList) { + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: Dialog( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + // height: 400.0, + width: MediaQuery.of(context).size.width * 0.8, + color: Colors.white, + child: Column( + children: [ + Container( + alignment: Alignment.center, + width: MediaQuery.of(context).size.width, + color: Theme.of(context).primaryColor, + margin: EdgeInsets.only(bottom: 5.0), + padding: EdgeInsets.all(10.0), + child: Text(TranslationBase.of(context).doctorRating, + style: TextStyle( + fontSize: 22.0, color: Colors.white))), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Text( + this + .widget + .doctor + .actualDoctorRate + .ceilToDouble() + .toString(), + style: TextStyle( + fontSize: 32.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: + this.widget.doctor.actualDoctorRate.toDouble(), + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text( + this.widget.doctor.noOfPatientsRate.toString() + + " " + + TranslationBase.of(context).reviews, + style: TextStyle( + fontSize: 14.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).excellent, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[0].patientNumber), + height: 6.0, + child: Container( + color: Colors.green[700], + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).v_good, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[1].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffB7B723), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).good, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[2].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEBA727), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).average, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[3].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEB7227), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).below_average, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[4].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffE20C0C), + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 40.0), child: Divider()), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Align( + alignment: FractionalOffset.bottomCenter, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 40.0, + child: RaisedButton( + elevation: 0.0, + color: Colors.white, + textColor: Colors.red, + hoverColor: Colors.transparent, + focusColor: Colors.transparent, + highlightColor: Colors.transparent, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(TranslationBase.of(context).cancel, + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}); + } + + double getRatingWidth(int patientNumber) { + var width = (patientNumber / this.widget.doctor.noOfPatientsRate) * 100; + return width; + } + getPatientData() async { if (await sharedPref.getObject(USER_PROFILE) != null) { var data = diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index e92c2348..487d1be7 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -10,11 +10,11 @@ import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsLis import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class QRCode extends StatefulWidget { PatientShareResponse patientShareResponse; @@ -235,6 +235,7 @@ class _QRCodeState extends State { okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () { + GifLoaderDialogUtils.showMyDialog(context); service .sendAppointmentQREmail( widget.authUser.emailAddress, @@ -247,15 +248,15 @@ class _QRCodeState extends State { widget.patientShareResponse.doctorSpeciality), context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res); ConfirmDialog.closeAlertDialog(context); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); ConfirmDialog.closeAlertDialog(context); AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", - backgroundColor: Colors.blue.withOpacity(0.6)); + }); }, cancelFunction: () => {}); dialog.showAlertDialog(context); diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 095d72a6..44cf46c3 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -1,18 +1,16 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; -import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart'; -import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:flutter/material.dart'; -import 'package:geolocator/geolocator.dart'; class Search extends StatefulWidget { final int type; final List clnicIds; + Search({this.type = 0, this.clnicIds}); + @override _SearchState createState() => _SearchState(); } diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 055b0c41..72226c2e 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -27,6 +27,7 @@ class _SearchResultsState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, isShowAppBar: true, + isShowDecPage: false, body: Container( margin: EdgeInsets.all(10.0), child: SingleChildScrollView( diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 7943e423..355bb52b 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -13,7 +13,6 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class SearchByClinic extends StatefulWidget { final List clnicIds; @@ -137,7 +136,8 @@ class _SearchByClinicState extends State { margin: EdgeInsets.only(top: 15.0), child: DropdownButtonHideUnderline( child: DropdownButton( - hint: new Text("Select Project"), + hint: + new Text(TranslationBase.of(context).selectHospital), value: projectDropdownValue, items: projectsList.map((item) { return new DropdownMenuItem( diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 1e1945b5..8d2b9387 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../SearchResults.dart'; @@ -129,9 +128,12 @@ class _SearchByDoctorState extends State { navigateToSearchResults( context, doctorsList, _patientDoctorAppointmentListHospital); } else { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); }); } diff --git a/lib/pages/BookAppointment/widgets/CardCommon.dart b/lib/pages/BookAppointment/widgets/CardCommon.dart index e56ba965..6a7e2bdd 100644 --- a/lib/pages/BookAppointment/widgets/CardCommon.dart +++ b/lib/pages/BookAppointment/widgets/CardCommon.dart @@ -1,12 +1,16 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class CardCommon extends StatelessWidget { + var languageID; final image; final text; final subText; final type; - const CardCommon( + + CardCommon( {@required this.image, @required this.text, @required this.subText, @@ -14,6 +18,7 @@ class CardCommon extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return GestureDetector( onTap: () { navigateToSearch(context, this.type); @@ -43,8 +48,12 @@ class CardCommon extends StatelessWidget { color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), ), Container( - alignment: Alignment.bottomRight, - margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), + alignment: projectViewModel.isArabic + ? Alignment.bottomLeft + : Alignment.bottomRight, + margin: projectViewModel.isArabic + ? EdgeInsets.fromLTRB(10.0, 0.0, 00.0, 8.0) + : EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), child: Image.asset(this.image, width: 60.0, height: 60.0), ), ], diff --git a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart index 27f37d0a..eb434cad 100644 --- a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart +++ b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart @@ -3,8 +3,9 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; // ignore: must_be_immutable class DentalComplaintCard extends StatefulWidget { @@ -69,14 +70,15 @@ class _DentalComplaintCardState extends State { List doctorsList = []; List _patientDoctorAppointmentListHospital = List(); - + GifLoaderDialogUtils.showMyDialog(context); ClinicListService service = new ClinicListService(); service .getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD, widget.listDentalChiefComplain.projectID, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { - print(res['List_DentalDoctorChiefComplaintMapping']); + print(res['ErrorEndUserMessage']); setState(() { doctorsList.clear(); res['List_DentalDoctorChiefComplaintMapping'].forEach((v) { @@ -107,16 +109,21 @@ class _DentalComplaintCardState extends State { patientDoctorAppointment: element)); } }); - navigateToSearchResults( - context, doctorsList, _patientDoctorAppointmentListHospital); + if (doctorsList.length != 0) { + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).emptyResult); + } }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Future navigateToSearchResults( diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index d419e4af..bd4fb429 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -6,7 +6,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../DoctorProfile.dart'; diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index 807ac1c7..f920de9f 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model import 'package:diplomaticquarterapp/pages/ContactUs/findus/hospitrals_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/pharmacies_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -39,7 +40,7 @@ class _FindUsPageState extends State builder: (_, model, w) => AppScaffold( isShowAppBar: true, isShowDecPage: false, - appBarTitle: 'Locations', + appBarTitle: TranslationBase.of(context).ourLocation, baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, @@ -90,13 +91,13 @@ class _FindUsPageState extends State Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts(' Hospitals '), + child: Texts(TranslationBase.of(context).hospitals), ), ), Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts(' Pharmacies '), + child: Texts(TranslationBase.of(context).pharmacies), ), ), ], diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 3e58b657..8375e337 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -9,13 +9,13 @@ import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.da import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:intl/intl.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:table_calendar/table_calendar.dart'; class CovidTimeSlots extends StatefulWidget { @@ -481,6 +481,7 @@ class _CovidTimeSlotsState extends State insertAppointmentCovidTest(context, DoctorList docObject) { DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); AppoitmentAllHistoryResultList appo; service .insertAppointment( @@ -491,7 +492,7 @@ class _CovidTimeSlotsState extends State CovidTimeSlots.selectedDate, context) .then((res) { - print(res); + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); Future.delayed(new Duration(milliseconds: 1800), () { @@ -521,17 +522,19 @@ class _CovidTimeSlotsState extends State dialog.showAlertDialog(context); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) { ConfirmDialog.closeAlertDialog(context); + GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service.cancelAppointment(appo, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { Future.delayed(new Duration(milliseconds: 1500), () { insertAppointmentCovidTest(context, docObject); @@ -540,28 +543,27 @@ class _CovidTimeSlotsState extends State AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { + GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service .getPatientShare(appointmentNo, clinicID, projectID, context) .then((res) { - print(res); - widget.patientShareResponse = new PatientShareResponse.fromJson(res); - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - navigateToPaymentAlert(); - }); + GifLoaderDialogUtils.hideDialog(context); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + navigateToPaymentAlert(); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); } navigateToPaymentAlert() { @@ -573,8 +575,10 @@ class _CovidTimeSlotsState extends State } getCovidFreeSlots(BuildContext context, int projectID) { + GifLoaderDialogUtils.showMyDialog(context); CovidDriveThruService service = new CovidDriveThruService(); service.getCovidFreeSlots(context, projectID).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res['COVID19_FreeTimeSlots']); if (res['MessageStatus'] == 1) { if (res['COVID19_FreeTimeSlots'].length != 0) { @@ -595,8 +599,9 @@ class _CovidTimeSlotsState extends State AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } } diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 0563c4bd..245bcbaf 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -3,11 +3,12 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCe import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class CovidDrivethruLocation extends StatefulWidget { @override @@ -258,37 +259,38 @@ class _CovidDrivethruLocationState extends State { CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); + GifLoaderDialogUtils.showMyDialog(context); + service .getCovidPaymentInformation(context, int.parse(projectID)) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson( res['COVID19_PatientShare']); - print(covidPaymentInfoResponse.procedureNameField); }); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidPaymentDetails( + covidPaymentInfoResponse: covidPaymentInfoResponse, + projectID: int.parse(projectID), + ))); } else {} }) .catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => CovidPaymentDetails( - covidPaymentInfoResponse: covidPaymentInfoResponse, - projectID: int.parse(projectID), - ))); }); } getProjectsList(BuildContext context) { CovidDriveThruService service = new CovidDriveThruService(); + GifLoaderDialogUtils.showMyDialog(context); service.getCovidProjectsList(context).then((res) { - print(res); + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res); setState(() { @@ -298,8 +300,9 @@ class _CovidDrivethruLocationState extends State { }); } else {} }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } } diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 0e6d86bf..80de8ecd 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -1,12 +1,19 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as list; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -21,7 +28,7 @@ import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/routes.dart'; - +import 'package:provider/provider.dart'; class MyFamily extends StatefulWidget { final bool isAppbarVisible; MyFamily({this.isAppbarVisible =true}); @@ -30,23 +37,47 @@ class MyFamily extends StatefulWidget { } class _MyFamily extends State with TickerProviderStateMixin { + List imagesInfo = List(); final familyFileProvider = FamilyFilesProvider(); AppSharedPreferences sharedPref = new AppSharedPreferences(); var userID; TabController _tabController; int _tabIndex = 0; + AuthenticatedUserObject authenticatedUserObject = + locator(); + AppointmentRateViewModel appointmentRateViewModel = + locator(); + ProjectViewModel projectViewModel; + AuthenticatedUser user; @override void initState() { _tabController = new TabController(length: 2, vsync: this, initialIndex: 0); - + checkUserData(); super.initState(); } bool expandFlag = false; + Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), + ); + + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), + ); + projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).myFamilyFiles, isShowAppBar: widget.isAppbarVisible, + imagesInfo: imagesInfo, + description: TranslationBase.of(context).familyInfo, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -87,7 +118,7 @@ class _MyFamily extends State with TickerProviderStateMixin { //indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Colors.red[800], + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), @@ -117,14 +148,14 @@ class _MyFamily extends State with TickerProviderStateMixin { body: Column( children: [ Expanded( - child: TabBarView( + child: (user != null && projectViewModel.isLogin) ? TabBarView( physics: BouncingScrollPhysics(), controller: _tabController, children: [ myFamilyDetails(context), myFamilyRequest(context) ], - ), + ) : Container(child:AppText('Loading..')), ) ], ), @@ -169,7 +200,7 @@ class _MyFamily extends State with TickerProviderStateMixin { Widget myFamilyDetails(context) { return Container( height: MediaQuery.of(context).size.height, - margin: EdgeInsets.fromLTRB(20.0, 0, 20.0, 0.0), + margin: EdgeInsets.fromLTRB(20.0, 25.0, 20.0, 0.0), child: Column( children: [ Expanded( @@ -540,12 +571,14 @@ class _MyFamily extends State with TickerProviderStateMixin { } Future getFamilyFiles() async { - if (await sharedPref.getObject(FAMILY_FILE) != null) { - // print(await sharedPref.getObject(FAMILY_FILE)); - return Future.value(GetAllSharedRecordsByStatusResponse.fromJson( - await sharedPref.getObject(FAMILY_FILE))); - } else { - return familyFileProvider.getSharedRecordByStatus(); + if (user != null) { + if (await sharedPref.getObject(FAMILY_FILE) != null) { + // print(await sharedPref.getObject(FAMILY_FILE)); + return Future.value(GetAllSharedRecordsByStatusResponse.fromJson( + await sharedPref.getObject(FAMILY_FILE))); + } else { + return familyFileProvider.getSharedRecordByStatus(); + } } } @@ -592,20 +625,55 @@ class _MyFamily extends State with TickerProviderStateMixin { } switchUser(user, context) { - GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + // this + // .familyFileProvider + // .silentLoggin(user) + // .then((value) => loginAfter(value, context)); + + // Utils.showProgressDialog(context); this .familyFileProvider - .silentLoggin(user) - .then((value) => loginAfter(value, context)); + .silentLoggin(user is AuthenticatedUser ? null : user, + mainUser: user is AuthenticatedUser) + .then((value) => loginAfter(value, context)) + .catchError((err) { + print(err); + AppToast.showErrorToast(message: err); + Navigator.of(context).pop(); + }); } loginAfter(result, context) async{ GifLoaderDialogUtils.hideDialog(context); + // var familyFile = await sharedPref.getObject(FAMILY_FILE); + // var mainUser = await sharedPref.getObject(MAIN_USER); + // result = CheckActivationCode.fromJson(result); + // this.sharedPref.clear(); + // this.sharedPref.setObject(FAMILY_FILE, familyFile); + // this.sharedPref.setObject(MAIN_USER, mainUser); + // result.list.isFamily = true; + // this.sharedPref.setObject(USER_PROFILE, result.list); + // this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); + // this.sharedPref.setString(TOKEN, result.authenticationTokenID); + // + // authenticatedUserObject.isLogin = true; + // appointmentRateViewModel.isLogin = true; + // projectViewModel.isLogin = true; + // //this.checkIfUserAgreedBefore(result), + // Navigator.of(context).pushNamed( + // HOME, + // ); + result = list.CheckActivationCode.fromJson(result); var familyFile = await sharedPref.getObject(FAMILY_FILE); - result = CheckActivationCode.fromJson(result); + var mainUser = await sharedPref.getObject(MAIN_USER); this.sharedPref.clear(); - this.sharedPref.setObject(FAMILY_FILE, familyFile); + if (mainUser["PatientID"] != result.list.patientID) { + result.list.isFamily = true; + } + this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(USER_PROFILE, result.list); + this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID); //this.checkIfUserAgreedBefore(result), @@ -634,4 +702,17 @@ class _MyFamily extends State with TickerProviderStateMixin { refreshFamily(context) }); } + checkUserData() async{ + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + + var data2 = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(MAIN_USER)); + print(data2); + setState(() { + this.user = data; + }); + } + } } diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 413d80e6..1690254a 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -24,6 +25,7 @@ class AmbulanceReq extends StatefulWidget { class _AmbulanceReqState extends State with SingleTickerProviderStateMixin { TabController _tabController; + List imagesInfo = List(); @override void initState() { @@ -39,11 +41,19 @@ class _AmbulanceReqState extends State @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/Ambulance/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/Ambulance/ar/0.png')); + return BaseView( onModelReady: (model) => model.getAmRequestOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: "Ambulance Request", + appBarTitle: TranslationBase.of(context).transportationService, + description: TranslationBase.of(context).infoAmbulance, + imagesInfo: imagesInfo, baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, @@ -92,8 +102,7 @@ class _AmbulanceReqState extends State Container( width: MediaQuery.of(context).size.width * 0.40, child: Center( - child: Texts( - "Ambulance Request"), //TranslationBase.of(context).prescriptions + child: Texts(TranslationBase.of(context).transportationService), ), ), Container( @@ -118,8 +127,8 @@ class _AmbulanceReqState extends State controller: _tabController, children: [ AmbulanceRequestIndexPage( - amRequestViewModel: model, - ), + amRequestViewModel: model, + ), OrderLogPage( amRequestViewModel: model, ) diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart index cc6af0f2..16945a1e 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -51,7 +52,7 @@ class _BillAmountState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Bill Amount '), + Texts(TranslationBase.of(context).billAmount), SizedBox( height: 10, ), @@ -73,7 +74,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'Amount before tax: ', + TranslationBase.of(context).patientShareB, textAlign: TextAlign.start, color: Colors.black, fontSize: 15, @@ -91,7 +92,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'SR ${widget.patientER.patientERTransportationMethod.price}', + TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}', color: Colors.black, textAlign: TextAlign.start, fontSize: 15, @@ -108,7 +109,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'Tax amount :', + TranslationBase.of(context).patientShareTax, color: Colors.black, fontSize: 15, textAlign: TextAlign.start, @@ -121,7 +122,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'SR ${widget.patientER.patientERTransportationMethod.vAT}', + TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}', color: Colors.black, fontSize: 15, textAlign: TextAlign.start, @@ -143,7 +144,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'Total amount payable', + TranslationBase.of(context).patientShareTotal, color: Colors.black, fontSize: 15, textAlign: TextAlign.start, @@ -162,7 +163,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'SR ${widget.patientER.patientERTransportationMethod.totalPrice}', + TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}', color: Colors.black, fontSize: 15, textAlign: TextAlign.start, @@ -176,7 +177,7 @@ class _BillAmountState extends State { SizedBox( height: 10, ), - Texts('Select Ambulate',bold: true,), + Texts(TranslationBase.of(context).selectAmbulate,bold: true,), SizedBox(height: 5,), Row( children: [ @@ -196,11 +197,11 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text('Wheelchair'), + title: Text(TranslationBase.of(context).wheelchair), leading: Radio( value: Ambulate.Wheelchair, groupValue: _ambulate, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (value) { setState(() { _ambulate = value; @@ -227,11 +228,11 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text('Walker'), + title: Text(TranslationBase.of(context).walker), leading: Radio( value: Ambulate.Walker, groupValue: _ambulate, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (value) { setState(() { _ambulate = value; @@ -263,11 +264,11 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text('Stretcher'), + title: Text(TranslationBase.of(context).stretcher), leading: Radio( value: Ambulate.Stretcher, groupValue: _ambulate, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (value) { setState(() { _ambulate = value; @@ -294,11 +295,11 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text('None'), + title: Text(TranslationBase.of(context).none), leading: Radio( value: Ambulate.None, groupValue: _ambulate, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (value) { setState(() { _ambulate = value; @@ -313,7 +314,7 @@ class _BillAmountState extends State { ), SizedBox(height: 12,), NewTextFields( - hintText: 'Note', + hintText: TranslationBase.of(context).notes, initialValue: note, onChanged: (value){ setState(() { @@ -340,7 +341,7 @@ class _BillAmountState extends State { widget.changeCurrentTab(3); }); }, - label: 'Next', + label: TranslationBase.of(context).next, ), ) ], diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index b99596c8..78574e06 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; @@ -78,7 +79,7 @@ class _PickupLocationState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Pickup Location'), + Texts(TranslationBase.of(context).pickupLocation), SizedBox( height: 15, ), @@ -110,7 +111,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getSelectFromMapName()), + Texts(getSelectFromMapName(context)), Icon( FontAwesomeIcons.mapMarkerAlt, size: 24, @@ -123,7 +124,7 @@ class _PickupLocationState extends State { SizedBox( height: 12, ), - Texts('Pickup Spot'), + Texts(TranslationBase.of(context).pickupSpot), SizedBox( height: 5, ), @@ -141,7 +142,7 @@ class _PickupLocationState extends State { color: Colors.white, ), child: ListTile( - title: Texts('Inside Home'), + title: Texts(TranslationBase.of(context).insideHome), leading: Checkbox( activeColor: Colors.red[800], value: _isInsideHome, @@ -157,7 +158,7 @@ class _PickupLocationState extends State { SizedBox( height: 12, ), - Texts('Do you have an appointment ?'), + Texts(TranslationBase.of(context).haveAppo), SizedBox( height: 5, ), @@ -182,7 +183,7 @@ class _PickupLocationState extends State { color: Colors.white, ), child: ListTile( - title: Text('Yes'), + title: Text(TranslationBase.of(context).yes), leading: Radio( value: HaveAppointment.YES, groupValue: _haveAppointment, @@ -217,7 +218,7 @@ class _PickupLocationState extends State { color: Colors.white, ), child: ListTile( - title: Text('No'), + title: Text(TranslationBase.of(context).no), leading: Radio( value: HaveAppointment.NO, groupValue: _haveAppointment, @@ -250,7 +251,7 @@ class _PickupLocationState extends State { SizedBox( height: 12, ), - Texts('Drop off Location'), + Texts(TranslationBase.of(context).dropoffLocation), SizedBox( height: 8, ), @@ -270,7 +271,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getHospitalName('Pickup Location')), + Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), Icon( Icons.arrow_drop_down, size: 24, @@ -306,7 +307,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getHospitalName('Pickup Location')), + Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), Icon( Icons.arrow_drop_down, size: 24, @@ -319,7 +320,7 @@ class _PickupLocationState extends State { SizedBox( height: 12, ), - Texts('Drop off Location'), + Texts(TranslationBase.of(context).dropoffLocation), SizedBox( height: 8, ), @@ -351,7 +352,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getSelectFromMapName()), + Texts(getSelectFromMapName(context)), Icon( FontAwesomeIcons.mapMarkerAlt, size: 24, @@ -377,7 +378,7 @@ class _PickupLocationState extends State { onTap: () { if (_result == null || _selectedHospital == null) AppToast.showErrorToast( - message: 'please select all fields'); + message: TranslationBase.of(context).selectAll); else setState(() { widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; @@ -427,7 +428,7 @@ class _PickupLocationState extends State { widget.changeCurrentTab(2); }); }, - label: 'Next', + label: TranslationBase.of(context).next, ), ) ], @@ -455,8 +456,8 @@ class _PickupLocationState extends State { return _selectedHospital == null ? title : _selectedHospital.name; } - String getSelectFromMapName() { - return _result != null ? _result.formattedAddress : 'Select From Map'; + String getSelectFromMapName(BuildContext context) { + return _result != null ? _result.formattedAddress : TranslationBase.of(context).selectMap; } getAppointment() { @@ -494,7 +495,7 @@ class _PickupLocationState extends State { setState(() { _haveAppointment = HaveAppointment.NO; }); - AppToast.showErrorToast(message: 'You don\'t have any appointment'); + AppToast.showErrorToast(message: TranslationBase.of(context).noAppointment); } }).catchError((e) { ProgressDialogUtil.hideProgressDialog(context); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index 01683b55..952716c8 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -67,7 +68,7 @@ class _SelectTransportationMethodState SizedBox( height: 12, ), - Texts('Select Transportation Method'), + Texts(TranslationBase.of(context).transportHeading), ...List.generate( widget.amRequestViewModel.amRequestModeList.length, (index) => InkWell( @@ -96,7 +97,7 @@ class _SelectTransportationMethodState value: widget .amRequestViewModel.amRequestModeList[index], groupValue: _erTransportationMethod, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (value) { setState(() { _erTransportationMethod = value; @@ -108,7 +109,7 @@ class _SelectTransportationMethodState Expanded( flex: 1, child: Texts( - 'SR ${widget.amRequestViewModel.amRequestModeList[index].price}'), + TranslationBase.of(context).sar+' ${widget.amRequestViewModel.amRequestModeList[index].price}'), ) ], ), @@ -118,7 +119,7 @@ class _SelectTransportationMethodState SizedBox( height: 12, ), - Texts('Select Direction'), + Texts(TranslationBase.of(context).directionHeading), SizedBox( height: 5, ), @@ -144,11 +145,11 @@ class _SelectTransportationMethodState color: Colors.white, ), child: ListTile( - title: Text('To Hospital'), + title: Text(TranslationBase.of(context).toHospital), leading: Radio( value: Direction.ToHospital, groupValue: _direction, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (value) { setState(() { _direction = value; @@ -175,11 +176,11 @@ class _SelectTransportationMethodState color: Colors.white, ), child: ListTile( - title: Text('Form Hospital'), + title: Text(TranslationBase.of(context).fromHospital), leading: Radio( value: Direction.FromHospital, groupValue: _direction, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (value) { setState(() { _direction = value; @@ -200,7 +201,7 @@ class _SelectTransportationMethodState SizedBox( height: 8, ), - Texts('Select Direction'), + Texts(TranslationBase.of(context).directionHeading), SizedBox( height: 5, ), @@ -222,11 +223,11 @@ class _SelectTransportationMethodState color: Colors.white, ), child: ListTile( - title: Text('One Way'), + title: Text(TranslationBase.of(context).oneDirec), leading: Radio( value: Way.OneWay, groupValue: _way, - activeColor: Colors.red[800], + activeColor:Theme.of(context).primaryColor, onChanged: (value) { setState(() { _way = value; @@ -253,11 +254,11 @@ class _SelectTransportationMethodState color: Colors.white, ), child: ListTile( - title: Text('Two Ways'), + title: Text(TranslationBase.of(context).twoDirec), leading: Radio( value: Way.TwoWays, groupValue: _way, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (value) { setState(() { _way = value; @@ -298,7 +299,7 @@ class _SelectTransportationMethodState widget.changeCurrentTab(1); }); }, - label: 'Next', + label: TranslationBase.of(context).next, ), ) ], diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index 7696dd09..66da39df 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -17,7 +18,7 @@ class Summary extends StatefulWidget { _SummaryState createState() => _SummaryState(); } -//TODO it should be dynamic +//TODO it should be dynamic fix it class _SummaryState extends State { @override Widget build(BuildContext context) { @@ -27,7 +28,7 @@ class _SummaryState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Summary'), + Texts(TranslationBase.of(context).RRTSummary), SizedBox(height: 5,), Container( width: double.infinity, @@ -39,11 +40,11 @@ class _SummaryState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Transportation Method',color: Colors.grey,), + Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,), Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,), SizedBox(height: 8,), - Texts('Direction',color: Colors.grey,), + Texts(TranslationBase.of(context).directions,color: Colors.grey,), Texts('From Hospital',bold: true,), SizedBox(height: 8,), @@ -66,7 +67,7 @@ class _SummaryState extends State { ), ), SizedBox(height: 20,), - Texts('Bill Amount',textAlign: TextAlign.start,), + Texts(TranslationBase.of(context).RRTSummary,textAlign: TextAlign.start,), SizedBox(height: 5,), Container( height: 55, @@ -92,7 +93,7 @@ class _SummaryState extends State { child:SecondaryButton( color: Colors.grey[800], textColor: Colors.white, - label: 'Send', + label: TranslationBase.of(context).send, onTap: () async { await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER); diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 886d47d2..e3438af5 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -31,13 +31,13 @@ class _ErOptionsState extends State { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: widget.isAppbar, + isShowDecPage: false, appBarTitle: TranslationBase.of(context).bookAppo, body: Container( margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), child: Row( diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 227cfb3b..1c786954 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -27,14 +27,15 @@ class NearestEr extends StatelessWidget { : (model) => model.getProjectAvgERWaitingTimeOrders(), builder: (_, mode, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Nearest ER', + appBarTitle: TranslationBase.of(context).er, + description: TranslationBase.of(context).erContant, baseViewModel: mode, body: mode.ProjectAvgERWaitingTimeModeList.length > 0 ? Container( child: ListView( children: [ Text( - "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", + TranslationBase.of(context).erContant, textAlign: TextAlign.center, style: TextStyle( fontSize: 18.0, diff --git a/lib/pages/ErService/widgets/StepsWidget.dart b/lib/pages/ErService/widgets/StepsWidget.dart index c5864710..40af61d0 100644 --- a/lib/pages/ErService/widgets/StepsWidget.dart +++ b/lib/pages/ErService/widgets/StepsWidget.dart @@ -13,7 +13,7 @@ class StepsWidget extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return projectViewModel.isArabic? Stack( + return !projectViewModel.isArabic? Stack( children: [ Container( height: 50, diff --git a/lib/pages/ErService/widgets/card_common.dart b/lib/pages/ErService/widgets/card_common.dart index 35ece966..0796a5bc 100644 --- a/lib/pages/ErService/widgets/card_common.dart +++ b/lib/pages/ErService/widgets/card_common.dart @@ -11,6 +11,7 @@ class CardCommonEr extends StatelessWidget { final text; final subText; final type; + const CardCommonEr( {@required this.image, @required this.text, @@ -22,7 +23,6 @@ class CardCommonEr extends StatelessWidget { return GestureDetector( onTap: () { navigateToSearch(context, this.type); - }, child: Container( margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), @@ -60,24 +60,10 @@ class CardCommonEr extends StatelessWidget { } Future navigateToSearch(context, type) async { -//===Switch case=== - if(type==0) - { - - Navigator.push( - context, - FadePage( - page: AmbulanceReq())); - } - else{ - - Navigator.push( - context, - FadePage( - page: NearestEr())); - + if (type == 0) { + Navigator.push(context, FadePage(page: AmbulanceReq())); + } else { + Navigator.push(context, FadePage(page: NearestEr())); } - - } } diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 95485da5..aa3b72ae 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -40,12 +41,25 @@ class _MyAppointmentsState extends State AuthenticatedUserObject authenticatedUserObject = locator(); + List imagesInfo = List(); + @override void initState() { _tabController = new TabController(length: 3, vsync: this); WidgetsBinding.instance.addPostFrameCallback((_) { - if (Provider.of(context, listen: false).isLogin) getPatientAppointmentHistory(); + if (Provider.of(context, listen: false).isLogin) + getPatientAppointmentHistory(); }); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/1.png')); super.initState(); } @@ -54,6 +68,8 @@ class _MyAppointmentsState extends State return AppScaffold( appBarTitle: TranslationBase.of(context).myAppointments, isShowAppBar: true, + imagesInfo: imagesInfo, + description: TranslationBase.of(context).infoMyAppointments, body: Container( child: Column(children: [ TabBar( @@ -101,14 +117,14 @@ class _MyAppointmentsState extends State if (res['MessageStatus'] == 1) { GifLoaderDialogUtils.hideDialog(context); setState(() { + isDataLoaded = true; if (res['AppoimentAllHistoryResultList'].length != 0) { + isDataLoaded = true; res['AppoimentAllHistoryResultList'].forEach((v) { widget.appoList .add(new AppoitmentAllHistoryResultList.fromJson(v)); }); sortAppointmentList(); - openAppointmentsTab(); - isDataLoaded = true; } else {} }); } else { @@ -217,6 +233,7 @@ class _MyAppointmentsState extends State filterName: element.clinicName, patientDoctorAppointment: element)); } + openAppointmentsTab(); }); } @@ -283,7 +300,7 @@ class _MyAppointmentsState extends State "assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text("No Booked Appointments", + child: Text(TranslationBase.of(context).noBookedAppo, style: TextStyle( fontSize: 16.0, )), @@ -338,8 +355,7 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text( - TranslationBase.of(context).noConfirmedAppointments, + child: Text(TranslationBase.of(context).noConfirmedAppo, style: TextStyle( fontSize: 16.0, )), @@ -393,11 +409,10 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: - Text(TranslationBase.of(context).noArrivedAppointments, - style: TextStyle( - fontSize: 16.0, - )), + child: Text(TranslationBase.of(context).noArrivedAppo, + style: TextStyle( + fontSize: 16.0, + )), ), ], ), diff --git a/lib/pages/MyAppointments/VisitTicket.dart b/lib/pages/MyAppointments/VisitTicket.dart index 54dcf13f..6f1dbdf8 100644 --- a/lib/pages/MyAppointments/VisitTicket.dart +++ b/lib/pages/MyAppointments/VisitTicket.dart @@ -2,11 +2,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class VisitTicket extends StatefulWidget { List appoList = []; @@ -48,9 +48,10 @@ class _VisitTicketState extends State { } getPatientAppointmentCurfewHistory(BuildContext context) { - loading(true); DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service.getPatientAppointmentHistory(true, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res['AppoimentAllHistoryResultList']); if (res['MessageStatus'] == 1) { setState(() { @@ -61,20 +62,13 @@ class _VisitTicketState extends State { }); } else {} }); - loading(false); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - loading(false); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - loading(false); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); - } - - loading(bool flag) { - setState(() { - isLoading = flag; }); } } diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index a89253c6..a30349ba 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -4,32 +4,32 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class ArrivedButtons { static var buttons = [ { - "title": "Arrived", - "subtitle": "Status", + "title": TranslationBase.of(AppGlobal.context).arrived, + "subtitle": TranslationBase.of(AppGlobal.context).status, "icon": "assets/images/new-design/waiting-room.png", "caller": "openReschedule" }, { - "title": "Medicines", - "subtitle": "Prescriptions", + "title": TranslationBase.of(AppGlobal.context).medicines, + "subtitle": TranslationBase.of(AppGlobal.context).medicinesSubtitle, "icon": "assets/images/new-design/medicine_prescriptions_icon.png", "caller": "prescriptions" }, { - "title": "Radiology", - "subtitle": "Services", + "title": TranslationBase.of(AppGlobal.context).radiology, + "subtitle": TranslationBase.of(AppGlobal.context).radiologySubtitle, "icon": "assets/images/new-design/radiology_service_icon.png", "caller": "radiology" }, { - "title": "Lab", - "subtitle": "Result", + "title": TranslationBase.of(AppGlobal.context).lab, + "subtitle": TranslationBase.of(AppGlobal.context).labSubtitle, "icon": "assets/images/new-design/lab_result_icon.png", "caller": "labResult" }, { - "title": "Vital Signs", - "subtitle": "Values", + "title": TranslationBase.of(AppGlobal.context).vitalSigns, + "subtitle": TranslationBase.of(AppGlobal.context).vitalSignsSubtitle, "icon": "assets/images/new-design/vital_signs.png", "caller": "VitalSigns" }, @@ -40,20 +40,20 @@ class ArrivedButtons { "caller": "insertComplaint" }, { - "title": "Insurance", - "subtitle": "Approvals", + "title": TranslationBase.of(AppGlobal.context).insurance, + "subtitle": TranslationBase.of(AppGlobal.context).insuranceSubtitle, "icon": "assets/images/new-design/insurance_approvals_icon.png", "caller": "Insurance" }, { - "title": "Ask Your", - "subtitle": "Doctor", + "title": TranslationBase.of(AppGlobal.context).askYour, + "subtitle": TranslationBase.of(AppGlobal.context).askYourSubtitle, "icon": "assets/images/new-design/ask_doctor_icon.png", "caller": "askDoc" }, { - "title": "Survey", - "subtitle": "Service", + "title": TranslationBase.of(AppGlobal.context).appoSurvey, + "subtitle": TranslationBase.of(AppGlobal.context).service, "icon": "assets/images/new-design/survey.png", "caller": "Survey" } diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 7bb45bad..c0399b8a 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -1,7 +1,9 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart'; @@ -17,6 +19,7 @@ import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.d import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -24,6 +27,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class AppointmentActions extends StatefulWidget { @@ -44,6 +48,8 @@ class AppointmentActions extends StatefulWidget { class _AppointmentActionsState extends State { List appoButtonsList = []; + ToDoCountProviderModel toDoProvider; + @override void initState() { _getAppointmentActionButtons(); @@ -52,8 +58,12 @@ class _AppointmentActionsState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + toDoProvider = Provider.of(context); var size = MediaQuery.of(context).size; - final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2; + final double itemHeight = projectViewModel.isArabic + ? ((size.height - kToolbarHeight - 24) * 0.47) / 2 + : ((size.height - kToolbarHeight - 24) * 0.4) / 2; final double itemWidth = size.width / 2; return Container( @@ -72,51 +82,62 @@ class _AppointmentActionsState extends State { onTap: () { _handleButtonClicks(e); }, - child: Container( - height: 100.0, - margin: EdgeInsets.all(9.0), - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey[400], - blurRadius: 2.0, - spreadRadius: 0.0) - ], - borderRadius: BorderRadius.circular(10), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Container( - margin: - EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), - child: Text(e.title, - overflow: TextOverflow.clip, - style: TextStyle( - color: new Color(0xFF40ACC9), - letterSpacing: 1.0, - fontSize: 20.0)), - ), - Container( - margin: - EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), - child: Text(e.subtitle, - overflow: TextOverflow.clip, - style: TextStyle( - color: Colors.black, - letterSpacing: 1.0, - fontSize: 15.0)), - ), - Container( - alignment: Alignment.bottomRight, - margin: - EdgeInsets.fromLTRB(0.0, 10.0, 10.0, 7.0), - child: Image.asset(e.icon, - width: 45.0, height: 45.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + // height: 100.0, + margin: EdgeInsets.all(7.0), + padding: EdgeInsets.only(bottom: 15.0), + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey[400], + blurRadius: 2.0, + spreadRadius: 0.0) + ], + borderRadius: BorderRadius.circular(10), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Container( + margin: + EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0), + child: Text(e.title, + overflow: TextOverflow.clip, + style: TextStyle( + color: new Color(0xFF40ACC9), + letterSpacing: 1.0, + fontSize: 18.0)), + ), + Container( + margin: + EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), + child: Text(e.subtitle, + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.black, + letterSpacing: 1.0, + fontSize: 15.0)), + ), + Container( + alignment: projectViewModel.isArabic + ? Alignment.bottomLeft + : Alignment.bottomRight, + margin: projectViewModel.isArabic + ? EdgeInsets.fromLTRB( + 10.0, 7.0, 0.0, 8.0) + : EdgeInsets.fromLTRB( + 0.0, 7.0, 10.0, 8.0), + child: Image.asset(e.icon, + width: 45.0, height: 45.0), + ), + ], ), - ], - ), + ), + ], ), )) .toList(), @@ -357,6 +378,7 @@ class _AppointmentActionsState extends State { GifLoaderDialogUtils.hideDialog(context); print(res); if (res['MessageStatus'] == 1) { + getToDoCount(); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); Navigator.of(context).pop(); } else { @@ -368,6 +390,19 @@ class _AppointmentActionsState extends State { }); } + getToDoCount() { + toDoProvider.setState(0); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber']); + } else {} + }).catchError((err) { + print(err); + }); + } + openAppointmentRadiology() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index 71bde484..1bbe471a 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -1,6 +1,10 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_countdown_timer/current_remaining_time.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:rating_bar/rating_bar.dart'; import '../AppointmentDetails.dart'; @@ -104,6 +108,23 @@ class _ApointmentCardState extends State { ), ], ), + widget.appo.patientStatusType == AppointmentType.BOOKED ? + Container( + child: CountdownTimer( + endTime: DateTime.now().millisecondsSinceEpoch + + (widget.appo.remaniningHoursTocanPay * 1000) * + 60, + widgetBuilder: (_, CurrentRemainingTime time) { + return Text( + '${time.days}:${time.hours}:${time.min}:${time.sec} ' + + TranslationBase.of(context) + .upcomingTimeLeft, + style: TextStyle( + fontSize: 12.0, + color: Color(0xff40ACC9))); + }, + ), + ) : Container(), ], ), ), diff --git a/lib/pages/MyAppointments/widgets/PrescriptionReport.dart b/lib/pages/MyAppointments/widgets/PrescriptionReport.dart index 932211ba..213e28e1 100644 --- a/lib/pages/MyAppointments/widgets/PrescriptionReport.dart +++ b/lib/pages/MyAppointments/widgets/PrescriptionReport.dart @@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -16,7 +16,10 @@ class PrescriptionReportPage extends StatefulWidget { dynamic listPres; AppoitmentAllHistoryResultList appo; - PrescriptionReportPage({@required this.prescriptionReportEnhList, @required this.listPres, @required this.appo}); + PrescriptionReportPage( + {@required this.prescriptionReportEnhList, + @required this.listPres, + @required this.appo}); @override _PrescriptionReportState createState() => _PrescriptionReportState(); @@ -113,12 +116,18 @@ class _PrescriptionReportState extends State { sendPrescriptionReportEmail() { DoctorsListService service = new DoctorsListService(); - service.sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, widget.listPres, context).then((res) { + GifLoaderDialogUtils.showMyDialog(context); + service + .sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, + widget.listPres, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail'); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); AppToast.showErrorToast(message: err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } navigateToPrescriptionDetails(PrescriptionReportEnh prescriptionReportEnh) { diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 96835d7b..fb8990b2 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; @@ -18,6 +19,8 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_countdown_timer/current_remaining_time.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -38,19 +41,29 @@ class _ToDoState extends State { AuthenticatedUserObject authenticatedUserObject = locator(); + List imagesInfo = List(); + @override void initState() { widget.patientShareResponse = new PatientShareResponse(); WidgetsBinding.instance.addPostFrameCallback((_) { - if (authenticatedUserObject.isLogin) getPatientAppointmentHistory(); + if (authenticatedUserObject.isLogin) getPatientData(); }); super.initState(); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png')); } @override Widget build(BuildContext context) { return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, + imagesInfo: imagesInfo, + isShowAppBar: true, + description: TranslationBase.of(context).infoTodo, body: SingleChildScrollView( child: Column( children: [ @@ -197,6 +210,22 @@ class _ToDoState extends State { ), ], ), + Container( + child: CountdownTimer( + endTime: DateTime.now().millisecondsSinceEpoch + + (widget.appoList[index] + .remaniningHoursTocanPay * + 1000) * + 60, + widgetBuilder: (_, CurrentRemainingTime time) { + return Text( + '${time.days}:${time.hours}:${time.min}:${time.sec} ' + TranslationBase.of(context).upcomingTimeLeft, + style: TextStyle( + fontSize: 12.0, + color: Color(0xff40ACC9))); + }, + ), + ), ], ), ), @@ -426,7 +455,8 @@ class _ToDoState extends State { } getLanguageID() async { - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); setState(() { widget.languageID = languageID; }); @@ -491,6 +521,7 @@ class _ToDoState extends State { widget.appoList.forEach((element) { print(element.isLiveCareAppointment); print(element.nextAction); + print(element.remaniningHoursTocanPay); }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); @@ -666,8 +697,8 @@ class _ToDoState extends State { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); service - .createAdvancePayment( - appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context) + .createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], + res['Fort_id'], res['PaymentMethod'], context) .then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); @@ -699,6 +730,19 @@ class _ToDoState extends State { }); } + getPatientData() async { + AppSharedPreferences sharedPref = AppSharedPreferences(); + if (await sharedPref.getObject(USER_PROFILE) != null) { + var data = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + setState(() { + print(data); + authUser = data; + }); + getPatientAppointmentHistory(); + } + } + Future navigateToPaymentMethod( context, PatientShareResponse patientShareResponse, diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index a189128a..fe2a217b 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -163,45 +163,45 @@ class _PaymentMethodState extends State { ], ), ), - Container( - margin: EdgeInsets.only(top: 25.0), - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - child: Container( - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("ApplePay"); - }, - child: Card( - elevation: 3.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "ApplePay" - ? BorderSide( - color: Colors.green, width: 5.0) - : BorderSide( - color: Colors.transparent, width: 0.0), - ), - child: Container( - height: 120.0, - padding: EdgeInsets.all(20.0), - child: SvgPicture.asset( - "assets/images/new-design/applepay.svg"), - ), - ), - ), - ), - ), - Expanded( - child: Container(), - ), - ], - ), - ), + // Container( + // margin: EdgeInsets.only(top: 25.0), + // child: Flex( + // direction: Axis.horizontal, + // children: [ + // Expanded( + // child: Container( + // child: InkWell( + // onTap: () { + // updateSelectedPaymentMethod("ApplePay"); + // }, + // child: Card( + // elevation: 3.0, + // margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + // color: Colors.white, + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10), + // side: selectedPaymentMethod == "ApplePay" + // ? BorderSide( + // color: Colors.green, width: 5.0) + // : BorderSide( + // color: Colors.transparent, width: 0.0), + // ), + // child: Container( + // height: 120.0, + // padding: EdgeInsets.all(20.0), + // child: SvgPicture.asset( + // "assets/images/new-design/applepay.svg"), + // ), + // ), + // ), + // ), + // ), + // Expanded( + // child: Container(), + // ), + // ], + // ), + // ), SizedBox( height: 150.0, ), diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index 3b19e670..d21e06a5 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -1,6 +1,8 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; import 'package:flutter/cupertino.dart'; @@ -18,8 +20,20 @@ class InsuranceApproval extends StatefulWidget { } class _InsuranceApprovalState extends State { + List imagesInfo = List(); + @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png')); return BaseView( onModelReady: widget.appointmentNo != null ? (model) => @@ -32,6 +46,7 @@ class _InsuranceApprovalState extends State { appBarTitle: TranslationBase.of(context).approvals, description: TranslationBase.of(context).infoApprovals, infoList: TranslationBase.of(context).infoApprovalPoints, + imagesInfo: imagesInfo, body: SingleChildScrollView( child: Container( margin: EdgeInsets.only( @@ -58,10 +73,10 @@ class _InsuranceApprovalState extends State { ), if (model.insuranceApproval.length > 0) Container( - width: SizeConfig.widthMultiplier * 18.0, - height: SizeConfig.heightMultiplier * 2.8, + width: 60, + height: 35, decoration: BoxDecoration( - color: Color(0xffC5272D), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(19.0)), child: Center( child: Text( @@ -87,29 +102,21 @@ class _InsuranceApprovalState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - model.insuranceApproval[index] - .patientDescription == - "In Patient" + model.insuranceApproval[index].patientDescription == "In Patient" ? Container( decoration: BoxDecoration( - color: Color(0xffB8372C), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular( 16.0)), - width: 95.0, + width: 115.0, padding: EdgeInsets.only(left: 11.5), - child: Text( - model.insuranceApproval[index] - .patientDescription == - null - ? '' - : model - .insuranceApproval[ - index] - .patientDescription, - style: TextStyle( - color: Colors.white), + child: Center( + child: Texts( + TranslationBase.of(context).inPatient, + color: Colors.white, + ), ), ) : Container( @@ -118,20 +125,14 @@ class _InsuranceApprovalState extends State { borderRadius: BorderRadius.circular( 16.0)), - width: 95.0, + width: 115.0, padding: EdgeInsets.only(left: 11.5), - child: Text( - model.insuranceApproval[index] - .patientDescription == - null - ? '' - : model - .insuranceApproval[ - index] - .patientDescription, - style: TextStyle( - color: Colors.white), + child: Center( + child: Texts( + TranslationBase.of(context).outpatient, + color: Colors.white, + ), ), ), Padding( diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index d5fac63f..5f8c6777 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -19,16 +20,19 @@ import '../base/base_view.dart'; class InsuranceCard extends StatefulWidget { int appointmentNo; + InsuranceCard({this.appointmentNo}); @override _InsuranceCardState createState() => _InsuranceCardState(); } -//TODO fix it class _InsuranceCardState extends State { InsuranceCardService _insuranceCardService = locator(); + List imagesInfo = List(); @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); + return BaseView( onModelReady: (model) => model.getInsurance(), builder: (BuildContext context, InsuranceViewModel model, Widget child) => @@ -39,6 +43,7 @@ class _InsuranceCardState extends State { appBarTitle: TranslationBase.of(context).insuranceCards, description: TranslationBase.of(context).infoInsuranceCards, infoList: TranslationBase.of(context).infoInsuranceCardsPoints, + imagesInfo: imagesInfo, body: Container( margin: EdgeInsets.only( left: SizeConfig.screenWidth * 0.004, diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index fb2cc108..f6742789 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -677,6 +677,7 @@ class _HomePageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ DashboardItem( + opacity:1.0, child: Container( width: double.infinity, padding: EdgeInsets.all(10), @@ -749,7 +750,7 @@ class _HomePageState extends State { ], ), ), - height: 100, + height: 106, imageName: 'contact_us_bg.png', opacity: 0.5, color: Colors.grey[700], diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index b47a1e75..e08f1773 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; @@ -71,7 +72,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { } bool isPageNavigated = false; - + LocationUtils locationUtils; _changeCurrentTab(int tab) { setState(() { currentTab = tab; @@ -138,7 +139,10 @@ class _LandingPageState extends State with WidgetsBindingObserver { pageController = PageController(keepPage: true); _firebaseMessaging.setAutoInitEnabled(true); - + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance + .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); if (Platform.isIOS) { diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index fc5c4eab..3243b269 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -3,12 +3,11 @@ import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingReque import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/livecare_logs.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; - -import 'livecare_type_select.dart'; class LiveCareHome extends StatefulWidget { static bool showFooterButton = true; @@ -93,40 +92,37 @@ class _LiveCareHomeState extends State hasLiveCareRequest = false; }); LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); PatientERVirtualHistoryResponse patientERVirtualHistoryResponse = new PatientERVirtualHistoryResponse(); - service - .getLivecareHistory(context) - .then((res) { - setState(() { - print(res['ErRequestHistoryList'].length); - if (res['ErRequestHistoryList'].length != 0) { - patientERVirtualHistoryResponse = - PatientERVirtualHistoryResponse.fromJson(res); - erRequestHistoryList = - patientERVirtualHistoryResponse.erRequestHistoryList; + service.getLivecareHistory(context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + setState(() { + print(res['ErRequestHistoryList'].length); + if (res['ErRequestHistoryList'].length != 0) { + patientERVirtualHistoryResponse = + PatientERVirtualHistoryResponse.fromJson(res); + erRequestHistoryList = + patientERVirtualHistoryResponse.erRequestHistoryList; - if (patientERVirtualHistoryResponse - .erRequestHistoryList[0].callStatus < - 4) { - pendingERRequestHistoryList = - patientERVirtualHistoryResponse.erRequestHistoryList[0]; - hasLiveCareRequest = true; - } else { - hasLiveCareRequest = false; - } - } - }); - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - setState(() { - isDataLoaded = true; - }); - }); + if (patientERVirtualHistoryResponse + .erRequestHistoryList[0].callStatus < + 4) { + pendingERRequestHistoryList = + patientERVirtualHistoryResponse.erRequestHistoryList[0]; + hasLiveCareRequest = true; + } else { + hasLiveCareRequest = false; + } + } + }); + setState(() { + isDataLoaded = true; + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); } } diff --git a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart index 25ec8514..e80f79ee 100644 --- a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart +++ b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart @@ -5,11 +5,11 @@ import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class LiveCareHistoryCard extends StatefulWidget { ErRequestHistoryList erRequestHistoryList; @@ -177,6 +177,7 @@ class _LiveCareHistoryCardState extends State { sendInvoiceEmail(context) { ConfirmDialog.closeAlertDialog(context); LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service .sendLiveCareInvoiceEmail( widget.erRequestHistoryList.appointmentNo.toString(), @@ -184,12 +185,13 @@ class _LiveCareHistoryCardState extends State { authUser.emailAddress, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: "LiveCare invoice sent successfully"); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } getAuthenticatedUser() async { diff --git a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart index bfd42e62..7ce39804 100644 --- a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart +++ b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart @@ -3,9 +3,9 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryR import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class LiveCarePendingRequest extends StatefulWidget { ErRequestHistoryList pendingERRequestHistoryList; @@ -149,19 +149,19 @@ class _LiveCarePendingRequestState extends State { cancelLiveCareRequest() { LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service .cancelLiveCareRequest(widget.pendingERRequestHistoryList.vCID, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast( message: "LiveCare request cancelled successfully"); + widget.getLiveCareHistory(); }) .catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - widget.getLiveCareHistory(); }); } } diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 56613034..410b7170 100644 --- a/lib/pages/livecare/widgets/clinic_card.dart +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -2,8 +2,8 @@ import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsRespon import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'ClinicTimingsDialog.dart'; @@ -90,9 +90,11 @@ class _State extends State { getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) { LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service .getLivecareClinicTiming(patientERGetClinicsList.serviceID, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { clinicsServiceTimingsResponse = @@ -129,8 +131,9 @@ class _State extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } } diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 8ce3b7b0..fc27d92b 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -17,13 +17,13 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart' import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class ClinicList extends StatefulWidget { final Function getLiveCareHistory; @@ -79,31 +79,27 @@ class _clinic_listState extends State { void startLiveCare() { bool isError = false; LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); ERAppointmentFeesResponse erAppointmentFeesResponse = new ERAppointmentFeesResponse(); - service - .getERAppointmentFees(selectedClinicID, context) - .then((res) { - if (res['HasAppointment'] == true) { - isError = true; - showLiveCareCancelDialog(res['ErrorEndUserMessage'], res); - } else { - erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); - isError = false; - } - }) - .catchError((err) { - print(err); - isError = true; - AppToast.showErrorToast(message: err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - if (!isError) - getERAppointmentTime( - erAppointmentFeesResponse.getERAppointmentFeesList); - }); + service.getERAppointmentFees(selectedClinicID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['HasAppointment'] == true) { + isError = true; + showLiveCareCancelDialog(res['ErrorEndUserMessage'], res); + } else { + erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); + isError = false; + } + if (!isError) + getERAppointmentTime( + erAppointmentFeesResponse.getERAppointmentFeesList); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + isError = true; + AppToast.showErrorToast(message: err); + }); } showLiveCareCancelDialog(String msg, res) { @@ -112,8 +108,7 @@ class _clinic_listState extends State { confirmMessage: msg, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => - {cancelAppointment(res)}, + okFunction: () => {cancelAppointment(res)}, cancelFunction: () => {}); dialog.showAlertDialog(context); } @@ -132,38 +127,37 @@ class _clinic_listState extends State { appo.appointmentDate = res['AppointmentDate']; ConfirmDialog.closeAlertDialog(context); + GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service - .cancelAppointment(appo, context) - .then((res) { - print(res); - if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - startLiveCare(); - }); + service.cancelAppointment(appo, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + startLiveCare(); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); } getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) { LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service.getERAppointmentTime(selectedClinicID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res); showLiveCarePaymentDialog( getERAppointmentFeesList, res['WatingtimeInteger']); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); AppToast.showErrorToast(message: err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } showLiveCarePaymentDialog( @@ -320,12 +314,14 @@ class _clinic_listState extends State { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service .checkPaymentStatus( Utils.getAppointmentTransID( appo.projectID, appo.clinicID, appo.appointmentNo), context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; @@ -336,27 +332,27 @@ class _clinic_listState extends State { AppToast.showErrorToast(message: res['Response_Message']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } addNewCallForPatientER(String clientRequestID) { LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service .addNewCallForPatientER(selectedClinicID, clientRequestID, context) .then((res) { - AppToast.showSuccessToast( - message: "New Call has been added successfully"); - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - widget.getLiveCareHistory(); - }); + GifLoaderDialogUtils.hideDialog(context); + AppToast.showSuccessToast( + message: "New Call has been added successfully"); + widget.getLiveCareHistory(); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); } getLanguageID() async { @@ -366,7 +362,9 @@ class _clinic_listState extends State { getLiveCareClinicsList() { isDataLoaded = false; LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service.getLivecareClinics(context).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res['PatientER_GetClinicsList'].length); if (res['MessageStatus'] == 1) { setState(() { @@ -384,15 +382,18 @@ class _clinic_listState extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } getLiveCareScheduleClinicsList() { isDataLoaded = false; LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service.getLiveCareScheduledClinics(context).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res['ClinicsHaveScheduleList'].length); if (res['MessageStatus'] == 1) { setState(() { @@ -411,9 +412,10 @@ class _clinic_listState extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } openLiveCareSelectionDialog() { @@ -605,13 +607,13 @@ class _clinic_listState extends State { void startScheduleLiveCare() { List doctorsList = []; LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); List _patientDoctorAppointmentListHospital = List(); service .getLiveCareScheduledDoctorList(context, selectedClinicID) .then((res) { - print(res['DoctorByClinicIDList']); - print(res['DoctorByClinicIDList'].length); + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { if (res['DoctorByClinicIDList'].length != 0) { @@ -650,9 +652,10 @@ class _clinic_listState extends State { context, doctorsList, _patientDoctorAppointmentListHospital); } else {} }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Future navigateToSearchResults( diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 87eaf1ce..50cada42 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -26,7 +26,7 @@ import 'package:flutter/services.dart'; import 'package:intl/intl.dart'; import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; +// import 'package:smart_progress_bar/smart_progress_bar.dart'; class ConfirmLogin extends StatefulWidget { @override @@ -69,12 +69,11 @@ class _ConfirmLogin extends State { int fingrePrintBefore; AuthenticatedUserObject authenticatedUserObject = - locator(); + locator(); AppointmentRateViewModel appointmentRateViewModel = - locator(); + locator(); ProjectViewModel projectViewModel; - @override void initState() { _getAvailableBiometrics(); @@ -262,6 +261,7 @@ class _ConfirmLogin extends State { } authenticateUser(type, isActive) { + GifLoaderDialogUtils.showMyDialog(context); if (type == 2 || type == 3) { fingrePrintBefore = type; } @@ -308,7 +308,6 @@ class _ConfirmLogin extends State { req.logInTokenID = ""; var request = CheckPatientAuthenticationReq.fromJson(req.toJson()); - GifLoaderDialogUtils.showMyDialog(context); sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); authService @@ -367,25 +366,25 @@ class _ConfirmLogin extends State { localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true); - - if (authenticated == true) { - if(user !=null && (user.logInType==2 || user.logInType ==3)){ - this.checkActivationCode(); - }else{ - var request = this.getCommonRequest(type: type); - this.getMobileInfo(request); - } - + if (authenticated == true) { + if (user != null && (user.logInType == 2 || user.logInType == 3)) { + this.checkActivationCode(); + } else { + var request = this.getCommonRequest(type: type); + this.getMobileInfo(request); + } } } } getMobileInfo(request) { + GifLoaderDialogUtils.showMyDialog(context); this .authService .getLoginInfo(request) .then((result) => { + GifLoaderDialogUtils.hideDialog(context), if (result['SMSLoginRequired'] == false) { this.loginTokenID = result.logInTokenID, @@ -422,9 +421,9 @@ class _ConfirmLogin extends State { } }) .catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } setUser() async {} @@ -460,7 +459,9 @@ class _ConfirmLogin extends State { this.deviceToken = await sharedPref.getString(PUSH_TOKEN); this.lastLogin = await sharedPref.getInt(LAST_LOGIN) != null ? await sharedPref.getInt(LAST_LOGIN) - : user !=null ? user.logInType : null; + : user != null + ? user.logInType + : null; //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); } @@ -514,7 +515,6 @@ class _ConfirmLogin extends State { .then((result) => { if (result is Map) { - result = CheckActivationCode.fromJson(result), if (this.registerd_data != null && this.registerd_data.isRegister == true) @@ -552,7 +552,6 @@ class _ConfirmLogin extends State { } checkIfUserAgreedBefore(CheckActivationCode result) { - print(result); if (result.isNeedUserAgreement == true) { //move to agreement page. } else { @@ -570,7 +569,6 @@ class _ConfirmLogin extends State { } goToHome() { - authenticatedUserObject.isLogin = true; appointmentRateViewModel.isLogin = true; projectViewModel.isLogin = true; @@ -756,7 +754,7 @@ class _ConfirmLogin extends State { bool checkIfBiometricAvailable(BiometricType biometricType) { bool isAvailable = false; - if(_availableBiometrics != null) { + if (_availableBiometrics != null) { for (var i = 0; i < _availableBiometrics.length; i++) { if (biometricType == _availableBiometrics[i]) isAvailable = true; } diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 5a5a8b19..db4ba713 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -91,22 +91,24 @@ class _Login extends State { onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), - Container( - child: TextFields( - fontWeight: FontWeight.normal, - controller: nationalIDorFile, - onChanged: (value) => {validateForm()}, - prefixIcon: Icon( - loginType == 1 - ? Icons.chrome_reader_mode - : Icons.receipt, - color: Color(0xFF40ACC9)), - padding: EdgeInsets.only( - top: 20, bottom: 20, left: 10, right: 10), - hintText: loginType == 1 - ? TranslationBase.of(context).nationalID - : TranslationBase.of(context).fileNo, - )) + Directionality( + textDirection: TextDirection.ltr, + child: Container( + child: TextFields( + fontWeight: FontWeight.normal, + controller: nationalIDorFile, + onChanged: (value) => {validateForm()}, + prefixIcon: Icon( + loginType == 1 + ? Icons.chrome_reader_mode + : Icons.receipt, + color: Color(0xFF40ACC9)), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + hintText: loginType == 1 + ? TranslationBase.of(context).nationalID + : TranslationBase.of(context).fileNo, + ))) ], ), ), diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 042f56fe..9245d6c3 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -72,7 +72,8 @@ class _Register extends State { onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), - Container( + Directionality( + textDirection:TextDirection.ltr,child:Container( child: TextFields( controller: nationalIDorFile, onChanged: (value) => validateForm(), @@ -81,7 +82,7 @@ class _Register extends State { padding: EdgeInsets.only( top: 20, bottom: 20, left: 10, right: 10), hintText: TranslationBase.of(context).nationalID, - )), + ))), Row( children: [ Expanded( diff --git a/lib/pages/medical/allergies_page.dart b/lib/pages/medical/allergies_page.dart index 7fe30a8a..459ef0f8 100644 --- a/lib/pages/medical/allergies_page.dart +++ b/lib/pages/medical/allergies_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/AllergiesViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -7,8 +8,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class AllergiesPage extends StatelessWidget { + List imagesInfo = List(); @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/alllergies/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/alllergies/ar/0.png')); return BaseView( onModelReady: (model) => model.getAllergies(), builder: (_, model, w) => AppScaffold( @@ -16,6 +19,7 @@ class AllergiesPage extends StatelessWidget { appBarTitle: TranslationBase.of(context).allergies, baseViewModel: model, description: TranslationBase.of(context).infoAllergies, + imagesInfo: imagesInfo, body: ListView.builder( itemCount: model.allergies.length, itemBuilder: (context, index) => Container( diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index 6beed0dc..e6172b7a 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -1,7 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; -import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/ask_doctor/request_type.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -12,7 +10,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class AskDoctorPage extends StatelessWidget { @override diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 9b255711..85a0cc8f 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; @@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; @@ -18,7 +20,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../../../core/model/my_balance/AdvanceModel.dart'; import 'confirm_payment_page.dart'; @@ -49,10 +50,17 @@ class _AdvancePaymentPageState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser; + List imagesInfo = List(); + @override void initState() { super.initState(); getAuthUser(); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/ar/0.png')); } @override @@ -61,7 +69,9 @@ class _AdvancePaymentPageState extends State { onModelReady: (model) => model.getHospitals(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, + imagesInfo: imagesInfo, appBarTitle: TranslationBase.of(context).advancePayment, + description: TranslationBase.of(context).infoAdvancePayment, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( @@ -101,13 +111,13 @@ class _AdvancePaymentPageState extends State { if (beneficiaryType == BeneficiaryType.MyFamilyFiles) InkWell( onTap: () { + GifLoaderDialogUtils.showMyDialog(context); model.getFamilyFiles().then((value) { + GifLoaderDialogUtils.hideDialog(context); confirmSelectFamilyDialog(model .getAllSharedRecordsByStatusResponse .getAllSharedRecordsByStatusList); - }).showProgressBar( - text: "Loading", - backgroundColor: Colors.blue.withOpacity(0.6)); + }); }, child: Container( padding: EdgeInsets.all(12), @@ -139,17 +149,16 @@ class _AdvancePaymentPageState extends State { if (beneficiaryType == BeneficiaryType.OtherAccount) InkWell( onTap: () { - if (_fileTextController.text.isNotEmpty) + if (_fileTextController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); model .getPatientInfoByPatientID( id: _fileTextController.text) .then((value) { + GifLoaderDialogUtils.hideDialog(context); confirmSelectPatientDialog(model.patientInfoList); - }).showProgressBar( - text: "Loading", - backgroundColor: - Colors.blue.withOpacity(0.6)); - else + }); + } else AppToast.showErrorToast( message: 'Please Enter The File Number'); }, @@ -262,10 +271,11 @@ class _AdvancePaymentPageState extends State { advanceModel.amount = amount; advanceModel.mobileNumber = mobileNum; advanceModel.patientName = patientName; - + GifLoaderDialogUtils.showMyDialog(context); model .getPatientInfoByPatientIDAndMobileNumber(advanceModel) .then((value) { + GifLoaderDialogUtils.hideDialog(context); if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) { Utils.hideKeyboard(context); @@ -289,9 +299,7 @@ class _AdvancePaymentPageState extends State { }, ); } - }).showProgressBar( - text: "Loading", - backgroundColor: Colors.blue.withOpacity(0.6)); + }); }, ), )), diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 4954653d..679a16db 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -19,7 +19,6 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'dialogs/ConfirmSMSDialog.dart'; import 'new_text_Field.dart'; @@ -165,16 +164,16 @@ class ConfirmPaymentPage extends StatelessWidget { label: TranslationBase.of(context).confirm.toUpperCase(), disabled: model.state == ViewState.Busy, onTap: () { + GifLoaderDialogUtils.showMyDialog(context); model .sendActivationCodeForAdvancePayment( patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD) .then((value) { + GifLoaderDialogUtils.hideDialog(context); if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(); - }).showProgressBar( - text: "Loading", - backgroundColor: Colors.blue.withOpacity(0.6)); + }); }, ), ), diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index 421e2bed..2fb8c51c 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -12,14 +13,20 @@ import 'package:hexcolor/hexcolor.dart'; import 'advance_payment_page.dart'; class MyBalancePage extends StatelessWidget { + + List imagesInfo = List(); + @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png')); return BaseView( onModelReady: (model) => model.getPatientAdvanceBalanceAmount(), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, appBarTitle: TranslationBase.of(context).myBalances, + imagesInfo: imagesInfo, + description: TranslationBase.of(context).infoMyBalance, body: Container( margin: EdgeInsets.all(12), child: Column( @@ -50,7 +57,7 @@ class MyBalancePage extends StatelessWidget { color: Colors.white, ), Texts( - '${model.totalAdvanceBalanceAmount ?? 0} SAR', + '${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar, color: Colors.white, bold: true, ), @@ -74,12 +81,13 @@ class MyBalancePage extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(model.patientAdvanceBalanceAmountList[index] - .projectDescription), + Texts( - '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} SAR', + '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} '+TranslationBase.of(context).sar, bold: true, ), + Texts(model.patientAdvanceBalanceAmountList[index] + .projectDescription), ], ), ), diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart index 9687b931..6a03b58b 100644 --- a/lib/pages/medical/doctor/doctor_home_page.dart +++ b/lib/pages/medical/doctor/doctor_home_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; @@ -15,8 +16,11 @@ import 'package:flutter/material.dart'; import 'doctor_profile_page.dart'; class DoctorHomePage extends StatelessWidget { + List imagesInfo = List(); @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/ar/1.png')); return BaseView( onModelReady: (model) => model.getMyDoctor(), builder: (context, MyDoctorViewModel model, widget) => AppScaffold( @@ -25,6 +29,7 @@ class DoctorHomePage extends StatelessWidget { appBarTitle: TranslationBase.of(context).myDoctor, description: TranslationBase.of(context).infoMyDoctor, infoList: TranslationBase.of(context).infoMyDoctorPoints, + imagesInfo: imagesInfo, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 01cb6725..9b1f5a26 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/laboratory_result_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -21,7 +22,7 @@ class LaboratoryResultPage extends StatelessWidget { orderNo: patientLabOrders.orderNo), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Laboratory result', + appBarTitle: TranslationBase.of(context).labResults, baseViewModel: model, body: Scaffold( body: ListView.builder( diff --git a/lib/pages/medical/labs/labs_home_page.dart b/lib/pages/medical/labs/labs_home_page.dart index f459a057..4b412f5b 100644 --- a/lib/pages/medical/labs/labs_home_page.dart +++ b/lib/pages/medical/labs/labs_home_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -13,8 +14,11 @@ import 'package:flutter/material.dart'; import 'laboratory_result_page.dart'; class LabsHomePage extends StatelessWidget { + List imagesInfo =List(); + @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/ar/0.png')); return BaseView( onModelReady: (model) => model.getLabs(), builder: (context, LabsViewModel model, widget) => AppScaffold( @@ -22,6 +26,7 @@ class LabsHomePage extends StatelessWidget { isShowAppBar: true, description: TranslationBase.of(context).infoLab, appBarTitle: TranslationBase.of(context).labOrders, + imagesInfo: imagesInfo, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index dcb6eea3..033295aa 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -12,8 +13,10 @@ class PatientSickLeavePage extends StatefulWidget { } class _PatientSickLeavePageState extends State { + List imagesInfo = List(); @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png')); return BaseView( onModelReady: (model) => model.getSickLeave(), builder: (_, model, w) => AppScaffold( @@ -21,6 +24,7 @@ class _PatientSickLeavePageState extends State { appBarTitle: TranslationBase.of(context).sickLeaves, description: TranslationBase.of(context).infoSickLeaves, infoList: TranslationBase.of(context).infoSickLeavePoints, + imagesInfo: imagesInfo, baseViewModel: model, body: Container( margin: EdgeInsets.all(12), diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index dad6fd17..94484340 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; @@ -18,11 +19,14 @@ class HomePrescriptionsPage extends StatefulWidget { class _HomePrescriptionsPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; + List imagesInfo = List(); @override void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/1.png')); } @override @@ -40,6 +44,7 @@ class _HomePrescriptionsPageState extends State appBarTitle: TranslationBase.of(context).prescriptions, description: TranslationBase.of(context).infoPrescriptions, infoList: TranslationBase.of(context).infoPrescriptionsPoints, + imagesInfo: imagesInfo, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 1233a89a..ebc3527d 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; @@ -12,8 +13,11 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class RadiologyHomePage extends StatelessWidget { + List imagesInfo = List(); @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/1.png')); return BaseView( onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, widget) => AppScaffold( @@ -21,6 +25,7 @@ class RadiologyHomePage extends StatelessWidget { appBarTitle: TranslationBase.of(context).radiology, baseViewModel: model, description: TranslationBase.of(context).infoRadiology, + imagesInfo: imagesInfo, body: FractionallySizedBox( widthFactor: 1.0, child: ListView( diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 5c6812e2..636d4e00 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart'; @@ -20,6 +21,7 @@ class HomeReportPage extends StatefulWidget { class _HomeReportPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; + List imagesInfo = List(); @override void initState() { @@ -35,6 +37,9 @@ class _HomeReportPageState extends State @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png')); return BaseView( onModelReady: (model) => model.getReports(), //model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( @@ -42,8 +47,7 @@ class _HomeReportPageState extends State appBarTitle: TranslationBase.of(context).monthReport, description: TranslationBase.of(context).infoMonthReport, baseViewModel: model, - //bottomSheet: Container(), - + imagesInfo: imagesInfo, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -82,32 +86,32 @@ class _HomeReportPageState extends State controller: _tabController, indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Colors.red[800], + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts('Requested'), + child: Texts(TranslationBase.of(context).requested), ), ), Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts('Ready'), + child: Texts(TranslationBase.of(context).ready), ), ), Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts('Completed'), + child: Texts(TranslationBase.of(context).completed), ), ), Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts('Cancelled'), + child: Texts(TranslationBase.of(context).cancelled), ), ), ], @@ -148,7 +152,7 @@ class _HomeReportPageState extends State height: 90, margin: EdgeInsets.all(8.0), child: Button( - label: 'Resend order & deliver', + label: TranslationBase.of(context).requestMedicalReport, backgroundColor: Colors.grey[800], onTap: () => Navigator.push( context, diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart index 3f07693b..1a5270f8 100644 --- a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -3,9 +3,9 @@ import 'dart:io'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/health_data_list.dart'; import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:url_launcher/url_launcher.dart'; class SmartWatchInstructions extends StatefulWidget { @@ -811,7 +811,9 @@ class _SmartWatchInstructionsState extends State { getLastPatientRecord(BuildContext context) { SmartWatchIntegrationService service = new SmartWatchIntegrationService(); + GifLoaderDialogUtils.showMyDialog(context); service.getLastPatientRecord(context).then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res['Med_GetPatientLastRecordList']); setState(() { @@ -822,9 +824,9 @@ class _SmartWatchInstructionsState extends State { }); } else {} }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } _openHealthDataList() { diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart index 667620a2..c4273a09 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/vital_sign_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_item.dart'; @@ -17,9 +18,13 @@ class VitalSignDetailsScreen extends StatelessWidget { int appointmentNo; int projectID; VitalSignDetailsScreen({this.appointmentNo, this.projectID}); + List imagesInfo = List(); + @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/ar/1.png')); return BaseView( onModelReady: appointmentNo != null && projectID != null ? (model) => model.getPatientRadOrders( @@ -29,6 +34,8 @@ class VitalSignDetailsScreen extends StatelessWidget { isShowAppBar: true, appBarTitle: TranslationBase.of(context).vitalSigns, baseViewModel: mode, + description: TranslationBase.of(context).infoSigns, + imagesInfo: imagesInfo, body: mode.vitalSignResModelList.length > 0 ? Container( child: ListView( diff --git a/lib/pages/medical/vital_sign/vital_sign_item.dart b/lib/pages/medical/vital_sign/vital_sign_item.dart index a42e26d5..5304bb9b 100644 --- a/lib/pages/medical/vital_sign/vital_sign_item.dart +++ b/lib/pages/medical/vital_sign/vital_sign_item.dart @@ -78,9 +78,9 @@ class VitalSignItem extends StatelessWidget { children: [ TextSpan(text: lastVal + " "), TextSpan( - text: unit, + text: " " + unit, style: TextStyle( - color: Theme.of(context).textTheme.headline1.color, + color: HexColor('#B8382C'), ), ), ]), diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index c31981f7..cc2fd7ca 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -115,12 +115,12 @@ class PaymentService extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - 'My Balances', + TranslationBase.of(context).hmg, color: HexColor('#B61422'), bold: true, ), Texts( - TranslationBase.of(context).payment, + TranslationBase.of(context).wallet, fontSize: 14, fontWeight: FontWeight.normal, ), diff --git a/lib/pages/pharmacies/medicine_search_screen.dart b/lib/pages/pharmacies/medicine_search_screen.dart index a41fde16..62cacb7f 100644 --- a/lib/pages/pharmacies/medicine_search_screen.dart +++ b/lib/pages/pharmacies/medicine_search_screen.dart @@ -1,23 +1,23 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/pharmacies_list_screen.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; -import '../base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/pharmacy/drug_item.dart'; -import 'package:diplomaticquarterapp/core/service/pharmacies_service.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/pharmacies_list_screen.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../base/base_view.dart'; class MedicineSearch extends StatelessWidget { final textController = TextEditingController(); final _formKey = GlobalKey(); + @override Widget build(BuildContext context) { return BaseView( @@ -51,11 +51,13 @@ class MedicineSearch extends StatelessWidget { controller: textController, validator: (value) { if (value.isEmpty) { - return TranslationBase.of(context).pleaseEnterMedicineName; - }else if( value.length <4){ - return TranslationBase.of(context).searchItemError; - }else - return null; + return TranslationBase.of(context) + .pleaseEnterMedicineName; + } else if (value.length < 4) { + return TranslationBase.of(context) + .searchItemError; + } else + return null; }, ), ), @@ -81,21 +83,24 @@ class MedicineSearch extends StatelessWidget { ], ), ), - if(model.pharmacy.isNotEmpty) - Container( - margin: EdgeInsets.only( - left: SizeConfig.heightMultiplier * 2), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).youCanFind+ - '${model.pharmacy == null ? '0' : model.pharmacy.length.toString()}'+ - TranslationBase.of(context).itemInSearch, - ), - ], + if (model.pharmacy.isNotEmpty) + Container( + margin: EdgeInsets.only( + left: SizeConfig.heightMultiplier * 2), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: Texts( + TranslationBase.of(context).youCanFind + + '${model.pharmacy == null ? '0' : model.pharmacy.length.toString()}' + + TranslationBase.of(context).itemInSearch, + ), + ), + ], + ), ), - ), if (model.state == ViewState.ErrorLocal) Container( child: Texts(model.error), diff --git a/lib/pages/pharmacies/pharmacies_list_screen.dart b/lib/pages/pharmacies/pharmacies_list_screen.dart index 040e5bee..dc69a3e2 100644 --- a/lib/pages/pharmacies/pharmacies_list_screen.dart +++ b/lib/pages/pharmacies/pharmacies_list_screen.dart @@ -1,20 +1,19 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:flutter/material.dart'; +import 'dart:convert'; +import 'dart:typed_data'; + import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:maps_launcher/maps_launcher.dart'; -import '../base/base_view.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; -import 'dart:typed_data'; -import 'dart:convert'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; -import 'package:map_launcher/map_launcher.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:maps_launcher/maps_launcher.dart'; import 'package:url_launcher/url_launcher.dart'; +import '../base/base_view.dart'; + class PharmaciesList extends StatelessWidget { final int medicineID; final String imageURL; @@ -30,6 +29,7 @@ class PharmaciesList extends StatelessWidget { AppScaffold( appBarTitle: TranslationBase.of(context).pharmaciesList, baseViewModel: model, + isShowAppBar: true, body: Container( height: SizeConfig.screenHeight, child: ListView( diff --git a/lib/routes.dart b/lib/routes.dart index 1fdff27b..84438456 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/add-family-member.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/add-family_type.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; @@ -36,6 +37,7 @@ const String SYMPTOM_CHECKER = 'symptom-checker'; const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info'; const String SELECT_GENDER = 'select-gender'; const String SETTINGS = 'settings'; +const String HEALTH_WEATHER = 'health-weather'; const String APP_UPDATE = 'app_update'; var routes = { SPLASH: (_) => SplashScreen(), @@ -56,4 +58,6 @@ var routes = { SELECT_GENDER: (_) => SelectGender(), SETTINGS: (_) => Settings(), APP_UPDATE: (_) => AppUpdatePage() + SETTINGS: (_) => Settings(), + HEALTH_WEATHER: (_)=> HealthWeatherIndicator() }; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 579c0e10..a320cf6b 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -177,6 +177,72 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future getDoctorsRating( + int docID, context) async { + Map request; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null, + "doctorID": docID, + "PatientID": 0, + "License": true, + "IsRegistered": true, + "isDentalAllowedBackend": false + }; + + dynamic localRes; + + await baseAppClient.post(GET_DOCTOR_RATING_NOTES, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getDoctorsRatingDetails( + int docID, context) async { + Map request; + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null, + "DoctorID": docID, + "PatientID": 0, + "License": true, + "IsRegistered": true, + "isDentalAllowedBackend": false + }; + + dynamic localRes; + + await baseAppClient.post(GET_DOCTOR_RATING_DETAILS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future getDoctorFreeSlots( int docID, int clinicID, int projectID, BuildContext context) async { Map request; diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 4dedb37f..59f51bfc 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -50,6 +50,7 @@ const FORGOT_PATIENT_ID = const DASHBOARD = 'Services/Patients.svc/REST/PatientDashboard'; const PROFILE_SETTING = 'Services/Patients.svc/REST/GetPateintInfoForUpdate'; const SAVE_SETTING = 'Services/Patients.svc/REST/UpdatePateintInfo'; + class AuthProvider with ChangeNotifier { bool isLogin = false; bool isLoading = true; @@ -232,7 +233,7 @@ class AuthProvider with ChangeNotifier { neRequest.channel = CHANNEL; neRequest.iPAdress = IP_ADDRESS; neRequest.generalid = GENERAL_ID; - neRequest.languageID = LANGUAGE_ID; + // neRequest.languageID = LANGUAGE_ID; neRequest.deviceTypeID = DeviceTypeID; neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1; neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true; @@ -458,36 +459,36 @@ class AuthProvider with ChangeNotifier { //return Future.value(error); } } - getSettings() async{ + getSettings() async { dynamic localRes; try { await new BaseAppClient().post(PROFILE_SETTING, onSuccess: (dynamic response, int statusCode) { - localRes = response; //CheckActivationCode.fromJson(); - }, onFailure: (String error, int statusCode) { - localRes = error; - return Future.value(error); - // throw error; - }, body: {}); + localRes = response; //CheckActivationCode.fromJson(); + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + // throw error; + }, body: {}); return Future.value(localRes); } catch (error) { throw error; //return Future.value(error); } } - Future saveSettings(request) async{ + Future saveSettings(request) async { dynamic localRes; try { await new BaseAppClient().post(SAVE_SETTING, onSuccess: (dynamic response, int statusCode) { - localRes = response; //CheckActivationCode.fromJson(); - }, onFailure: (String error, int statusCode) { - localRes = error; - return Future.value(error); - // throw error; - }, body: request); + localRes = response; //CheckActivationCode.fromJson(); + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + // throw error; + }, body: request); return Future.value(localRes); } catch (error) { throw error; diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index ea2b87fd..0b0c1ef5 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -37,8 +37,10 @@ const String SENT_REQUEST_URL = 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus'; const String RECEVIED_REQUEST_URL = 'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId'; -const ACCEPT_REJECT_FAMILY = 'Services/Authentication.svc/REST/Update_FileStatus'; -const DEACTIVATE_FAMILY = 'Services/Authentication.svc/REST/DeactivateRequestByRensponse'; +const ACCEPT_REJECT_FAMILY = + 'Services/Authentication.svc/REST/Update_FileStatus'; +const DEACTIVATE_FAMILY = + 'Services/Authentication.svc/REST/DeactivateRequestByRensponse'; class FamilyFilesProvider with ChangeNotifier { bool isLogin = false; @@ -49,7 +51,9 @@ class FamilyFilesProvider with ChangeNotifier { try { dynamic localRes; var request = GetAllSharedRecordsByStatusReq(); + var result = await sharedPref.getObject(MAIN_USER); request.status = 0; + request.patientID = result["PatientID"]; await new BaseAppClient().post(GET_SHARED_RECORD_BY_STATUS, onSuccess: (dynamic response, int statusCode) { localRes = response; @@ -57,7 +61,7 @@ class FamilyFilesProvider with ChangeNotifier { AppToast.showErrorToast(message: error); throw error; }, body: request.toJson()); - + sharedPref.setObject(FAMILY_FILE, localRes); return Future.value( GetAllSharedRecordsByStatusResponse.fromJson(localRes)); @@ -80,7 +84,7 @@ class FamilyFilesProvider with ChangeNotifier { return Future.error(error); }, body: request); if (localRes != null) { - sharedPref.setObject(FAMILY_FILE, localRes); + // sharedPref.setObject(FAMILY_FILE, localRes); allSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(localRes); return Future.value(allSharedRecordsByStatusResponse); @@ -105,7 +109,7 @@ class FamilyFilesProvider with ChangeNotifier { //AppToast.showErrorToast(message: error); //throw error; }, body: request); - sharedPref.setObject(FAMILY_FILE, localRes); + //sharedPref.setObject(FAMILY_FILE, localRes); return Future.value( GetAllSharedRecordsByStatusResponse.fromJson(localRes)); } catch (error) { @@ -251,9 +255,9 @@ class FamilyFilesProvider with ChangeNotifier { Future silentLoggin(GetAllSharedRecordsByStatusList switchUser, {onSuccess, mainUser}) async { Map request = {}; - if(mainUser ==true){ + if (mainUser == true) { var currentUser = - AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER)); + AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER)); //const request = new SwitchUserRequest(); request['LogInTokenID'] = ''; request['PatientOutSA'] = currentUser.outSA; //? 1 : 0; @@ -267,9 +271,9 @@ class FamilyFilesProvider with ChangeNotifier { request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; request['activationCode'] = '0000'; request['isRegister'] = false; - }else { + } else { var currentUser = - AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); //const request = new SwitchUserRequest(); request['LogInTokenID'] = ''; @@ -309,11 +313,11 @@ class FamilyFilesProvider with ChangeNotifier { await new BaseAppClient().post(ACCEPT_REJECT_FAMILY, onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - AppToast.showErrorToast(message: error); - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request); return Future.value(localRes); } catch (error) { @@ -321,17 +325,18 @@ class FamilyFilesProvider with ChangeNotifier { throw error; } } + Future deactivateFamily(request) async { try { dynamic localRes; await new BaseAppClient().post(DEACTIVATE_FAMILY, onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - AppToast.showErrorToast(message: error); - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request); return Future.value(localRes); } catch (error) { @@ -339,6 +344,4 @@ class FamilyFilesProvider with ChangeNotifier { throw error; } } - - } diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index e3012734..5c2d3a3c 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -15,12 +15,12 @@ class LocationUtils { void getCurrentLocation() async { print("current location"); - isLocationServiceEnabled().then((value) { + Geolocator.isLocationServiceEnabled().then((value) { if (value) { - checkPermission().then((permission) { + Geolocator.checkPermission().then((permission) { if (permission == LocationPermission.always || permission == LocationPermission.whileInUse) { - getLastKnownPosition().then((value) => setLocation(value)); + Geolocator.getLastKnownPosition().then((value) => setLocation(value)); } if (permission == LocationPermission.denied || @@ -48,9 +48,9 @@ class LocationUtils { okFunction: () => { ConfirmDialog.closeAlertDialog(context), if (isPermissionError) - openAppSettings() + Geolocator.openAppSettings() else - openLocationSettings() + Geolocator.openLocationSettings() }, cancelFunction: () => {}); return dialog.showAlertDialog(context); @@ -58,8 +58,8 @@ class LocationUtils { void setLocation(Position position) { print(position); - this.sharedPref.setDouble(USER_LAT, position.latitude); - this.sharedPref.setDouble(USER_LONG, position.longitude); + this.sharedPref.setDouble(USER_LAT, position.latitude ?? 0.0); + this.sharedPref.setDouble(USER_LONG, position.longitude ?? 0.0); } void setZeroLocation() { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index e31ac717..d76c6e7d 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -898,6 +898,82 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get addedChild => localizedValues['added-child'][locale.languageCode]; String get appUpdate => localizedValues['appUpdate'][locale.languageCode]; String get ereferralSaveSuccess => localizedValues['ereferralSaveSuccess'][locale.languageCode]; + String get appoSurvey => localizedValues['appoSurvey'][locale.languageCode]; + String get labResults => localizedValues['labResults'][locale.languageCode]; + String get doctorRating => localizedValues['doctorRating'][locale.languageCode]; + String get good => localizedValues['good'][locale.languageCode]; + String get v_good => localizedValues['v-good'][locale.languageCode]; + String get excellent => localizedValues['excellent'][locale.languageCode]; + String get below_average => localizedValues['below-average'][locale.languageCode]; + String get infoSigns => localizedValues['info-signs'][locale.languageCode]; + String get infoAdvancePayment => localizedValues['info-advance-payment'][locale.languageCode]; + String get infoMyBalance => localizedValues['info-my-balance'][locale.languageCode]; + String get erContant => localizedValues['er-contant'][locale.languageCode]; + String get er => localizedValues['er'][locale.languageCode]; + String get transportationService => localizedValues['transportation-Service'][locale.languageCode]; + String get infoAmbulance => localizedValues['info-ambulance'][locale.languageCode]; + String get transportHeading => localizedValues['RRT-transport-heading'][locale.languageCode]; + String get sar => localizedValues['sar'][locale.languageCode]; + String get directionHeading => localizedValues['RRT-direction-heading'][locale.languageCode]; + String get toHospital => localizedValues['to-hospital'][locale.languageCode]; + String get fromHospital => localizedValues['from-hospital'][locale.languageCode]; + String get oneDirec => localizedValues['one-direc'][locale.languageCode]; + String get twoDirec => localizedValues['two-direc'][locale.languageCode]; + String get pickupLocation => localizedValues['pickup-location'][locale.languageCode]; + String get pickupSpot => localizedValues['pickup-spot'][locale.languageCode]; + String get insideHome => localizedValues['inside-home'][locale.languageCode]; + String get haveAppo => localizedValues['have-appo'][locale.languageCode]; + String get dropoffLocation => localizedValues['dropoff-location'][locale.languageCode]; + String get selectAll => localizedValues['select-all'][locale.languageCode]; + String get selectMap => localizedValues['select-map'][locale.languageCode]; + String get noAppointment => localizedValues['no-appointment'][locale.languageCode]; + String get patientShareB => localizedValues['patient-share'][locale.languageCode]; + String get patientShareTax => localizedValues['patient-share-tax'][locale.languageCode]; + String get patientShareTotal => localizedValues['patient-share-total'][locale.languageCode]; + String get selectAmbulate => localizedValues['select-ambulate'][locale.languageCode]; + String get wheelchair => localizedValues['wheelchair'][locale.languageCode]; + String get walker => localizedValues['walker"'][locale.languageCode]; + String get stretcher => localizedValues['stretcher'][locale.languageCode]; + String get none => localizedValues['none'][locale.languageCode]; + String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; + String get billAmount => localizedValues['bill-amount'][locale.languageCode]; + String get transportMethod => localizedValues['transport-method'][locale.languageCode]; + String get directions => localizedValues['directions'][locale.languageCode]; + + String get infoMyAppointments => localizedValues['info-my-appointments'][locale.languageCode]; + String get infoTodo => localizedValues['info-todo'][locale.languageCode]; + String get familyInfo => localizedValues['family-info'][locale.languageCode]; + String get dentalComplaints => localizedValues['dental-complains'][locale.languageCode]; + String get emptyResult => localizedValues['empty-result'][locale.languageCode]; + + String get noBookedAppo => localizedValues['no-booked-appointment'][locale.languageCode]; + String get noConfirmedAppo => localizedValues['no-confirmed-appointment'][locale.languageCode]; + String get noArrivedAppo => localizedValues['no-arrived-appointment'][locale.languageCode]; + String get upcomingEmpty => localizedValues['upcoming-empty'][locale.languageCode]; + String get upcomingTimeLeft => localizedValues['upcoming-timeLeft'][locale.languageCode]; + + String get covidTestAllServices => localizedValues['covid-test-all-services'][locale.languageCode]; + String get pharmacy => localizedValues['pharmacy'][locale.languageCode]; + String get ereferral => localizedValues['ereferral'][locale.languageCode]; + String get childVaccine => localizedValues['child-vaccine'][locale.languageCode]; + String get calculators => localizedValues['calculators'][locale.languageCode]; + String get converters => localizedValues['converters'][locale.languageCode]; + String get h2o => localizedValues['h2o'][locale.languageCode]; + String get vTour => localizedValues['v-tour'][locale.languageCode]; + String get hmgNews => localizedValues['hmg-news'][locale.languageCode]; + String get bloodD => localizedValues['blood-d'][locale.languageCode]; + String get symptomCheckerTitle => localizedValues['symptomCheckerTitle'][locale.languageCode]; + String get latestNews => localizedValues['latest-news'][locale.languageCode]; + String get ourLocation => localizedValues['our-location'][locale.languageCode]; + String get pharmacies => localizedValues['pharmacies'][locale.languageCode]; + String get hospitals => localizedValues['hospitals'][locale.languageCode]; + String get wallet => localizedValues['wallet'][locale.languageCode]; + String get hmg => localizedValues['hmg'][locale.languageCode]; + String get requested => localizedValues['requested'][locale.languageCode]; + String get ready => localizedValues['ready'][locale.languageCode]; + String get completed => localizedValues['completed'][locale.languageCode]; + String get cancelled => localizedValues['cancelled'][locale.languageCode]; + String get requestMedicalReport => localizedValues['request-medical-report'][locale.languageCode]; String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; String get referralDate => localizedValues['referralDate'][locale.languageCode]; diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 21cbebba..1ae7b684 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -10,8 +10,9 @@ import 'bottom_navigation_item.dart'; class BottomNavBar extends StatefulWidget { final ValueChanged changeIndex; - final int index ; - BottomNavBar({Key key, this.changeIndex,this.index}) : super(key: key); + final int index; + + BottomNavBar({Key key, this.changeIndex, this.index}) : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); @@ -52,29 +53,28 @@ class _BottomNavBarState extends State { currentIndex: 1, name: TranslationBase.of(context).medicalProfile, ), - if(widget.index == 0) - Expanded( - child: SizedBox( - height: 50, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox(height: 22), - ], - ), - ), - ), - if(widget.index != 0) - BottomNavigationItem( - icon: EvaIcons.calendar, - activeIcon: EvaIcons.calendar, - changeIndex: _changeIndex, - index: _index, - currentIndex: 2, - name: TranslationBase.of(context).bookAppo, - ), - + if (widget.index == 0) + Expanded( + child: SizedBox( + height: 50, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(height: 22), + ], + ), + ), + ), + if (widget.index != 0) + BottomNavigationItem( + icon: EvaIcons.calendar, + activeIcon: EvaIcons.calendar, + changeIndex: _changeIndex, + index: _index, + currentIndex: 2, + name: TranslationBase.of(context).bookAppo, + ), BottomNavigationItem( icon: DQIcons.family, activeIcon: DQIcons.family, diff --git a/lib/widgets/data_display/medical/medical_profile_item.dart b/lib/widgets/data_display/medical/medical_profile_item.dart index 6aadb3e0..8c14fb02 100644 --- a/lib/widgets/data_display/medical/medical_profile_item.dart +++ b/lib/widgets/data_display/medical/medical_profile_item.dart @@ -25,7 +25,7 @@ class MedicalProfileItem extends StatelessWidget { showBorder: true, borderWidth: 0, margin: 4, - height: 120, + // height: 120, // MediaQuery.of(context).size.height * 0.12, child: Container( //width: MediaQuery.of(context).size.width * 0.25, diff --git a/lib/widgets/data_display/text.dart b/lib/widgets/data_display/text.dart index 49f31354..0515ba58 100644 --- a/lib/widgets/data_display/text.dart +++ b/lib/widgets/data_display/text.dart @@ -244,7 +244,7 @@ class _TextsState extends State { Theme.of(context).backgroundColor.withOpacity(0), ], begin: Alignment.bottomCenter, end: Alignment.topCenter), ), - height: 30.0, + height: 32.0, ), ) ], diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index f9658c02..cc77d17d 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -11,12 +11,12 @@ import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:url_launcher/url_launcher.dart'; import '../../config/size_config.dart'; @@ -40,7 +40,8 @@ class _AppDrawerState extends State { var familyFileProvider = FamilyFilesProvider(); AuthenticatedUser user; AuthenticatedUser mainUser; - AuthenticatedUserObject authenticatedUserObject = locator(); + AuthenticatedUserObject authenticatedUserObject = locator< + AuthenticatedUserObject>(); VitalSignService _vitalSignService = locator(); @@ -48,7 +49,10 @@ class _AppDrawerState extends State { Widget build(BuildContext context) { projectProvider = Provider.of(context); return SizedBox( - width: MediaQuery.of(context).size.width * 0.75, + width: MediaQuery + .of(context) + .size + .width * 0.75, child: Container( color: Colors.white, child: Drawer( @@ -67,66 +71,67 @@ class _AppDrawerState extends State { children: [ Container( child: - Image.asset('assets/images/DQ/DQ_logo.png'), + Image.asset('assets/images/DQ/DQ_logo.png'), margin: EdgeInsets.all( SizeConfig.imageSizeMultiplier * 4), ), (user != null && projectProvider.isLogin) ? Padding( - padding: EdgeInsets.all(15), - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, + padding: EdgeInsets.all(15), + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Row( children: [ - Row( - children: [ - Padding( - padding: EdgeInsets.only( - right: 5), - child: Icon( - Icons.account_circle, - color: Color(0xFF40ACC9), - )), - AppText( - user.firstName + - ' ' + - user.lastName, + Padding( + padding: EdgeInsets.only( + right: 5), + child: Icon( + Icons.account_circle, color: Color(0xFF40ACC9), - ) - ], - ), - Row(children: [ - Padding( - padding: EdgeInsets.only( - left: 30, top: 5), - child: Column( - children: [ - AppText( - TranslationBase.of( - context) - .fileno + - ": " + - user.patientID - .toString(), - color: - Color(0xFF40ACC9), - fontSize: SizeConfig - .textMultiplier * - 1.5, - ), - AppText( - user.bloodGroup != null - ? 'Blood Group: ' + - user.bloodGroup - : '', - fontSize: SizeConfig - .textMultiplier * - 1.5, - ), - ], - )) - ]) - ])) + )), + AppText( + user.firstName + + ' ' + + user.lastName, + color: Color(0xFF40ACC9), + ) + ], + ), + Row(children: [ + Padding( + padding: EdgeInsets.only( + left: 30, top: 5), + child: Column( + children: [ + AppText( + TranslationBase + .of( + context) + .fileno + + ": " + + user.patientID + .toString(), + color: + Color(0xFF40ACC9), + fontSize: SizeConfig + .textMultiplier * + 1.5, + ), + AppText( + user.bloodGroup != null + ? 'Blood Group: ' + + user.bloodGroup + : '', + fontSize: SizeConfig + .textMultiplier * + 1.5, + ), + ], + )) + ]) + ])) : SizedBox(), ], ), @@ -138,7 +143,9 @@ class _AppDrawerState extends State { children: [ InkWell( child: DrawerItem( - TranslationBase.of(context).arabicChange, + TranslationBase + .of(context) + .arabicChange, Icons.translate), onTap: () { // Navigator.of(context).pushNamed( @@ -153,192 +160,263 @@ class _AppDrawerState extends State { ), (user != null && projectProvider.isLogin) ? Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - InkWell( - child: DrawerItem( - TranslationBase.of(context).family, - Icons.group, - textColor: Color(0xFF40ACC9), - iconColor: Color(0xFF40ACC9), - bottomLine: false, - sideArrow: true, - ), - onTap: () { - Navigator.of(context).pushNamed( - MY_FAMILIY, - ); - }, - ), - FutureBuilder( - future: getFamilyFiles(), // async work - builder: (BuildContext context, - AsyncSnapshot< - GetAllSharedRecordsByStatusResponse> - snapshot) { - switch (snapshot.connectionState) { - case ConnectionState.waiting: - return Padding( - padding: EdgeInsets.all(10), - child: Text('Loading....')); - default: - if (snapshot.hasError) - return Padding( - padding: EdgeInsets.all(10), - child: Text(snapshot.error)); - else - return Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - // <--- left side - color: Colors.grey[200], - width: 1.0, - ), - )), - child: Column( - children: [ - user.isFamily == true - ? Container( - padding: - EdgeInsets.only( - bottom: 5), + mainAxisAlignment: MainAxisAlignment.start, + children: [ + user.isFamily == null || user.isFamily == false + ? InkWell( + child: DrawerItem( + TranslationBase + .of(context) + .family, + Icons.group, + textColor: Color(0xFF40ACC9), + iconColor: Color(0xFF40ACC9), + bottomLine: false, + sideArrow: true, + ), + onTap: () { + Navigator.of(context).pushNamed( + MY_FAMILIY, + ); + }, + ) + : SizedBox(), + FutureBuilder( + future: getFamilyFiles(), // async work + builder: (BuildContext context, + AsyncSnapshot< + GetAllSharedRecordsByStatusResponse> + snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.all(10), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text(snapshot.error)); + else + return Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + // <--- left side + color: Colors.grey[200], + width: 1.0, + ), + )), + child: Column( + children: [ + user.isFamily == true + ? Container( + padding: + EdgeInsets.only( + bottom: 5), + child: InkWell( + onTap: () { + switchUser( + mainUser, + context); + }, + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: < + Widget>[ + Expanded( + child: Icon( + Icons + .person), + ), + Expanded( + flex: 7, + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: < + Widget>[ + AppText( + mainUser + .firstName + + ' ' + + mainUser + .lastName), + AppText( + TranslationBase + .of( + context) + .fileno + + ": " + + mainUser + .patientID + .toString()), + ])), + ], + ))) + : SizedBox(), + Column( + mainAxisAlignment: + MainAxisAlignment + .start, + mainAxisSize: + MainAxisSize.min, + children: snapshot.data + .getAllSharedRecordsByStatusList + .map( + (result) { + return result + .status == + 3 + ? Container( + padding: EdgeInsets + .only( + bottom: + 5), child: InkWell( onTap: () { switchUser( - mainUser, + result, context); }, child: Row( crossAxisAlignment: - CrossAxisAlignment - .start, + CrossAxisAlignment + .start, children: < Widget>[ Expanded( - child: Icon( - Icons - .person), + child: + Icon(Icons + .person, + color: result + .responseID == + user + .patientID + ? Color( + 0xFF40ACC9) + : Colors + .black), ), Expanded( flex: 7, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText(mainUser.firstName + ' ' + mainUser.lastName), - AppText(TranslationBase.of(context).fileno + ": " + mainUser.patientID.toString()), - ])), + child: Padding( + padding: EdgeInsets + .only( + left: 5, + right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: < + Widget>[ + AppText( + result + .patientName, + color: result + .responseID == + user + .patientID + ? Color( + 0xFF40ACC9) + : Colors + .black), + AppText( + TranslationBase + .of( + context) + .fileno + + ": " + + result + .iD + .toString(), + color: result + .responseID == + user + .patientID + ? Color( + 0xFF40ACC9) + : Colors + .black), + ]))), ], ))) - : SizedBox(), - Column( - mainAxisAlignment: - MainAxisAlignment - .start, - mainAxisSize: - MainAxisSize.min, - children: snapshot.data - .getAllSharedRecordsByStatusList - .map( - (result) { - return result - .status == - 3 - ? Container( - padding: EdgeInsets - .only( - bottom: - 5), - child: InkWell( - onTap: () { - switchUser( - result, - context); - }, - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: < - Widget>[ - Expanded( - child: - Icon(Icons.person, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), - ), - Expanded( - flex: 7, - child: Padding( - padding:EdgeInsets.only(left:5, right:5), - child:Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), - AppText(TranslationBase.of(context).fileno + ": " + result.iD.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), - ]))), - ], - ))) - : SizedBox(); - }).toList()) - ], - )); - } - }, - ), - InkWell( - child: DrawerItem( - TranslationBase.of(context) - .notification, - Icons.notifications), - onTap: () { - //NotificationsPage - Navigator.of(context).pop(); - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - NotificationsPage())); - }, - ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).appsetting, - Icons.settings_input_composite), - onTap: () { - Navigator.of(context).pushNamed( - SETTINGS, - ); - }, - ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).rateApp, - Icons.star), - onTap: () { - if (Platform.isIOS) { - launch( - "https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978"); - } else { - launch( - "https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en"); - } - }, - ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).logout, - Icons.lock_open), - onTap: () { - logout(); - }, - ) - ], - ) + : SizedBox(); + }).toList()) + ], + )); + } + }, + ), + InkWell( + child: DrawerItem( + TranslationBase + .of(context) + .notification, + Icons.notifications), + onTap: () { + //NotificationsPage + Navigator.of(context).pop(); + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + NotificationsPage())); + }, + ), + InkWell( + child: DrawerItem( + TranslationBase + .of(context) + .appsetting, + Icons.settings_input_composite), + onTap: () { + Navigator.of(context).pushNamed( + SETTINGS, + ); + }, + ), + InkWell( + child: DrawerItem( + TranslationBase + .of(context) + .rateApp, + Icons.star), + onTap: () { + if (Platform.isIOS) { + launch( + "https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978"); + } else { + launch( + "https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en"); + } + }, + ), + InkWell( + child: DrawerItem( + TranslationBase + .of(context) + .logout, + Icons.lock_open), + onTap: () { + logout(); + }, + ) + ], + ) : InkWell( - child: DrawerItem( - TranslationBase.of(context).loginregister, - Icons.lock_open), - onTap: () { - login(); - }, - ), + child: DrawerItem( + TranslationBase + .of(context) + .loginregister, + Icons.lock_open), + onTap: () { + login(); + }, + ), ], ) ], @@ -357,7 +435,9 @@ class _AppDrawerState extends State { children: [ Column( children: [ - Text(TranslationBase.of(context).poweredBy), + Text(TranslationBase + .of(context) + .poweredBy), Image.asset( 'assets/images/cs_logo_container.png', width: SizeConfig.imageSizeMultiplier * 30, @@ -410,8 +490,8 @@ class _AppDrawerState extends State { authenticatedUserObject.logout(); projectProvider.isLogin = false; await authenticatedUserObject.getUser(); - _vitalSignService.heightCm =""; - _vitalSignService.weightKg =""; + _vitalSignService.heightCm = ""; + _vitalSignService.weightKg = ""; await sharedPref.clear(); this.user = null; Navigator.of(context).pushNamed(HOME); @@ -442,18 +522,21 @@ class _AppDrawerState extends State { } switchUser(user, context) { - Utils.showProgressDialog(context); + GifLoaderDialogUtils.showMyDialog(context); this .familyFileProvider .silentLoggin(user is AuthenticatedUser ? null : user, - mainUser: user is AuthenticatedUser) - .then((value) => loginAfter(value, context)) + mainUser: user is AuthenticatedUser) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + loginAfter(value, context); + }) .catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); AppToast.showErrorToast(message: err); Navigator.of(context).pop(); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } loginAfter(result, context) async { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e465db39..c46b5616 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -10,17 +10,17 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; class MyInAppBrowser extends InAppBrowser { - static String SERVICE_URL = - 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = + // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT -// static String SERVICE_URL = -// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = + 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - static String PREAUTH_SERVICE_URL = - 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + // static String PREAUTH_SERVICE_URL = + // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT -// static String PREAUTH_SERVICE_URL = -// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + static String PREAUTH_SERVICE_URL = + 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store static List successURLS = [ 'success', diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart index 2bb12a68..a16f40ce 100644 --- a/lib/widgets/mobile-no/mobile_no.dart +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -89,7 +89,8 @@ class _MobileNo extends State { }).toList())))), ], ), - Container( + Directionality( + textDirection:TextDirection.ltr,child:Container( padding: EdgeInsets.all(5), decoration: BoxDecoration( color: Colors.white, @@ -131,7 +132,7 @@ class _MobileNo extends State { ), ) ]), - ) + )) ])); } } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 976b28e1..92f660c6 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; @@ -43,6 +44,7 @@ class AppScaffold extends StatelessWidget { final List infoList; final Color backgroundColor; + final List imagesInfo; AuthenticatedUserObject authenticatedUserObject = locator(); @@ -61,7 +63,7 @@ class AppScaffold extends StatelessWidget { this.backgroundColor, this.isBottomBar, this.image, - this.infoList}); + this.infoList, this.imagesInfo}); @override Widget build(BuildContext context) { @@ -129,6 +131,7 @@ class AppScaffold extends StatelessWidget { title: appBarTitle, description: description, infoList: infoList, + imagesInfo: imagesInfo, ) : baseViewModel != null ? NetworkBaseView( @@ -136,7 +139,7 @@ class AppScaffold extends StatelessWidget { baseViewModel: baseViewModel, ) : buildBodyWidget(), - bottomSheet: bottomSheet, + bottomSheet: (Provider.of(context, listen: false).isLogin || !isShowDecPage)?bottomSheet:null, //floatingActionButton: floatingActionButton ?? floatingActionButton, // bottomNavigationBar: // this.isBottomBar == true ? BottomBarSearch() : SizedBox() diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 4de9efdf..71381a18 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -1,53 +1,41 @@ import 'dart:collection'; -import 'dart:convert'; +import 'dart:math'; import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/pages/ErService/NearestEr.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; -import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; +import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; -import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_result.dart'; import 'package:speech_to_text/speech_to_text.dart'; -import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart'; -import 'dart:math'; -import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; -import 'package:diplomaticquarterapp/routes.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; -import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; -import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; class BottomBarSearch extends StatefulWidget { @override @@ -76,6 +64,7 @@ class _SearchBot extends State { bool _isInit = true; TextEditingController searchController = TextEditingController(); + @override void initState() { requestPermissions(); @@ -432,10 +421,12 @@ class _SearchBot extends State { List arr = []; List arrDistance = []; DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service .getDoctorsList(clinicId, projectId, false, context, doctorId: doctorId, doctorName: doctorName) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && @@ -483,9 +474,10 @@ class _SearchBot extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Future navigateToDoctorProfile(context, docObject, docProfile, diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 2bfacaea..2d1f9109 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -40,6 +40,7 @@ import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -55,7 +56,6 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:flutter/cupertino.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:url_launcher/url_launcher.dart'; class FloatingSearchButton extends StatefulWidget { @@ -734,10 +734,12 @@ class _FloatingSearchButton extends State List arr = []; List arrDistance = []; DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service .getDoctorsList(clinicId, projectId, isNearest, context, doctorId: doctorId, doctorName: doctorName) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && @@ -785,9 +787,10 @@ class _FloatingSearchButton extends State AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Future navigateToDoctorProfile(context, docObject, docProfile, diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index a1a2f00c..3fcb9025 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -1,5 +1,9 @@ +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; +import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -8,12 +12,24 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -class NotAutPage extends StatelessWidget { +import '../../splashPage.dart'; + +class NotAutPage extends StatefulWidget { final String title; final String description; final List infoList; + final List imagesInfo; + + NotAutPage({@required this.title, @required this.description, this.infoList, this.imagesInfo}); + + @override + _NotAutPageState createState() => _NotAutPageState(); +} + +class _NotAutPageState extends State { + + int _current = 0; - NotAutPage({@required this.title, @required this.description, this.infoList}); @override Widget build(BuildContext context) { @@ -25,7 +41,7 @@ class NotAutPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - title ?? 'Service', + widget.title ?? 'Service', fontWeight: FontWeight.w800, fontSize: 25, bold: true, @@ -36,17 +52,17 @@ class NotAutPage extends StatelessWidget { height: 12, ), Texts( - description ?? 'Description', + widget.description ?? 'Description', fontWeight: FontWeight.normal, fontSize: 17, ), - if (infoList != null) + if (widget.infoList != null) SizedBox( height: 12, ), - if (infoList != null) + if (widget.infoList != null) ...List.generate( - infoList.length, + widget.infoList.length, (index) => Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -65,7 +81,7 @@ class NotAutPage extends StatelessWidget { ), ), SizedBox(width: 6,), - Expanded(child: Texts('${infoList[index]}')) + Expanded(child: Texts('${widget.infoList[index]}')) ], ), SizedBox(height: 12,), @@ -76,6 +92,7 @@ class NotAutPage extends StatelessWidget { SizedBox( height: 22, ), + if(!projectViewModel.isInternetConnection) Center( child: SizedBox( height: MediaQuery.of(context).size.height * 0.55, @@ -85,6 +102,24 @@ class NotAutPage extends StatelessWidget { : 'assets/images/wifi-EN.png'), ), ), + if(projectViewModel.isInternetConnection && widget.imagesInfo!=null) + CarouselSlider( + items: widget.imagesInfo.map((image) { + return Builder( + builder: (BuildContext context){ + return SizedBox( + width: MediaQuery.of(context).size.width * 0.50, + child: Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn)); + }, + ); + }).toList(), + options: CarouselOptions( + height: MediaQuery.of(context).size.height * 0.55, + autoPlay: widget.imagesInfo.length>1, + viewportFraction: 1.0, + ), + ), + SizedBox( height: 77, ), @@ -99,8 +134,9 @@ class NotAutPage extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( - onTap: () => Navigator.pushReplacement( - context, FadePage(page: LoginType())), + onTap: (){ + loginCheck(context); + }, label: TranslationBase.of(context).serviceInformationButton, textColor: Theme.of(context).backgroundColor), ), @@ -109,4 +145,16 @@ class NotAutPage extends StatelessWidget { ), ); } + + loginCheck(context) async{ + var data = await sharedPref.getObject(IMEI_USER_DATA); + sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); + if (data != null) { + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + } + } } diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index 39e41a93..02282c7b 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -54,7 +54,6 @@ class SMSOTP { String displayTime = ''; displayDialog(BuildContext context) async { - return showDialog( context: context, builder: (context) { @@ -80,7 +79,8 @@ class SMSOTP { height: SizeConfig.realScreenHeight * 0.5, width: SizeConfig.realScreenWidth * 0.8, child: Center( - child: Column( + child: SingleChildScrollView( + child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ type == 1 @@ -101,114 +101,117 @@ class SMSOTP { child: Padding( padding: EdgeInsets.only(top: 20), child: Directionality( - textDirection:TextDirection.ltr, - child:Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - width: SizeConfig.realScreenWidth * 0.15, - child: TextFormField( - textInputAction: TextInputAction.next, - style: buildTextStyle(), - autofocus: true, - maxLength: 1, - controller: digit1, - textAlign: TextAlign.center, - keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), - onSaved: (val) {}, - validator: validateCodeDigit, - onFieldSubmitted: (_) { - FocusScope.of(context).requestFocus(focusD2); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD2); - verifyAccountFormValue['digit1'] = - val.trim(); - checkValue(); - } - }, - ), - ), - Container( - width: SizeConfig.realScreenWidth * 0.15, - child: TextFormField( - focusNode: focusD2, - textInputAction: TextInputAction.next, - maxLength: 1, - controller: digit2, - textAlign: TextAlign.center, - style: buildTextStyle(), - keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), - onSaved: (val) {}, - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD3); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD3); - verifyAccountFormValue['digit2'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit), - ), - Container( - width: SizeConfig.realScreenWidth * 0.15, - child: TextFormField( - focusNode: focusD3, + textDirection: TextDirection.ltr, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + width: SizeConfig.realScreenWidth * 0.15, + child: TextFormField( textInputAction: TextInputAction.next, + style: buildTextStyle(), + autofocus: true, maxLength: 1, - controller: digit3, + controller: digit1, textAlign: TextAlign.center, - style: buildTextStyle(), keyboardType: TextInputType.number, decoration: buildInputDecoration(context), onSaved: (val) {}, + validator: validateCodeDigit, onFieldSubmitted: (_) { FocusScope.of(context) - .requestFocus(focusD4); + .requestFocus(focusD2); }, onChanged: (val) { if (val.length == 1) { FocusScope.of(context) - .requestFocus(focusD4); - verifyAccountFormValue['digit3'] = + .requestFocus(focusD2); + verifyAccountFormValue['digit1'] = val.trim(); checkValue(); } }, - validator: validateCodeDigit)), - Container( - width: SizeConfig.realScreenWidth * 0.15, - child: TextFormField( - focusNode: focusD4, - maxLength: 1, - textAlign: TextAlign.center, - style: buildTextStyle(), - controller: digit4, - keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); - }, - onChanged: (val) { - if (val.length == 1) { - verifyAccountFormValue['digit4'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit)), - ], - )), + ), + ), + Container( + width: SizeConfig.realScreenWidth * 0.15, + child: TextFormField( + focusNode: focusD2, + textInputAction: TextInputAction.next, + maxLength: 1, + controller: digit2, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD3); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD3); + verifyAccountFormValue['digit2'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit), + ), + Container( + width: SizeConfig.realScreenWidth * 0.15, + child: TextFormField( + focusNode: focusD3, + textInputAction: TextInputAction.next, + maxLength: 1, + controller: digit3, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType.number, + decoration: + buildInputDecoration(context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + verifyAccountFormValue['digit3'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + Container( + width: SizeConfig.realScreenWidth * 0.15, + child: TextFormField( + focusNode: focusD4, + maxLength: 1, + textAlign: TextAlign.center, + style: buildTextStyle(), + controller: digit4, + keyboardType: TextInputType.number, + decoration: + buildInputDecoration(context), + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + verifyAccountFormValue['digit4'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + ], + )), ), ), Padding( @@ -221,7 +224,7 @@ class SMSOTP { textAlign: TextAlign.center, )) ], - )), + ))), ); }), ); @@ -270,9 +273,11 @@ class SMSOTP { checkValue() { //print(verifyAccountFormValue); if (verifyAccountForm.currentState.validate()) { - onSuccess(digit1.text.toString()+digit2.text.toString()+digit3.text.toString()+digit4.text.toString()); + onSuccess(digit1.text.toString() + + digit2.text.toString() + + digit3.text.toString() + + digit4.text.toString()); } - } getSecondsAsDigitalClock(int inputSeconds) { diff --git a/lib/widgets/pharmacy/drug_item.dart b/lib/widgets/pharmacy/drug_item.dart index b50f825a..05f6ef4c 100644 --- a/lib/widgets/pharmacy/drug_item.dart +++ b/lib/widgets/pharmacy/drug_item.dart @@ -29,7 +29,7 @@ class _MedicineItemWidgetState extends State { @override Widget build(BuildContext context) { return new RoundedContainer( - height: SizeConfig.heightMultiplier * 12.9, + height: SizeConfig.heightMultiplier * 13.1, child: Padding( padding: const EdgeInsets.all(2.0), child: Row( diff --git a/lib/widgets/weather_slider/weather_slider.dart b/lib/widgets/weather_slider/weather_slider.dart new file mode 100644 index 00000000..61d5c1d5 --- /dev/null +++ b/lib/widgets/weather_slider/weather_slider.dart @@ -0,0 +1,191 @@ +import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class WeatherSlider extends StatelessWidget { + // final width; + // final LinearGradient color; + final GetCityInfoList data; + WeatherSlider(this.data); + LinearGradient red = LinearGradient( + colors: [ + Colors.redAccent[100], + Colors.redAccent + ]); + LinearGradient green = LinearGradient( + colors: [ + Colors.greenAccent[100], + Colors.greenAccent + ]); + LinearGradient grey = LinearGradient( + colors: [ + Colors.grey[100], + Colors.grey + ]); + LinearGradient orange = LinearGradient( + colors: [ + Colors.orangeAccent[100], + Colors.orange + ]); + LinearGradient yellow = LinearGradient( + colors: [ + Colors.yellow[100], + Colors.yellow[600] + ]); + @override + Widget build(BuildContext context) { + // TODO: implement build + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top:10), + child: AppText(data.name)), + AppText( + data.category, + fontSize: 24, + ), + Padding( + padding: EdgeInsets.all(10), + child: Stack( + children: [ + Container( + margin: EdgeInsets.only(bottom:10), + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [Colors.grey[100], Colors.grey[400]]), + borderRadius: BorderRadius.circular(10)), + height: 15, + width: MediaQuery.of(context).size.width, + child: SizedBox(), + ), + Positioned( + top: 0, + child: Container( + decoration: BoxDecoration( + gradient: data.colorName =='red' ? red : data.colorName =='orange' ? orange : data.colorName =='green' ? green : data.colorName == 'yellow' ? yellow : grey, + borderRadius: BorderRadius.circular(10)), + height: 15, + width: (MediaQuery.of(context).size.width * (double.parse(data.value) / 10)), + padding: EdgeInsets.all(15), + child: SizedBox(), + )), + Positioned(child: Container( + height: 0, + width:0, + decoration: ShapeDecoration( + color:data.colorName =='red' ? Colors.redAccent : data.colorName =='orange' ? Colors.orangeAccent : data.colorName =='green' ? Colors.greenAccent : data.colorName == 'yellow' ? Colors.yellowAccent : Colors.grey, + shape: MessageBorder(), + + )),top:25, left: (MediaQuery.of(context).size.width * (double.parse(data.value) / 10)),) + + ], + ), + + ), + Padding( + padding: EdgeInsets.only(top:10), + child: data.isValuesReversed == false ? Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + data.categoriesNames.category1, + fontSize: 12, + color: data.categoriesNames.category1== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category1== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category1== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category1== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black + ), + AppText( + data.categoriesNames.category2, + fontSize: 12, + color: data.categoriesNames.category2== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category2== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category2== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category2== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black + + ), + AppText( + data.categoriesNames.category3, + fontSize: 12, + color: data.categoriesNames.category3== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category3== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category3== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category3== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black + + ), + AppText( + data.categoriesNames.category4, + fontSize: 12, + color: data.categoriesNames.category4== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category4== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category4== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category4== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black + + ), + AppText( + data.categoriesNames.category5, + fontSize: 12, + color: data.categoriesNames.category5== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category5== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category5== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category5== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black + + ), + ], + ) : Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + data.categoriesNames.category5, + fontSize: 12, + color: data.categoriesNames.category5== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category5== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category5== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category5== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black + ), + AppText( + data.categoriesNames.category4, + fontSize: 12, + color: data.categoriesNames.category4== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category4== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category4== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category4== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black + + ), + AppText( + data.categoriesNames.category3, + fontSize: 12, + color: data.categoriesNames.category3== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category3== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category3== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category3== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black + + ), + AppText( + data.categoriesNames.category2, + fontSize: 12, + color: data.categoriesNames.category2== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category2== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category2== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category2== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black + + ), + AppText( + data.categoriesNames.category1, + fontSize: 12, + color: data.categoriesNames.category1== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category1== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category1== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category1== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black + + ), + ], + )), + Padding( + padding: EdgeInsets.all(15), + child:Divider()) + ], + ); + + } +} +class MessageBorder extends ShapeBorder { + final bool usePadding; + + MessageBorder({this.usePadding = true}); + + @override + EdgeInsetsGeometry get dimensions => EdgeInsets.only(bottom: usePadding? 0 : 0); + + @override + Path getInnerPath(Rect rect, {TextDirection textDirection}) => null; + + @override + Path getOuterPath(Rect rect, {TextDirection textDirection}) { + rect = Rect.fromPoints(rect.bottomRight, rect.bottomLeft - Offset(0, 0)); + return Path() + ..addRRect(RRect.fromRectAndRadius(rect, Radius.circular(rect.height / 2))) + ..moveTo(rect.topCenter.dx - 10, rect.topCenter.dy) + ..relativeLineTo(10, -10) + ..relativeLineTo(10,10) + ..close(); + } + + @override + void paint(Canvas canvas, Rect rect, {TextDirection textDirection}) {} + + @override + ShapeBorder scale(double t) => this; +} \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index d3c16056..e74a0939 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 1.0.0+1 +version: 1.0.4+5 environment: sdk: ">=2.6.0 <3.0.0" @@ -77,9 +77,6 @@ dependencies: # charts charts_flutter: ^0.9.0 - #image banner slider - carousel_slider: ^2.3.1 - google_maps_flutter: ^1.0.3 # Qr code Scanner @@ -97,6 +94,9 @@ dependencies: # Location Helper map_launcher: ^0.8.1 + #carousel slider + carousel_slider: ^2.3.1 + #Calendar Events manage_calendar_events: ^1.0.2 @@ -106,8 +106,6 @@ dependencies: #Circular progress bar for reverse timer circular_countdown_timer: ^0.0.5 - smart_progress_bar: ^0.1.6 - #Just Audio to play ringing for incoming video call just_audio: ^0.3.4 @@ -138,11 +136,13 @@ dependencies: device_calendar: ^3.1.0 #Handle Geolocation - geolocator: ^6.0.0+1 + geolocator: ^6.1.10 screen: ^0.0.5 #google maps places google_maps_place_picker: ^1.0.0 +#countdown timer for Upcoming List + flutter_countdown_timer: ^1.4.0 #Dependencies for video call implementation native_device_orientation: ^0.3.0 @@ -150,8 +150,8 @@ dependencies: # recase: ^3.0.0 wakelock: ^0.1.4 after_layout: ^1.0.7 - twilio_programmable_video: ^0.5.0+3 - flutter_tts: ^1.2.6 + twilio_programmable_video: ^0.6.3+1 + flutter_tts: any vibration: ^1.7.2 speech_to_text: path: speech_to_text