diff --git a/android/app/build.gradle b/android/app/build.gradle index 06128dc0..e4d2cb78 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'] +// } } } @@ -81,7 +103,6 @@ dependencies { // Dependency on a remote binary // implementation 'com.example.android:app-magic:12.3' - implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava' - - + + } 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"> - - - - - - - - - - - - - diff --git a/assets/images/pharmacy/Group 1207.svg b/assets/images/pharmacy/Group 1207.svg deleted file mode 100644 index fd2ffd41..00000000 --- a/assets/images/pharmacy/Group 1207.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/assets/images/pharmacy/aramex_shipping_logo.svg b/assets/images/pharmacy/aramex_shipping_logo.svg deleted file mode 100644 index 30cc03b8..00000000 --- a/assets/images/pharmacy/aramex_shipping_logo.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - diff --git a/assets/images/pharmacy/arrow_right.svg b/assets/images/pharmacy/arrow_right.svg deleted file mode 100644 index b4243287..00000000 --- a/assets/images/pharmacy/arrow_right.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/assets/images/pharmacy/check_icon.svg b/assets/images/pharmacy/check_icon.svg deleted file mode 100644 index cfa4f441..00000000 --- a/assets/images/pharmacy/check_icon.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/assets/images/pharmacy/contact_us_icon.svg b/assets/images/pharmacy/contact_us_icon.svg deleted file mode 100644 index fa591d47..00000000 --- a/assets/images/pharmacy/contact_us_icon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/assets/images/pharmacy/credit_card_icon.svg b/assets/images/pharmacy/credit_card_icon.svg deleted file mode 100644 index 9ba6c2bf..00000000 --- a/assets/images/pharmacy/credit_card_icon.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/assets/images/pharmacy/delete_red_icon.svg b/assets/images/pharmacy/delete_red_icon.svg deleted file mode 100644 index 8897a683..00000000 --- a/assets/images/pharmacy/delete_red_icon.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/assets/images/pharmacy/edit_icon.svg b/assets/images/pharmacy/edit_icon.svg deleted file mode 100644 index df7cca2f..00000000 --- a/assets/images/pharmacy/edit_icon.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/images/pharmacy/empty_box.svg b/assets/images/pharmacy/empty_box.svg deleted file mode 100644 index 05816608..00000000 --- a/assets/images/pharmacy/empty_box.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/assets/images/pharmacy/hmg_shipping_logo.svg b/assets/images/pharmacy/hmg_shipping_logo.svg deleted file mode 100644 index 8e9db3d6..00000000 --- a/assets/images/pharmacy/hmg_shipping_logo.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/assets/images/pharmacy/lakum_icon.svg b/assets/images/pharmacy/lakum_icon.svg deleted file mode 100644 index e2b223de..00000000 --- a/assets/images/pharmacy/lakum_icon.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/assets/images/pharmacy/medication_refill_icon.svg b/assets/images/pharmacy/medication_refill_icon.svg deleted file mode 100644 index d5951130..00000000 --- a/assets/images/pharmacy/medication_refill_icon.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/pharmacy/mobile_number_icon.svg b/assets/images/pharmacy/mobile_number_icon.svg deleted file mode 100644 index d98aaf29..00000000 --- a/assets/images/pharmacy/mobile_number_icon.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/images/pharmacy/my_family_icon.svg b/assets/images/pharmacy/my_family_icon.svg deleted file mode 100644 index 838b357e..00000000 --- a/assets/images/pharmacy/my_family_icon.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/pharmacy/my_prescription_icon.svg b/assets/images/pharmacy/my_prescription_icon.svg deleted file mode 100644 index bda0e22e..00000000 --- a/assets/images/pharmacy/my_prescription_icon.svg +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/pharmacy/orders_icon.svg b/assets/images/pharmacy/orders_icon.svg deleted file mode 100644 index f09ae19d..00000000 --- a/assets/images/pharmacy/orders_icon.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/assets/images/pharmacy/our_locations_icon.svg b/assets/images/pharmacy/our_locations_icon.svg deleted file mode 100644 index 2be16631..00000000 --- a/assets/images/pharmacy/our_locations_icon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/assets/images/pharmacy/pill_reminder_icon.svg b/assets/images/pharmacy/pill_reminder_icon.svg deleted file mode 100644 index f4fb4ddc..00000000 --- a/assets/images/pharmacy/pill_reminder_icon.svg +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/pharmacy/quote_end.svg b/assets/images/pharmacy/quote_end.svg deleted file mode 100644 index 083ff39a..00000000 --- a/assets/images/pharmacy/quote_end.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/assets/images/pharmacy/quote_start.svg b/assets/images/pharmacy/quote_start.svg deleted file mode 100644 index 74216f14..00000000 --- a/assets/images/pharmacy/quote_start.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/assets/images/pharmacy/review_icon.svg b/assets/images/pharmacy/review_icon.svg deleted file mode 100644 index bb826f21..00000000 --- a/assets/images/pharmacy/review_icon.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/assets/images/pharmacy/shipping_addresses_icon.svg b/assets/images/pharmacy/shipping_addresses_icon.svg deleted file mode 100644 index ebb8692f..00000000 --- a/assets/images/pharmacy/shipping_addresses_icon.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/assets/images/pharmacy/shipping_mark_icon.svg b/assets/images/pharmacy/shipping_mark_icon.svg deleted file mode 100644 index 5cf9606b..00000000 --- a/assets/images/pharmacy/shipping_mark_icon.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/assets/images/pharmacy/shipping_truck_icon.svg b/assets/images/pharmacy/shipping_truck_icon.svg deleted file mode 100644 index 8ffda974..00000000 --- a/assets/images/pharmacy/shipping_truck_icon.svg +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/pharmacy/success_check_icon.svg b/assets/images/pharmacy/success_check_icon.svg deleted file mode 100644 index ed1379b8..00000000 --- a/assets/images/pharmacy/success_check_icon.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/assets/images/pharmacy/success_review_icon.svg b/assets/images/pharmacy/success_review_icon.svg deleted file mode 100644 index f6951456..00000000 --- a/assets/images/pharmacy/success_review_icon.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/pharmacy/user_icon.svg b/assets/images/pharmacy/user_icon.svg deleted file mode 100644 index 8e978105..00000000 --- a/assets/images/pharmacy/user_icon.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/images/pharmacy/wishklist_icon.svg b/assets/images/pharmacy/wishklist_icon.svg deleted file mode 100644 index cd0ce16d..00000000 --- a/assets/images/pharmacy/wishklist_icon.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/images/pharmacy/wishlist_icon.svg b/assets/images/pharmacy/wishlist_icon.svg deleted file mode 100644 index 910a3ab8..00000000 --- a/assets/images/pharmacy/wishlist_icon.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/assets/images/pharmacy_module/ic_payment_option.png b/assets/images/pharmacy_module/ic_payment_option.png deleted file mode 100644 index 5f3fca8f..00000000 Binary files a/assets/images/pharmacy_module/ic_payment_option.png and /dev/null differ diff --git a/assets/images/pharmacy_module/ic_shipping_address.png b/assets/images/pharmacy_module/ic_shipping_address.png deleted file mode 100644 index 9566fb30..00000000 Binary files a/assets/images/pharmacy_module/ic_shipping_address.png and /dev/null differ diff --git a/assets/images/pharmacy_module/ic_shipping_mark.png b/assets/images/pharmacy_module/ic_shipping_mark.png deleted file mode 100644 index cc4b272d..00000000 Binary files a/assets/images/pharmacy_module/ic_shipping_mark.png and /dev/null differ diff --git a/assets/images/pharmacy_module/ic_shipping_truck.png b/assets/images/pharmacy_module/ic_shipping_truck.png deleted file mode 100644 index 274ae1da..00000000 Binary files a/assets/images/pharmacy_module/ic_shipping_truck.png and /dev/null differ diff --git a/assets/images/pharmacy_module/lakum/Account_activation_icon.png b/assets/images/pharmacy_module/lakum/Account_activation_icon.png deleted file mode 100644 index dc93366c..00000000 Binary files a/assets/images/pharmacy_module/lakum/Account_activation_icon.png and /dev/null differ diff --git a/assets/images/pharmacy_module/lakum/Lakum_transfer_icon.png b/assets/images/pharmacy_module/lakum/Lakum_transfer_icon.png deleted file mode 100644 index b7d33dd6..00000000 Binary files a/assets/images/pharmacy_module/lakum/Lakum_transfer_icon.png and /dev/null differ diff --git a/assets/images/pharmacy_module/lakum/expired_icon.png b/assets/images/pharmacy_module/lakum/expired_icon.png deleted file mode 100644 index 9a980984..00000000 Binary files a/assets/images/pharmacy_module/lakum/expired_icon.png and /dev/null differ diff --git a/assets/images/pharmacy_module/lakum/inactive_cross.png b/assets/images/pharmacy_module/lakum/inactive_cross.png deleted file mode 100644 index 5a592b7a..00000000 Binary files a/assets/images/pharmacy_module/lakum/inactive_cross.png and /dev/null differ diff --git a/assets/images/pharmacy_module/lakum/lakum_card_front_bg.png b/assets/images/pharmacy_module/lakum/lakum_card_front_bg.png deleted file mode 100644 index 73323a0e..00000000 Binary files a/assets/images/pharmacy_module/lakum/lakum_card_front_bg.png and /dev/null differ diff --git a/assets/images/pharmacy_module/lakum/lakum_checkout.png b/assets/images/pharmacy_module/lakum/lakum_checkout.png deleted file mode 100644 index e0230a00..00000000 Binary files a/assets/images/pharmacy_module/lakum/lakum_checkout.png and /dev/null differ diff --git a/assets/images/pharmacy_module/lakum/waiting_gained_icon.png b/assets/images/pharmacy_module/lakum/waiting_gained_icon.png deleted file mode 100644 index 37ff1ac9..00000000 Binary files a/assets/images/pharmacy_module/lakum/waiting_gained_icon.png and /dev/null differ diff --git a/assets/images/pharmacy_module/lakum/will_be_expired_icon.png b/assets/images/pharmacy_module/lakum/will_be_expired_icon.png deleted file mode 100644 index 7f31f622..00000000 Binary files a/assets/images/pharmacy_module/lakum/will_be_expired_icon.png and /dev/null differ diff --git a/assets/images/pharmacy_module/payment/aramex_shipping_logo.png b/assets/images/pharmacy_module/payment/aramex_shipping_logo.png deleted file mode 100644 index e7b45d9c..00000000 Binary files a/assets/images/pharmacy_module/payment/aramex_shipping_logo.png and /dev/null differ diff --git a/assets/images/pharmacy_module/payment/hmg_shipping_logo.png b/assets/images/pharmacy_module/payment/hmg_shipping_logo.png deleted file mode 100644 index 725b2e5e..00000000 Binary files a/assets/images/pharmacy_module/payment/hmg_shipping_logo.png and /dev/null differ diff --git a/assets/images/pharmacy_module/payment/installment.png b/assets/images/pharmacy_module/payment/installment.png deleted file mode 100644 index 034497ef..00000000 Binary files a/assets/images/pharmacy_module/payment/installment.png and /dev/null differ diff --git a/assets/images/pharmacy_module/payment/mada.png b/assets/images/pharmacy_module/payment/mada.png deleted file mode 100644 index f65b970c..00000000 Binary files a/assets/images/pharmacy_module/payment/mada.png and /dev/null differ diff --git a/assets/images/pharmacy_module/payment/mastercard.png b/assets/images/pharmacy_module/payment/mastercard.png deleted file mode 100644 index 1d48b854..00000000 Binary files a/assets/images/pharmacy_module/payment/mastercard.png and /dev/null differ diff --git a/assets/images/pharmacy_module/payment/sadad.png b/assets/images/pharmacy_module/payment/sadad.png deleted file mode 100644 index 35e0426c..00000000 Binary files a/assets/images/pharmacy_module/payment/sadad.png and /dev/null differ diff --git a/assets/images/pharmacy_module/payment/visa.png b/assets/images/pharmacy_module/payment/visa.png deleted file mode 100644 index 8d29703c..00000000 Binary files a/assets/images/pharmacy_module/payment/visa.png and /dev/null differ diff --git a/assets/images/pharmacy_module/payment_image.png b/assets/images/pharmacy_module/payment_image.png deleted file mode 100644 index ebf7a929..00000000 Binary files a/assets/images/pharmacy_module/payment_image.png and /dev/null differ diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index 44c4b26c..6bca0336 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -da98d9f0c1f407e541c636e84847ac81 \ No newline at end of file +f4a819c27119d0f472892c1088ad1ca3 \ No newline at end of file diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 6b4c0f78..f2872cf4 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ 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 bba3a934..1aa6c81d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,6 +21,10 @@ const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; 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 @@ -266,7 +270,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 = @@ -365,41 +369,12 @@ const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; -//Pharmacy wishlist -// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; - // pharmacy -const PHARMACY_VERIFY_CUSTOMER = "epharmacy/api/VerifyCustomer"; -const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer"; const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners"; const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer"; const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts"; const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/"; const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/"; -const GET_WISHLIST = "epharmacy/api/shopping_cart_items/"; -const GET_ORDER = "orders?"; -const GET_ORDER_DETAILS = "epharmacy/api/orders/"; -const GET_ADDRESS = "epharmacy/api/Customers/272843?fields=addresses"; -const GET_SHOPPING_CART = "epharmacy/api/shopping_cart_items/"; -const GET_SHIPPING_OPTIONS = "epharmacy/api/get_shipping_option/"; -const DELETE_SHOPPING_CART = "epharmacy/api/delete_shopping_cart_items/"; -const DELETE_SHOPPING_CART_ALL = - "epharmacy/api/delete_shopping_cart_item_by_customer/"; -const ORDER_SHOPPING_CART = "epharmacy/api/orders"; -const GET_LACUM_ACCOUNT_INFORMATION = - "Services/Patients.svc/REST/GetLakumAccountInformation"; -const GET_LACUM_GROUP_INFORMATION = - "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; -const LACUM_ACCOUNT_ACTIVATE = - "Services/Patients.svc/REST/LakumAccountActivation"; -const LACUM_ACCOUNT_DEACTIVATE = - "Services/Patients.svc/REST/LakumAccountDeactivation"; -const CREATE_LAKUM_ACCOUNT = - "Services/Patients.svc/REST/PHR_CreateLakumAccount"; -const TRANSFER_YAHALA_LOYALITY_POINTS = - "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; -const LAKUM_GET_USER_TERMS_AND_CONDITIONS = - "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; // Home Health Care const HHC_GET_ALL_SERVICES = @@ -430,32 +405,10 @@ const GET_CUSTOMER_ADDRESSES = const GET_CUSTOMER_INFO = "https://mdlaboratories.com/exacartapi/api/VerifyCustomer"; -//Pharmacy - -const GET_PHARMACY_CATEGORISE = - 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0'; -const GET_OFFERS_CATEGORISE = 'epharmacy/api/discountcategories'; -const GET_OFFERS_PRODUCTS = 'epharmacy/api/offerproducts/'; -const GET_CATEGORISE_PARENT = - 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; -const GET_PARENT_PRODUCTS = 'epharmacy/api/products?categoryid='; -const GET_SUB_CATEGORISE = - 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; -const GET_SUB_PRODUCTS = 'epharmacy/api/products?categoryid='; -const GET_FINAL_PRODUCTS = - 'epharmacy/api/products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId='; - const TIMER_MIN = 10; const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"; -const GET_BRANDS_LIST = 'epharmacy/api/categoryManufacturer?categoryids='; - -const GET_SEARCH_PRODUCTS = - 'epharmacy/api/searchproducts?fields=id,discount_ids,reviews,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&search_key='; - -const SCAN_QR_CODE = 'epharmacy/api/productbysku/'; - class AppGlobal { static var context; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index af1bd592..1f933203 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -187,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", @@ -522,12 +522,9 @@ 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": "الرصيد الكلي"}, - "CreateAdvancedPayment": { - "en": "Create Advanced Payment", - "ar": "إنشاء دفعة مقدمة" - }, + "BalanceAmount": {"en": "Wallet Amount", "ar": "مبلغ المحفظة"}, + "TotalBalance": {"en": "Total Amount", "ar": "المبلغ الإجمالي"}, + "CreateAdvancedPayment": {"en": "Recharge Wallet", "ar": "إعادة شحن المحفظة"}, "AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"}, "AdvancePaymentLabel": { "en": @@ -632,64 +629,6 @@ const Map localizedValues = { "ar": "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل." }, - "orders": {"en": "Orders", "ar": "الطلبات"}, - "lakum": {"en": "Lakum", "ar": "لكم"}, - "wishlist": {"en": "Wishlist", "ar": "الرغبات"}, - "reviews": {"en": "Reviews", "ar": "التقيمات"}, - // "myPrescriptions": {"en": "My Prescriptions", "ar": "وصفاتي"}, - // "medicationRefill": {"en": "Medication Refill", "ar": "تعبئة الأدوية"}, - "pillReminder": {"en": "Pill Reminder", "ar": "تذكير الأدويه"}, - "shippingAddresses": {"en": "Shipping Addresses", "ar": "عناوين الشحن"}, - "reachUs": {"en": "Reach Us", "ar": "الوصول لنا"}, - "ourLocations": {"en": "Our Locations", "ar": "مواقعنا"}, - "edit": {"en": "Edit", "ar": "تعديل"}, - "delete": {"en": "Delete", "ar": " حذف"}, - "addAddress": {"en": "ADD A NEW ADDRESS", "ar": " اضافة عنوان جديد"}, - "addNewAddress": {"en": "Add New Address", "ar": " اضافة عنوان جديد"}, - "order": {"en": "My Order", "ar": " طلباتي"}, - "delivered": {"en": "Delivered", "ar": " تم التوصيل"}, - "pending": {"en": "Pending", "ar": " معلقة "}, - "processing": {"en": "Processing", "ar": " تحت المعالجة"}, - "cancelled": {"en": "Cancelled", "ar": " ملغي"}, - "writeReview": {"en": "Write Review", "ar": " اكتب تقييمك"}, - "shareReview": {"en": "SHARE REVIEW", "ar": " اكتب تقييمك"}, - "backMyAccount": { - "en": "BACK TO MY ACCOUNT ", - "ar": " الرجوع لحسابي الشخصي" - }, - "reviewSuccessful": {"en": "Review Successful", "ar": " تقييم ناجح"}, - "reviewShared": { - "en": "Your review has been shared on product review section", - "ar": " تمت مشاركة تقييمك في قسم تقييم المنتج" - }, - "reviewComment": { - "en": "Your reviews help other to choose better product", - "ar": " تقييمك سوف يساعد الأخرين في اختيار المنتج الأفضل" - }, - "shippedMethod": {"en": "SHIP BY:", "ar": " الشحن بواسطة:"}, - "orderDetail": {"en": "Order Detail", "ar": " تفاصيل الطلب"}, - "orderSummary": {"en": "Order Summary", "ar": " تفاصيل المنتج"}, - "subtotal": {"en": "Subtotal", "ar": " المجموع"}, - "shipping": {"en": "Shipping", "ar": " الشحن"}, - "vat": {"en": "VAT (15%)", "ar": "(15%) القيمة المضافة"}, - "sar": {"en": "SAR", "ar": " ر.س "}, - "payOnline": {"en": "PAY ONLINE", "ar": "اتمام عملية الدفع "}, - "cancelOrder": {"en": "CANCEL ORDER", "ar": "الغاء الطلب "}, - "confirmAddress": {"en": "CONFIRM ADDRESS ", "ar": " تأكيد العنوان "}, - "confirmLocation": {"en": "CONFIRM LOCATION ", "ar": " تأكيد الموقع "}, - "confirmDeleteMsg": { - "en": "Are you sure! want to delete ", - "ar": "هل انت متأكد تريد الحذف " - }, - "confirmDelete": {"en": "DELETE", "ar": "حذف"}, - "confirmCancellation": { - "en": "Are you sure! want to cancel this order ", - "ar": "هل انت متأكد تريد حذف هذا المنتج " - }, - "orderNumber": {"en": "Order#: ", "ar": "الطلب: "}, - "orderDate": {"en": "Date", "ar": "التاريخ:"}, - "itemsNo": {"en": "items(s)", "ar": "عناصر"}, - "noOrder": {"en": "You Don't have any orders.", "ar": "ليس لديك طلبات"}, "TermsService": {"en": "Terms of Service", "ar": "شروط الخدمه"}, "Beforeusing": { @@ -748,26 +687,6 @@ const Map localizedValues = { "recentlyViewed": {"en": "Recently Viewed", "ar": "شوهدت مؤخرا"}, "bestSellers": {"en": "Best Sellers", "ar": "أفضل البائعين"}, "deleteAllItems": {"en": "Delete All Items", "ar": "حذف كافة العناصر"}, - "total": {"en": "Total", "ar": "المجموع"}, - "selectAddress": {"en": "Select Address", "ar": "حدد العنوان"}, - "shippingAddress": {"en": "SHIPPING ADDRESS", "ar": "عنوان الشحن"}, - "changeAddress": {"en": "Change Address", "ar": "تغيير العنوان"}, - "selectPaymentOption": { - "en": "Select Payment Option", - "ar": "حدد خيار الدفع" - }, - "changeMethod": {"en": "Change Method", "ar": "تغيير خيار الدفع"}, - "reviewOrder": {"en": "Review Order", "ar": "مراجعة الطلب"}, - "active": {"en": "ACTIVE", "ar": "فعال"}, - "inactive": {"en": "INACTIVE", "ar": "غير فعال"}, - "balance": {"en": "BALANCE", "ar": "الحالي"}, - "gained": {"en": "GAINED", "ar": "المكتسب"}, - "consumed": {"en": "CONSUMED", "ar": "المستهلك"}, - "transferred": {"en": "TRANSFERRED", "ar": "المحول"}, - "checkBeneficiary": {"en": "CHECK BENEFICIARY", "ar": "تحقق من المستفيد"}, - "beneficiaryName": {"en": "Beneficiary Name", "ar": "اسم المستفيد"}, - "accountActivation": {"en": "Account Activation", "ar": "تفعيل الحساب"}, - "acceptLbl": {"en": "Accept", "ar": "موافقة"}, "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, "select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, @@ -777,15 +696,6 @@ const Map localizedValues = { "en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك" }, - - "categorise": {"en": "Categories", "ar": "التطبيقات"}, - "wishList": {"en": "WishList", "ar": "الرغبات"}, - "myAccount": {"en": "My Account", "ar": "حسابي"}, - "cart": {"en": "Cart", "ar": "التسوق"}, - "searchProductHere": { - "en": "Search Product here", - "ar": "ابحث في الطلب الخاص بك" - }, "HHCNotAuthMsg": { "en": "This service provides a set of home health care services, continuous and comprehensive follow-up in their places of residence for those who cannot access health facilities, such as (laboratory analyzes - radiology - vaccinations - physical therapy), etc.", @@ -1038,6 +948,7 @@ const Map localizedValues = { "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 أحرف" @@ -1068,6 +979,156 @@ const Map localizedValues = { "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": + "خدمة المؤشرات الحيوية: هذه الخدمة تمكنك من الاطلاع على جميع المؤشرات الحيوية على سبيل المثال (الطول، الوزن، مؤشر كتلة الجسم، معدل نبضات القلب الخ..) التي تمت في مجموعة الحبيب الطبية وكذلك رسوم بيانية على مستوى المؤشر." + }, + "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": + "تم تصميم هذه الخدمة حتى تتمكن من دفع مبلغ مقدما او تحت الحساب سواء في حسابك او في حساب شخص اخر لدى مجموعة الحبيب الطبية." + }, + "info-my-balance": { + "en": "This service allows you to check your balance in all branchs", + "ar": "هذه الخدمه تتيح لك الاطلاع رصيدك في كل الفروع" + }, + "er-contant": { + "en": + "This service displays nearest branch among all the branches of Al Habib Medical Group based on your current location.", + "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": "المبلغ الإجمالي المستحق:" + }, + "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": + "خدمة مواعيدي: هذه الخدمة تمكنك من الاطلاع على جميع المواعيد التي قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" + }, + "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": + "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها" + }, + "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": + "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." + }, + "dental-complains": {"en": "Symptoms", "ar": "الأعراض"}, + "empty-result": { + "en": "There is no search results found", + "ar": "لايوجد نتائج" + }, + + "no-booked-appointment": { + "en": "No booked appointments", + "ar": "لا يوجد مواعيد محجوزة" + }, + "no-confirmed-appointment": { + "en": "No confirmed appointments", + "ar": "لا توجد مواعيد مؤكدة" + }, + "no-arrived-appointment": { + "en": "No arrived appointments", + "ar": "لا يوجد مواعيد" + }, + "upcoming-empty": { + "en": "You do not have any Todo actions yet.", + "ar": "ليس لديك أي إجراءات الآن." + }, + "upcoming-timeLeft": { + "en": "time left for appointment", + "ar": "الوقت المتبقي للموعد" + }, + "covid-test-all-services": { + "en": "Covid-19 Drive-Thru Test", + "ar": "فحص كورونا من داخل السيارة" + }, + "pharmacy": {"en": "Pharmacy", "ar": "الصيدلية"}, + "ereferral": {"en": "E-Referral", "ar": "طلب التحويل"}, + "child-vaccine": {"en": "Child Vaccines", "ar": "تطعيمات الأطفال"}, + "calculators": {"en": "Health Calculators", "ar": "الحاسبات الصحية"}, + "converters": {"en": "Health Converter", "ar": "تحويل القياسات"}, + "h2o": {"en": "Water Tracker", "ar": "حساب كمية الماء"}, + "v-tour": {"en": "Virtual Tour", "ar": "جولة إفتراضية"}, + "hmg-news": {"en": "HMG News", "ar": "أخبار المجموعة"}, + "blood-d": {"en": "Blood Donation", "ar": "تبرع بالدم"}, + "symptomCheckerTitle": {"en": "Symptom Checker", "ar": "مدقق الأعراض"}, + "latest-news": {"en": "Latest News", "ar": "أحدث الأخبار"}, + "our-location": {"en": "Our Locations", "ar": "موقعنا"}, + "pharmacies": {"en": "Pharmacies", "ar": "الصيدليات"}, + "hospitals": {"en": "Hospitals", "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": {"en": "Vaccination", "ar": "جدول التطعيمات"}, "welcomeBack": {"en": "Welcome back", "ar": "مرحبا مرة أخرى"}, @@ -1091,6 +1152,7 @@ const Map localizedValues = { "add-child": {"en": "Add New Child", "ar": "اضافة طفل"}, "child-name": {"en": "Child Name", "ar": "اسم الطفل"}, "childDob": {"en": "Birth Date", "ar": "تاريخ الولادة"}, + "delete": {"en": "Delete", "ar": "حذف"}, "deleted-child-mes": { "en": "The request was successful. The children have removed from the vaccination schedule subscription service.", @@ -1152,6 +1214,17 @@ const Map localizedValues = { "en": "Selected Service : ", "ar": " الخدمات المختارة : " }, + + "help": {"en": "Help", "ar": "مساعدة"}, + + "habibRobotText": { + "en": + "Hi, This is HABIB, your personal assistant. I'm here to assist you by voice commands. How can I help?", + "ar": "مرحباً ، معك حبيب مساعدك الشخصي. أنا هنا لمساعدتك بالأوامر الصوتية." + }, + + "selectAddress": {"en": "Select Address", "ar": "حدد العنوان"}, + "addNewAddress": {"en": "Add New Address", "ar": "أضف عنوان جديد"}, "cancelOrderMsg": { "en": "Are you sure!! want to cancel this order", "ar": "هل أنت واثق!! تريد إلغاء هذا الطلب" @@ -1164,16 +1237,4 @@ const Map localizedValues = { "en": "Select Home Health Care Services", "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": - "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." - }, - "help": {"en": "Help", "ar": "مساعدة"}, - - "habibRobotText":{ - "en":"Hi, This is HABIB, your personal assistant. I'm here to assist you by voice commands. How can I help?", - "ar":"مرحباً ، معك حبيب مساعدك الشخصي. أنا هنا لمساعدتك بالأوامر الصوتية." - } }; diff --git a/lib/core/model/pharmacies/Addresses.dart b/lib/core/model/pharmacies/Addresses.dart index b00b1a17..74d5a591 100644 --- a/lib/core/model/pharmacies/Addresses.dart +++ b/lib/core/model/pharmacies/Addresses.dart @@ -17,7 +17,6 @@ class Addresses { String createdOnUtc; String province; String latLong; - bool isChecked; Addresses( {this.id, @@ -37,8 +36,7 @@ class Addresses { this.customerAttributes, this.createdOnUtc, this.province, - this.latLong, - this.isChecked = false}); + this.latLong}); Addresses.fromJson(Map json) { id = json['id']; @@ -59,7 +57,6 @@ class Addresses { createdOnUtc = json['created_on_utc']; province = json['province']; latLong = json['lat_long']; - isChecked = json['isChecked']; } Map toJson() { @@ -82,7 +79,6 @@ class Addresses { data['created_on_utc'] = this.createdOnUtc; data['province'] = this.province; data['lat_long'] = this.latLong; - data['isChecked'] = this.isChecked; return data; } diff --git a/lib/core/model/pharmacies/BillingAddress.dart b/lib/core/model/pharmacies/BillingAddress.dart deleted file mode 100644 index 765ac54d..00000000 --- a/lib/core/model/pharmacies/BillingAddress.dart +++ /dev/null @@ -1,84 +0,0 @@ -class BillingAddress { - String id; - String firstName; - String lastName; - String email; - String company; - int countryId; - String country; - String stateProvinceId; - String city; - String address1; - String address2; - String zipPostalCode; - String phoneNumber; - String faxNumber; - String customerAttributes; - String createdOnUtc; - String province; - String latLong; - - BillingAddress( - {this.id, - this.firstName, - this.lastName, - this.email, - this.company, - this.countryId, - this.country, - this.stateProvinceId, - this.city, - this.address1, - this.address2, - this.zipPostalCode, - this.phoneNumber, - this.faxNumber, - this.customerAttributes, - this.createdOnUtc, - this.province, - this.latLong}); - - BillingAddress.fromJson(Map json) { - id = json['id']; - firstName = json['first_name']; - lastName = json['last_name']; - email = json['email']; - company = json['company']; - countryId = json['country_id']; - country = json['country']; - stateProvinceId = json['state_province_id']; - city = json['city']; - address1 = json['address1']; - address2 = json['address2']; - zipPostalCode = json['zip_postal_code']; - phoneNumber = json['phone_number']; - faxNumber = json['fax_number']; - customerAttributes = json['customer_attributes']; - createdOnUtc = json['created_on_utc']; - province = json['province']; - latLong = json['lat_long']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['first_name'] = this.firstName; - data['last_name'] = this.lastName; - data['email'] = this.email; - data['company'] = this.company; - data['country_id'] = this.countryId; - data['country'] = this.country; - data['state_province_id'] = this.stateProvinceId; - data['city'] = this.city; - data['address1'] = this.address1; - data['address2'] = this.address2; - data['zip_postal_code'] = this.zipPostalCode; - data['phone_number'] = this.phoneNumber; - data['fax_number'] = this.faxNumber; - data['customer_attributes'] = this.customerAttributes; - data['created_on_utc'] = this.createdOnUtc; - data['province'] = this.province; - data['lat_long'] = this.latLong; - return data; - } -} diff --git a/lib/core/model/pharmacies/Customer.dart b/lib/core/model/pharmacies/Customer.dart index e3defbbe..a5311489 100644 --- a/lib/core/model/pharmacies/Customer.dart +++ b/lib/core/model/pharmacies/Customer.dart @@ -1,10 +1,4 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/BillingAddress.dart'; - class Customer { - BillingAddress billingAddress; - BillingAddress shippingAddress; - List addresses; String fileNumber; String iqamaNumber; int isOutSa; @@ -14,6 +8,8 @@ class Customer { String phone; String countryCode; String yahalaAccountno; + String billingAddress; + String shippingAddress; String id; String username; String email; @@ -21,63 +17,50 @@ class Customer { String lastName; String languageId; String adminComment; - bool isTaxExempt; - bool hasShoppingCartItems; - bool active; - bool deleted; - bool isSystemAccount; + String isTaxExempt; + String hasShoppingCartItems; + String active; + String deleted; + String isSystemAccount; String systemName; String lastIpAddress; String createdOnUtc; String lastLoginDateUtc; String lastActivityDateUtc; - int registeredInStoreId; + String registeredInStoreId; Customer( - {this.billingAddress, - this.shippingAddress, - this.addresses, - this.fileNumber, - this.iqamaNumber, - this.isOutSa, - this.patientType, - this.gender, - this.birthDate, - this.phone, - this.countryCode, - this.yahalaAccountno, - this.id, - this.username, - this.email, - this.firstName, - this.lastName, - this.languageId, - this.adminComment, - this.isTaxExempt, - this.hasShoppingCartItems, - this.active, - this.deleted, - this.isSystemAccount, - this.systemName, - this.lastIpAddress, - this.createdOnUtc, - this.lastLoginDateUtc, - this.lastActivityDateUtc, - this.registeredInStoreId}); + {this.fileNumber, + this.iqamaNumber, + this.isOutSa, + this.patientType, + this.gender, + this.birthDate, + this.phone, + this.countryCode, + this.yahalaAccountno, + this.billingAddress, + this.shippingAddress, + this.id, + this.username, + this.email, + this.firstName, + this.lastName, + this.languageId, + this.adminComment, + this.isTaxExempt, + this.hasShoppingCartItems, + this.active, + this.deleted, + this.isSystemAccount, + this.systemName, + this.lastIpAddress, + this.createdOnUtc, + this.lastLoginDateUtc, + this.lastActivityDateUtc, + this.registeredInStoreId}); Customer.fromJson(Map json) { - billingAddress = json['billing_address'] != null - ? new BillingAddress.fromJson(json['billing_address']) - : null; - shippingAddress = json['shipping_address'] != null - ? new BillingAddress.fromJson(json['shipping_address']) - : null; - if (json['addresses'] != null) { - addresses = new List(); - json['addresses'].forEach((v) { - addresses.add(new Addresses.fromJson(v)); - }); - } fileNumber = json['file_number']; iqamaNumber = json['iqama_number']; isOutSa = json['is_out_sa']; @@ -87,6 +70,8 @@ class Customer { phone = json['phone']; countryCode = json['country_code']; yahalaAccountno = json['yahala_accountno']; + billingAddress = json['billing_address']; + shippingAddress = json['shipping_address']; id = json['id']; username = json['username']; email = json['email']; @@ -109,15 +94,6 @@ class Customer { Map toJson() { final Map data = new Map(); - if (this.billingAddress != null) { - data['billing_address'] = this.billingAddress.toJson(); - } - if (this.shippingAddress != null) { - data['shipping_address'] = this.shippingAddress.toJson(); - } - if (this.addresses != null) { - data['addresses'] = this.addresses.map((v) => v.toJson()).toList(); - } data['file_number'] = this.fileNumber; data['iqama_number'] = this.iqamaNumber; data['is_out_sa'] = this.isOutSa; @@ -127,6 +103,8 @@ class Customer { data['phone'] = this.phone; data['country_code'] = this.countryCode; data['yahala_accountno'] = this.yahalaAccountno; + data['billing_address'] = this.billingAddress; + data['shipping_address'] = this.shippingAddress; data['id'] = this.id; data['username'] = this.username; data['email'] = this.email; @@ -147,4 +125,4 @@ class Customer { data['registered_in_store_id'] = this.registeredInStoreId; return data; } -} +} \ No newline at end of file diff --git a/lib/core/model/pharmacies/LacumAccountInformation.dart b/lib/core/model/pharmacies/LacumAccountInformation.dart deleted file mode 100644 index 4f1d0455..00000000 --- a/lib/core/model/pharmacies/LacumAccountInformation.dart +++ /dev/null @@ -1,1926 +0,0 @@ -import 'LakumInquiryInformationObjVersion.dart'; - -class LacumAccountInformation { - - String date; - int languageID; - int serviceName; - String time; - String androidLink; - String authenticationTokenID; - String data; - bool dataw; - int dietType; - String errorCode; - String errorEndUserMessage; - String errorEndUserMessageN; - String errorMessage; - int errorType; - int foodCategory; - String iOSLink; - bool isAuthenticated; - int mealOrderStatus; - int mealType; - int messageStatus; - int numberOfResultRecords; - String patientBlodType; - String successMsg; - String successMsgN; - int accountStatus; - String activeArchiveObject; - int activeMedicationCount; - String allMedicationTakenDuringAdmissionList; - int appointmentNo; - String arePatientsOnlineList; - String balanceAmount; - String bloodGroupList; - int cVIUnreadCount; - String checkUserHasAccount; - int complaintNo; - String dischargeList; - int episodeID; - String finalRadiologyList; - String fullName; - String geoFPointsList; - String geoGetPateintInfo; - String getAllDoctorsByProjectAndClinicList; - String getAppointmentNumbersForDoctorList; - String getCheckUpItemsList; - String getCosmeticConferenceForTodayList; - String getDoctorERClinicResult; - String getInvoiceApprovalList; - String getNearestProjectList; - String getPatientAdmissionOrAppoinmentNoList; - String getPatientBloodType; - String getPatientInsuranceCardStatusStatisticsList; - String getSurveyList; - String getTotalRegisteredPatientList; - String getUserDetailsList; - String getCustomerPointInfo; - String hISApprovalList; - String hISInpAdmissionList; - String hISProgNoteAssesmentModelList; - String hMGGetAllOffersList; - bool hasApproval; - bool hasConsultation; - bool hasDental; - bool hasLab; - bool hasPharmacy; - bool hasRad; - String hmgSMSGetByProjectIDAndPatientIDList; - int hoursLeft; - String iNPMGetAllAdmissionList; - String iNPMGetPatientInfoForSickLeaveReportList; - String iNPMHISPatientMedicalStatusUnreadCount; - String iNPMLABGetPatientLabOrdersResultsList; - String iNPMLABGetPatientLabResultsList; - String iNPMLABGetPatientRADReportList; - String iNPMLABGetPatientRadResultsList; - String iNPMRadGetPatientRadOrdersCVIList; - String iNPMRadGetPatientRadOrdersList; - String iNPMRadGetRadMedicalRecordsList; - String iNPGetPrescriptionDischargesList; - String iNPGetPrescriptionReportList; - String identificationNo; - bool isHomeMedicineDeliverySupported; - int isInsertedOrUpdated; - bool isMainAcoountEqualPatienID; - bool isPatientAlreadyAgreed; - bool isPatientCallBackBlackList; - bool isPatientHaveFingerPrint; - bool isPatientOnline; - bool isPatientTokenRemoved; - bool isPaused; - bool isProjectWorkingHours; - String isStoreRateAllowed; - String isStoreRateInserted; - String isStoreRateUpdated; - int labRadUpdatedToRead; - int labReportUnreadNo; - String lakumInquiryInformationObj; - LakumInquiryInformationObjVersion lakumInquiryInformationObjVersion; - String lakumResponseList; - String laserGetBodyPartsByCategoryList; - String laserGetCategoriesList; - String list; - int listCount; - int listCountDeliverd; - int listCountUnDeliverd; - String listDeviceInfo; - String listFamilyAppointments; - String listLabResultsByAppNo; - String listLakumInquiryInformationObj; - String listOpinionGetAllPeriod; - String listOpinionGetAllServices; - String listOpinionGetIsAgreeValue; - String listOpinionGetOpinionLogin; - String listOpinionGetRequestedSerives; - String listOpinionGetShareServicesDetails; - String listOpinionUserTerms; - String listPLO; - String listPLR; - String listPLSR; - String listPRM; - String listPatientFamilyFiles; - String listPatientFileInfo; - String listRAD; - String listRADAPI; - String listActiveGetPrescriptionReportByPatientID; - String listAppointmentsForDentalClinic; - String listBabyInfoResult; - String listCheckInsuranceCoverage; - String listCompanyClass; - String listConsentMedicalReport; - String listDentalAppointments; - String listDeviceTokenIDByAppointmentNo; - String listDischargeDiagnosis; - String listDischargeMedicine; - String listDischargeSummary; - String listDoctorResponse; - String listDoneVaccines; - String listEReferralResult; - String listEReferrals; - String listGetAllPatientsLiveCareAdmin; - String listGetDataForExcel; - String listGetMainCountID; - String listGetPrescriptionReportByPatientID; - String listGetSickLeave; - String listHISInvoice; - String listHISInvoiceProcedures; - String listInpatientInvoices; - String listInsuranceCheckList; - String listInsuranceCompanies; - String listInsuranceCompaniesGroup; - String listInsuranceUpdateDetails; - String listInvoiceApprovalProcedureInfo; - String listIsLastSatisfactionSurveyReviewedModel; - String listLabOrderDetailsModel; - String listMedicalReport; - String listMedicalReportApprovals; - String listMedicalReportStatus; - String listMonthBloodPressureResult; - String listMonthBloodPressureResultAverage; - String listMonthDiabtecPatientResult; - String listMonthDiabtectResultAverage; - String listMonthWeightMeasurementResult; - String listMonthWeightMeasurementResultAverage; - String listOnlinePrescriptionResult; - String listOutPatientInvoices; - String listPHRInvoice; - String listPHRInvoiceItems; - String listPHRPaymentMethods; - String listPateintDetails; - String listPateintInformation; - String listPatientAdmissionInfo; - String listPatientAdvanceBalanceAmount; - String listPatientCallBackLogs; - String listPatientCallBackToUpdateFromICServer; - String listPatientCount; - String listPatientDashboard; - String listPatientERGetAdminClinicsModel; - String listPatientERGetAdminProjectsModel; - String listPatientERGetAllClinicsModel; - String listPatientHISInvoices; - String listPatientICProjects; - String listPatientICProjectsByID; - String listPatientICProjectsTimings; - String listPatientIDByUID; - String listPatientIDForSurveyResult; - String listPatientInfo; - String listPatientInfoForDDScreen; - String listPatientInfoForSickleaveReport; - String listPatientInsuranceCard; - String listPatientInsuranceCardHistory; - String listPatientInsuranceDetails; - String listPatientPHRInvoices; - String listPatientServicePoint; - String listPatientStatusCount; - String listPatientChatRequestMapModel; - String listPatientChatRequestModel; - String listPatientChatRequestVCModel; - String listPaymentMethods; - String listPointServices; - String listPregnancyStagesInfo; - String listProjectAvgERWaitingTime; - String listProjectAvgERWaitingTimeHourly; - String listRadMedicalRecords; - String listRadMedicalRecordsAPI; - String listRadMedicalRecordsCVI; - String listRadMedicalRecordsCVIAPI; - String listRadMedicalRecordsResults; - String listSickLeave; - String listTransaction; - String listVideoConferenceSessions; - String listWeekBloodPressureResult; - String listWeekBloodPressureResultAverage; - String listWeekDiabtecPatientResult; - String listWeekDiabtectResultAverage; - String listWeekWeightMeasurementResult; - String listWeekWeightMeasurementResultAverage; - String listYearBloodPressureResult; - String listYearBloodPressureResultAverage; - String listYearDiabtecPatientResult; - String listYearDiabtecResultAverage; - String listYearWeightMeasurementResult; - String listYearWeightMeasurementResultAverage; - String listEInvoiceForDental; - String listEInvoiceForOnlineCheckIn; - String medGetActivitiesTransactionsStsList; - String medGetAvgMonthTransactionsStsList; - String medGetAvgWeekTransactionsStsList; - String medGetCategoriesList; - String medGetMonthActivitiesTransactionsStsList; - String medGetMonthStepsTransactionsStsList; - String medGetMonthTransactionsStsList; - String medGetPatientLastRecordList; - String medGetSubCategoriesList; - String medGetTransactionsAndActTransactionsResult; - String medGetTransactionsList; - String medGetWeekActivitiesTransactionsStsList; - String medGetWeekStepsTransactionsStsList; - String medGetWeekTransactionsStsList; - String medGetYearActivitiesTransactionsStsList; - String medGetYearSleepTransactionsStsList; - String medGetYearStepsTransactionsStsList; - String medGetYearTransactionsStsList; - String medInsertTransactionsOutputsList; - String medicalRecordImages; - int medicalReportToRead; - int medicalReportUnreadNo; - bool missingIDCardAttachment; - bool missingInsuranceCardAttachment; - bool missingMedicalReportAttachment; - bool missingOtherRelationship; - bool missingPatientContactNo; - bool missingPatientId; - bool missingPatientIdentityNumber; - bool missingPatientName; - bool missingReferralContactNo; - bool missingReferralRelationship; - bool missingReferralRequesterName; - String mobileNumber; - int nationalityNumber; - String onlineCheckInAppointments; - String opinionUserAgreementContent; - bool orderInsert; - String pateintInfoForUpdateList; - String pateintUpatedList; - String patientBirthdayCertificate; - String patientERCMCRequestSummaryByProject; - String patientERCMCRequestWithTotal; - String patientERCMCGetAllServicesList; - String patientERCMCGetTransactionsForOrderList; - String patientERCoordinates; - String patientERCountOrderList; - String patientERCountsForApprovalOffice; - String patientERDeleteOldCurrentDoctorsOutputsList; - String patientERDeliveryGetAllDeliverdOrderList; - String patientERDeliveryGetAllOrderList; - bool patientERDeliveryIsOrderInserted; - bool patientERDeliveryIsOrderUpdated; - bool patientERDeliveryIsPausedChanged; - String patientERDeliveryNextOrder; - int patientERDeliveryOrderInsert; - int patientERDeliveryUpdateOrderStatus; - bool patientERDriverUpdate; - String patientERExacartCheckIsDispenseAccpetableList; - String patientERExacartGetDispenseQuantitiesByOrderIDList; - String patientERExacartGetOrderDetailsByePharmacyOrderNoList; - String patientERExacartGetOrderDetailsList; - String patientERExacartGetTotalDispenseQuantitiesByPresNoList; - bool patientERExacartIsDispenseAdded; - String patientERExacartIsDispenseAddedList; - bool patientERExacartIsOrderCompleted; - String patientERGetAdminByProjectAndRoleList; - String patientERGetAdminProjectsList; - String patientERGetAllDriversList; - String patientERGetAllNeedAproveStatusList; - String patientERGetAllPresOrdersStatusList; - String patientERGetAllProjectsList; - String patientERGetArchiveInformationList; - String patientERGetAskDoctorTotalByDateFilterList; - String patientERGetBookScheduleConfigsList; - String patientERGetClinicAndTimeAndEpisodeForAppointmentList; - String patientERGetClinicAndTimeForDischargeList; - String patientERGetDashboardDataforApporvalSectionForAdminList; - String patientERGetDashboardDataforApporvalSectionList; - String patientERGetDashboardDataforHHCSectionForAdminList; - String patientERGetDashboardDataforHHCSectionList; - String patientERGetDashboardDataforPrescriptionSectionForAdminList; - String patientERGetDashboardDataforPrescriptionSectionList; - String patientERGetDoctorDashboardDataModelList; - String patientERGetDriverLocationList; - String patientERGetInsuranceCardRequestByDateFilterList; - String patientERGetLiveCareSummaryBookedAppoinmentStatusList; - String patientERGetLiveCareSummaryCovidList; - String patientERGetLiveCareSummaryForCMCList; - String patientERGetLiveCareSummaryForHHCList; - String patientERGetLiveCareSummaryForHomeDeliveryList; - String patientERGetLiveCareSummaryForInsuranceCardRequestList; - String patientERGetLiveCareSummaryForNewFilesList; - String patientERGetLiveCareSummaryForOnlinePaymetRequestList; - String patientERGetLiveCareSummaryForOnlinePharmacyOrdersList; - String patientERGetLiveCareSummaryForTrasnportationList; - String patientERGetLiveCareSummaryLiveCareCountsList; - String patientERGetMedicalRequestTotalByDateFilterList; - String patientERGetNearestPendingOrdersList; - String patientERGetNeedAproveHistoryForOrderList; - String patientERGetNeedAprovePendingOrdersList; - String patientERGetNeedAproveStatusStatisticsList; - String patientERGetPatientAllPresOrdersList; - String patientERGetPendingPatientsCountList; - String patientERGetPresOrdersHistoryForAdminList; - String patientERGetPresOrdersHistoryForOrderList; - String patientERGetPresOrdersStatusStatisticsList; - String patientERHHCRequest; - String patientERHHCRequestSummaryByProject; - String patientERHHCRequestWithTotal; - String patientERHHCGetAllServicesList; - String patientERHHCGetTransactionsForOrderList; - String patientERHomeDeliveryCounts; - bool patientERInsertDriver; - String patientERInsertNewCurrentDoctorsOutputsList; - String patientERInsuranceStatusCountList; - bool patientERIsNearestProjectUpdated; - bool patientERIsNeedAproveReturnedToQueue; - bool patientERIsNeedAproveUpdated; - bool patientERIsOrderClientRequestUpdated; - bool patientERIsOrderReturnedToQueue; - bool patientERIsPresOrderInserted; - bool patientERIsPresOrderUpdated; - bool patientERIsProjectUpdated; - String patientERNotCompletedDetails; - String patientERPatientsCountByCallStatus; - String patientERPeakHourCounts; - String patientERPresOrderInfo; - String patientERPrescriptionCounts; - String patientERProjectsContribution; - String patientERRRTGetAllQuestionsList; - String patientERRRTGetAllTransportationMethodList; - String patientERRRTGetPickUpRequestByPresOrderIDList; - String patientERRealRRTGetAllServicesList; - String patientERRealRRTGetOrderDetailsList; - String patientERRealRRTGetTransactionsForOrderList; - bool patientERRealRRTIsTransInserted; - String patientERRequestList; - String patientERTransportationRequestWithTotal; - String patientERealRRTGetServicePriceList; - String patientInfoByAdmissionNoList; - String patientMonitorGetPatientHeartRate; - int patientNotServedCounts; - String patientPrescriptionList; - String patientAllergies; - String patientCheckAppointmentValidationList; - String patientLoginTokenList; - String patientQRLoginInfoList; - String patientSELECTDeviceIMEIbyIMEIList; - String pharmList; - String prefLang; - int radReportUnreadNo; - String radGetPatientRadOrdersForDentalList; - int referralNumber; - String reminderConfigurations; - String requestNo; - int rowCount; - String servicePrivilegeList; - String shareFamilyFileObj; - String status; - int successCode; - String surveyRate; - String symptomCheckerConditionList; - String symptomCheckerGetAllDefaultQuestionsList; - String symptomCheckerGetBodyPartSymptomsList; - String symptomCheckerGetBodyPartsByCodeList; - String symptomCheckerGetBodyPartsList; - String symptomCheckerJsonResponseInString; - int timerTime; - int totalAdvanceBalanceAmount; - int totalPatientsCount; - int totalPendingApprovalCount; - int totalUnUsedCount; - int transactionNo; - int unReadCounts; - bool updateStatus; - String userAgreementContent; - int yahalaAccountNo; - bool check24HourComplaint; - String currency; - String message; - int patientID; - int returnValue; - String returnValueStr; - int statusCode; - - LacumAccountInformation( - {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.accountStatus, - this.activeArchiveObject, - this.activeMedicationCount, - this.allMedicationTakenDuringAdmissionList, - this.appointmentNo, - this.arePatientsOnlineList, - this.balanceAmount, - this.bloodGroupList, - this.cVIUnreadCount, - this.checkUserHasAccount, - this.complaintNo, - this.dischargeList, - this.episodeID, - this.finalRadiologyList, - this.fullName, - this.geoFPointsList, - this.geoGetPateintInfo, - this.getAllDoctorsByProjectAndClinicList, - this.getAppointmentNumbersForDoctorList, - this.getCheckUpItemsList, - this.getCosmeticConferenceForTodayList, - this.getDoctorERClinicResult, - this.getInvoiceApprovalList, - this.getNearestProjectList, - this.getPatientAdmissionOrAppoinmentNoList, - this.getPatientBloodType, - this.getPatientInsuranceCardStatusStatisticsList, - this.getSurveyList, - this.getTotalRegisteredPatientList, - this.getUserDetailsList, - this.getCustomerPointInfo, - this.hISApprovalList, - this.hISInpAdmissionList, - this.hISProgNoteAssesmentModelList, - this.hMGGetAllOffersList, - this.hasApproval, - this.hasConsultation, - this.hasDental, - this.hasLab, - this.hasPharmacy, - this.hasRad, - this.hmgSMSGetByProjectIDAndPatientIDList, - this.hoursLeft, - this.iNPMGetAllAdmissionList, - this.iNPMGetPatientInfoForSickLeaveReportList, - this.iNPMHISPatientMedicalStatusUnreadCount, - this.iNPMLABGetPatientLabOrdersResultsList, - this.iNPMLABGetPatientLabResultsList, - this.iNPMLABGetPatientRADReportList, - this.iNPMLABGetPatientRadResultsList, - this.iNPMRadGetPatientRadOrdersCVIList, - this.iNPMRadGetPatientRadOrdersList, - this.iNPMRadGetRadMedicalRecordsList, - this.iNPGetPrescriptionDischargesList, - this.iNPGetPrescriptionReportList, - this.identificationNo, - this.isHomeMedicineDeliverySupported, - this.isInsertedOrUpdated, - this.isMainAcoountEqualPatienID, - this.isPatientAlreadyAgreed, - this.isPatientCallBackBlackList, - this.isPatientHaveFingerPrint, - this.isPatientOnline, - this.isPatientTokenRemoved, - this.isPaused, - this.isProjectWorkingHours, - this.isStoreRateAllowed, - this.isStoreRateInserted, - this.isStoreRateUpdated, - this.labRadUpdatedToRead, - this.labReportUnreadNo, - this.lakumInquiryInformationObj, - this.lakumInquiryInformationObjVersion, - this.lakumResponseList, - this.laserGetBodyPartsByCategoryList, - this.laserGetCategoriesList, - this.list, - this.listCount, - this.listCountDeliverd, - this.listCountUnDeliverd, - this.listDeviceInfo, - this.listFamilyAppointments, - this.listLabResultsByAppNo, - this.listLakumInquiryInformationObj, - this.listOpinionGetAllPeriod, - this.listOpinionGetAllServices, - this.listOpinionGetIsAgreeValue, - this.listOpinionGetOpinionLogin, - this.listOpinionGetRequestedSerives, - this.listOpinionGetShareServicesDetails, - this.listOpinionUserTerms, - this.listPLO, - this.listPLR, - this.listPLSR, - this.listPRM, - this.listPatientFamilyFiles, - this.listPatientFileInfo, - this.listRAD, - this.listRADAPI, - this.listActiveGetPrescriptionReportByPatientID, - this.listAppointmentsForDentalClinic, - this.listBabyInfoResult, - this.listCheckInsuranceCoverage, - this.listCompanyClass, - this.listConsentMedicalReport, - this.listDentalAppointments, - this.listDeviceTokenIDByAppointmentNo, - this.listDischargeDiagnosis, - this.listDischargeMedicine, - this.listDischargeSummary, - this.listDoctorResponse, - this.listDoneVaccines, - this.listEReferralResult, - this.listEReferrals, - this.listGetAllPatientsLiveCareAdmin, - this.listGetDataForExcel, - this.listGetMainCountID, - this.listGetPrescriptionReportByPatientID, - this.listGetSickLeave, - this.listHISInvoice, - this.listHISInvoiceProcedures, - this.listInpatientInvoices, - this.listInsuranceCheckList, - this.listInsuranceCompanies, - this.listInsuranceCompaniesGroup, - this.listInsuranceUpdateDetails, - this.listInvoiceApprovalProcedureInfo, - this.listIsLastSatisfactionSurveyReviewedModel, - this.listLabOrderDetailsModel, - this.listMedicalReport, - this.listMedicalReportApprovals, - this.listMedicalReportStatus, - this.listMonthBloodPressureResult, - this.listMonthBloodPressureResultAverage, - this.listMonthDiabtecPatientResult, - this.listMonthDiabtectResultAverage, - this.listMonthWeightMeasurementResult, - this.listMonthWeightMeasurementResultAverage, - this.listOnlinePrescriptionResult, - this.listOutPatientInvoices, - this.listPHRInvoice, - this.listPHRInvoiceItems, - this.listPHRPaymentMethods, - this.listPateintDetails, - this.listPateintInformation, - this.listPatientAdmissionInfo, - this.listPatientAdvanceBalanceAmount, - this.listPatientCallBackLogs, - this.listPatientCallBackToUpdateFromICServer, - this.listPatientCount, - this.listPatientDashboard, - this.listPatientERGetAdminClinicsModel, - this.listPatientERGetAdminProjectsModel, - this.listPatientERGetAllClinicsModel, - this.listPatientHISInvoices, - this.listPatientICProjects, - this.listPatientICProjectsByID, - this.listPatientICProjectsTimings, - this.listPatientIDByUID, - this.listPatientIDForSurveyResult, - this.listPatientInfo, - this.listPatientInfoForDDScreen, - this.listPatientInfoForSickleaveReport, - this.listPatientInsuranceCard, - this.listPatientInsuranceCardHistory, - this.listPatientInsuranceDetails, - this.listPatientPHRInvoices, - this.listPatientServicePoint, - this.listPatientStatusCount, - this.listPatientChatRequestMapModel, - this.listPatientChatRequestModel, - this.listPatientChatRequestVCModel, - this.listPaymentMethods, - this.listPointServices, - this.listPregnancyStagesInfo, - this.listProjectAvgERWaitingTime, - this.listProjectAvgERWaitingTimeHourly, - this.listRadMedicalRecords, - this.listRadMedicalRecordsAPI, - this.listRadMedicalRecordsCVI, - this.listRadMedicalRecordsCVIAPI, - this.listRadMedicalRecordsResults, - this.listSickLeave, - this.listTransaction, - this.listVideoConferenceSessions, - this.listWeekBloodPressureResult, - this.listWeekBloodPressureResultAverage, - this.listWeekDiabtecPatientResult, - this.listWeekDiabtectResultAverage, - this.listWeekWeightMeasurementResult, - this.listWeekWeightMeasurementResultAverage, - this.listYearBloodPressureResult, - this.listYearBloodPressureResultAverage, - this.listYearDiabtecPatientResult, - this.listYearDiabtecResultAverage, - this.listYearWeightMeasurementResult, - this.listYearWeightMeasurementResultAverage, - this.listEInvoiceForDental, - this.listEInvoiceForOnlineCheckIn, - this.medGetActivitiesTransactionsStsList, - this.medGetAvgMonthTransactionsStsList, - this.medGetAvgWeekTransactionsStsList, - this.medGetCategoriesList, - this.medGetMonthActivitiesTransactionsStsList, - this.medGetMonthStepsTransactionsStsList, - this.medGetMonthTransactionsStsList, - this.medGetPatientLastRecordList, - this.medGetSubCategoriesList, - this.medGetTransactionsAndActTransactionsResult, - this.medGetTransactionsList, - this.medGetWeekActivitiesTransactionsStsList, - this.medGetWeekStepsTransactionsStsList, - this.medGetWeekTransactionsStsList, - this.medGetYearActivitiesTransactionsStsList, - this.medGetYearSleepTransactionsStsList, - this.medGetYearStepsTransactionsStsList, - this.medGetYearTransactionsStsList, - this.medInsertTransactionsOutputsList, - this.medicalRecordImages, - this.medicalReportToRead, - this.medicalReportUnreadNo, - this.missingIDCardAttachment, - this.missingInsuranceCardAttachment, - this.missingMedicalReportAttachment, - this.missingOtherRelationship, - this.missingPatientContactNo, - this.missingPatientId, - this.missingPatientIdentityNumber, - this.missingPatientName, - this.missingReferralContactNo, - this.missingReferralRelationship, - this.missingReferralRequesterName, - this.mobileNumber, - this.nationalityNumber, - this.onlineCheckInAppointments, - this.opinionUserAgreementContent, - this.orderInsert, - this.pateintInfoForUpdateList, - this.pateintUpatedList, - this.patientBirthdayCertificate, - this.patientERCMCRequestSummaryByProject, - this.patientERCMCRequestWithTotal, - this.patientERCMCGetAllServicesList, - this.patientERCMCGetTransactionsForOrderList, - this.patientERCoordinates, - this.patientERCountOrderList, - this.patientERCountsForApprovalOffice, - this.patientERDeleteOldCurrentDoctorsOutputsList, - this.patientERDeliveryGetAllDeliverdOrderList, - this.patientERDeliveryGetAllOrderList, - this.patientERDeliveryIsOrderInserted, - this.patientERDeliveryIsOrderUpdated, - this.patientERDeliveryIsPausedChanged, - this.patientERDeliveryNextOrder, - this.patientERDeliveryOrderInsert, - this.patientERDeliveryUpdateOrderStatus, - this.patientERDriverUpdate, - this.patientERExacartCheckIsDispenseAccpetableList, - this.patientERExacartGetDispenseQuantitiesByOrderIDList, - this.patientERExacartGetOrderDetailsByePharmacyOrderNoList, - this.patientERExacartGetOrderDetailsList, - this.patientERExacartGetTotalDispenseQuantitiesByPresNoList, - this.patientERExacartIsDispenseAdded, - this.patientERExacartIsDispenseAddedList, - this.patientERExacartIsOrderCompleted, - this.patientERGetAdminByProjectAndRoleList, - this.patientERGetAdminProjectsList, - this.patientERGetAllDriversList, - this.patientERGetAllNeedAproveStatusList, - this.patientERGetAllPresOrdersStatusList, - this.patientERGetAllProjectsList, - this.patientERGetArchiveInformationList, - this.patientERGetAskDoctorTotalByDateFilterList, - this.patientERGetBookScheduleConfigsList, - this.patientERGetClinicAndTimeAndEpisodeForAppointmentList, - this.patientERGetClinicAndTimeForDischargeList, - this.patientERGetDashboardDataforApporvalSectionForAdminList, - this.patientERGetDashboardDataforApporvalSectionList, - this.patientERGetDashboardDataforHHCSectionForAdminList, - this.patientERGetDashboardDataforHHCSectionList, - this.patientERGetDashboardDataforPrescriptionSectionForAdminList, - this.patientERGetDashboardDataforPrescriptionSectionList, - this.patientERGetDoctorDashboardDataModelList, - this.patientERGetDriverLocationList, - this.patientERGetInsuranceCardRequestByDateFilterList, - this.patientERGetLiveCareSummaryBookedAppoinmentStatusList, - this.patientERGetLiveCareSummaryCovidList, - this.patientERGetLiveCareSummaryForCMCList, - this.patientERGetLiveCareSummaryForHHCList, - this.patientERGetLiveCareSummaryForHomeDeliveryList, - this.patientERGetLiveCareSummaryForInsuranceCardRequestList, - this.patientERGetLiveCareSummaryForNewFilesList, - this.patientERGetLiveCareSummaryForOnlinePaymetRequestList, - this.patientERGetLiveCareSummaryForOnlinePharmacyOrdersList, - this.patientERGetLiveCareSummaryForTrasnportationList, - this.patientERGetLiveCareSummaryLiveCareCountsList, - this.patientERGetMedicalRequestTotalByDateFilterList, - this.patientERGetNearestPendingOrdersList, - this.patientERGetNeedAproveHistoryForOrderList, - this.patientERGetNeedAprovePendingOrdersList, - this.patientERGetNeedAproveStatusStatisticsList, - this.patientERGetPatientAllPresOrdersList, - this.patientERGetPendingPatientsCountList, - this.patientERGetPresOrdersHistoryForAdminList, - this.patientERGetPresOrdersHistoryForOrderList, - this.patientERGetPresOrdersStatusStatisticsList, - this.patientERHHCRequest, - this.patientERHHCRequestSummaryByProject, - this.patientERHHCRequestWithTotal, - this.patientERHHCGetAllServicesList, - this.patientERHHCGetTransactionsForOrderList, - this.patientERHomeDeliveryCounts, - this.patientERInsertDriver, - this.patientERInsertNewCurrentDoctorsOutputsList, - this.patientERInsuranceStatusCountList, - this.patientERIsNearestProjectUpdated, - this.patientERIsNeedAproveReturnedToQueue, - this.patientERIsNeedAproveUpdated, - this.patientERIsOrderClientRequestUpdated, - this.patientERIsOrderReturnedToQueue, - this.patientERIsPresOrderInserted, - this.patientERIsPresOrderUpdated, - this.patientERIsProjectUpdated, - this.patientERNotCompletedDetails, - this.patientERPatientsCountByCallStatus, - this.patientERPeakHourCounts, - this.patientERPresOrderInfo, - this.patientERPrescriptionCounts, - this.patientERProjectsContribution, - this.patientERRRTGetAllQuestionsList, - this.patientERRRTGetAllTransportationMethodList, - this.patientERRRTGetPickUpRequestByPresOrderIDList, - this.patientERRealRRTGetAllServicesList, - this.patientERRealRRTGetOrderDetailsList, - this.patientERRealRRTGetTransactionsForOrderList, - this.patientERRealRRTIsTransInserted, - this.patientERRequestList, - this.patientERTransportationRequestWithTotal, - this.patientERealRRTGetServicePriceList, - this.patientInfoByAdmissionNoList, - this.patientMonitorGetPatientHeartRate, - this.patientNotServedCounts, - this.patientPrescriptionList, - this.patientAllergies, - this.patientCheckAppointmentValidationList, - this.patientLoginTokenList, - this.patientQRLoginInfoList, - this.patientSELECTDeviceIMEIbyIMEIList, - this.pharmList, - this.prefLang, - this.radReportUnreadNo, - this.radGetPatientRadOrdersForDentalList, - this.referralNumber, - this.reminderConfigurations, - this.requestNo, - this.rowCount, - this.servicePrivilegeList, - this.shareFamilyFileObj, - this.status, - this.successCode, - this.surveyRate, - this.symptomCheckerConditionList, - this.symptomCheckerGetAllDefaultQuestionsList, - this.symptomCheckerGetBodyPartSymptomsList, - this.symptomCheckerGetBodyPartsByCodeList, - this.symptomCheckerGetBodyPartsList, - this.symptomCheckerJsonResponseInString, - this.timerTime, - this.totalAdvanceBalanceAmount, - this.totalPatientsCount, - this.totalPendingApprovalCount, - this.totalUnUsedCount, - this.transactionNo, - this.unReadCounts, - this.updateStatus, - this.userAgreementContent, - this.yahalaAccountNo, - this.check24HourComplaint, - this.currency, - this.message, - this.patientID, - this.returnValue, - this.returnValueStr, - this.statusCode}); - - LacumAccountInformation.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']; - accountStatus = json['AccountStatus']; - activeArchiveObject = json['ActiveArchiveObject']; - activeMedicationCount = json['ActiveMedicationCount']; - allMedicationTakenDuringAdmissionList = - json['AllMedicationTakenDuringAdmission_List']; - appointmentNo = json['AppointmentNo']; - arePatientsOnlineList = json['ArePatientsOnlineList']; - balanceAmount = json['BalanceAmount']; - bloodGroupList = json['BloodGroupList']; - cVIUnreadCount = json['CVI_UnreadCount']; - checkUserHasAccount = json['CheckUserHasAccount']; - complaintNo = json['ComplaintNo']; - dischargeList = json['DischargeList']; - episodeID = json['EpisodeID']; - finalRadiologyList = json['FinalRadiologyList']; - fullName = json['FullName']; - geoFPointsList = json['GeoF_PointsList']; - geoGetPateintInfo = json['GeoGetPateintInfo']; - getAllDoctorsByProjectAndClinicList = - json['GetAllDoctorsByProjectAndClinicList']; - getAppointmentNumbersForDoctorList = - json['GetAppointmentNumbersForDoctorList']; - getCheckUpItemsList = json['GetCheckUpItemsList']; - getCosmeticConferenceForTodayList = - json['GetCosmeticConferenceForTodayList']; - getDoctorERClinicResult = json['GetDoctorERClinicResult']; - getInvoiceApprovalList = json['GetInvoiceApprovalList']; - getNearestProjectList = json['GetNearestProjectList']; - getPatientAdmissionOrAppoinmentNoList = - json['GetPatientAdmissionOrAppoinmentNo_List']; - getPatientBloodType = json['GetPatientBloodType']; - getPatientInsuranceCardStatusStatisticsList = - json['GetPatientInsuranceCardStatusStatisticsList']; - getSurveyList = json['GetSurveyList']; - getTotalRegisteredPatientList = json['GetTotalRegisteredPatientList']; - getUserDetailsList = json['GetUserDetailsList']; - getCustomerPointInfo = json['Get_CustomerPointInfo']; - hISApprovalList = json['HIS_Approval_List']; - hISInpAdmissionList = json['HIS_InpAdmission_List']; - hISProgNoteAssesmentModelList = json['HIS_ProgNoteAssesmentModel_List']; - hMGGetAllOffersList = json['HMG_GetAllOffersList']; - hasApproval = json['Has_Approval']; - hasConsultation = json['Has_Consultation']; - hasDental = json['Has_Dental']; - hasLab = json['Has_Lab']; - hasPharmacy = json['Has_Pharmacy']; - hasRad = json['Has_Rad']; - hmgSMSGetByProjectIDAndPatientIDList = - json['Hmg_SMS_Get_By_ProjectID_And_PatientIDList']; - hoursLeft = json['HoursLeft']; - iNPMGetAllAdmissionList = json['INPM_GetAllAdmission_List']; - iNPMGetPatientInfoForSickLeaveReportList = - json['INPM_GetPatientInfoForSickLeaveReport_List']; - iNPMHISPatientMedicalStatusUnreadCount = - json['INPM_HIS_PatientMedicalStatus_UnreadCount']; - iNPMLABGetPatientLabOrdersResultsList = - json['INPM_LAB_GetPatientLabOrdersResults_List']; - iNPMLABGetPatientLabResultsList = - json['INPM_LAB_GetPatientLabResults_List']; - iNPMLABGetPatientRADReportList = json['INPM_LAB_GetPatientRADReport_List']; - iNPMLABGetPatientRadResultsList = - json['INPM_LAB_GetPatientRadResults_List']; - iNPMRadGetPatientRadOrdersCVIList = - json['INPM_Rad_GetPatientRadOrders_CVI_List']; - iNPMRadGetPatientRadOrdersList = json['INPM_Rad_GetPatientRadOrders_List']; - iNPMRadGetRadMedicalRecordsList = - json['INPM_Rad_GetRadMedicalRecords_List']; - iNPGetPrescriptionDischargesList = - json['INP_GetPrescriptionDischarges_List']; - iNPGetPrescriptionReportList = json['INP_GetPrescriptionReport_List']; - identificationNo = json['IdentificationNo']; - isHomeMedicineDeliverySupported = json['IsHomeMedicineDeliverySupported']; - isInsertedOrUpdated = json['IsInsertedOrUpdated']; - isMainAcoountEqualPatienID = json['IsMainAcoountEqualPatienID']; - isPatientAlreadyAgreed = json['IsPatientAlreadyAgreed']; - isPatientCallBackBlackList = json['IsPatientCallBackBlackList']; - isPatientHaveFingerPrint = json['IsPatientHaveFingerPrint']; - isPatientOnline = json['IsPatientOnline']; - isPatientTokenRemoved = json['IsPatientTokenRemoved']; - isPaused = json['IsPaused']; - isProjectWorkingHours = json['IsProjectWorkingHours']; - isStoreRateAllowed = json['IsStoreRateAllowed']; - isStoreRateInserted = json['IsStoreRateInserted']; - isStoreRateUpdated = json['IsStoreRateUpdated']; - labRadUpdatedToRead = json['LabRadUpdatedToRead']; - labReportUnreadNo = json['LabReportUnreadNo']; - lakumInquiryInformationObj = json['LakumInquiryInformationObj']; - lakumInquiryInformationObjVersion = - json['LakumInquiryInformationObjVersion'] != null - ? new LakumInquiryInformationObjVersion.fromJson( - json['LakumInquiryInformationObjVersion']) - : null; - lakumResponseList = json['LakumResponseList']; - laserGetBodyPartsByCategoryList = json['Laser_GetBodyPartsByCategoryList']; - laserGetCategoriesList = json['Laser_GetCategoriesList']; - list = json['List']; - listCount = json['ListCount']; - listCountDeliverd = json['ListCountDeliverd']; - listCountUnDeliverd = json['ListCountUnDeliverd']; - listDeviceInfo = json['ListDeviceInfo']; - listFamilyAppointments = json['ListFamilyAppointments']; - listLabResultsByAppNo = json['ListLabResultsByAppNo']; - listLakumInquiryInformationObj = json['ListLakumInquiryInformationObj']; - listOpinionGetAllPeriod = json['ListOpinion_GetAllPeriod']; - listOpinionGetAllServices = json['ListOpinion_GetAllServices']; - listOpinionGetIsAgreeValue = json['ListOpinion_GetIsAgreeValue']; - listOpinionGetOpinionLogin = json['ListOpinion_GetOpinionLogin']; - listOpinionGetRequestedSerives = json['ListOpinion_GetRequestedSerives']; - listOpinionGetShareServicesDetails = - json['ListOpinion_GetShareServicesDetails']; - listOpinionUserTerms = json['ListOpinion_UserTerms']; - listPLO = json['ListPLO']; - listPLR = json['ListPLR']; - listPLSR = json['ListPLSR']; - listPRM = json['ListPRM']; - listPatientFamilyFiles = json['ListPatientFamilyFiles']; - listPatientFileInfo = json['ListPatientFileInfo']; - listRAD = json['ListRAD']; - listRADAPI = json['ListRADAPI']; - listActiveGetPrescriptionReportByPatientID = - json['List_ActiveGetPrescriptionReportByPatientID']; - listAppointmentsForDentalClinic = json['List_AppointmentsForDentalClinic']; - listBabyInfoResult = json['List_BabyInfoResult']; - listCheckInsuranceCoverage = json['List_CheckInsuranceCoverage']; - listCompanyClass = json['List_CompanyClass']; - listConsentMedicalReport = json['List_ConsentMedicalReport']; - listDentalAppointments = json['List_DentalAppointments']; - listDeviceTokenIDByAppointmentNo = - json['List_DeviceTokenIDByAppointmentNo']; - listDischargeDiagnosis = json['List_DischargeDiagnosis']; - listDischargeMedicine = json['List_DischargeMedicine']; - listDischargeSummary = json['List_DischargeSummary']; - listDoctorResponse = json['List_DoctorResponse']; - listDoneVaccines = json['List_DoneVaccines']; - listEReferralResult = json['List_EReferralResult']; - listEReferrals = json['List_EReferrals']; - listGetAllPatientsLiveCareAdmin = - json['List_GetAllPatients_LiveCare_Admin']; - listGetDataForExcel = json['List_GetDataForExcel']; - listGetMainCountID = json['List_GetMainCountID']; - listGetPrescriptionReportByPatientID = - json['List_GetPrescriptionReportByPatientID']; - listGetSickLeave = json['List_GetSickLeave']; - listHISInvoice = json['List_HISInvoice']; - listHISInvoiceProcedures = json['List_HISInvoiceProcedures']; - listInpatientInvoices = json['List_InpatientInvoices']; - listInsuranceCheckList = json['List_InsuranceCheckList']; - listInsuranceCompanies = json['List_InsuranceCompanies']; - listInsuranceCompaniesGroup = json['List_InsuranceCompaniesGroup']; - listInsuranceUpdateDetails = json['List_InsuranceUpdateDetails']; - listInvoiceApprovalProcedureInfo = - json['List_InvoiceApprovalProcedureInfo']; - listIsLastSatisfactionSurveyReviewedModel = - json['List_IsLastSatisfactionSurveyReviewedModel']; - listLabOrderDetailsModel = json['List_LabOrderDetailsModel']; - listMedicalReport = json['List_MedicalReport']; - listMedicalReportApprovals = json['List_MedicalReportApprovals']; - listMedicalReportStatus = json['List_MedicalReportStatus']; - listMonthBloodPressureResult = json['List_MonthBloodPressureResult']; - listMonthBloodPressureResultAverage = - json['List_MonthBloodPressureResultAverage']; - listMonthDiabtecPatientResult = json['List_MonthDiabtecPatientResult']; - listMonthDiabtectResultAverage = json['List_MonthDiabtectResultAverage']; - listMonthWeightMeasurementResult = - json['List_MonthWeightMeasurementResult']; - listMonthWeightMeasurementResultAverage = - json['List_MonthWeightMeasurementResultAverage']; - listOnlinePrescriptionResult = json['List_OnlinePrescriptionResult']; - listOutPatientInvoices = json['List_OutPatientInvoices']; - listPHRInvoice = json['List_PHRInvoice']; - listPHRInvoiceItems = json['List_PHRInvoiceItems']; - listPHRPaymentMethods = json['List_PHRPaymentMethods']; - listPateintDetails = json['List_PateintDetails']; - listPateintInformation = json['List_PateintInformation']; - listPatientAdmissionInfo = json['List_PatientAdmissionInfo']; - listPatientAdvanceBalanceAmount = json['List_PatientAdvanceBalanceAmount']; - listPatientCallBackLogs = json['List_PatientCallBackLogs']; - listPatientCallBackToUpdateFromICServer = - json['List_PatientCallBackToUpdateFromICServer']; - listPatientCount = json['List_PatientCount']; - listPatientDashboard = json['List_PatientDashboard']; - listPatientERGetAdminClinicsModel = - json['List_PatientER_GetAdminClinicsModel']; - listPatientERGetAdminProjectsModel = - json['List_PatientER_GetAdminProjectsModel']; - listPatientERGetAllClinicsModel = json['List_PatientER_GetAllClinicsModel']; - listPatientHISInvoices = json['List_PatientHISInvoices']; - listPatientICProjects = json['List_PatientICProjects']; - listPatientICProjectsByID = json['List_PatientICProjectsByID']; - listPatientICProjectsTimings = json['List_PatientICProjectsTimings']; - listPatientIDByUID = json['List_PatientIDByUID']; - listPatientIDForSurveyResult = json['List_PatientIDForSurveyResult']; - listPatientInfo = json['List_PatientInfo']; - listPatientInfoForDDScreen = json['List_PatientInfoForDDScreen']; - listPatientInfoForSickleaveReport = - json['List_PatientInfoForSickleaveReport']; - listPatientInsuranceCard = json['List_PatientInsuranceCard']; - listPatientInsuranceCardHistory = json['List_PatientInsuranceCardHistory']; - listPatientInsuranceDetails = json['List_PatientInsuranceDetails']; - listPatientPHRInvoices = json['List_PatientPHRInvoices']; - listPatientServicePoint = json['List_PatientServicePoint']; - listPatientStatusCount = json['List_PatientStatusCount']; - listPatientChatRequestMapModel = json['List_Patient_ChatRequestMapModel']; - listPatientChatRequestModel = json['List_Patient_ChatRequestModel']; - listPatientChatRequestVCModel = json['List_Patient_ChatRequestVCModel']; - listPaymentMethods = json['List_PaymentMethods']; - listPointServices = json['List_PointServices']; - listPregnancyStagesInfo = json['List_PregnancyStagesInfo']; - listProjectAvgERWaitingTime = json['List_ProjectAvgERWaitingTime']; - listProjectAvgERWaitingTimeHourly = - json['List_ProjectAvgERWaitingTimeHourly']; - listRadMedicalRecords = json['List_RadMedicalRecords']; - listRadMedicalRecordsAPI = json['List_RadMedicalRecordsAPI']; - listRadMedicalRecordsCVI = json['List_RadMedicalRecordsCVI']; - listRadMedicalRecordsCVIAPI = json['List_RadMedicalRecordsCVIAPI']; - listRadMedicalRecordsResults = json['List_RadMedicalRecordsResults']; - listSickLeave = json['List_SickLeave']; - listTransaction = json['List_Transaction']; - listVideoConferenceSessions = json['List_VideoConferenceSessions']; - listWeekBloodPressureResult = json['List_WeekBloodPressureResult']; - listWeekBloodPressureResultAverage = - json['List_WeekBloodPressureResultAverage']; - listWeekDiabtecPatientResult = json['List_WeekDiabtecPatientResult']; - listWeekDiabtectResultAverage = json['List_WeekDiabtectResultAverage']; - listWeekWeightMeasurementResult = json['List_WeekWeightMeasurementResult']; - listWeekWeightMeasurementResultAverage = - json['List_WeekWeightMeasurementResultAverage']; - listYearBloodPressureResult = json['List_YearBloodPressureResult']; - listYearBloodPressureResultAverage = - json['List_YearBloodPressureResultAverage']; - listYearDiabtecPatientResult = json['List_YearDiabtecPatientResult']; - listYearDiabtecResultAverage = json['List_YearDiabtecResultAverage']; - listYearWeightMeasurementResult = json['List_YearWeightMeasurementResult']; - listYearWeightMeasurementResultAverage = - json['List_YearWeightMeasurementResultAverage']; - listEInvoiceForDental = json['List_eInvoiceForDental']; - listEInvoiceForOnlineCheckIn = json['List_eInvoiceForOnlineCheckIn']; - medGetActivitiesTransactionsStsList = - json['Med_GetActivitiesTransactionsStsList']; - medGetAvgMonthTransactionsStsList = - json['Med_GetAvgMonthTransactionsStsList']; - medGetAvgWeekTransactionsStsList = - json['Med_GetAvgWeekTransactionsStsList']; - medGetCategoriesList = json['Med_GetCategoriesList']; - medGetMonthActivitiesTransactionsStsList = - json['Med_GetMonthActivitiesTransactionsStsList']; - medGetMonthStepsTransactionsStsList = - json['Med_GetMonthStepsTransactionsStsList']; - medGetMonthTransactionsStsList = json['Med_GetMonthTransactionsStsList']; - medGetPatientLastRecordList = json['Med_GetPatientLastRecordList']; - medGetSubCategoriesList = json['Med_GetSubCategoriesList']; - medGetTransactionsAndActTransactionsResult = - json['Med_GetTransactionsAndActTransactionsResult']; - medGetTransactionsList = json['Med_GetTransactionsList']; - medGetWeekActivitiesTransactionsStsList = - json['Med_GetWeekActivitiesTransactionsStsList']; - medGetWeekStepsTransactionsStsList = - json['Med_GetWeekStepsTransactionsStsList']; - medGetWeekTransactionsStsList = json['Med_GetWeekTransactionsStsList']; - medGetYearActivitiesTransactionsStsList = - json['Med_GetYearActivitiesTransactionsStsList']; - medGetYearSleepTransactionsStsList = - json['Med_GetYearSleepTransactionsStsList']; - medGetYearStepsTransactionsStsList = - json['Med_GetYearStepsTransactionsStsList']; - medGetYearTransactionsStsList = json['Med_GetYearTransactionsStsList']; - medInsertTransactionsOutputsList = - json['Med_InsertTransactionsOutputsList']; - medicalRecordImages = json['MedicalRecordImages']; - medicalReportToRead = json['MedicalReportToRead']; - medicalReportUnreadNo = json['MedicalReportUnreadNo']; - missingIDCardAttachment = json['Missing_IDCardAttachment']; - missingInsuranceCardAttachment = json['Missing_InsuranceCardAttachment']; - missingMedicalReportAttachment = json['Missing_MedicalReportAttachment']; - missingOtherRelationship = json['Missing_OtherRelationship']; - missingPatientContactNo = json['Missing_PatientContactNo']; - missingPatientId = json['Missing_PatientId']; - missingPatientIdentityNumber = json['Missing_PatientIdentityNumber']; - missingPatientName = json['Missing_PatientName']; - missingReferralContactNo = json['Missing_ReferralContactNo']; - missingReferralRelationship = json['Missing_ReferralRelationship']; - missingReferralRequesterName = json['Missing_ReferralRequesterName']; - mobileNumber = json['MobileNumber']; - nationalityNumber = json['NationalityNumber']; - onlineCheckInAppointments = json['OnlineCheckInAppointments']; - opinionUserAgreementContent = json['Opinion_UserAgreementContent']; - orderInsert = json['OrderInsert']; - pateintInfoForUpdateList = json['PateintInfoForUpdateList']; - pateintUpatedList = json['PateintUpatedList']; - patientBirthdayCertificate = json['PatientBirthdayCertificate']; - patientERCMCRequestSummaryByProject = - json['PatientER_CMCRequestSummaryByProject']; - patientERCMCRequestWithTotal = json['PatientER_CMCRequestWithTotal']; - patientERCMCGetAllServicesList = json['PatientER_CMC_GetAllServicesList']; - patientERCMCGetTransactionsForOrderList = - json['PatientER_CMC_GetTransactionsForOrderList']; - patientERCoordinates = json['PatientER_Coordinates']; - patientERCountOrderList = json['PatientER_CountOrderList']; - patientERCountsForApprovalOffice = - json['PatientER_CountsForApprovalOffice']; - patientERDeleteOldCurrentDoctorsOutputsList = - json['PatientER_DeleteOldCurrentDoctorsOutputsList']; - patientERDeliveryGetAllDeliverdOrderList = - json['PatientER_Delivery_GetAllDeliverdOrderList']; - patientERDeliveryGetAllOrderList = - json['PatientER_Delivery_GetAllOrderList']; - patientERDeliveryIsOrderInserted = - json['PatientER_Delivery_IsOrderInserted']; - patientERDeliveryIsOrderUpdated = json['PatientER_Delivery_IsOrderUpdated']; - patientERDeliveryIsPausedChanged = - json['PatientER_Delivery_IsPausedChanged']; - patientERDeliveryNextOrder = json['PatientER_Delivery_NextOrder']; - patientERDeliveryOrderInsert = json['PatientER_Delivery_OrderInsert']; - patientERDeliveryUpdateOrderStatus = - json['PatientER_Delivery_UpdateOrderStatus']; - patientERDriverUpdate = json['PatientER_DriverUpdate']; - patientERExacartCheckIsDispenseAccpetableList = - json['PatientER_Exacart_CheckIsDispenseAccpetableList']; - patientERExacartGetDispenseQuantitiesByOrderIDList = - json['PatientER_Exacart_GetDispenseQuantitiesByOrderIDList']; - patientERExacartGetOrderDetailsByePharmacyOrderNoList = - json['PatientER_Exacart_GetOrderDetailsByePharmacyOrderNoList']; - patientERExacartGetOrderDetailsList = - json['PatientER_Exacart_GetOrderDetailsList']; - patientERExacartGetTotalDispenseQuantitiesByPresNoList = - json['PatientER_Exacart_GetTotalDispenseQuantitiesByPresNoList']; - patientERExacartIsDispenseAdded = json['PatientER_Exacart_IsDispenseAdded']; - patientERExacartIsDispenseAddedList = - json['PatientER_Exacart_IsDispenseAddedList']; - patientERExacartIsOrderCompleted = - json['PatientER_Exacart_IsOrderCompleted']; - patientERGetAdminByProjectAndRoleList = - json['PatientER_GetAdminByProjectAndRoleList']; - patientERGetAdminProjectsList = json['PatientER_GetAdminProjectsList']; - patientERGetAllDriversList = json['PatientER_GetAllDriversList']; - patientERGetAllNeedAproveStatusList = - json['PatientER_GetAllNeedAproveStatusList']; - patientERGetAllPresOrdersStatusList = - json['PatientER_GetAllPresOrdersStatusList']; - patientERGetAllProjectsList = json['PatientER_GetAllProjectsList']; - patientERGetArchiveInformationList = - json['PatientER_GetArchiveInformation_List']; - patientERGetAskDoctorTotalByDateFilterList = - json['PatientER_GetAskDoctorTotalByDateFilterList']; - patientERGetBookScheduleConfigsList = - json['PatientER_GetBookScheduleConfigsList']; - patientERGetClinicAndTimeAndEpisodeForAppointmentList = - json['PatientER_GetClinicAndTimeAndEpisodeForAppointmentList']; - patientERGetClinicAndTimeForDischargeList = - json['PatientER_GetClinicAndTimeForDischargeList']; - patientERGetDashboardDataforApporvalSectionForAdminList = - json['PatientER_GetDashboardDataforApporvalSectionForAdminList']; - patientERGetDashboardDataforApporvalSectionList = - json['PatientER_GetDashboardDataforApporvalSectionList']; - patientERGetDashboardDataforHHCSectionForAdminList = - json['PatientER_GetDashboardDataforHHCSectionForAdminList']; - patientERGetDashboardDataforHHCSectionList = - json['PatientER_GetDashboardDataforHHCSectionList']; - patientERGetDashboardDataforPrescriptionSectionForAdminList = - json['PatientER_GetDashboardDataforPrescriptionSectionForAdminList']; - patientERGetDashboardDataforPrescriptionSectionList = - json['PatientER_GetDashboardDataforPrescriptionSectionList']; - patientERGetDoctorDashboardDataModelList = - json['PatientER_GetDoctorDashboardDataModelList']; - patientERGetDriverLocationList = json['PatientER_GetDriverLocationList']; - patientERGetInsuranceCardRequestByDateFilterList = - json['PatientER_GetInsuranceCardRequestByDateFilterList']; - patientERGetLiveCareSummaryBookedAppoinmentStatusList = - json['PatientER_GetLiveCareSummaryBookedAppoinmentStatusList']; - patientERGetLiveCareSummaryCovidList = - json['PatientER_GetLiveCareSummaryCovidList']; - patientERGetLiveCareSummaryForCMCList = - json['PatientER_GetLiveCareSummaryForCMCList']; - patientERGetLiveCareSummaryForHHCList = - json['PatientER_GetLiveCareSummaryForHHCList']; - patientERGetLiveCareSummaryForHomeDeliveryList = - json['PatientER_GetLiveCareSummaryForHomeDeliveryList']; - patientERGetLiveCareSummaryForInsuranceCardRequestList = - json['PatientER_GetLiveCareSummaryForInsuranceCardRequestList']; - patientERGetLiveCareSummaryForNewFilesList = - json['PatientER_GetLiveCareSummaryForNewFilesList']; - patientERGetLiveCareSummaryForOnlinePaymetRequestList = - json['PatientER_GetLiveCareSummaryForOnlinePaymetRequestList']; - patientERGetLiveCareSummaryForOnlinePharmacyOrdersList = - json['PatientER_GetLiveCareSummaryForOnlinePharmacyOrdersList']; - patientERGetLiveCareSummaryForTrasnportationList = - json['PatientER_GetLiveCareSummaryForTrasnportationList']; - patientERGetLiveCareSummaryLiveCareCountsList = - json['PatientER_GetLiveCareSummaryLiveCareCountsList']; - patientERGetMedicalRequestTotalByDateFilterList = - json['PatientER_GetMedicalRequestTotalByDateFilterList']; - patientERGetNearestPendingOrdersList = - json['PatientER_GetNearestPendingOrdersList']; - patientERGetNeedAproveHistoryForOrderList = - json['PatientER_GetNeedAproveHistoryForOrderList']; - patientERGetNeedAprovePendingOrdersList = - json['PatientER_GetNeedAprovePendingOrdersList']; - patientERGetNeedAproveStatusStatisticsList = - json['PatientER_GetNeedAproveStatusStatisticsList']; - patientERGetPatientAllPresOrdersList = - json['PatientER_GetPatientAllPresOrdersList']; - patientERGetPendingPatientsCountList = - json['PatientER_GetPendingPatientsCountList']; - patientERGetPresOrdersHistoryForAdminList = - json['PatientER_GetPresOrdersHistoryForAdminList']; - patientERGetPresOrdersHistoryForOrderList = - json['PatientER_GetPresOrdersHistoryForOrderList']; - patientERGetPresOrdersStatusStatisticsList = - json['PatientER_GetPresOrdersStatusStatisticsList']; - patientERHHCRequest = json['PatientER_HHCRequest']; - patientERHHCRequestSummaryByProject = - json['PatientER_HHCRequestSummaryByProject']; - patientERHHCRequestWithTotal = json['PatientER_HHCRequestWithTotal']; - patientERHHCGetAllServicesList = json['PatientER_HHC_GetAllServicesList']; - patientERHHCGetTransactionsForOrderList = - json['PatientER_HHC_GetTransactionsForOrderList']; - patientERHomeDeliveryCounts = json['PatientER_HomeDeliveryCounts']; - patientERInsertDriver = json['PatientER_InsertDriver']; - patientERInsertNewCurrentDoctorsOutputsList = - json['PatientER_InsertNewCurrentDoctorsOutputsList']; - patientERInsuranceStatusCountList = - json['PatientER_InsuranceStatusCountList']; - patientERIsNearestProjectUpdated = - json['PatientER_IsNearestProjectUpdated']; - patientERIsNeedAproveReturnedToQueue = - json['PatientER_IsNeedAproveReturnedToQueue']; - patientERIsNeedAproveUpdated = json['PatientER_IsNeedAproveUpdated']; - patientERIsOrderClientRequestUpdated = - json['PatientER_IsOrderClientRequestUpdated']; - patientERIsOrderReturnedToQueue = json['PatientER_IsOrderReturnedToQueue']; - patientERIsPresOrderInserted = json['PatientER_IsPresOrderInserted']; - patientERIsPresOrderUpdated = json['PatientER_IsPresOrderUpdated']; - patientERIsProjectUpdated = json['PatientER_IsProjectUpdated']; - patientERNotCompletedDetails = json['PatientER_NotCompletedDetails']; - patientERPatientsCountByCallStatus = - json['PatientER_PatientsCountByCallStatus']; - patientERPeakHourCounts = json['PatientER_PeakHourCounts']; - patientERPresOrderInfo = json['PatientER_PresOrderInfo']; - patientERPrescriptionCounts = json['PatientER_PrescriptionCounts']; - patientERProjectsContribution = json['PatientER_ProjectsContribution']; - patientERRRTGetAllQuestionsList = json['PatientER_RRT_GetAllQuestionsList']; - patientERRRTGetAllTransportationMethodList = - json['PatientER_RRT_GetAllTransportationMethodList']; - patientERRRTGetPickUpRequestByPresOrderIDList = - json['PatientER_RRT_GetPickUpRequestByPresOrderIDList']; - patientERRealRRTGetAllServicesList = - json['PatientER_RealRRT_GetAllServicesList']; - patientERRealRRTGetOrderDetailsList = - json['PatientER_RealRRT_GetOrderDetailsList']; - patientERRealRRTGetTransactionsForOrderList = - json['PatientER_RealRRT_GetTransactionsForOrderList']; - patientERRealRRTIsTransInserted = json['PatientER_RealRRT_IsTransInserted']; - patientERRequestList = json['PatientER_RequestList']; - patientERTransportationRequestWithTotal = - json['PatientER_TransportationRequestWithTotal']; - patientERealRRTGetServicePriceList = - json['PatientE_RealRRT_GetServicePriceList']; - patientInfoByAdmissionNoList = json['PatientInfoByAdmissionNo_List']; - patientMonitorGetPatientHeartRate = - json['PatientMonitor_GetPatientHeartRate']; - patientNotServedCounts = json['PatientNotServedCounts']; - patientPrescriptionList = json['PatientPrescriptionList']; - patientAllergies = json['Patient_Allergies']; - patientCheckAppointmentValidationList = - json['Patient_CheckAppointmentValidationList']; - patientLoginTokenList = json['Patient_LoginTokenList']; - patientQRLoginInfoList = json['Patient_QRLoginInfoList']; - patientSELECTDeviceIMEIbyIMEIList = - json['Patient_SELECTDeviceIMEIbyIMEIList']; - pharmList = json['PharmList']; - prefLang = json['PrefLang']; - radReportUnreadNo = json['RadReportUnreadNo']; - radGetPatientRadOrdersForDentalList = - json['Rad_GetPatientRadOrdersForDental_List']; - referralNumber = json['ReferralNumber']; - reminderConfigurations = json['ReminderConfigurations']; - requestNo = json['RequestNo']; - rowCount = json['RowCount']; - servicePrivilegeList = json['ServicePrivilegeList']; - shareFamilyFileObj = json['ShareFamilyFileObj']; - status = json['Status']; - successCode = json['SuccessCode']; - surveyRate = json['SurveyRate']; - symptomCheckerConditionList = json['SymptomChecker_ConditionList']; - symptomCheckerGetAllDefaultQuestionsList = - json['SymptomChecker_GetAllDefaultQuestionsList']; - symptomCheckerGetBodyPartSymptomsList = - json['SymptomChecker_GetBodyPartSymptomsList']; - symptomCheckerGetBodyPartsByCodeList = - json['SymptomChecker_GetBodyPartsByCodeList']; - symptomCheckerGetBodyPartsList = json['SymptomChecker_GetBodyPartsList']; - symptomCheckerJsonResponseInString = - json['SymptomChecker_JsonResponseInString']; - timerTime = json['TimerTime']; - totalAdvanceBalanceAmount = json['TotalAdvanceBalanceAmount']; - totalPatientsCount = json['TotalPatientsCount']; - totalPendingApprovalCount = json['TotalPendingApprovalCount']; - totalUnUsedCount = json['TotalUnUsedCount']; - transactionNo = json['TransactionNo']; - unReadCounts = json['UnReadCounts']; - updateStatus = json['UpdateStatus']; - userAgreementContent = json['UserAgreementContent']; - yahalaAccountNo = json['YahalaAccountNo']; - check24HourComplaint = json['check24HourComplaint']; - currency = json['currency']; - message = json['message']; - patientID = json['patientID']; - returnValue = json['returnValue']; - returnValueStr = json['returnValueStr']; - statusCode = json['statusCode']; - } - - 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['AccountStatus'] = this.accountStatus; - data['ActiveArchiveObject'] = this.activeArchiveObject; - data['ActiveMedicationCount'] = this.activeMedicationCount; - data['AllMedicationTakenDuringAdmission_List'] = - this.allMedicationTakenDuringAdmissionList; - data['AppointmentNo'] = this.appointmentNo; - data['ArePatientsOnlineList'] = this.arePatientsOnlineList; - data['BalanceAmount'] = this.balanceAmount; - data['BloodGroupList'] = this.bloodGroupList; - data['CVI_UnreadCount'] = this.cVIUnreadCount; - data['CheckUserHasAccount'] = this.checkUserHasAccount; - data['ComplaintNo'] = this.complaintNo; - data['DischargeList'] = this.dischargeList; - data['EpisodeID'] = this.episodeID; - data['FinalRadiologyList'] = this.finalRadiologyList; - data['FullName'] = this.fullName; - data['GeoF_PointsList'] = this.geoFPointsList; - data['GeoGetPateintInfo'] = this.geoGetPateintInfo; - data['GetAllDoctorsByProjectAndClinicList'] = - this.getAllDoctorsByProjectAndClinicList; - data['GetAppointmentNumbersForDoctorList'] = - this.getAppointmentNumbersForDoctorList; - data['GetCheckUpItemsList'] = this.getCheckUpItemsList; - data['GetCosmeticConferenceForTodayList'] = - this.getCosmeticConferenceForTodayList; - data['GetDoctorERClinicResult'] = this.getDoctorERClinicResult; - data['GetInvoiceApprovalList'] = this.getInvoiceApprovalList; - data['GetNearestProjectList'] = this.getNearestProjectList; - data['GetPatientAdmissionOrAppoinmentNo_List'] = - this.getPatientAdmissionOrAppoinmentNoList; - data['GetPatientBloodType'] = this.getPatientBloodType; - data['GetPatientInsuranceCardStatusStatisticsList'] = - this.getPatientInsuranceCardStatusStatisticsList; - data['GetSurveyList'] = this.getSurveyList; - data['GetTotalRegisteredPatientList'] = this.getTotalRegisteredPatientList; - data['GetUserDetailsList'] = this.getUserDetailsList; - data['Get_CustomerPointInfo'] = this.getCustomerPointInfo; - data['HIS_Approval_List'] = this.hISApprovalList; - data['HIS_InpAdmission_List'] = this.hISInpAdmissionList; - data['HIS_ProgNoteAssesmentModel_List'] = - this.hISProgNoteAssesmentModelList; - data['HMG_GetAllOffersList'] = this.hMGGetAllOffersList; - data['Has_Approval'] = this.hasApproval; - data['Has_Consultation'] = this.hasConsultation; - data['Has_Dental'] = this.hasDental; - data['Has_Lab'] = this.hasLab; - data['Has_Pharmacy'] = this.hasPharmacy; - data['Has_Rad'] = this.hasRad; - data['Hmg_SMS_Get_By_ProjectID_And_PatientIDList'] = - this.hmgSMSGetByProjectIDAndPatientIDList; - data['HoursLeft'] = this.hoursLeft; - data['INPM_GetAllAdmission_List'] = this.iNPMGetAllAdmissionList; - data['INPM_GetPatientInfoForSickLeaveReport_List'] = - this.iNPMGetPatientInfoForSickLeaveReportList; - data['INPM_HIS_PatientMedicalStatus_UnreadCount'] = - this.iNPMHISPatientMedicalStatusUnreadCount; - data['INPM_LAB_GetPatientLabOrdersResults_List'] = - this.iNPMLABGetPatientLabOrdersResultsList; - data['INPM_LAB_GetPatientLabResults_List'] = - this.iNPMLABGetPatientLabResultsList; - data['INPM_LAB_GetPatientRADReport_List'] = - this.iNPMLABGetPatientRADReportList; - data['INPM_LAB_GetPatientRadResults_List'] = - this.iNPMLABGetPatientRadResultsList; - data['INPM_Rad_GetPatientRadOrders_CVI_List'] = - this.iNPMRadGetPatientRadOrdersCVIList; - data['INPM_Rad_GetPatientRadOrders_List'] = - this.iNPMRadGetPatientRadOrdersList; - data['INPM_Rad_GetRadMedicalRecords_List'] = - this.iNPMRadGetRadMedicalRecordsList; - data['INP_GetPrescriptionDischarges_List'] = - this.iNPGetPrescriptionDischargesList; - data['INP_GetPrescriptionReport_List'] = this.iNPGetPrescriptionReportList; - data['IdentificationNo'] = this.identificationNo; - data['IsHomeMedicineDeliverySupported'] = - this.isHomeMedicineDeliverySupported; - data['IsInsertedOrUpdated'] = this.isInsertedOrUpdated; - data['IsMainAcoountEqualPatienID'] = this.isMainAcoountEqualPatienID; - data['IsPatientAlreadyAgreed'] = this.isPatientAlreadyAgreed; - data['IsPatientCallBackBlackList'] = this.isPatientCallBackBlackList; - data['IsPatientHaveFingerPrint'] = this.isPatientHaveFingerPrint; - data['IsPatientOnline'] = this.isPatientOnline; - data['IsPatientTokenRemoved'] = this.isPatientTokenRemoved; - data['IsPaused'] = this.isPaused; - data['IsProjectWorkingHours'] = this.isProjectWorkingHours; - data['IsStoreRateAllowed'] = this.isStoreRateAllowed; - data['IsStoreRateInserted'] = this.isStoreRateInserted; - data['IsStoreRateUpdated'] = this.isStoreRateUpdated; - data['LabRadUpdatedToRead'] = this.labRadUpdatedToRead; - data['LabReportUnreadNo'] = this.labReportUnreadNo; - data['LakumInquiryInformationObj'] = this.lakumInquiryInformationObj; - if (this.lakumInquiryInformationObjVersion != null) { - data['LakumInquiryInformationObjVersion'] = - this.lakumInquiryInformationObjVersion.toJson(); - } - data['LakumResponseList'] = this.lakumResponseList; - data['Laser_GetBodyPartsByCategoryList'] = - this.laserGetBodyPartsByCategoryList; - data['Laser_GetCategoriesList'] = this.laserGetCategoriesList; - data['List'] = this.list; - data['ListCount'] = this.listCount; - data['ListCountDeliverd'] = this.listCountDeliverd; - data['ListCountUnDeliverd'] = this.listCountUnDeliverd; - data['ListDeviceInfo'] = this.listDeviceInfo; - data['ListFamilyAppointments'] = this.listFamilyAppointments; - data['ListLabResultsByAppNo'] = this.listLabResultsByAppNo; - data['ListLakumInquiryInformationObj'] = - this.listLakumInquiryInformationObj; - data['ListOpinion_GetAllPeriod'] = this.listOpinionGetAllPeriod; - data['ListOpinion_GetAllServices'] = this.listOpinionGetAllServices; - data['ListOpinion_GetIsAgreeValue'] = this.listOpinionGetIsAgreeValue; - data['ListOpinion_GetOpinionLogin'] = this.listOpinionGetOpinionLogin; - data['ListOpinion_GetRequestedSerives'] = - this.listOpinionGetRequestedSerives; - data['ListOpinion_GetShareServicesDetails'] = - this.listOpinionGetShareServicesDetails; - data['ListOpinion_UserTerms'] = this.listOpinionUserTerms; - data['ListPLO'] = this.listPLO; - data['ListPLR'] = this.listPLR; - data['ListPLSR'] = this.listPLSR; - data['ListPRM'] = this.listPRM; - data['ListPatientFamilyFiles'] = this.listPatientFamilyFiles; - data['ListPatientFileInfo'] = this.listPatientFileInfo; - data['ListRAD'] = this.listRAD; - data['ListRADAPI'] = this.listRADAPI; - data['List_ActiveGetPrescriptionReportByPatientID'] = - this.listActiveGetPrescriptionReportByPatientID; - data['List_AppointmentsForDentalClinic'] = - this.listAppointmentsForDentalClinic; - data['List_BabyInfoResult'] = this.listBabyInfoResult; - data['List_CheckInsuranceCoverage'] = this.listCheckInsuranceCoverage; - data['List_CompanyClass'] = this.listCompanyClass; - data['List_ConsentMedicalReport'] = this.listConsentMedicalReport; - data['List_DentalAppointments'] = this.listDentalAppointments; - data['List_DeviceTokenIDByAppointmentNo'] = - this.listDeviceTokenIDByAppointmentNo; - data['List_DischargeDiagnosis'] = this.listDischargeDiagnosis; - data['List_DischargeMedicine'] = this.listDischargeMedicine; - data['List_DischargeSummary'] = this.listDischargeSummary; - data['List_DoctorResponse'] = this.listDoctorResponse; - data['List_DoneVaccines'] = this.listDoneVaccines; - data['List_EReferralResult'] = this.listEReferralResult; - data['List_EReferrals'] = this.listEReferrals; - data['List_GetAllPatients_LiveCare_Admin'] = - this.listGetAllPatientsLiveCareAdmin; - data['List_GetDataForExcel'] = this.listGetDataForExcel; - data['List_GetMainCountID'] = this.listGetMainCountID; - data['List_GetPrescriptionReportByPatientID'] = - this.listGetPrescriptionReportByPatientID; - data['List_GetSickLeave'] = this.listGetSickLeave; - data['List_HISInvoice'] = this.listHISInvoice; - data['List_HISInvoiceProcedures'] = this.listHISInvoiceProcedures; - data['List_InpatientInvoices'] = this.listInpatientInvoices; - data['List_InsuranceCheckList'] = this.listInsuranceCheckList; - data['List_InsuranceCompanies'] = this.listInsuranceCompanies; - data['List_InsuranceCompaniesGroup'] = this.listInsuranceCompaniesGroup; - data['List_InsuranceUpdateDetails'] = this.listInsuranceUpdateDetails; - data['List_InvoiceApprovalProcedureInfo'] = - this.listInvoiceApprovalProcedureInfo; - data['List_IsLastSatisfactionSurveyReviewedModel'] = - this.listIsLastSatisfactionSurveyReviewedModel; - data['List_LabOrderDetailsModel'] = this.listLabOrderDetailsModel; - data['List_MedicalReport'] = this.listMedicalReport; - data['List_MedicalReportApprovals'] = this.listMedicalReportApprovals; - data['List_MedicalReportStatus'] = this.listMedicalReportStatus; - data['List_MonthBloodPressureResult'] = this.listMonthBloodPressureResult; - data['List_MonthBloodPressureResultAverage'] = - this.listMonthBloodPressureResultAverage; - data['List_MonthDiabtecPatientResult'] = this.listMonthDiabtecPatientResult; - data['List_MonthDiabtectResultAverage'] = - this.listMonthDiabtectResultAverage; - data['List_MonthWeightMeasurementResult'] = - this.listMonthWeightMeasurementResult; - data['List_MonthWeightMeasurementResultAverage'] = - this.listMonthWeightMeasurementResultAverage; - data['List_OnlinePrescriptionResult'] = this.listOnlinePrescriptionResult; - data['List_OutPatientInvoices'] = this.listOutPatientInvoices; - data['List_PHRInvoice'] = this.listPHRInvoice; - data['List_PHRInvoiceItems'] = this.listPHRInvoiceItems; - data['List_PHRPaymentMethods'] = this.listPHRPaymentMethods; - data['List_PateintDetails'] = this.listPateintDetails; - data['List_PateintInformation'] = this.listPateintInformation; - data['List_PatientAdmissionInfo'] = this.listPatientAdmissionInfo; - data['List_PatientAdvanceBalanceAmount'] = - this.listPatientAdvanceBalanceAmount; - data['List_PatientCallBackLogs'] = this.listPatientCallBackLogs; - data['List_PatientCallBackToUpdateFromICServer'] = - this.listPatientCallBackToUpdateFromICServer; - data['List_PatientCount'] = this.listPatientCount; - data['List_PatientDashboard'] = this.listPatientDashboard; - data['List_PatientER_GetAdminClinicsModel'] = - this.listPatientERGetAdminClinicsModel; - data['List_PatientER_GetAdminProjectsModel'] = - this.listPatientERGetAdminProjectsModel; - data['List_PatientER_GetAllClinicsModel'] = - this.listPatientERGetAllClinicsModel; - data['List_PatientHISInvoices'] = this.listPatientHISInvoices; - data['List_PatientICProjects'] = this.listPatientICProjects; - data['List_PatientICProjectsByID'] = this.listPatientICProjectsByID; - data['List_PatientICProjectsTimings'] = this.listPatientICProjectsTimings; - data['List_PatientIDByUID'] = this.listPatientIDByUID; - data['List_PatientIDForSurveyResult'] = this.listPatientIDForSurveyResult; - data['List_PatientInfo'] = this.listPatientInfo; - data['List_PatientInfoForDDScreen'] = this.listPatientInfoForDDScreen; - data['List_PatientInfoForSickleaveReport'] = - this.listPatientInfoForSickleaveReport; - data['List_PatientInsuranceCard'] = this.listPatientInsuranceCard; - data['List_PatientInsuranceCardHistory'] = - this.listPatientInsuranceCardHistory; - data['List_PatientInsuranceDetails'] = this.listPatientInsuranceDetails; - data['List_PatientPHRInvoices'] = this.listPatientPHRInvoices; - data['List_PatientServicePoint'] = this.listPatientServicePoint; - data['List_PatientStatusCount'] = this.listPatientStatusCount; - data['List_Patient_ChatRequestMapModel'] = - this.listPatientChatRequestMapModel; - data['List_Patient_ChatRequestModel'] = this.listPatientChatRequestModel; - data['List_Patient_ChatRequestVCModel'] = - this.listPatientChatRequestVCModel; - data['List_PaymentMethods'] = this.listPaymentMethods; - data['List_PointServices'] = this.listPointServices; - data['List_PregnancyStagesInfo'] = this.listPregnancyStagesInfo; - data['List_ProjectAvgERWaitingTime'] = this.listProjectAvgERWaitingTime; - data['List_ProjectAvgERWaitingTimeHourly'] = - this.listProjectAvgERWaitingTimeHourly; - data['List_RadMedicalRecords'] = this.listRadMedicalRecords; - data['List_RadMedicalRecordsAPI'] = this.listRadMedicalRecordsAPI; - data['List_RadMedicalRecordsCVI'] = this.listRadMedicalRecordsCVI; - data['List_RadMedicalRecordsCVIAPI'] = this.listRadMedicalRecordsCVIAPI; - data['List_RadMedicalRecordsResults'] = this.listRadMedicalRecordsResults; - data['List_SickLeave'] = this.listSickLeave; - data['List_Transaction'] = this.listTransaction; - data['List_VideoConferenceSessions'] = this.listVideoConferenceSessions; - data['List_WeekBloodPressureResult'] = this.listWeekBloodPressureResult; - data['List_WeekBloodPressureResultAverage'] = - this.listWeekBloodPressureResultAverage; - data['List_WeekDiabtecPatientResult'] = this.listWeekDiabtecPatientResult; - data['List_WeekDiabtectResultAverage'] = this.listWeekDiabtectResultAverage; - data['List_WeekWeightMeasurementResult'] = - this.listWeekWeightMeasurementResult; - data['List_WeekWeightMeasurementResultAverage'] = - this.listWeekWeightMeasurementResultAverage; - data['List_YearBloodPressureResult'] = this.listYearBloodPressureResult; - data['List_YearBloodPressureResultAverage'] = - this.listYearBloodPressureResultAverage; - data['List_YearDiabtecPatientResult'] = this.listYearDiabtecPatientResult; - data['List_YearDiabtecResultAverage'] = this.listYearDiabtecResultAverage; - data['List_YearWeightMeasurementResult'] = - this.listYearWeightMeasurementResult; - data['List_YearWeightMeasurementResultAverage'] = - this.listYearWeightMeasurementResultAverage; - data['List_eInvoiceForDental'] = this.listEInvoiceForDental; - data['List_eInvoiceForOnlineCheckIn'] = this.listEInvoiceForOnlineCheckIn; - data['Med_GetActivitiesTransactionsStsList'] = - this.medGetActivitiesTransactionsStsList; - data['Med_GetAvgMonthTransactionsStsList'] = - this.medGetAvgMonthTransactionsStsList; - data['Med_GetAvgWeekTransactionsStsList'] = - this.medGetAvgWeekTransactionsStsList; - data['Med_GetCategoriesList'] = this.medGetCategoriesList; - data['Med_GetMonthActivitiesTransactionsStsList'] = - this.medGetMonthActivitiesTransactionsStsList; - data['Med_GetMonthStepsTransactionsStsList'] = - this.medGetMonthStepsTransactionsStsList; - data['Med_GetMonthTransactionsStsList'] = - this.medGetMonthTransactionsStsList; - data['Med_GetPatientLastRecordList'] = this.medGetPatientLastRecordList; - data['Med_GetSubCategoriesList'] = this.medGetSubCategoriesList; - data['Med_GetTransactionsAndActTransactionsResult'] = - this.medGetTransactionsAndActTransactionsResult; - data['Med_GetTransactionsList'] = this.medGetTransactionsList; - data['Med_GetWeekActivitiesTransactionsStsList'] = - this.medGetWeekActivitiesTransactionsStsList; - data['Med_GetWeekStepsTransactionsStsList'] = - this.medGetWeekStepsTransactionsStsList; - data['Med_GetWeekTransactionsStsList'] = this.medGetWeekTransactionsStsList; - data['Med_GetYearActivitiesTransactionsStsList'] = - this.medGetYearActivitiesTransactionsStsList; - data['Med_GetYearSleepTransactionsStsList'] = - this.medGetYearSleepTransactionsStsList; - data['Med_GetYearStepsTransactionsStsList'] = - this.medGetYearStepsTransactionsStsList; - data['Med_GetYearTransactionsStsList'] = this.medGetYearTransactionsStsList; - data['Med_InsertTransactionsOutputsList'] = - this.medInsertTransactionsOutputsList; - data['MedicalRecordImages'] = this.medicalRecordImages; - data['MedicalReportToRead'] = this.medicalReportToRead; - data['MedicalReportUnreadNo'] = this.medicalReportUnreadNo; - data['Missing_IDCardAttachment'] = this.missingIDCardAttachment; - data['Missing_InsuranceCardAttachment'] = - this.missingInsuranceCardAttachment; - data['Missing_MedicalReportAttachment'] = - this.missingMedicalReportAttachment; - data['Missing_OtherRelationship'] = this.missingOtherRelationship; - data['Missing_PatientContactNo'] = this.missingPatientContactNo; - data['Missing_PatientId'] = this.missingPatientId; - data['Missing_PatientIdentityNumber'] = this.missingPatientIdentityNumber; - data['Missing_PatientName'] = this.missingPatientName; - data['Missing_ReferralContactNo'] = this.missingReferralContactNo; - data['Missing_ReferralRelationship'] = this.missingReferralRelationship; - data['Missing_ReferralRequesterName'] = this.missingReferralRequesterName; - data['MobileNumber'] = this.mobileNumber; - data['NationalityNumber'] = this.nationalityNumber; - data['OnlineCheckInAppointments'] = this.onlineCheckInAppointments; - data['Opinion_UserAgreementContent'] = this.opinionUserAgreementContent; - data['OrderInsert'] = this.orderInsert; - data['PateintInfoForUpdateList'] = this.pateintInfoForUpdateList; - data['PateintUpatedList'] = this.pateintUpatedList; - data['PatientBirthdayCertificate'] = this.patientBirthdayCertificate; - data['PatientER_CMCRequestSummaryByProject'] = - this.patientERCMCRequestSummaryByProject; - data['PatientER_CMCRequestWithTotal'] = this.patientERCMCRequestWithTotal; - data['PatientER_CMC_GetAllServicesList'] = - this.patientERCMCGetAllServicesList; - data['PatientER_CMC_GetTransactionsForOrderList'] = - this.patientERCMCGetTransactionsForOrderList; - data['PatientER_Coordinates'] = this.patientERCoordinates; - data['PatientER_CountOrderList'] = this.patientERCountOrderList; - data['PatientER_CountsForApprovalOffice'] = - this.patientERCountsForApprovalOffice; - data['PatientER_DeleteOldCurrentDoctorsOutputsList'] = - this.patientERDeleteOldCurrentDoctorsOutputsList; - data['PatientER_Delivery_GetAllDeliverdOrderList'] = - this.patientERDeliveryGetAllDeliverdOrderList; - data['PatientER_Delivery_GetAllOrderList'] = - this.patientERDeliveryGetAllOrderList; - data['PatientER_Delivery_IsOrderInserted'] = - this.patientERDeliveryIsOrderInserted; - data['PatientER_Delivery_IsOrderUpdated'] = - this.patientERDeliveryIsOrderUpdated; - data['PatientER_Delivery_IsPausedChanged'] = - this.patientERDeliveryIsPausedChanged; - data['PatientER_Delivery_NextOrder'] = this.patientERDeliveryNextOrder; - data['PatientER_Delivery_OrderInsert'] = this.patientERDeliveryOrderInsert; - data['PatientER_Delivery_UpdateOrderStatus'] = - this.patientERDeliveryUpdateOrderStatus; - data['PatientER_DriverUpdate'] = this.patientERDriverUpdate; - data['PatientER_Exacart_CheckIsDispenseAccpetableList'] = - this.patientERExacartCheckIsDispenseAccpetableList; - data['PatientER_Exacart_GetDispenseQuantitiesByOrderIDList'] = - this.patientERExacartGetDispenseQuantitiesByOrderIDList; - data['PatientER_Exacart_GetOrderDetailsByePharmacyOrderNoList'] = - this.patientERExacartGetOrderDetailsByePharmacyOrderNoList; - data['PatientER_Exacart_GetOrderDetailsList'] = - this.patientERExacartGetOrderDetailsList; - data['PatientER_Exacart_GetTotalDispenseQuantitiesByPresNoList'] = - this.patientERExacartGetTotalDispenseQuantitiesByPresNoList; - data['PatientER_Exacart_IsDispenseAdded'] = - this.patientERExacartIsDispenseAdded; - data['PatientER_Exacart_IsDispenseAddedList'] = - this.patientERExacartIsDispenseAddedList; - data['PatientER_Exacart_IsOrderCompleted'] = - this.patientERExacartIsOrderCompleted; - data['PatientER_GetAdminByProjectAndRoleList'] = - this.patientERGetAdminByProjectAndRoleList; - data['PatientER_GetAdminProjectsList'] = this.patientERGetAdminProjectsList; - data['PatientER_GetAllDriversList'] = this.patientERGetAllDriversList; - data['PatientER_GetAllNeedAproveStatusList'] = - this.patientERGetAllNeedAproveStatusList; - data['PatientER_GetAllPresOrdersStatusList'] = - this.patientERGetAllPresOrdersStatusList; - data['PatientER_GetAllProjectsList'] = this.patientERGetAllProjectsList; - data['PatientER_GetArchiveInformation_List'] = - this.patientERGetArchiveInformationList; - data['PatientER_GetAskDoctorTotalByDateFilterList'] = - this.patientERGetAskDoctorTotalByDateFilterList; - data['PatientER_GetBookScheduleConfigsList'] = - this.patientERGetBookScheduleConfigsList; - data['PatientER_GetClinicAndTimeAndEpisodeForAppointmentList'] = - this.patientERGetClinicAndTimeAndEpisodeForAppointmentList; - data['PatientER_GetClinicAndTimeForDischargeList'] = - this.patientERGetClinicAndTimeForDischargeList; - data['PatientER_GetDashboardDataforApporvalSectionForAdminList'] = - this.patientERGetDashboardDataforApporvalSectionForAdminList; - data['PatientER_GetDashboardDataforApporvalSectionList'] = - this.patientERGetDashboardDataforApporvalSectionList; - data['PatientER_GetDashboardDataforHHCSectionForAdminList'] = - this.patientERGetDashboardDataforHHCSectionForAdminList; - data['PatientER_GetDashboardDataforHHCSectionList'] = - this.patientERGetDashboardDataforHHCSectionList; - data['PatientER_GetDashboardDataforPrescriptionSectionForAdminList'] = - this.patientERGetDashboardDataforPrescriptionSectionForAdminList; - data['PatientER_GetDashboardDataforPrescriptionSectionList'] = - this.patientERGetDashboardDataforPrescriptionSectionList; - data['PatientER_GetDoctorDashboardDataModelList'] = - this.patientERGetDoctorDashboardDataModelList; - data['PatientER_GetDriverLocationList'] = - this.patientERGetDriverLocationList; - data['PatientER_GetInsuranceCardRequestByDateFilterList'] = - this.patientERGetInsuranceCardRequestByDateFilterList; - data['PatientER_GetLiveCareSummaryBookedAppoinmentStatusList'] = - this.patientERGetLiveCareSummaryBookedAppoinmentStatusList; - data['PatientER_GetLiveCareSummaryCovidList'] = - this.patientERGetLiveCareSummaryCovidList; - data['PatientER_GetLiveCareSummaryForCMCList'] = - this.patientERGetLiveCareSummaryForCMCList; - data['PatientER_GetLiveCareSummaryForHHCList'] = - this.patientERGetLiveCareSummaryForHHCList; - data['PatientER_GetLiveCareSummaryForHomeDeliveryList'] = - this.patientERGetLiveCareSummaryForHomeDeliveryList; - data['PatientER_GetLiveCareSummaryForInsuranceCardRequestList'] = - this.patientERGetLiveCareSummaryForInsuranceCardRequestList; - data['PatientER_GetLiveCareSummaryForNewFilesList'] = - this.patientERGetLiveCareSummaryForNewFilesList; - data['PatientER_GetLiveCareSummaryForOnlinePaymetRequestList'] = - this.patientERGetLiveCareSummaryForOnlinePaymetRequestList; - data['PatientER_GetLiveCareSummaryForOnlinePharmacyOrdersList'] = - this.patientERGetLiveCareSummaryForOnlinePharmacyOrdersList; - data['PatientER_GetLiveCareSummaryForTrasnportationList'] = - this.patientERGetLiveCareSummaryForTrasnportationList; - data['PatientER_GetLiveCareSummaryLiveCareCountsList'] = - this.patientERGetLiveCareSummaryLiveCareCountsList; - data['PatientER_GetMedicalRequestTotalByDateFilterList'] = - this.patientERGetMedicalRequestTotalByDateFilterList; - data['PatientER_GetNearestPendingOrdersList'] = - this.patientERGetNearestPendingOrdersList; - data['PatientER_GetNeedAproveHistoryForOrderList'] = - this.patientERGetNeedAproveHistoryForOrderList; - data['PatientER_GetNeedAprovePendingOrdersList'] = - this.patientERGetNeedAprovePendingOrdersList; - data['PatientER_GetNeedAproveStatusStatisticsList'] = - this.patientERGetNeedAproveStatusStatisticsList; - data['PatientER_GetPatientAllPresOrdersList'] = - this.patientERGetPatientAllPresOrdersList; - data['PatientER_GetPendingPatientsCountList'] = - this.patientERGetPendingPatientsCountList; - data['PatientER_GetPresOrdersHistoryForAdminList'] = - this.patientERGetPresOrdersHistoryForAdminList; - data['PatientER_GetPresOrdersHistoryForOrderList'] = - this.patientERGetPresOrdersHistoryForOrderList; - data['PatientER_GetPresOrdersStatusStatisticsList'] = - this.patientERGetPresOrdersStatusStatisticsList; - data['PatientER_HHCRequest'] = this.patientERHHCRequest; - data['PatientER_HHCRequestSummaryByProject'] = - this.patientERHHCRequestSummaryByProject; - data['PatientER_HHCRequestWithTotal'] = this.patientERHHCRequestWithTotal; - data['PatientER_HHC_GetAllServicesList'] = - this.patientERHHCGetAllServicesList; - data['PatientER_HHC_GetTransactionsForOrderList'] = - this.patientERHHCGetTransactionsForOrderList; - data['PatientER_HomeDeliveryCounts'] = this.patientERHomeDeliveryCounts; - data['PatientER_InsertDriver'] = this.patientERInsertDriver; - data['PatientER_InsertNewCurrentDoctorsOutputsList'] = - this.patientERInsertNewCurrentDoctorsOutputsList; - data['PatientER_InsuranceStatusCountList'] = - this.patientERInsuranceStatusCountList; - data['PatientER_IsNearestProjectUpdated'] = - this.patientERIsNearestProjectUpdated; - data['PatientER_IsNeedAproveReturnedToQueue'] = - this.patientERIsNeedAproveReturnedToQueue; - data['PatientER_IsNeedAproveUpdated'] = this.patientERIsNeedAproveUpdated; - data['PatientER_IsOrderClientRequestUpdated'] = - this.patientERIsOrderClientRequestUpdated; - data['PatientER_IsOrderReturnedToQueue'] = - this.patientERIsOrderReturnedToQueue; - data['PatientER_IsPresOrderInserted'] = this.patientERIsPresOrderInserted; - data['PatientER_IsPresOrderUpdated'] = this.patientERIsPresOrderUpdated; - data['PatientER_IsProjectUpdated'] = this.patientERIsProjectUpdated; - data['PatientER_NotCompletedDetails'] = this.patientERNotCompletedDetails; - data['PatientER_PatientsCountByCallStatus'] = - this.patientERPatientsCountByCallStatus; - data['PatientER_PeakHourCounts'] = this.patientERPeakHourCounts; - data['PatientER_PresOrderInfo'] = this.patientERPresOrderInfo; - data['PatientER_PrescriptionCounts'] = this.patientERPrescriptionCounts; - data['PatientER_ProjectsContribution'] = this.patientERProjectsContribution; - data['PatientER_RRT_GetAllQuestionsList'] = - this.patientERRRTGetAllQuestionsList; - data['PatientER_RRT_GetAllTransportationMethodList'] = - this.patientERRRTGetAllTransportationMethodList; - data['PatientER_RRT_GetPickUpRequestByPresOrderIDList'] = - this.patientERRRTGetPickUpRequestByPresOrderIDList; - data['PatientER_RealRRT_GetAllServicesList'] = - this.patientERRealRRTGetAllServicesList; - data['PatientER_RealRRT_GetOrderDetailsList'] = - this.patientERRealRRTGetOrderDetailsList; - data['PatientER_RealRRT_GetTransactionsForOrderList'] = - this.patientERRealRRTGetTransactionsForOrderList; - data['PatientER_RealRRT_IsTransInserted'] = - this.patientERRealRRTIsTransInserted; - data['PatientER_RequestList'] = this.patientERRequestList; - data['PatientER_TransportationRequestWithTotal'] = - this.patientERTransportationRequestWithTotal; - data['PatientE_RealRRT_GetServicePriceList'] = - this.patientERealRRTGetServicePriceList; - data['PatientInfoByAdmissionNo_List'] = this.patientInfoByAdmissionNoList; - data['PatientMonitor_GetPatientHeartRate'] = - this.patientMonitorGetPatientHeartRate; - data['PatientNotServedCounts'] = this.patientNotServedCounts; - data['PatientPrescriptionList'] = this.patientPrescriptionList; - data['Patient_Allergies'] = this.patientAllergies; - data['Patient_CheckAppointmentValidationList'] = - this.patientCheckAppointmentValidationList; - data['Patient_LoginTokenList'] = this.patientLoginTokenList; - data['Patient_QRLoginInfoList'] = this.patientQRLoginInfoList; - data['Patient_SELECTDeviceIMEIbyIMEIList'] = - this.patientSELECTDeviceIMEIbyIMEIList; - data['PharmList'] = this.pharmList; - data['PrefLang'] = this.prefLang; - data['RadReportUnreadNo'] = this.radReportUnreadNo; - data['Rad_GetPatientRadOrdersForDental_List'] = - this.radGetPatientRadOrdersForDentalList; - data['ReferralNumber'] = this.referralNumber; - data['ReminderConfigurations'] = this.reminderConfigurations; - data['RequestNo'] = this.requestNo; - data['RowCount'] = this.rowCount; - data['ServicePrivilegeList'] = this.servicePrivilegeList; - data['ShareFamilyFileObj'] = this.shareFamilyFileObj; - data['Status'] = this.status; - data['SuccessCode'] = this.successCode; - data['SurveyRate'] = this.surveyRate; - data['SymptomChecker_ConditionList'] = this.symptomCheckerConditionList; - data['SymptomChecker_GetAllDefaultQuestionsList'] = - this.symptomCheckerGetAllDefaultQuestionsList; - data['SymptomChecker_GetBodyPartSymptomsList'] = - this.symptomCheckerGetBodyPartSymptomsList; - data['SymptomChecker_GetBodyPartsByCodeList'] = - this.symptomCheckerGetBodyPartsByCodeList; - data['SymptomChecker_GetBodyPartsList'] = - this.symptomCheckerGetBodyPartsList; - data['SymptomChecker_JsonResponseInString'] = - this.symptomCheckerJsonResponseInString; - data['TimerTime'] = this.timerTime; - data['TotalAdvanceBalanceAmount'] = this.totalAdvanceBalanceAmount; - data['TotalPatientsCount'] = this.totalPatientsCount; - data['TotalPendingApprovalCount'] = this.totalPendingApprovalCount; - data['TotalUnUsedCount'] = this.totalUnUsedCount; - data['TransactionNo'] = this.transactionNo; - data['UnReadCounts'] = this.unReadCounts; - data['UpdateStatus'] = this.updateStatus; - data['UserAgreementContent'] = this.userAgreementContent; - data['YahalaAccountNo'] = this.yahalaAccountNo; - data['check24HourComplaint'] = this.check24HourComplaint; - data['currency'] = this.currency; - data['message'] = this.message; - data['patientID'] = this.patientID; - data['returnValue'] = this.returnValue; - data['returnValueStr'] = this.returnValueStr; - data['statusCode'] = this.statusCode; - return data; - } -} \ No newline at end of file diff --git a/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart b/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart deleted file mode 100644 index 809277e1..00000000 --- a/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart +++ /dev/null @@ -1,179 +0,0 @@ -import 'PointsAmountPerYear.dart'; -import 'PointsDetails.dart'; - -class LakumInquiryInformationObjVersion { - int accountNumber; - String accountStatus; - String barCode; - int consumedPoints; - String consumedPointsAmount; - List consumedPointsAmountPerYear; - List consumedPointsDetails; - String createdDate; - int expiredPoints; - String expiryDate; - int gainedPoints; - List gainedPointsAmountPerYear; - List gainedPointsDetails; - String lakumMessageStatus; - String memberName; - String memberUniversalId; - String mobileNumber; - int pointsBalance; - int pointsBalanceAmount; - int pointsWillBeExpired; - String prefLang; - int statusCode; - int transferPoints; - List transferPointsAmountPerYear; - List transferPointsDetails; - int waitingPoints; - int loyalityAmount; - int loyalityPoints; - int purchaseRate; - - LakumInquiryInformationObjVersion( - {this.accountNumber, - this.accountStatus, - this.barCode, - this.consumedPoints, - this.consumedPointsAmount, - this.consumedPointsAmountPerYear, - this.consumedPointsDetails, - this.createdDate, - this.expiredPoints, - this.expiryDate, - this.gainedPoints, - this.gainedPointsAmountPerYear, - this.gainedPointsDetails, - this.lakumMessageStatus, - this.memberName, - this.memberUniversalId, - this.mobileNumber, - this.pointsBalance, - this.pointsBalanceAmount, - this.pointsWillBeExpired, - this.prefLang, - this.statusCode, - this.transferPoints, - this.transferPointsAmountPerYear, - this.transferPointsDetails, - this.waitingPoints, - this.loyalityAmount, - this.loyalityPoints, - this.purchaseRate}); - - LakumInquiryInformationObjVersion.fromJson(Map json) { - accountNumber = json['AccountNumber']; - accountStatus = json['AccountStatus']; - barCode = json['BarCode']; - consumedPoints = json['ConsumedPoints']; - consumedPointsAmount = json['ConsumedPointsAmount']; - if (json['ConsumedPointsAmountPerYear'] != null) { - consumedPointsAmountPerYear = new List(); - json['ConsumedPointsAmountPerYear'].forEach((v) { - consumedPointsAmountPerYear.add(PointsAmountPerYear.fromJson(v)); - }); - } - if (json['ConsumedPointsDetails'] != null) { - consumedPointsDetails = new List(); - json['ConsumedPointsDetails'].forEach((v) { - consumedPointsDetails.add(PointsDetails.fromJson(v)); - }); - } - createdDate = json['CreatedDate']; - expiredPoints = json['ExpiredPoints']; - expiryDate = json['ExpiryDate']; - gainedPoints = json['GainedPoints']; - if (json['GainedPointsAmountPerYear'] != null) { - gainedPointsAmountPerYear = new List(); - json['GainedPointsAmountPerYear'].forEach((v) { - gainedPointsAmountPerYear.add(PointsAmountPerYear.fromJson(v)); - }); - } - if (json['GainedPointsDetails'] != null) { - gainedPointsDetails = new List(); - json['GainedPointsDetails'].forEach((v) { - gainedPointsDetails.add(PointsDetails.fromJson(v)); - }); - } - lakumMessageStatus = json['LakumMessageStatus']; - memberName = json['MemberName']; - memberUniversalId = json['MemberUniversalId']; - mobileNumber = json['MobileNumber']; - pointsBalance = json['PointsBalance']; - pointsBalanceAmount = json['PointsBalanceAmount']; - pointsWillBeExpired = json['PointsWillBeExpired']; - prefLang = json['PrefLang']; - statusCode = json['StatusCode']; - transferPoints = json['TransferPoints']; - if (json['TransferPointsAmountPerYear'] != null) { - transferPointsAmountPerYear = new List(); - json['TransferPointsAmountPerYear'].forEach((v) { - transferPointsAmountPerYear.add(PointsAmountPerYear.fromJson(v)); - }); - } - if (json['TransferPointsDetails'] != null) { - transferPointsDetails = new List(); - json['TransferPointsDetails'].forEach((v) { - transferPointsDetails.add(PointsDetails.fromJson(v)); - }); - } - waitingPoints = json['WaitingPoints']; - loyalityAmount = json['loyalityAmount']; - loyalityPoints = json['loyalityPoints']; - purchaseRate = json['purchaseRate']; - } - - Map toJson() { - final Map data = new Map(); - data['AccountNumber'] = this.accountNumber; - data['AccountStatus'] = this.accountStatus; - data['BarCode'] = this.barCode; - data['ConsumedPoints'] = this.consumedPoints; - data['ConsumedPointsAmount'] = this.consumedPointsAmount; - if (this.consumedPointsAmountPerYear != null) { - data['ConsumedPointsAmountPerYear'] = - this.consumedPointsAmountPerYear.map((v) => v).toList(); - } - if (this.consumedPointsDetails != null) { - data['ConsumedPointsDetails'] = - this.consumedPointsDetails.map((v) => v).toList(); - } - data['CreatedDate'] = this.createdDate; - data['ExpiredPoints'] = this.expiredPoints; - data['ExpiryDate'] = this.expiryDate; - data['GainedPoints'] = this.gainedPoints; - if (this.gainedPointsAmountPerYear != null) { - data['GainedPointsAmountPerYear'] = - this.gainedPointsAmountPerYear.map((v) => v).toList(); - } - if (this.gainedPointsDetails != null) { - data['GainedPointsDetails'] = - this.gainedPointsDetails.map((v) => v).toList(); - } - data['LakumMessageStatus'] = this.lakumMessageStatus; - data['MemberName'] = this.memberName; - data['MemberUniversalId'] = this.memberUniversalId; - data['MobileNumber'] = this.mobileNumber; - data['PointsBalance'] = this.pointsBalance; - data['PointsBalanceAmount'] = this.pointsBalanceAmount; - data['PointsWillBeExpired'] = this.pointsWillBeExpired; - data['PrefLang'] = this.prefLang; - data['StatusCode'] = this.statusCode; - data['TransferPoints'] = this.transferPoints; - if (this.transferPointsAmountPerYear != null) { - data['TransferPointsAmountPerYear'] = - this.transferPointsAmountPerYear.map((v) => v).toList(); - } - if (this.transferPointsDetails != null) { - data['TransferPointsDetails'] = - this.transferPointsDetails.map((v) => v).toList(); - } - data['WaitingPoints'] = this.waitingPoints; - data['loyalityAmount'] = this.loyalityAmount; - data['loyalityPoints'] = this.loyalityPoints; - data['purchaseRate'] = this.purchaseRate; - return data; - } -} \ No newline at end of file diff --git a/lib/core/model/pharmacies/ListUserAgreement.dart b/lib/core/model/pharmacies/ListUserAgreement.dart deleted file mode 100644 index 4237e304..00000000 --- a/lib/core/model/pharmacies/ListUserAgreement.dart +++ /dev/null @@ -1,28 +0,0 @@ -class ListUserAgreement { - String userAgreementLAKUM; - String userAgreementLAKUMn; - String userAgreementTxt; - String userAgreementTxtn; - - ListUserAgreement( - {this.userAgreementLAKUM, - this.userAgreementLAKUMn, - this.userAgreementTxt, - this.userAgreementTxtn}); - - ListUserAgreement.fromJson(Map json) { - userAgreementLAKUM = json['UserAgreementLAKUM']; - userAgreementLAKUMn = json['UserAgreementLAKUMn']; - userAgreementTxt = json['UserAgreementTxt']; - userAgreementTxtn = json['UserAgreementTxtn']; - } - - Map toJson() { - final Map data = new Map(); - data['UserAgreementLAKUM'] = this.userAgreementLAKUM; - data['UserAgreementLAKUMn'] = this.userAgreementLAKUMn; - data['UserAgreementTxt'] = this.userAgreementTxt; - data['UserAgreementTxtn'] = this.userAgreementTxtn; - return data; - } -} diff --git a/lib/core/model/pharmacies/PharmacyAddressesModel.dart b/lib/core/model/pharmacies/PharmacyAddressesModel.dart deleted file mode 100644 index db9c20ae..00000000 --- a/lib/core/model/pharmacies/PharmacyAddressesModel.dart +++ /dev/null @@ -1,170 +0,0 @@ - -import 'dart:convert'; - -PharmacyAddressesModel pharmacyAddressesModelFromJson(String str) => PharmacyAddressesModel.fromJson(json.decode(str)); - -String pharmacyAddressesModelToJson(PharmacyAddressesModel data) => json.encode(data.toJson()); - -class PharmacyAddressesModel { - PharmacyAddressesModel({ - this.customers, - }); - - List customers; - - factory PharmacyAddressesModel.fromJson(Map json) => PharmacyAddressesModel( - customers: List.from(json["customers"].map((x) => Customer.fromJson(x))), - ); - - Map toJson() => { - "customers": List.from(customers.map((x) => x.toJson())), - }; -} - -class Customer { - Customer({ - this.addresses, - }); - - List
addresses; - - factory Customer.fromJson(Map json) => Customer( - addresses: List
.from(json["addresses"].map((x) => Address.fromJson(x))), - ); - - Map toJson() => { - "addresses": List.from(addresses.map((x) => x.toJson())), - }; -} - -class Address { - Address({ - this.id, - this.firstName, - this.lastName, - this.email, - this.company, - this.countryId, - this.country, - this.stateProvinceId, - this.city, - this.address1, - this.address2, - this.zipPostalCode, - this.phoneNumber, - this.faxNumber, - this.customerAttributes, - this.createdOnUtc, - this.province, - this.latLong, - }); - - String id; - FirstName firstName; - LastName lastName; - Email email; - dynamic company; - int countryId; - Country country; - dynamic stateProvinceId; - City city; - String address1; - String address2; - String zipPostalCode; - String phoneNumber; - dynamic faxNumber; - String customerAttributes; - DateTime createdOnUtc; - dynamic province; - String latLong; - - factory Address.fromJson(Map json) => Address( - id: json["id"], - firstName: firstNameValues.map[json["first_name"]], - lastName: lastNameValues.map[json["last_name"]], - email: emailValues.map[json["email"]], - company: json["company"], - countryId: json["country_id"], - country: countryValues.map[json["country"]], - stateProvinceId: json["state_province_id"], - city: cityValues.map[json["city"]], - address1: json["address1"], - address2: json["address2"], - zipPostalCode: json["zip_postal_code"], - phoneNumber: json["phone_number"], - faxNumber: json["fax_number"], - customerAttributes: json["customer_attributes"], - createdOnUtc: DateTime.parse(json["created_on_utc"]), - province: json["province"], - latLong: json["lat_long"], - ); - - Map toJson() => { - "id": id, - "first_name": firstNameValues.reverse[firstName], - "last_name": lastNameValues.reverse[lastName], - "email": emailValues.reverse[email], - "company": company, - "country_id": countryId, - "country": countryValues.reverse[country], - "state_province_id": stateProvinceId, - "city": cityValues.reverse[city], - "address1": address1, - "address2": address2, - "zip_postal_code": zipPostalCode, - "phone_number": phoneNumber, - "fax_number": faxNumber, - "customer_attributes": customerAttributes, - "created_on_utc": createdOnUtc.toIso8601String(), - "province": province, - "lat_long": latLong, - }; -} - -enum City { RIYADH, AL_OYUN } - -final cityValues = EnumValues({ - "Al Oyun": City.AL_OYUN, - "Riyadh": City.RIYADH -}); - -enum Country { SAUDI_ARABIA } - -final countryValues = EnumValues({ - "Saudi Arabia": Country.SAUDI_ARABIA -}); - -enum Email { TAMER_FANASHEH_GMAIL_COM, TAMER_DASDASDAS_GMAIL_COM } - -final emailValues = EnumValues({ - "Tamer.dasdasdas@gmail.com": Email.TAMER_DASDASDAS_GMAIL_COM, - "Tamer.fanasheh@gmail.com": Email.TAMER_FANASHEH_GMAIL_COM -}); - -enum FirstName { TAMER, TAMER_FANASHEH } - -final firstNameValues = EnumValues({ - "TAMER": FirstName.TAMER, - "TAMER FANASHEH": FirstName.TAMER_FANASHEH -}); - -enum LastName { FANASHEH, MUSA } - -final lastNameValues = EnumValues({ - "FANASHEH": LastName.FANASHEH, - "MUSA": LastName.MUSA -}); - -class EnumValues { - Map map; - Map reverseMap; - - EnumValues(this.map); - - Map get reverse { - if (reverseMap == null) { - reverseMap = map.map((k, v) => new MapEntry(v, k)); - } - return reverseMap; - } -} diff --git a/lib/core/model/pharmacies/PharmacyProduct.dart b/lib/core/model/pharmacies/PharmacyProduct.dart index c472cb4c..cd461ae5 100644 --- a/lib/core/model/pharmacies/PharmacyProduct.dart +++ b/lib/core/model/pharmacies/PharmacyProduct.dart @@ -1,538 +1,149 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/Specifications.dart'; - import 'PharmacyImageObject.dart'; import 'Reviews.dart'; class PharmacyProduct { String id; - bool visibleIndividually; String name; String namen; String shortDescription; - String shortDescriptionn; String fullDescription; String fullDescriptionn; - bool markasNew; - bool showOnHomePage; - String metaKeywords; - String metaDescription; - String metaTitle; - bool allowCustomerReviews; int approvedRatingSum; - int notApprovedRatingSum; int approvedTotalReviews; - int notApprovedTotalReviews; String sku; bool isRx; - bool prescriptionRequired; String rxMessage; String rxMessagen; - String manufacturerPartNumber; - String gtin; - bool isGiftCard; - bool requireOtherProducts; - bool automaticallyAddRequiredProducts; - bool isDownload; - bool unlimitedDownloads; - int maxNumberOfDownloads; - String downloadExpirationDays; - bool hasSampleDownload; - bool hasUserAgreement; - bool isRecurring; - int recurringCycleLength; - int recurringTotalCycles; - bool isRental; - int rentalPriceLength; - bool isShipEnabled; - bool isFreeShipping; - bool shipSeparately; - double additionalShippingCharge; - bool isTaxExempt; - bool isTelecommunicationsOrBroadcastingOrElectronicServices; - bool useMultipleWarehouses; - int manageInventoryMethodId; int stockQuantity; String stockAvailability; String stockAvailabilityn; - bool displayStockAvailability; - bool displayStockQuantity; - int minStockQuantity; - int notifyAdminForQuantityBelow; bool allowBackInStockSubscriptions; int orderMinimumQuantity; int orderMaximumQuantity; - String allowedQuantities; - bool allowAddingOnlyExistingAttributeCombinations; - bool disableBuyButton; - bool disableWishlistButton; - bool availableForPreOrder; - String preOrderAvailabilityStartDateTimeUtc; - bool callForPrice; double price; double oldPrice; - double productCost; - String specialPrice; - String specialPriceStartDateTimeUtc; - String specialPriceEndDateTimeUtc; - bool customerEntersPrice; - double minimumCustomerEnteredPrice; - double maximumCustomerEnteredPrice; - bool basepriceEnabled; - double basepriceAmount; - double basepriceBaseAmount; - bool hasTierPrices; - bool hasDiscountsApplied; String discountName; String discountNamen; - String discountDescription; - String discountDescriptionn; String discountPercentage; - String currency; - String currencyn; - double weight; - double length; - double width; - double height; - String availableStartDateTimeUtc; - String availableEndDateTimeUtc; int displayOrder; - bool published; - bool deleted; - String createdOnUtc; - String updatedOnUtc; - String productType; - int parentGroupedProductId; - List roleIds; List discountIds; - List storeIds; - List manufacturerIds; List reviews; List images; - List attributes; - List specifications; - List associatedProductIds; - List tags; - int vendorId; - String seName; - PharmacyProduct( {this.id, - this.visibleIndividually, this.name, this.namen, this.shortDescription, - this.shortDescriptionn, this.fullDescription, this.fullDescriptionn, - this.markasNew, - this.showOnHomePage, - this.metaKeywords, - this.metaDescription, - this.metaTitle, - this.allowCustomerReviews, this.approvedRatingSum, - this.notApprovedRatingSum, this.approvedTotalReviews, - this.notApprovedTotalReviews, this.sku, this.isRx, - this.prescriptionRequired, this.rxMessage, this.rxMessagen, - this.manufacturerPartNumber, - this.gtin, - this.isGiftCard, - this.requireOtherProducts, - this.automaticallyAddRequiredProducts, - this.isDownload, - this.unlimitedDownloads, - this.maxNumberOfDownloads, - this.downloadExpirationDays, - this.hasSampleDownload, - this.hasUserAgreement, - this.isRecurring, - this.recurringCycleLength, - this.recurringTotalCycles, - this.isRental, - this.rentalPriceLength, - this.isShipEnabled, - this.isFreeShipping, - this.shipSeparately, - this.additionalShippingCharge, - this.isTaxExempt, - this.isTelecommunicationsOrBroadcastingOrElectronicServices, - this.useMultipleWarehouses, - this.manageInventoryMethodId, this.stockQuantity, this.stockAvailability, this.stockAvailabilityn, - this.displayStockAvailability, - this.displayStockQuantity, - this.minStockQuantity, - this.notifyAdminForQuantityBelow, this.allowBackInStockSubscriptions, this.orderMinimumQuantity, this.orderMaximumQuantity, - this.allowedQuantities, - this.allowAddingOnlyExistingAttributeCombinations, - this.disableBuyButton, - this.disableWishlistButton, - this.availableForPreOrder, - this.preOrderAvailabilityStartDateTimeUtc, - this.callForPrice, this.price, this.oldPrice, - this.productCost, - this.specialPrice, - this.specialPriceStartDateTimeUtc, - this.specialPriceEndDateTimeUtc, - this.customerEntersPrice, - this.minimumCustomerEnteredPrice, - this.maximumCustomerEnteredPrice, - this.basepriceEnabled, - this.basepriceAmount, - this.basepriceBaseAmount, - this.hasTierPrices, - this.hasDiscountsApplied, this.discountName, this.discountNamen, - this.discountDescription, - this.discountDescriptionn, this.discountPercentage, - this.currency, - this.currencyn, - this.weight, - this.length, - this.width, - this.height, - this.availableStartDateTimeUtc, - this.availableEndDateTimeUtc, this.displayOrder, - this.published, - this.deleted, - this.createdOnUtc, - this.updatedOnUtc, - this.productType, - this.parentGroupedProductId, - this.roleIds, this.discountIds, - this.storeIds, - this.manufacturerIds, this.reviews, - this.images, - this.attributes, - this.specifications, - this.associatedProductIds, - this.tags, - this.vendorId, - this.seName}); + this.images}); PharmacyProduct.fromJson(Map json) { - id = json['id']; - visibleIndividually = json['visible_individually']; - name = json['name']; - namen = json['namen']; - shortDescription = json['short_description']; - shortDescriptionn = json['short_descriptionn']; - fullDescription = json['full_description']; - fullDescriptionn = json['full_descriptionn']; - markasNew = json['markas_new']; - showOnHomePage = json['show_on_home_page']; - metaKeywords = json['meta_keywords']; - metaDescription = json['meta_description']; - metaTitle = json['meta_title']; - allowCustomerReviews = json['allow_customer_reviews']; - approvedRatingSum = json['approved_rating_sum']; - notApprovedRatingSum = json['not_approved_rating_sum']; - approvedTotalReviews = json['approved_total_reviews']; - notApprovedTotalReviews = json['not_approved_total_reviews']; - sku = json['sku']; - isRx = json['is_rx']; - prescriptionRequired = json['prescription_required']; - rxMessage = json['rx_message']; - rxMessagen = json['rx_messagen']; - manufacturerPartNumber = json['manufacturer_part_number']; - gtin = json['gtin']; - isGiftCard = json['is_gift_card']; - requireOtherProducts = json['require_other_products']; - automaticallyAddRequiredProducts = - json['automatically_add_required_products']; - isDownload = json['is_download']; - unlimitedDownloads = json['unlimited_downloads']; - maxNumberOfDownloads = json['max_number_of_downloads']; - downloadExpirationDays = json['download_expiration_days']; - hasSampleDownload = json['has_sample_download']; - hasUserAgreement = json['has_user_agreement']; - isRecurring = json['is_recurring']; - recurringCycleLength = json['recurring_cycle_length']; - recurringTotalCycles = json['recurring_total_cycles']; - isRental = json['is_rental']; - rentalPriceLength = json['rental_price_length']; - isShipEnabled = json['is_ship_enabled']; - isFreeShipping = json['is_free_shipping']; - shipSeparately = json['ship_separately']; - additionalShippingCharge = json['additional_shipping_charge']; - isTaxExempt = json['is_tax_exempt']; - isTelecommunicationsOrBroadcastingOrElectronicServices = - json['is_telecommunications_or_broadcasting_or_electronic_services']; - useMultipleWarehouses = json['use_multiple_warehouses']; - manageInventoryMethodId = json['manage_inventory_method_id']; - stockQuantity = json['stock_quantity']; - stockAvailability = json['stock_availability']; - stockAvailabilityn = json['stock_availabilityn']; - displayStockAvailability = json['display_stock_availability']; - displayStockQuantity = json['display_stock_quantity']; - minStockQuantity = json['min_stock_quantity']; - notifyAdminForQuantityBelow = json['notify_admin_for_quantity_below']; - allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; - orderMinimumQuantity = json['order_minimum_quantity']; - orderMaximumQuantity = json['order_maximum_quantity']; - allowedQuantities = json['allowed_quantities']; - allowAddingOnlyExistingAttributeCombinations = - json['allow_adding_only_existing_attribute_combinations']; - disableBuyButton = json['disable_buy_button']; - disableWishlistButton = json['disable_wishlist_button']; - availableForPreOrder = json['available_for_pre_order']; - preOrderAvailabilityStartDateTimeUtc = - json['pre_order_availability_start_date_time_utc']; - callForPrice = json['call_for_price']; - price = json['price']; - oldPrice = json['old_price']; - productCost = json['product_cost']; - specialPrice = json['special_price']; - specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc']; - specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc']; - customerEntersPrice = json['customer_enters_price']; - minimumCustomerEnteredPrice = json['minimum_customer_entered_price']; - maximumCustomerEnteredPrice = json['maximum_customer_entered_price']; - basepriceEnabled = json['baseprice_enabled']; - basepriceAmount = json['baseprice_amount']; - basepriceBaseAmount = json['baseprice_base_amount']; - hasTierPrices = json['has_tier_prices']; - hasDiscountsApplied = json['has_discounts_applied']; - discountName = json['discount_name']; - discountNamen = json['discount_namen']; - discountDescription = json['discount_description']; - discountDescriptionn = json['discount_Descriptionn']; - discountPercentage = json['discount_percentage']; - currency = json['currency']; - currencyn = json['currencyn']; - weight = json['weight']; - length = json['length']; - width = json['width']; - height = json['height']; - availableStartDateTimeUtc = json['available_start_date_time_utc']; - availableEndDateTimeUtc = json['available_end_date_time_utc']; - displayOrder = json['display_order']; - published = json['published']; - deleted = json['deleted']; - createdOnUtc = json['created_on_utc']; - updatedOnUtc = json['updated_on_utc']; - productType = json['product_type']; - parentGroupedProductId = json['parent_grouped_product_id']; - if (json['role_ids'] != null) { - roleIds = new List(); - json['role_ids'].forEach((v) { - roleIds.add(v); - }); - } - if (json['discount_ids'] != null) { - discountIds = new List(); - json['discount_ids'].forEach((v) { - discountIds.add(v); - }); - } - if (json['store_ids'] != null) { - storeIds = new List(); - json['store_ids'].forEach((v) { - storeIds.add(v); - }); - } - if (json['manufacturer_ids'] != null) { - manufacturerIds = new List(); - json['manufacturer_ids'].forEach((v) { - manufacturerIds.add(v); - }); - } - if (json['reviews'] != null) { - reviews = new List(); - json['reviews'].forEach((v) { - reviews.add(new Reviews.fromJson(v)); - }); - } - if (json['images'] != null) { - images = new List(); - json['images'].forEach((v) { - images.add(new PharmacyImageObject.fromJson(v)); - }); - } - if (json['attributes'] != null) { - attributes = new List(); - json['attributes'].forEach((v) { - attributes.add(v); - }); - } - if (json['specifications'] != null) { - specifications = new List(); - json['specifications'].forEach((v) { - specifications.add(new Specifications.fromJson(v)); - }); + try { + id = json['id']; + name = json['name']; + namen = json['namen']; + shortDescription = json['short_description']; + fullDescription = json['full_description']; + fullDescriptionn = json['full_descriptionn']; + approvedRatingSum = json['approved_rating_sum']; + approvedTotalReviews = json['approved_total_reviews']; + sku = json['sku']; + isRx = json['is_rx']; + rxMessage = json['rx_message']; + rxMessagen = json['rx_messagen']; + stockQuantity = json['stock_quantity']; + stockAvailability = json['stock_availability']; + stockAvailabilityn = json['stock_availabilityn']; + allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; + orderMinimumQuantity = json['order_minimum_quantity']; + orderMaximumQuantity = json['order_maximum_quantity']; + price = json['price']; + oldPrice = json['old_price']; + discountName = json['discount_name']; + discountNamen = json['discount_namen']; + discountPercentage = json['discount_percentage']; + displayOrder = json['display_order']; + if (json['discount_ids'] != null) { + discountIds = new List(); + json['discount_ids'].forEach((v) { + discountIds.add(v); + }); + } + if (json['reviews'] != null) { + reviews = new List(); + json['reviews'].forEach((v) { + reviews.add(new Reviews.fromJson(v)); + }); + } + if (json['images'] != null) { + images = new List(); + json['images'].forEach((v) { + images.add(new PharmacyImageObject.fromJson(v)); + }); + } + } catch (e) { + print(e); } - if (json['associated_product_ids'] != null) { - associatedProductIds = new List(); - json['associated_product_ids'].forEach((v) { - associatedProductIds.add(v); - }); - } - if (json['tags'] != null) { - tags = new List(); - json['tags'].forEach((v) { - tags.add(v); - }); - } - vendorId = json['vendor_id']; - seName = json['se_name']; } Map toJson() { final Map data = new Map(); data['id'] = this.id; - data['visible_individually'] = this.visibleIndividually; data['name'] = this.name; data['namen'] = this.namen; data['short_description'] = this.shortDescription; - data['short_descriptionn'] = this.shortDescriptionn; data['full_description'] = this.fullDescription; data['full_descriptionn'] = this.fullDescriptionn; - data['markas_new'] = this.markasNew; - data['show_on_home_page'] = this.showOnHomePage; - data['meta_keywords'] = this.metaKeywords; - data['meta_description'] = this.metaDescription; - data['meta_title'] = this.metaTitle; - data['allow_customer_reviews'] = this.allowCustomerReviews; data['approved_rating_sum'] = this.approvedRatingSum; - data['not_approved_rating_sum'] = this.notApprovedRatingSum; data['approved_total_reviews'] = this.approvedTotalReviews; - data['not_approved_total_reviews'] = this.notApprovedTotalReviews; data['sku'] = this.sku; data['is_rx'] = this.isRx; - data['prescription_required'] = this.prescriptionRequired; data['rx_message'] = this.rxMessage; data['rx_messagen'] = this.rxMessagen; - data['manufacturer_part_number'] = this.manufacturerPartNumber; - data['gtin'] = this.gtin; - data['is_gift_card'] = this.isGiftCard; - data['require_other_products'] = this.requireOtherProducts; - data['automatically_add_required_products'] = - this.automaticallyAddRequiredProducts; - data['is_download'] = this.isDownload; - data['unlimited_downloads'] = this.unlimitedDownloads; - data['max_number_of_downloads'] = this.maxNumberOfDownloads; - data['download_expiration_days'] = this.downloadExpirationDays; - data['has_sample_download'] = this.hasSampleDownload; - data['has_user_agreement'] = this.hasUserAgreement; - data['is_recurring'] = this.isRecurring; - data['recurring_cycle_length'] = this.recurringCycleLength; - data['recurring_total_cycles'] = this.recurringTotalCycles; - data['is_rental'] = this.isRental; - data['rental_price_length'] = this.rentalPriceLength; - data['is_ship_enabled'] = this.isShipEnabled; - data['is_free_shipping'] = this.isFreeShipping; - data['ship_separately'] = this.shipSeparately; - data['additional_shipping_charge'] = this.additionalShippingCharge; - data['is_tax_exempt'] = this.isTaxExempt; - data['is_telecommunications_or_broadcasting_or_electronic_services'] = - this.isTelecommunicationsOrBroadcastingOrElectronicServices; - data['use_multiple_warehouses'] = this.useMultipleWarehouses; - data['manage_inventory_method_id'] = this.manageInventoryMethodId; data['stock_quantity'] = this.stockQuantity; data['stock_availability'] = this.stockAvailability; data['stock_availabilityn'] = this.stockAvailabilityn; - data['display_stock_availability'] = this.displayStockAvailability; - data['display_stock_quantity'] = this.displayStockQuantity; - data['min_stock_quantity'] = this.minStockQuantity; - data['notify_admin_for_quantity_below'] = this.notifyAdminForQuantityBelow; data['allow_back_in_stock_subscriptions'] = this.allowBackInStockSubscriptions; data['order_minimum_quantity'] = this.orderMinimumQuantity; data['order_maximum_quantity'] = this.orderMaximumQuantity; - data['allowed_quantities'] = this.allowedQuantities; - data['allow_adding_only_existing_attribute_combinations'] = - this.allowAddingOnlyExistingAttributeCombinations; - data['disable_buy_button'] = this.disableBuyButton; - data['disable_wishlist_button'] = this.disableWishlistButton; - data['available_for_pre_order'] = this.availableForPreOrder; - data['pre_order_availability_start_date_time_utc'] = - this.preOrderAvailabilityStartDateTimeUtc; - data['call_for_price'] = this.callForPrice; data['price'] = this.price; data['old_price'] = this.oldPrice; - data['product_cost'] = this.productCost; - data['special_price'] = this.specialPrice; - data['special_price_start_date_time_utc'] = - this.specialPriceStartDateTimeUtc; - data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc; - data['customer_enters_price'] = this.customerEntersPrice; - data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice; - data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice; - data['baseprice_enabled'] = this.basepriceEnabled; - data['baseprice_amount'] = this.basepriceAmount; - data['baseprice_base_amount'] = this.basepriceBaseAmount; - data['has_tier_prices'] = this.hasTierPrices; - data['has_discounts_applied'] = this.hasDiscountsApplied; data['discount_name'] = this.discountName; data['discount_namen'] = this.discountNamen; - data['discount_description'] = this.discountDescription; - data['discount_Descriptionn'] = this.discountDescriptionn; data['discount_percentage'] = this.discountPercentage; - data['currency'] = this.currency; - data['currencyn'] = this.currencyn; - data['weight'] = this.weight; - data['length'] = this.length; - data['width'] = this.width; - data['height'] = this.height; - data['available_start_date_time_utc'] = this.availableStartDateTimeUtc; - data['available_end_date_time_utc'] = this.availableEndDateTimeUtc; data['display_order'] = this.displayOrder; - data['published'] = this.published; - data['deleted'] = this.deleted; - data['created_on_utc'] = this.createdOnUtc; - data['updated_on_utc'] = this.updatedOnUtc; - data['product_type'] = this.productType; - data['parent_grouped_product_id'] = this.parentGroupedProductId; - if (this.roleIds != null) { - data['role_ids'] = this.roleIds.map((v) => v).toList(); - } - if (this.discountIds != null) { + if (this.discountIds != String) { data['discount_ids'] = this.discountIds.map((v) => v).toList(); } - if (this.storeIds != null) { - data['store_ids'] = this.storeIds.map((v) => v).toList(); - } - data['manufacturer_ids'] = this.manufacturerIds; - if (this.reviews != null) { + if (this.reviews != String) { data['reviews'] = this.reviews.map((v) => v.toJson()).toList(); } - if (this.images != null) { + if (this.images != String) { data['images'] = this.images.map((v) => v.toJson()).toList(); } - if (this.attributes != null) { - data['attributes'] = this.attributes.map((v) => v).toList(); - } - if (this.specifications != null) { - data['specifications'] = - this.specifications.map((v) => v.toJson()).toList(); - } - if (this.associatedProductIds != null) { - data['associated_product_ids'] = - this.associatedProductIds.map((v) => v).toList(); - } - if (this.tags != null) { - data['tags'] = this.tags.map((v) => v).toList(); - } - data['vendor_id'] = this.vendorId; - data['se_name'] = this.seName; return data; } } diff --git a/lib/core/model/pharmacies/PointsAmountPerMonth.dart b/lib/core/model/pharmacies/PointsAmountPerMonth.dart deleted file mode 100644 index 71cf3498..00000000 --- a/lib/core/model/pharmacies/PointsAmountPerMonth.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'PointsAmountPerday.dart'; - -class PointsAmountPerMonth { - double amountPerMonth; - String month; - int monthNumber; - List pointsAmountPerday; - double pointsPerMonth; - - PointsAmountPerMonth( - {this.amountPerMonth, - this.month, - this.monthNumber, - this.pointsAmountPerday, - this.pointsPerMonth}); - - PointsAmountPerMonth.fromJson(Map json) { - amountPerMonth = json['AmountPerMonth']; - month = json['Month']; - monthNumber = json['MonthNumber']; - if (json['PointsAmountPerday'] != null) { - pointsAmountPerday = new List(); - json['PointsAmountPerday'].forEach((v) { - pointsAmountPerday.add(new PointsAmountPerday.fromJson(v)); - }); - } - pointsPerMonth = json['PointsPerMonth']; - } - - Map toJson() { - final Map data = new Map(); - data['AmountPerMonth'] = this.amountPerMonth; - data['Month'] = this.month; - data['MonthNumber'] = this.monthNumber; - if (this.pointsAmountPerday != null) { - data['PointsAmountPerday'] = - this.pointsAmountPerday.map((v) => v.toJson()).toList(); - } - data['PointsPerMonth'] = this.pointsPerMonth; - return data; - } -} diff --git a/lib/core/model/pharmacies/PointsAmountPerYear.dart b/lib/core/model/pharmacies/PointsAmountPerYear.dart deleted file mode 100644 index eef74064..00000000 --- a/lib/core/model/pharmacies/PointsAmountPerYear.dart +++ /dev/null @@ -1,38 +0,0 @@ -import 'PointsAmountPerMonth.dart'; - -class PointsAmountPerYear { - int amountPerYear; - List pointsAmountPerMonth; - int pointsPerYear; - int year; - - PointsAmountPerYear( - {this.amountPerYear, - this.pointsAmountPerMonth, - this.pointsPerYear, - this.year}); - - PointsAmountPerYear.fromJson(Map json) { - amountPerYear = json['AmountPerYear']; - if (json['PointsAmountPerMonth'] != null) { - pointsAmountPerMonth = new List(); - json['PointsAmountPerMonth'].forEach((v) { - pointsAmountPerMonth.add(new PointsAmountPerMonth.fromJson(v)); - }); - } - pointsPerYear = json['PointsPerYear']; - year = json['Year']; - } - - Map toJson() { - final Map data = new Map(); - data['AmountPerYear'] = this.amountPerYear; - if (this.pointsAmountPerMonth != null) { - data['PointsAmountPerMonth'] = - this.pointsAmountPerMonth.map((v) => v.toJson()).toList(); - } - data['PointsPerYear'] = this.pointsPerYear; - data['Year'] = this.year; - return data; - } -} diff --git a/lib/core/model/pharmacies/PointsAmountPerday.dart b/lib/core/model/pharmacies/PointsAmountPerday.dart deleted file mode 100644 index e78e87b7..00000000 --- a/lib/core/model/pharmacies/PointsAmountPerday.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'PointsDetails.dart'; - -class PointsAmountPerday { - double amountPerDay; - String day; - List pointsDetails; - double pointsPerDay; - String transationDate; - - PointsAmountPerday( - {this.amountPerDay, - this.day, - this.pointsDetails, - this.pointsPerDay, - this.transationDate}); - - PointsAmountPerday.fromJson(Map json) { - amountPerDay = json['AmountPerDay']; - day = json['Day']; - if (json['PointsDetails'] != null) { - pointsDetails = new List(); - json['PointsDetails'].forEach((v) { - pointsDetails.add(new PointsDetails.fromJson(v)); - }); - } - pointsPerDay = json['PointsPerDay']; - transationDate = json['TransationDate']; - } - - Map toJson() { - final Map data = new Map(); - data['AmountPerDay'] = this.amountPerDay; - data['Day'] = this.day; - if (this.pointsDetails != null) { - data['PointsDetails'] = - this.pointsDetails.map((v) => v.toJson()).toList(); - } - data['PointsPerDay'] = this.pointsPerDay; - data['TransationDate'] = this.transationDate; - return data; - } -} \ No newline at end of file diff --git a/lib/core/model/pharmacies/PointsDetails.dart b/lib/core/model/pharmacies/PointsDetails.dart deleted file mode 100644 index 7b342af9..00000000 --- a/lib/core/model/pharmacies/PointsDetails.dart +++ /dev/null @@ -1,57 +0,0 @@ -class PointsDetails { - int accNumber; - String accountStatus; - double amount; - int lineItemNo; - String operationType; - double points; - double purchasePoints; - int subTransactionType; - String subTransactionTypeDescription; - String transactionDate; - - PointsDetails( - {this.accNumber, - this.accountStatus, - this.amount, - this.lineItemNo, - this.operationType, - this.points, - this.purchasePoints, - this.subTransactionType, - this.subTransactionTypeDescription, - this.transactionDate}); - - PointsDetails.fromJson(Map json) { - accNumber = json['AccNumber']; - accountStatus = json['AccountStatus']; - amount = json['Amount']; - lineItemNo = json['LineItemNo']; - operationType = json['OperationType']; - points = json['Points']; - var purchasePoints = json['PurchasePoints']; - if(purchasePoints is int){ - this.purchasePoints = (purchasePoints).roundToDouble(); - }else { - this.purchasePoints = purchasePoints; - } - subTransactionType = json['SubTransactionType']; - subTransactionTypeDescription = json['SubTransactionTypeDescription']; - transactionDate = json['TransactionDate']; - } - - Map toJson() { - final Map data = new Map(); - data['AccNumber'] = this.accNumber; - data['AccountStatus'] = this.accountStatus; - data['Amount'] = this.amount; - data['LineItemNo'] = this.lineItemNo; - data['OperationType'] = this.operationType; - data['Points'] = this.points; - data['PurchasePoints'] = this.purchasePoints; - data['SubTransactionType'] = this.subTransactionType; - data['SubTransactionTypeDescription'] = this.subTransactionTypeDescription; - data['TransactionDate'] = this.transactionDate; - return data; - } -} diff --git a/lib/core/model/pharmacies/ShippingOption.dart b/lib/core/model/pharmacies/ShippingOption.dart deleted file mode 100644 index 309e1f4f..00000000 --- a/lib/core/model/pharmacies/ShippingOption.dart +++ /dev/null @@ -1,98 +0,0 @@ -class ShippingOption { - String shippingRateComputationMethodSystemName; - double rate; - double rateVat; - double rateVatPercent; - String name; - String namen; - String description; - String descriptionn; - bool allowShippingSunday; - bool allowShippingMonday; - bool allowShippingTuesday; - bool allowShippingWednesday; - bool allowShippingThursday; - bool allowShippingFriday; - bool allowShippingSaturday; - String allowShippingTime1From; - String allowShippingTime1To; - String allowShippingTime2From; - String allowShippingTime2To; - String allowShippingNote; - String allowShippingNoten; - - ShippingOption( - {this.shippingRateComputationMethodSystemName, - this.rate, - this.rateVat, - this.rateVatPercent, - this.name, - this.namen, - this.description, - this.descriptionn, - this.allowShippingSunday, - this.allowShippingMonday, - this.allowShippingTuesday, - this.allowShippingWednesday, - this.allowShippingThursday, - this.allowShippingFriday, - this.allowShippingSaturday, - this.allowShippingTime1From, - this.allowShippingTime1To, - this.allowShippingTime2From, - this.allowShippingTime2To, - this.allowShippingNote, - this.allowShippingNoten}); - - ShippingOption.fromJson(Map json) { - shippingRateComputationMethodSystemName = - json['shipping_rate_computation_method_system_name']; - rate = json['rate']; - rateVat = json['rate_vat']; - rateVatPercent = json['rate_vat_percent']; - name = json['name']; - namen = json['namen']; - description = json['description']; - descriptionn = json['descriptionn']; - allowShippingSunday = json['AllowShippingSunday']; - allowShippingMonday = json['AllowShippingMonday']; - allowShippingTuesday = json['AllowShippingTuesday']; - allowShippingWednesday = json['AllowShippingWednesday']; - allowShippingThursday = json['AllowShippingThursday']; - allowShippingFriday = json['AllowShippingFriday']; - allowShippingSaturday = json['AllowShippingSaturday']; - allowShippingTime1From = json['AllowShippingTime1From']; - allowShippingTime1To = json['AllowShippingTime1To']; - allowShippingTime2From = json['AllowShippingTime2From']; - allowShippingTime2To = json['AllowShippingTime2To']; - allowShippingNote = json['AllowShippingNote']; - allowShippingNoten = json['AllowShippingNoten']; - } - - Map toJson() { - final Map data = new Map(); - data['shipping_rate_computation_method_system_name'] = - this.shippingRateComputationMethodSystemName; - data['rate'] = this.rate; - data['rate_vat'] = this.rateVat; - data['rate_vat_percent'] = this.rateVatPercent; - data['name'] = this.name; - data['namen'] = this.namen; - data['description'] = this.description; - data['descriptionn'] = this.descriptionn; - data['AllowShippingSunday'] = this.allowShippingSunday; - data['AllowShippingMonday'] = this.allowShippingMonday; - data['AllowShippingTuesday'] = this.allowShippingTuesday; - data['AllowShippingWednesday'] = this.allowShippingWednesday; - data['AllowShippingThursday'] = this.allowShippingThursday; - data['AllowShippingFriday'] = this.allowShippingFriday; - data['AllowShippingSaturday'] = this.allowShippingSaturday; - data['AllowShippingTime1From'] = this.allowShippingTime1From; - data['AllowShippingTime1To'] = this.allowShippingTime1To; - data['AllowShippingTime2From'] = this.allowShippingTime2From; - data['AllowShippingTime2To'] = this.allowShippingTime2To; - data['AllowShippingNote'] = this.allowShippingNote; - data['AllowShippingNoten'] = this.allowShippingNoten; - return data; - } -} diff --git a/lib/core/model/pharmacies/ShoppingCart.dart b/lib/core/model/pharmacies/ShoppingCart.dart deleted file mode 100644 index f965203a..00000000 --- a/lib/core/model/pharmacies/ShoppingCart.dart +++ /dev/null @@ -1,115 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/Customer.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; - -class ShoppingCart { - int languageId; - String id; - // List productAttributes; - double customerEnteredPrice; - int quantity; - String discountAmountInclTax; - String subtotal; - String subtotalWithVat; - String subtotalVatAmount; - String subtotalVatRate; - String currency; - String currencyn; - String rentalStartDateUtc; - String rentalEndDateUtc; - String createdOnUtc; - String updatedOnUtc; - String shoppingCartType; - int productId; - PharmacyProduct product; - int customerId; - Customer customer; - - ShoppingCart( - {this.languageId, - this.id, - // this.productAttributes, - this.customerEnteredPrice, - this.quantity, - this.discountAmountInclTax, - this.subtotal, - this.subtotalWithVat, - this.subtotalVatAmount, - this.subtotalVatRate, - this.currency, - this.currencyn, - this.rentalStartDateUtc, - this.rentalEndDateUtc, - this.createdOnUtc, - this.updatedOnUtc, - this.shoppingCartType, - this.productId, - this.product, - this.customerId, - this.customer}); - - ShoppingCart.fromJson(Map json) { - languageId = json['language_id']; - id = json['id']; - /*if (json['product_attributes'] != null) { - productAttributes = new List(); - json['product_attributes'].forEach((v) { - productAttributes.add(new Null.fromJson(v)); - }); - }*/ - customerEnteredPrice = json['customer_entered_price']; - quantity = json['quantity']; - discountAmountInclTax = json['discount_amount_incl_tax']; - subtotal = json['subtotal']; - subtotalWithVat = json['subtotal_with_vat']; - subtotalVatAmount = json['subtotal_vat_amount']; - subtotalVatRate = json['subtotal_vat_rate']; - currency = json['currency']; - currencyn = json['currencyn']; - rentalStartDateUtc = json['rental_start_date_utc']; - rentalEndDateUtc = json['rental_end_date_utc']; - createdOnUtc = json['created_on_utc']; - updatedOnUtc = json['updated_on_utc']; - shoppingCartType = json['shopping_cart_type']; - productId = json['product_id']; - product = json['product'] != null - ? new PharmacyProduct.fromJson(json['product']) - : null; - customerId = json['customer_id']; - customer = json['customer'] != null - ? new Customer.fromJson(json['customer']) - : null; - } - - Map toJson() { - final Map data = new Map(); - data['language_id'] = this.languageId; - data['id'] = this.id; - /*if (this.productAttributes != null) { - data['product_attributes'] = - this.productAttributes.map((v) => v.toJson()).toList(); - }*/ - data['customer_entered_price'] = this.customerEnteredPrice; - data['quantity'] = this.quantity; - data['discount_amount_incl_tax'] = this.discountAmountInclTax; - data['subtotal'] = this.subtotal; - data['subtotal_with_vat'] = this.subtotalWithVat; - data['subtotal_vat_amount'] = this.subtotalVatAmount; - data['subtotal_vat_rate'] = this.subtotalVatRate; - data['currency'] = this.currency; - data['currencyn'] = this.currencyn; - data['rental_start_date_utc'] = this.rentalStartDateUtc; - data['rental_end_date_utc'] = this.rentalEndDateUtc; - data['created_on_utc'] = this.createdOnUtc; - data['updated_on_utc'] = this.updatedOnUtc; - data['shopping_cart_type'] = this.shoppingCartType; - data['product_id'] = this.productId; - if (this.product != null) { - data['product'] = this.product.toJson(); - } - data['customer_id'] = this.customerId; - if (this.customer != null) { - data['customer'] = this.customer.toJson(); - } - return data; - } -} diff --git a/lib/core/model/pharmacies/ShoppingCartResponse.dart b/lib/core/model/pharmacies/ShoppingCartResponse.dart deleted file mode 100644 index 96b751ae..00000000 --- a/lib/core/model/pharmacies/ShoppingCartResponse.dart +++ /dev/null @@ -1,55 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart'; -import 'package:flutter/material.dart'; - -class ShoppingCartResponse with ChangeNotifier { - int itemCount; - int quantityCount; - double subtotal; - double subtotalWithVat; - double subtotalVatAmount; - double subtotalVatRate; - List shoppingCarts; - - ShoppingCartResponse( - {this.itemCount, - this.quantityCount, - this.subtotal, - this.subtotalWithVat, - this.subtotalVatAmount, - this.subtotalVatRate, - this.shoppingCarts}); - - void updateShoppingCard() { - notifyListeners(); - } - - ShoppingCartResponse.fromJson(Map json) { - itemCount = json['item_count']; - quantityCount = json['quantity_count']; - subtotal = json['subtotal']; - subtotalWithVat = json['subtotal_with_vat']; - subtotalVatAmount = json['subtotal_vat_amount']; - subtotalVatRate = json['subtotal_vat_rate']; - if (json['shopping_carts'] != null) { - shoppingCarts = new List(); - json['shopping_carts'].forEach((v) { - shoppingCarts.add(new ShoppingCart.fromJson(v)); - }); - } - } - - Map toJson() { - final Map data = new Map(); - data['item_count'] = this.itemCount; - data['quantity_count'] = this.quantityCount; - data['subtotal'] = this.subtotal; - data['subtotal_with_vat'] = this.subtotalWithVat; - data['subtotal_vat_amount'] = this.subtotalVatAmount; - data['subtotal_vat_rate'] = this.subtotalVatRate; - if (this.shoppingCarts != null) { - data['shopping_carts'] = - this.shoppingCarts.map((v) => v.toJson()).toList(); - } - return data; - } -} diff --git a/lib/core/model/pharmacies/Specifications.dart b/lib/core/model/pharmacies/Specifications.dart deleted file mode 100644 index f227de69..00000000 --- a/lib/core/model/pharmacies/Specifications.dart +++ /dev/null @@ -1,36 +0,0 @@ -class Specifications { - int id; - int displayOrder; - String defaultValue; - String defaultValuen; - String name; - String nameN; - - Specifications( - {this.id, - this.displayOrder, - this.defaultValue, - this.defaultValuen, - this.name, - this.nameN}); - - Specifications.fromJson(Map json) { - id = json['id']; - displayOrder = json['display_order']; - defaultValue = json['default_value']; - defaultValuen = json['default_valuen']; - name = json['name']; - nameN = json['nameN']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['display_order'] = this.displayOrder; - data['default_value'] = this.defaultValue; - data['default_valuen'] = this.defaultValuen; - data['name'] = this.name; - data['nameN'] = this.nameN; - return data; - } -} diff --git a/lib/core/model/pharmacies/order_model.dart b/lib/core/model/pharmacies/order_model.dart deleted file mode 100644 index a82b8716..00000000 --- a/lib/core/model/pharmacies/order_model.dart +++ /dev/null @@ -1,1486 +0,0 @@ - -import 'dart:convert'; - -List orderModelFromJson(String str) => List.from(json.decode(str).map((x) => OrderModel.fromJson(x))); - -String orderModelToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); - -class OrderModel { - OrderModel({ - this.id, - this.storeId, - this.orderGuid, - this.pickUpInStore, - this.paymentMethodSystemName, - this.paymentName, - this.paymentNamen, - this.customerCurrencyCode, - this.currencyRate, - this.customerTaxDisplayTypeId, - this.vatNumber, - this.orderSubtotalInclTax, - this.orderSubtotalExclTax, - this.orderSubTotalDiscountInclTax, - this.orderSubTotalDiscountExclTax, - this.orderShippingInclTax, - this.orderShippingExclTax, - this.paymentMethodAdditionalFeeInclTax, - this.paymentMethodAdditionalFeeExclTax, - this.taxRates, - this.orderTax, - this.orderDiscount, - this.orderTotal, - this.refundedAmount, - this.rewardPointsWereAdded, - this.rxAttachments, - this.checkoutAttributeDescription, - this.customerLanguageId, - this.affiliateId, - this.customerIp, - this.authorizationTransactionId, - this.authorizationTransactionCode, - this.authorizationTransactionResult, - this.captureTransactionId, - this.captureTransactionResult, - this.subscriptionTransactionId, - this.paidDateUtc, - this.shippingMethod, - this.shippingRateComputationMethodSystemName, - this.customValuesXml, - this.deleted, - this.createdOnUtc, - this.customer, - this.customerId, - this.billingAddress, - this.shippingAddress, - this.orderItems, - this.orderStatusId, - this.orderStatus, - this.orderStatusn, - this.paymentStatusId, - this.paymentStatus, - this.paymentStatusn, - this.shippingStatus, - this.shippingStatusn, - this.customerTaxDisplayType, - this.canCancel, - this.canRefund, - this.lakumAmount, - this.preferDeliveryDate, - this.preferDeliveryTime, - this.preferDeliveryTimen, - }); - - String id; - dynamic storeId; - String orderGuid; - bool pickUpInStore; - PaymentMethodSystemName paymentMethodSystemName; - PaymentName paymentName; - PaymentName paymentNamen; - CustomerCurrencyCode customerCurrencyCode; - dynamic currencyRate; - dynamic customerTaxDisplayTypeId; - dynamic vatNumber; - double orderSubtotalInclTax; - double orderSubtotalExclTax; - dynamic orderSubTotalDiscountInclTax; - dynamic orderSubTotalDiscountExclTax; - double orderShippingInclTax; - dynamic orderShippingExclTax; - dynamic paymentMethodAdditionalFeeInclTax; - dynamic paymentMethodAdditionalFeeExclTax; - String taxRates; - double orderTax; - dynamic orderDiscount; - double orderTotal; - dynamic refundedAmount; - dynamic rewardPointsWereAdded; - String rxAttachments; - CheckoutAttributeDescription checkoutAttributeDescription; - dynamic customerLanguageId; - dynamic affiliateId; - CustomerIp customerIp; - String authorizationTransactionId; - dynamic authorizationTransactionCode; - dynamic authorizationTransactionResult; - dynamic captureTransactionId; - dynamic captureTransactionResult; - dynamic subscriptionTransactionId; - DateTime paidDateUtc; - ShippingMethod shippingMethod; - ShippingRateComputationMethodSystemName shippingRateComputationMethodSystemName; - String customValuesXml; - bool deleted; - DateTime createdOnUtc; - OrderModelCustomer customer; - dynamic customerId; - IngAddress billingAddress; - IngAddress shippingAddress; - List orderItems; - dynamic orderStatusId; - OrderStatus orderStatus; - OrderStatusn orderStatusn; - dynamic paymentStatusId; - PaymentStatus paymentStatus; - PaymentStatusn paymentStatusn; - ShippingStatus shippingStatus; - ShippingStatusn shippingStatusn; - CustomerTaxDisplayType customerTaxDisplayType; - bool canCancel; - bool canRefund; - dynamic lakumAmount; - DateTime preferDeliveryDate; - PreferDeliveryTime preferDeliveryTime; - PreferDeliveryTimen preferDeliveryTimen; - - factory OrderModel.fromJson(Map json) => OrderModel( - id: json["id"], - storeId: json["store_id"], - orderGuid: json["order_guid"], - pickUpInStore: json["pick_up_in_store"], - paymentMethodSystemName: paymentMethodSystemNameValues.map[json["payment_method_system_name"]], - paymentName: paymentNameValues.map[json["payment_name"]], - paymentNamen: paymentNameValues.map[json["payment_namen"]], - customerCurrencyCode: customerCurrencyCodeValues.map[json["customer_currency_code"]], - currencyRate: json["currency_rate"], - customerTaxDisplayTypeId: json["customer_tax_display_type_id"], - vatNumber: json["vat_number"], - orderSubtotalInclTax: json["order_subtotal_incl_tax"].toDouble(), - orderSubtotalExclTax: json["order_subtotal_excl_tax"].toDouble(), - orderSubTotalDiscountInclTax: json["order_sub_total_discount_incl_tax"], - orderSubTotalDiscountExclTax: json["order_sub_total_discount_excl_tax"], - orderShippingInclTax: json["order_shipping_incl_tax"].toDouble(), - orderShippingExclTax: json["order_shipping_excl_tax"], - paymentMethodAdditionalFeeInclTax: json["payment_method_additional_fee_incl_tax"], - paymentMethodAdditionalFeeExclTax: json["payment_method_additional_fee_excl_tax"], - taxRates: json["tax_rates"], - orderTax: json["order_tax"].toDouble(), - orderDiscount: json["order_discount"], - orderTotal: json["order_total"].toDouble(), - refundedAmount: json["refunded_amount"], - rewardPointsWereAdded: json["reward_points_were_added"], - rxAttachments: json["rx_attachments"] == null ? null : json["rx_attachments"], - checkoutAttributeDescription: checkoutAttributeDescriptionValues.map[json["checkout_attribute_description"]], - customerLanguageId: json["customer_language_id"], - affiliateId: json["affiliate_id"], - customerIp: customerIpValues.map[json["customer_ip"]], - authorizationTransactionId: json["authorization_transaction_id"] == null ? null : json["authorization_transaction_id"], - authorizationTransactionCode: json["authorization_transaction_code"], - authorizationTransactionResult: json["authorization_transaction_result"], - captureTransactionId: json["capture_transaction_id"], - captureTransactionResult: json["capture_transaction_result"], - subscriptionTransactionId: json["subscription_transaction_id"], - paidDateUtc: json["paid_date_utc"] == null ? null : DateTime.parse(json["paid_date_utc"]), - shippingMethod: shippingMethodValues.map[json["shipping_method"]], - shippingRateComputationMethodSystemName: shippingRateComputationMethodSystemNameValues.map[json["shipping_rate_computation_method_system_name"]], - customValuesXml: json["custom_values_xml"], - deleted: json["deleted"], - createdOnUtc: DateTime.parse(json["created_on_utc"]), - customer: OrderModelCustomer.fromJson(json["customer"]), - customerId: json["customer_id"], - billingAddress: IngAddress.fromJson(json["billing_address"]), - shippingAddress: IngAddress.fromJson(json["shipping_address"]), - orderItems: List.from(json["order_items"].map((x) => OrderItem.fromJson(x))), - orderStatusId: json["order_status_id"], - orderStatus: orderStatusValues.map[json["order_status"]], - orderStatusn: orderStatusnValues.map[json["order_statusn"]], - paymentStatusId: json["payment_status_id"], - paymentStatus: paymentStatusValues.map[json["payment_status"]], - paymentStatusn: paymentStatusnValues.map[json["payment_statusn"]], - shippingStatus: shippingStatusValues.map[json["shipping_status"]], - shippingStatusn: shippingStatusnValues.map[json["shipping_statusn"]], - customerTaxDisplayType: customerTaxDisplayTypeValues.map[json["customer_tax_display_type"]], - canCancel: json["can_cancel"], - canRefund: json["can_refund"], - lakumAmount: json["lakum_amount"], - preferDeliveryDate: json["prefer_delivery_date"] == null ? null : DateTime.parse(json["prefer_delivery_date"]), - preferDeliveryTime: json["prefer_delivery_time"] == null ? null : preferDeliveryTimeValues.map[json["prefer_delivery_time"]], - preferDeliveryTimen: json["prefer_delivery_timen"] == null ? null : preferDeliveryTimenValues.map[json["prefer_delivery_timen"]], - ); - - Map toJson() => { - "id": id, - "store_id": storeId, - "order_guid": orderGuid, - "pick_up_in_store": pickUpInStore, - "payment_method_system_name": paymentMethodSystemNameValues.reverse[paymentMethodSystemName], - "payment_name": paymentNameValues.reverse[paymentName], - "payment_namen": paymentNameValues.reverse[paymentNamen], - "customer_currency_code": customerCurrencyCodeValues.reverse[customerCurrencyCode], - "currency_rate": currencyRate, - "customer_tax_display_type_id": customerTaxDisplayTypeId, - "vat_number": vatNumber, - "order_subtotal_incl_tax": orderSubtotalInclTax, - "order_subtotal_excl_tax": orderSubtotalExclTax, - "order_sub_total_discount_incl_tax": orderSubTotalDiscountInclTax, - "order_sub_total_discount_excl_tax": orderSubTotalDiscountExclTax, - "order_shipping_incl_tax": orderShippingInclTax, - "order_shipping_excl_tax": orderShippingExclTax, - "payment_method_additional_fee_incl_tax": paymentMethodAdditionalFeeInclTax, - "payment_method_additional_fee_excl_tax": paymentMethodAdditionalFeeExclTax, - "tax_rates": taxRates, - "order_tax": orderTax, - "order_discount": orderDiscount, - "order_total": orderTotal, - "refunded_amount": refundedAmount, - "reward_points_were_added": rewardPointsWereAdded, - "rx_attachments": rxAttachments == null ? null : rxAttachments, - "checkout_attribute_description": checkoutAttributeDescriptionValues.reverse[checkoutAttributeDescription], - "customer_language_id": customerLanguageId, - "affiliate_id": affiliateId, - "customer_ip": customerIpValues.reverse[customerIp], - "authorization_transaction_id": authorizationTransactionId == null ? null : authorizationTransactionId, - "authorization_transaction_code": authorizationTransactionCode, - "authorization_transaction_result": authorizationTransactionResult, - "capture_transaction_id": captureTransactionId, - "capture_transaction_result": captureTransactionResult, - "subscription_transaction_id": subscriptionTransactionId, - "paid_date_utc": paidDateUtc == null ? null : paidDateUtc.toIso8601String(), - "shipping_method": shippingMethodValues.reverse[shippingMethod], - "shipping_rate_computation_method_system_name": shippingRateComputationMethodSystemNameValues.reverse[shippingRateComputationMethodSystemName], - "custom_values_xml": customValuesXml, - "deleted": deleted, - "created_on_utc": createdOnUtc.toIso8601String(), - "customer": customer.toJson(), - "customer_id": customerId, - "billing_address": billingAddress.toJson(), - "shipping_address": shippingAddress.toJson(), - "order_items": List.from(orderItems.map((x) => x.toJson())), - "order_status_id": orderStatusId, - "order_status": orderStatusValues.reverse[orderStatus], - "order_statusn": orderStatusnValues.reverse[orderStatusn], - "payment_status_id": paymentStatusId, - "payment_status": paymentStatusValues.reverse[paymentStatus], - "payment_statusn": paymentStatusnValues.reverse[paymentStatusn], - "shipping_status": shippingStatusValues.reverse[shippingStatus], - "shipping_statusn": shippingStatusnValues.reverse[shippingStatusn], - "customer_tax_display_type": customerTaxDisplayTypeValues.reverse[customerTaxDisplayType], - "can_cancel": canCancel, - "can_refund": canRefund, - "lakum_amount": lakumAmount, - "prefer_delivery_date": preferDeliveryDate == null ? null : "${preferDeliveryDate.year.toString().padLeft(4, '0')}-${preferDeliveryDate.month.toString().padLeft(2, '0')}-${preferDeliveryDate.day.toString().padLeft(2, '0')}", - "prefer_delivery_time": preferDeliveryTime == null ? null : preferDeliveryTimeValues.reverse[preferDeliveryTime], - "prefer_delivery_timen": preferDeliveryTimen == null ? null : preferDeliveryTimenValues.reverse[preferDeliveryTimen], - }; -} - -class IngAddress { - IngAddress({ - this.id, - this.firstName, - this.lastName, - this.email, - this.company, - this.countryId, - this.country, - this.stateProvinceId, - this.city, - this.address1, - this.address2, - this.zipPostalCode, - this.phoneNumber, - this.faxNumber, - this.customerAttributes, - this.createdOnUtc, - this.province, - this.latLong, - }); - - String id; - FirstName firstName; - LastName lastName; - BillingAddressEmail email; - dynamic company; - dynamic countryId; - Country country; - dynamic stateProvinceId; - City city; - Address1 address1; - Address2 address2; - String zipPostalCode; - String phoneNumber; - dynamic faxNumber; - String customerAttributes; - DateTime createdOnUtc; - dynamic province; - LatLong latLong; - - factory IngAddress.fromJson(Map json) => IngAddress( - id: json["id"], - firstName: firstNameValues.map[json["first_name"]], - lastName: lastNameValues.map[json["last_name"]], - email: billingAddressEmailValues.map[json["email"]], - company: json["company"], - countryId: json["country_id"], - country: countryValues.map[json["country"]], - stateProvinceId: json["state_province_id"], - city: cityValues.map[json["city"]], - address1: address1Values.map[json["address1"]], - address2: address2Values.map[json["address2"]], - zipPostalCode: json["zip_postal_code"], - phoneNumber: json["phone_number"], - faxNumber: json["fax_number"], - customerAttributes: json["customer_attributes"], - createdOnUtc: DateTime.parse(json["created_on_utc"]), - province: json["province"], - latLong: latLongValues.map[json["lat_long"]], - ); - - Map toJson() => { - "id": id, - "first_name": firstNameValues.reverse[firstName], - "last_name": lastNameValues.reverse[lastName], - "email": billingAddressEmailValues.reverse[email], - "company": company, - "country_id": countryId, - "country": countryValues.reverse[country], - "state_province_id": stateProvinceId, - "city": cityValues.reverse[city], - "address1": address1Values.reverse[address1], - "address2": address2Values.reverse[address2], - "zip_postal_code": zipPostalCode, - "phone_number": phoneNumber, - "fax_number": faxNumber, - "customer_attributes": customerAttributes, - "created_on_utc": createdOnUtc.toIso8601String(), - "province": province, - "lat_long": latLongValues.reverse[latLong], - }; -} - -enum Address1 { THE_7960_MOSAB_IBN_UMAIR_STREET_AL_RIYADH, THE_6500_AL_AMEEN_ABDULLAH_AL_ALI_AL_NAEEM_STREET_AL_RIYADH, THE_6603_IBRAHIM_IBN_AL_HAMASI_AR_RIYAD, THE_9626_SALAH_AD_DIN_AL_AYYUBI_ROAD_AL_RIYADH, THE_3075_PRINCE_MANSUR_BIN_ABDULAZIZ_STREET_AL_RIYADH, THE_40, THE_7801_AL_IHSA_AL_RIYADH } - -final address1Values = EnumValues({ - "3075, Prince Mansur Bin Abdulaziz Street, Al Riyadh, ": Address1.THE_3075_PRINCE_MANSUR_BIN_ABDULAZIZ_STREET_AL_RIYADH, - "40,": Address1.THE_40, - "6500, Al Ameen Abdullah Al Ali Al Naeem Street, Al Riyadh, ": Address1.THE_6500_AL_AMEEN_ABDULLAH_AL_ALI_AL_NAEEM_STREET_AL_RIYADH, - "6603, Ibrahim Ibn Al Hamasi, Ar-Riyad, ": Address1.THE_6603_IBRAHIM_IBN_AL_HAMASI_AR_RIYAD, - "7801, Al Ihsa, Al Riyadh, ": Address1.THE_7801_AL_IHSA_AL_RIYADH, - "7960, Mosab Ibn Umair Street, Al Riyadh, ": Address1.THE_7960_MOSAB_IBN_UMAIR_STREET_AL_RIYADH, - "9626, Salah Ad Din Al Ayyubi Road, Al Riyadh, ": Address1.THE_9626_SALAH_AD_DIN_AL_AYYUBI_ROAD_AL_RIYADH -}); - -enum Address2 { AL_MALAZ_RIYADH_PROVINCE_3460, AL_MALAZ_RIYADH_PROVINCE_2817, AR_RAHMANIYYAH_RIYADH_PROVINCE_3816, AL_MALAZ_RIYADH_PROVINCE_3815, AL_WIZARAT_RIYADH_PROVINCE_7039, EASTERN_PROVINCE, AL_MALAZ_RIYADH_PROVINCE_3084 } - -final address2Values = EnumValues({ - "Al Malaz, Riyadh Province, 2817, ": Address2.AL_MALAZ_RIYADH_PROVINCE_2817, - "Al Malaz, Riyadh Province, 3084, ": Address2.AL_MALAZ_RIYADH_PROVINCE_3084, - "Al Malaz, Riyadh Province, 3460, ": Address2.AL_MALAZ_RIYADH_PROVINCE_3460, - "Al Malaz, Riyadh Province, 3815, ": Address2.AL_MALAZ_RIYADH_PROVINCE_3815, - "Al Wizarat, Riyadh Province, 7039, ": Address2.AL_WIZARAT_RIYADH_PROVINCE_7039, - "Ar Rahmaniyyah, Riyadh Province, 3816, ": Address2.AR_RAHMANIYYAH_RIYADH_PROVINCE_3816, - "Eastern Province,": Address2.EASTERN_PROVINCE -}); - -enum City { RIYADH, DAMMAM } - -final cityValues = EnumValues({ - "Dammam": City.DAMMAM, - "Riyadh": City.RIYADH -}); - -enum Country { SAUDI_ARABIA } - -final countryValues = EnumValues({ - "Saudi Arabia": Country.SAUDI_ARABIA -}); - -enum BillingAddressEmail { TAMER_FANASHEH_GMAIL_COM, TAMER_DASDASDAS_GMAIL_COM, TAMER_FANASHEH_DRSULAIMANALHABIB_COM } - -final billingAddressEmailValues = EnumValues({ - "Tamer.dasdasdas@gmail.com": BillingAddressEmail.TAMER_DASDASDAS_GMAIL_COM, - "tamer.fanasheh@drsulaimanalhabib.com": BillingAddressEmail.TAMER_FANASHEH_DRSULAIMANALHABIB_COM, - "Tamer.fanasheh@gmail.com": BillingAddressEmail.TAMER_FANASHEH_GMAIL_COM -}); - -enum FirstName { TAMER, TAMER_FANASHEH, FIRST_NAME_TAMER } - -final firstNameValues = EnumValues({ - "tamer": FirstName.FIRST_NAME_TAMER, - "TAMER": FirstName.TAMER, - "TAMER FANASHEH": FirstName.TAMER_FANASHEH -}); - -enum LastName { FANASHEH, MUSA, LAST_NAME_FANASHEH } - -final lastNameValues = EnumValues({ - "FANASHEH": LastName.FANASHEH, - "Fanasheh": LastName.LAST_NAME_FANASHEH, - "MUSA": LastName.MUSA -}); - -enum LatLong { THE_246784385694919524674091019299842, THE_24664749106968054673501121876645, THE_2470993657522702246664724647270134, THE_246626170308533764673348444086107, THE_24664875225999005467347443322574, THE_24674331807435784671024726818286, THE_263430228396836664991113909164471, THE_246767400793488074673774399406786, THE_24665374673515 } - -final latLongValues = EnumValues({ - "24.662617030853376,46.73348444086107": LatLong.THE_246626170308533764673348444086107, - "24.66474910696805,46.73501121876645": LatLong.THE_24664749106968054673501121876645, - "24.664875225999005,46.7347443322574": LatLong.THE_24664875225999005467347443322574, - "24.66537,46.73515": LatLong.THE_24665374673515, - "24.67433180743578,46.71024726818286": LatLong.THE_24674331807435784671024726818286, - "24.676740079348807,46.73774399406786": LatLong.THE_246767400793488074673774399406786, - "24.678438569491952,46.74091019299842": LatLong.THE_246784385694919524674091019299842, - "24.709936575227022,46.664724647270134": LatLong.THE_2470993657522702246664724647270134, - "26.343022839683666, 49.91113909164471": LatLong.THE_263430228396836664991113909164471 -}); - -enum CheckoutAttributeDescription { EMPTY, CHECKOUT_ATTRIBUTE_DESCRIPTION } - -final checkoutAttributeDescriptionValues = EnumValues({ - "ارفاق وصفة: ": CheckoutAttributeDescription.CHECKOUT_ATTRIBUTE_DESCRIPTION, - "": CheckoutAttributeDescription.EMPTY -}); - -class OrderModelCustomer { - OrderModelCustomer({ - this.id, - this.username, - this.email, - this.firstName, - this.lastName, - this.languageId, - this.adminComment, - this.isTaxExempt, - this.hasShoppingCartItems, - this.active, - this.deleted, - this.isSystemAccount, - this.systemName, - this.lastIpAddress, - this.createdOnUtc, - this.lastLoginDateUtc, - this.lastActivityDateUtc, - this.registeredInStoreId, - this.roleIds, - }); - - String id; - Username username; - BillingAddressEmail email; - FirstName firstName; - LastName lastName; - String languageId; - dynamic adminComment; - bool isTaxExempt; - bool hasShoppingCartItems; - bool active; - bool deleted; - bool isSystemAccount; - dynamic systemName; - LastIpAddress lastIpAddress; - DateTime createdOnUtc; - DateTime lastLoginDateUtc; - DateTime lastActivityDateUtc; - dynamic registeredInStoreId; - List roleIds; - - factory OrderModelCustomer.fromJson(Map json) => OrderModelCustomer( - id: json["id"], - username: usernameValues.map[json["username"]], - email: billingAddressEmailValues.map[json["email"]], - firstName: firstNameValues.map[json["first_name"]], - lastName: lastNameValues.map[json["last_name"]], - languageId: json["language_id"], - adminComment: json["admin_comment"], - isTaxExempt: json["is_tax_exempt"], - hasShoppingCartItems: json["has_shopping_cart_items"], - active: json["active"], - deleted: json["deleted"], - isSystemAccount: json["is_system_account"], - systemName: json["system_name"], - lastIpAddress: lastIpAddressValues.map[json["last_ip_address"]], - createdOnUtc: DateTime.parse(json["created_on_utc"]), - lastLoginDateUtc: DateTime.parse(json["last_login_date_utc"]), - lastActivityDateUtc: DateTime.parse(json["last_activity_date_utc"]), - registeredInStoreId: json["registered_in_store_id"], - roleIds: List.from(json["role_ids"].map((x) => x)), - ); - - Map toJson() => { - "id": id, - "username": usernameValues.reverse[username], - "email": billingAddressEmailValues.reverse[email], - "first_name": firstNameValues.reverse[firstName], - "last_name": lastNameValues.reverse[lastName], - "language_id": languageId, - "admin_comment": adminComment, - "is_tax_exempt": isTaxExempt, - "has_shopping_cart_items": hasShoppingCartItems, - "active": active, - "deleted": deleted, - "is_system_account": isSystemAccount, - "system_name": systemName, - "last_ip_address": lastIpAddressValues.reverse[lastIpAddress], - "created_on_utc": createdOnUtc.toIso8601String(), - "last_login_date_utc": lastLoginDateUtc.toIso8601String(), - "last_activity_date_utc": lastActivityDateUtc.toIso8601String(), - "registered_in_store_id": registeredInStoreId, - "role_ids": List.from(roleIds.map((x) => x)), - }; -} - -enum LastIpAddress { THE_1050220126 } - -final lastIpAddressValues = EnumValues({ - "10.50.220.126": LastIpAddress.THE_1050220126 -}); - -enum Username { TAMERF } - -final usernameValues = EnumValues({ - "tamerf": Username.TAMERF -}); - -enum CustomerCurrencyCode { SAR } - -final customerCurrencyCodeValues = EnumValues({ - "SAR": CustomerCurrencyCode.SAR -}); - -enum CustomerIp { THE_105010210, THE_127001, THE_1020200101, THE_102020041, THE_10501028, THE_102020033, THE_1020200170, THE_102020011 } - -final customerIpValues = EnumValues({ - "10.20.200.101": CustomerIp.THE_1020200101, - "10.20.200.11": CustomerIp.THE_102020011, - "10.20.200.170": CustomerIp.THE_1020200170, - "10.20.200.33": CustomerIp.THE_102020033, - "10.20.200.41": CustomerIp.THE_102020041, - "10.50.102.10": CustomerIp.THE_105010210, - "10.50.102.8": CustomerIp.THE_10501028, - "127.0.0.1": CustomerIp.THE_127001 -}); - -enum CustomerTaxDisplayType { EXCLUDING_TAX } - -final customerTaxDisplayTypeValues = EnumValues({ - "ExcludingTax": CustomerTaxDisplayType.EXCLUDING_TAX -}); - -class OrderItem { - OrderItem({ - this.quantity, - this.unitPriceInclTax, - this.unitPriceExclTax, - this.priceInclTax, - this.priceExclTax, - this.discountAmountInclTax, - this.discountAmountExclTax, - this.originalProductCost, - this.attributeDescription, - this.downloadCount, - this.isDownloadActivated, - this.licenseDownloadId, - this.itemWeight, - this.rentalStartDateUtc, - this.rentalEndDateUtc, - this.product, - this.productId, - }); - - dynamic quantity; - double unitPriceInclTax; - double unitPriceExclTax; - double priceInclTax; - double priceExclTax; - double discountAmountInclTax; - double discountAmountExclTax; - double originalProductCost; - String attributeDescription; - dynamic downloadCount; - bool isDownloadActivated; - dynamic licenseDownloadId; - double itemWeight; - dynamic rentalStartDateUtc; - dynamic rentalEndDateUtc; - Product product; - dynamic productId; - - factory OrderItem.fromJson(Map json) => OrderItem( - quantity: json["quantity"], - unitPriceInclTax: json["unit_price_incl_tax"].toDouble(), - unitPriceExclTax: json["unit_price_excl_tax"].toDouble(), - priceInclTax: json["price_incl_tax"].toDouble(), - priceExclTax: json["price_excl_tax"].toDouble(), - discountAmountInclTax: json["discount_amount_incl_tax"].toDouble(), - discountAmountExclTax: json["discount_amount_excl_tax"].toDouble(), - originalProductCost: json["original_product_cost"].toDouble(), - attributeDescription: json["attribute_description"], - downloadCount: json["download_count"], - isDownloadActivated: json["isDownload_activated"], - licenseDownloadId: json["license_download_id"], - itemWeight: json["item_weight"].toDouble(), - rentalStartDateUtc: json["rental_start_date_utc"], - rentalEndDateUtc: json["rental_end_date_utc"], - product: Product.fromJson(json["product"]), - productId: json["product_id"], - ); - - Map toJson() => { - "quantity": quantity, - "unit_price_incl_tax": unitPriceInclTax, - "unit_price_excl_tax": unitPriceExclTax, - "price_incl_tax": priceInclTax, - "price_excl_tax": priceExclTax, - "discount_amount_incl_tax": discountAmountInclTax, - "discount_amount_excl_tax": discountAmountExclTax, - "original_product_cost": originalProductCost, - "attribute_description": attributeDescription, - "download_count": downloadCount, - "isDownload_activated": isDownloadActivated, - "license_download_id": licenseDownloadId, - "item_weight": itemWeight, - "rental_start_date_utc": rentalStartDateUtc, - "rental_end_date_utc": rentalEndDateUtc, - "product": product.toJson(), - "product_id": productId, - }; -} - -class Product { - Product({ - this.id, - this.visibleIndividually, - this.name, - this.namen, - this.localizedNames, - this.shortDescription, - this.shortDescriptionn, - this.fullDescription, - this.fullDescriptionn, - this.markasNew, - this.showOnHomePage, - this.metaKeywords, - this.metaDescription, - this.metaTitle, - this.allowCustomerReviews, - this.approvedRatingSum, - this.notApprovedRatingSum, - this.approvedTotalReviews, - this.notApprovedTotalReviews, - this.sku, - this.isRx, - this.prescriptionRequired, - this.rxMessage, - this.rxMessagen, - this.manufacturerPartNumber, - this.gtin, - this.isGiftCard, - this.requireOtherProducts, - this.automaticallyAddRequiredProducts, - this.isDownload, - this.unlimitedDownloads, - this.maxNumberOfDownloads, - this.downloadExpirationDays, - this.hasSampleDownload, - this.hasUserAgreement, - this.isRecurring, - this.recurringCycleLength, - this.recurringTotalCycles, - this.isRental, - this.rentalPriceLength, - this.isShipEnabled, - this.isFreeShipping, - this.shipSeparately, - this.additionalShippingCharge, - this.isTaxExempt, - this.isTelecommunicationsOrBroadcastingOrElectronicServices, - this.useMultipleWarehouses, - this.manageInventoryMethodId, - this.stockQuantity, - this.stockAvailability, - this.stockAvailabilityn, - this.displayStockAvailability, - this.displayStockQuantity, - this.minStockQuantity, - this.notifyAdminForQuantityBelow, - this.allowBackInStockSubscriptions, - this.orderMinimumQuantity, - this.orderMaximumQuantity, - this.allowedQuantities, - this.allowAddingOnlyExistingAttributeCombinations, - this.disableBuyButton, - this.disableWishlistButton, - this.availableForPreOrder, - this.preOrderAvailabilityStartDateTimeUtc, - this.callForPrice, - this.price, - this.oldPrice, - this.productCost, - this.specialPrice, - this.specialPriceStartDateTimeUtc, - this.specialPriceEndDateTimeUtc, - this.customerEntersPrice, - this.minimumCustomerEnteredPrice, - this.maximumCustomerEnteredPrice, - this.basepriceEnabled, - this.basepriceAmount, - this.basepriceBaseAmount, - this.hasTierPrices, - this.hasDiscountsApplied, - this.discountName, - this.discountNamen, - this.discountDescription, - this.discountDescriptionn, - this.discountPercentage, - this.currency, - this.currencyn, - this.weight, - this.length, - this.width, - this.height, - this.availableStartDateTimeUtc, - this.availableEndDateTimeUtc, - this.displayOrder, - this.published, - this.deleted, - this.createdOnUtc, - this.updatedOnUtc, - this.productType, - this.parentGroupedProductId, - this.roleIds, - this.discountIds, - this.storeIds, - this.manufacturerIds, - this.reviews, - this.images, - this.attributes, - this.specifications, - this.associatedProductIds, - this.tags, - this.vendorId, - this.seName, - }); - - String id; - bool visibleIndividually; - String name; - String namen; - dynamic localizedNames; - String shortDescription; - String shortDescriptionn; - String fullDescription; - String fullDescriptionn; - bool markasNew; - bool showOnHomePage; - String metaKeywords; - String metaDescription; - String metaTitle; - bool allowCustomerReviews; - dynamic approvedRatingSum; - dynamic notApprovedRatingSum; - dynamic approvedTotalReviews; - dynamic notApprovedTotalReviews; - String sku; - bool isRx; - bool prescriptionRequired; - dynamic rxMessage; - dynamic rxMessagen; - dynamic manufacturerPartNumber; - dynamic gtin; - bool isGiftCard; - bool requireOtherProducts; - bool automaticallyAddRequiredProducts; - bool isDownload; - bool unlimitedDownloads; - dynamic maxNumberOfDownloads; - dynamic downloadExpirationDays; - bool hasSampleDownload; - bool hasUserAgreement; - bool isRecurring; - dynamic recurringCycleLength; - dynamic recurringTotalCycles; - bool isRental; - dynamic rentalPriceLength; - bool isShipEnabled; - bool isFreeShipping; - bool shipSeparately; - dynamic additionalShippingCharge; - bool isTaxExempt; - bool isTelecommunicationsOrBroadcastingOrElectronicServices; - bool useMultipleWarehouses; - dynamic manageInventoryMethodId; - dynamic stockQuantity; - dynamic stockAvailability; - dynamic stockAvailabilityn; - bool displayStockAvailability; - bool displayStockQuantity; - dynamic minStockQuantity; - dynamic notifyAdminForQuantityBelow; - bool allowBackInStockSubscriptions; - dynamic orderMinimumQuantity; - dynamic orderMaximumQuantity; - dynamic allowedQuantities; - bool allowAddingOnlyExistingAttributeCombinations; - bool disableBuyButton; - bool disableWishlistButton; - bool availableForPreOrder; - dynamic preOrderAvailabilityStartDateTimeUtc; - bool callForPrice; - double price; - dynamic oldPrice; - double productCost; - dynamic specialPrice; - dynamic specialPriceStartDateTimeUtc; - dynamic specialPriceEndDateTimeUtc; - bool customerEntersPrice; - dynamic minimumCustomerEnteredPrice; - dynamic maximumCustomerEnteredPrice; - bool basepriceEnabled; - dynamic basepriceAmount; - dynamic basepriceBaseAmount; - bool hasTierPrices; - bool hasDiscountsApplied; - dynamic discountName; - dynamic discountNamen; - dynamic discountDescription; - dynamic discountDescriptionn; - dynamic discountPercentage; - dynamic currency; - dynamic currencyn; - double weight; - dynamic length; - dynamic width; - dynamic height; - dynamic availableStartDateTimeUtc; - dynamic availableEndDateTimeUtc; - dynamic displayOrder; - bool published; - bool deleted; - DateTime createdOnUtc; - DateTime updatedOnUtc; - ProductType productType; - dynamic parentGroupedProductId; - dynamic roleIds; - dynamic discountIds; - dynamic storeIds; - dynamic manufacturerIds; - List reviews; - List images; - dynamic attributes; - dynamic specifications; - dynamic associatedProductIds; - List tags; - dynamic vendorId; - String seName; - - factory Product.fromJson(Map json) => Product( - id: json["id"], - visibleIndividually: json["visible_individually"], - name: json["name"], - namen: json["namen"], - localizedNames: json["localized_names"], - shortDescription: json["short_description"] == null ? null : json["short_description"], - shortDescriptionn: json["short_descriptionn"] == null ? null : json["short_descriptionn"], - fullDescription: json["full_description"], - fullDescriptionn: json["full_descriptionn"], - markasNew: json["markas_new"], - showOnHomePage: json["show_on_home_page"], - metaKeywords: json["meta_keywords"] == null ? null : json["meta_keywords"], - metaDescription: json["meta_description"] == null ? null : json["meta_description"], - metaTitle: json["meta_title"] == null ? null : json["meta_title"], - allowCustomerReviews: json["allow_customer_reviews"], - approvedRatingSum: json["approved_rating_sum"], - notApprovedRatingSum: json["not_approved_rating_sum"], - approvedTotalReviews: json["approved_total_reviews"], - notApprovedTotalReviews: json["not_approved_total_reviews"], - sku: json["sku"], - isRx: json["is_rx"], - prescriptionRequired: json["prescription_required"], - rxMessage: json["rx_message"], - rxMessagen: json["rx_messagen"], - manufacturerPartNumber: json["manufacturer_part_number"], - gtin: json["gtin"], - isGiftCard: json["is_gift_card"], - requireOtherProducts: json["require_other_products"], - automaticallyAddRequiredProducts: json["automatically_add_required_products"], - isDownload: json["is_download"], - unlimitedDownloads: json["unlimited_downloads"], - maxNumberOfDownloads: json["max_number_of_downloads"], - downloadExpirationDays: json["download_expiration_days"], - hasSampleDownload: json["has_sample_download"], - hasUserAgreement: json["has_user_agreement"], - isRecurring: json["is_recurring"], - recurringCycleLength: json["recurring_cycle_length"], - recurringTotalCycles: json["recurring_total_cycles"], - isRental: json["is_rental"], - rentalPriceLength: json["rental_price_length"], - isShipEnabled: json["is_ship_enabled"], - isFreeShipping: json["is_free_shipping"], - shipSeparately: json["ship_separately"], - additionalShippingCharge: json["additional_shipping_charge"], - isTaxExempt: json["is_tax_exempt"], - isTelecommunicationsOrBroadcastingOrElectronicServices: json["is_telecommunications_or_broadcasting_or_electronic_services"], - useMultipleWarehouses: json["use_multiple_warehouses"], - manageInventoryMethodId: json["manage_inventory_method_id"], - stockQuantity: json["stock_quantity"], - stockAvailability: json["stock_availability"], - stockAvailabilityn: json["stock_availabilityn"], - displayStockAvailability: json["display_stock_availability"], - displayStockQuantity: json["display_stock_quantity"], - minStockQuantity: json["min_stock_quantity"], - notifyAdminForQuantityBelow: json["notify_admin_for_quantity_below"], - allowBackInStockSubscriptions: json["allow_back_in_stock_subscriptions"], - orderMinimumQuantity: json["order_minimum_quantity"], - orderMaximumQuantity: json["order_maximum_quantity"], - allowedQuantities: json["allowed_quantities"], - allowAddingOnlyExistingAttributeCombinations: json["allow_adding_only_existing_attribute_combinations"], - disableBuyButton: json["disable_buy_button"], - disableWishlistButton: json["disable_wishlist_button"], - availableForPreOrder: json["available_for_pre_order"], - preOrderAvailabilityStartDateTimeUtc: json["pre_order_availability_start_date_time_utc"], - callForPrice: json["call_for_price"], - price: json["price"].toDouble(), - oldPrice: json["old_price"], - productCost: json["product_cost"].toDouble(), - specialPrice: json["special_price"], - specialPriceStartDateTimeUtc: json["special_price_start_date_time_utc"], - specialPriceEndDateTimeUtc: json["special_price_end_date_time_utc"], - customerEntersPrice: json["customer_enters_price"], - minimumCustomerEnteredPrice: json["minimum_customer_entered_price"], - maximumCustomerEnteredPrice: json["maximum_customer_entered_price"], - basepriceEnabled: json["baseprice_enabled"], - basepriceAmount: json["baseprice_amount"], - basepriceBaseAmount: json["baseprice_base_amount"], - hasTierPrices: json["has_tier_prices"], - hasDiscountsApplied: json["has_discounts_applied"], - discountName: json["discount_name"], - discountNamen: json["discount_namen"], - discountDescription: json["discount_description"], - discountDescriptionn: json["discount_Descriptionn"], - discountPercentage: json["discount_percentage"], - currency: json["currency"], - currencyn: json["currencyn"], - weight: json["weight"].toDouble(), - length: json["length"], - width: json["width"], - height: json["height"], - availableStartDateTimeUtc: json["available_start_date_time_utc"], - availableEndDateTimeUtc: json["available_end_date_time_utc"], - displayOrder: json["display_order"], - published: json["published"], - deleted: json["deleted"], - createdOnUtc: DateTime.parse(json["created_on_utc"]), - updatedOnUtc: DateTime.parse(json["updated_on_utc"]), - productType: productTypeValues.map[json["product_type"]], - parentGroupedProductId: json["parent_grouped_product_id"], - roleIds: json["role_ids"], - discountIds: json["discount_ids"], - storeIds: json["store_ids"], - manufacturerIds: json["manufacturer_ids"], - reviews: List.from(json["reviews"].map((x) => Review.fromJson(x))), - images: List.from(json["images"].map((x) => Image.fromJson(x))), - attributes: json["attributes"], - specifications: json["specifications"], - associatedProductIds: json["associated_product_ids"], - tags: List.from(json["tags"].map((x) => x)), - vendorId: json["vendor_id"], - seName: json["se_name"], - ); - - Map toJson() => { - "id": id, - "visible_individually": visibleIndividually, - "name": name, - "namen": namen, - "localized_names": localizedNames, - "short_description": shortDescription == null ? null : shortDescription, - "short_descriptionn": shortDescriptionn == null ? null : shortDescriptionn, - "full_description": fullDescription, - "full_descriptionn": fullDescriptionn, - "markas_new": markasNew, - "show_on_home_page": showOnHomePage, - "meta_keywords": metaKeywords == null ? null : metaKeywords, - "meta_description": metaDescription == null ? null : metaDescription, - "meta_title": metaTitle == null ? null : metaTitle, - "allow_customer_reviews": allowCustomerReviews, - "approved_rating_sum": approvedRatingSum, - "not_approved_rating_sum": notApprovedRatingSum, - "approved_total_reviews": approvedTotalReviews, - "not_approved_total_reviews": notApprovedTotalReviews, - "sku": sku, - "is_rx": isRx, - "prescription_required": prescriptionRequired, - "rx_message": rxMessage, - "rx_messagen": rxMessagen, - "manufacturer_part_number": manufacturerPartNumber, - "gtin": gtin, - "is_gift_card": isGiftCard, - "require_other_products": requireOtherProducts, - "automatically_add_required_products": automaticallyAddRequiredProducts, - "is_download": isDownload, - "unlimited_downloads": unlimitedDownloads, - "max_number_of_downloads": maxNumberOfDownloads, - "download_expiration_days": downloadExpirationDays, - "has_sample_download": hasSampleDownload, - "has_user_agreement": hasUserAgreement, - "is_recurring": isRecurring, - "recurring_cycle_length": recurringCycleLength, - "recurring_total_cycles": recurringTotalCycles, - "is_rental": isRental, - "rental_price_length": rentalPriceLength, - "is_ship_enabled": isShipEnabled, - "is_free_shipping": isFreeShipping, - "ship_separately": shipSeparately, - "additional_shipping_charge": additionalShippingCharge, - "is_tax_exempt": isTaxExempt, - "is_telecommunications_or_broadcasting_or_electronic_services": isTelecommunicationsOrBroadcastingOrElectronicServices, - "use_multiple_warehouses": useMultipleWarehouses, - "manage_inventory_method_id": manageInventoryMethodId, - "stock_quantity": stockQuantity, - "stock_availability": stockAvailability, - "stock_availabilityn": stockAvailabilityn, - "display_stock_availability": displayStockAvailability, - "display_stock_quantity": displayStockQuantity, - "min_stock_quantity": minStockQuantity, - "notify_admin_for_quantity_below": notifyAdminForQuantityBelow, - "allow_back_in_stock_subscriptions": allowBackInStockSubscriptions, - "order_minimum_quantity": orderMinimumQuantity, - "order_maximum_quantity": orderMaximumQuantity, - "allowed_quantities": allowedQuantities, - "allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations, - "disable_buy_button": disableBuyButton, - "disable_wishlist_button": disableWishlistButton, - "available_for_pre_order": availableForPreOrder, - "pre_order_availability_start_date_time_utc": preOrderAvailabilityStartDateTimeUtc, - "call_for_price": callForPrice, - "price": price, - "old_price": oldPrice, - "product_cost": productCost, - "special_price": specialPrice, - "special_price_start_date_time_utc": specialPriceStartDateTimeUtc, - "special_price_end_date_time_utc": specialPriceEndDateTimeUtc, - "customer_enters_price": customerEntersPrice, - "minimum_customer_entered_price": minimumCustomerEnteredPrice, - "maximum_customer_entered_price": maximumCustomerEnteredPrice, - "baseprice_enabled": basepriceEnabled, - "baseprice_amount": basepriceAmount, - "baseprice_base_amount": basepriceBaseAmount, - "has_tier_prices": hasTierPrices, - "has_discounts_applied": hasDiscountsApplied, - "discount_name": discountName, - "discount_namen": discountNamen, - "discount_description": discountDescription, - "discount_Descriptionn": discountDescriptionn, - "discount_percentage": discountPercentage, - "currency": currency, - "currencyn": currencyn, - "weight": weight, - "length": length, - "width": width, - "height": height, - "available_start_date_time_utc": availableStartDateTimeUtc, - "available_end_date_time_utc": availableEndDateTimeUtc, - "display_order": displayOrder, - "published": published, - "deleted": deleted, - "created_on_utc": createdOnUtc.toIso8601String(), - "updated_on_utc": updatedOnUtc.toIso8601String(), - "product_type": productTypeValues.reverse[productType], - "parent_grouped_product_id": parentGroupedProductId, - "role_ids": roleIds, - "discount_ids": discountIds, - "store_ids": storeIds, - "manufacturer_ids": manufacturerIds, - "reviews": List.from(reviews.map((x) => x.toJson())), - "images": List.from(images.map((x) => x.toJson())), - "attributes": attributes, - "specifications": specifications, - "associated_product_ids": associatedProductIds, - "tags": List.from(tags.map((x) => x)), - "vendor_id": vendorId, - "se_name": seName, - }; -} - -class Image { - Image({ - this.id, - this.position, - this.src, - this.thumb, - this.attachment, - }); - - dynamic id; - dynamic position; - String src; - String thumb; - String attachment; - - factory Image.fromJson(Map json) => Image( - id: json["id"], - position: json["position"], - src: json["src"], - thumb: json["thumb"], - attachment: json["attachment"], - ); - - Map toJson() => { - "id": id, - "position": position, - "src": src, - "thumb": thumb, - "attachment": attachment, - }; -} - -enum ProductType { SIMPLE_PRODUCT } - -final productTypeValues = EnumValues({ - "SimpleProduct": ProductType.SIMPLE_PRODUCT -}); - -class Review { - Review({ - this.id, - this.position, - this.reviewId, - this.customerId, - this.productId, - this.storeId, - this.isApproved, - this.title, - this.reviewText, - this.replyText, - this.rating, - this.helpfulYesTotal, - this.helpfulNoTotal, - this.createdOnUtc, - this.customer, - this.product, - }); - - dynamic id; - dynamic position; - dynamic reviewId; - dynamic customerId; - dynamic productId; - dynamic storeId; - bool isApproved; - Title title; - ReviewText reviewText; - dynamic replyText; - dynamic rating; - dynamic helpfulYesTotal; - dynamic helpfulNoTotal; - DateTime createdOnUtc; - ReviewCustomer customer; - dynamic product; - - factory Review.fromJson(Map json) => Review( - id: json["id"], - position: json["position"], - reviewId: json["review_id"], - customerId: json["customer_id"], - productId: json["product_id"], - storeId: json["store_id"], - isApproved: json["is_approved"], - title: titleValues.map[json["title"]], - reviewText: reviewTextValues.map[json["review_text"]], - replyText: json["reply_text"], - rating: json["rating"], - helpfulYesTotal: json["helpful_yes_total"], - helpfulNoTotal: json["helpful_no_total"], - createdOnUtc: DateTime.parse(json["created_on_utc"]), - customer: ReviewCustomer.fromJson(json["customer"]), - product: json["product"], - ); - - Map toJson() => { - "id": id, - "position": position, - "review_id": reviewId, - "customer_id": customerId, - "product_id": productId, - "store_id": storeId, - "is_approved": isApproved, - "title": titleValues.reverse[title], - "review_text": reviewTextValues.reverse[reviewText], - "reply_text": replyText, - "rating": rating, - "helpful_yes_total": helpfulYesTotal, - "helpful_no_total": helpfulNoTotal, - "created_on_utc": createdOnUtc.toIso8601String(), - "customer": customer.toJson(), - "product": product, - }; -} - -class ReviewCustomer { - ReviewCustomer({ - this.fileNumber, - this.iqamaNumber, - this.isOutSa, - this.patientType, - this.gender, - this.birthDate, - this.phone, - this.countryCode, - this.yahalaAccountno, - this.billingAddress, - this.shippingAddress, - this.addresses, - this.id, - this.username, - this.email, - this.firstName, - this.lastName, - this.languageId, - this.adminComment, - this.isTaxExempt, - this.hasShoppingCartItems, - this.active, - this.deleted, - this.isSystemAccount, - this.systemName, - this.lastIpAddress, - this.createdOnUtc, - this.lastLoginDateUtc, - this.lastActivityDateUtc, - this.registeredInStoreId, - this.roleIds, - }); - - dynamic fileNumber; - dynamic iqamaNumber; - dynamic isOutSa; - dynamic patientType; - dynamic gender; - DateTime birthDate; - dynamic phone; - dynamic countryCode; - dynamic yahalaAccountno; - dynamic billingAddress; - dynamic shippingAddress; - List addresses; - String id; - String username; - PurpleEmail email; - dynamic firstName; - dynamic lastName; - dynamic languageId; - dynamic adminComment; - dynamic isTaxExempt; - dynamic hasShoppingCartItems; - dynamic active; - dynamic deleted; - dynamic isSystemAccount; - dynamic systemName; - dynamic lastIpAddress; - dynamic createdOnUtc; - dynamic lastLoginDateUtc; - dynamic lastActivityDateUtc; - dynamic registeredInStoreId; - List roleIds; - - factory ReviewCustomer.fromJson(Map json) => ReviewCustomer( - fileNumber: json["file_number"], - iqamaNumber: json["iqama_number"], - isOutSa: json["is_out_sa"], - patientType: json["patient_type"], - gender: json["gender"], - birthDate: DateTime.parse(json["birth_date"]), - phone: json["phone"], - countryCode: json["country_code"], - yahalaAccountno: json["yahala_accountno"], - billingAddress: json["billing_address"], - shippingAddress: json["shipping_address"], - addresses: List.from(json["addresses"].map((x) => x)), - id: json["id"], - username: json["username"], - email: purpleEmailValues.map[json["email"]], - firstName: json["first_name"], - lastName: json["last_name"], - languageId: json["language_id"], - adminComment: json["admin_comment"], - isTaxExempt: json["is_tax_exempt"], - hasShoppingCartItems: json["has_shopping_cart_items"], - active: json["active"], - deleted: json["deleted"], - isSystemAccount: json["is_system_account"], - systemName: json["system_name"], - lastIpAddress: json["last_ip_address"], - createdOnUtc: json["created_on_utc"], - lastLoginDateUtc: json["last_login_date_utc"], - lastActivityDateUtc: json["last_activity_date_utc"], - registeredInStoreId: json["registered_in_store_id"], - roleIds: List.from(json["role_ids"].map((x) => x)), - ); - - Map toJson() => { - "file_number": fileNumber, - "iqama_number": iqamaNumber, - "is_out_sa": isOutSa, - "patient_type": patientType, - "gender": gender, - "birth_date": birthDate.toIso8601String(), - "phone": phone, - "country_code": countryCode, - "yahala_accountno": yahalaAccountno, - "billing_address": billingAddress, - "shipping_address": shippingAddress, - "addresses": List.from(addresses.map((x) => x)), - "id": id, - "username": username, - "email": purpleEmailValues.reverse[email], - "first_name": firstName, - "last_name": lastName, - "language_id": languageId, - "admin_comment": adminComment, - "is_tax_exempt": isTaxExempt, - "has_shopping_cart_items": hasShoppingCartItems, - "active": active, - "deleted": deleted, - "is_system_account": isSystemAccount, - "system_name": systemName, - "last_ip_address": lastIpAddress, - "created_on_utc": createdOnUtc, - "last_login_date_utc": lastLoginDateUtc, - "last_activity_date_utc": lastActivityDateUtc, - "registered_in_store_id": registeredInStoreId, - "role_ids": List.from(roleIds.map((x) => x)), - }; -} - -enum PurpleEmail { STEVE_GATES_NOP_COMMERCE_COM, TAMER_FANASHEH_DRSULAIMANALHABIB_COM, ASIF_RAZA_DRSULAIMANALHABIB_COM, ABOSAMI_YMAIL_COM } - -final purpleEmailValues = EnumValues({ - "abosami@ymail.com": PurpleEmail.ABOSAMI_YMAIL_COM, - "asif.raza@drsulaimanalhabib.com": PurpleEmail.ASIF_RAZA_DRSULAIMANALHABIB_COM, - "steve_gates@nopCommerce.com": PurpleEmail.STEVE_GATES_NOP_COMMERCE_COM, - "tamer.fanasheh@drsulaimanalhabib.com": PurpleEmail.TAMER_FANASHEH_DRSULAIMANALHABIB_COM -}); - -enum ReviewText { GOOD, NICE_PRICE, GREAT, REVIEW_TEXT_GOOD, GG, ENAD_TEST_REVIEW_001, ENAD, ENADDD, ENAD_TEST_0001, PURPLE_GOOD, EMPTY } - -final reviewTextValues = EnumValues({ - "افضل علاج للزكام": ReviewText.EMPTY, - "ENAD ": ReviewText.ENAD, - "enaddd": ReviewText.ENADDD, - "ENAD TEST 0001": ReviewText.ENAD_TEST_0001, - "Enad Test Review 001": ReviewText.ENAD_TEST_REVIEW_001, - "gg": ReviewText.GG, - "good ": ReviewText.GOOD, - "great": ReviewText.GREAT, - "nice price": ReviewText.NICE_PRICE, - "Good": ReviewText.PURPLE_GOOD, - "good": ReviewText.REVIEW_TEXT_GOOD -}); - -enum Title { EMPTY, GOOD, TITLE } - -final titleValues = EnumValues({ - "": Title.EMPTY, - "Good": Title.GOOD, - "ممتاز": Title.TITLE -}); - -enum OrderStatus { ORDER_SUBMITTED, PENDING, ORDER_IN_PROGRESS, ORDER_COMPLETED, CANCELLED, PROCESSING, ORDER_REFUNDED, COMPLETE } - -final orderStatusValues = EnumValues({ - "Cancelled": OrderStatus.CANCELLED, - "Complete": OrderStatus.COMPLETE, - "OrderCompleted": OrderStatus.ORDER_COMPLETED, - "OrderInProgress": OrderStatus.ORDER_IN_PROGRESS, - "OrderRefunded": OrderStatus.ORDER_REFUNDED, - "OrderSubmitted": OrderStatus.ORDER_SUBMITTED, - "Pending": OrderStatus.PENDING, - "Processing": OrderStatus.PROCESSING -}); - -enum OrderStatusn { ORDER_SUBMITTED, EMPTY, ORDER_IN_PROGRESS, ORDER_COMPLETED, ORDER_STATUSN, PURPLE, FLUFFY, TENTACLED } - -final orderStatusnValues = EnumValues({ - "معلقة": OrderStatusn.EMPTY, - "تم ارجاع مبلغ الطلبية المدفوع للعميل": OrderStatusn.FLUFFY, - "Order Completed": OrderStatusn.ORDER_COMPLETED, - "Order In Progress": OrderStatusn.ORDER_IN_PROGRESS, - "ملغي": OrderStatusn.ORDER_STATUSN, - "Order Submitted": OrderStatusn.ORDER_SUBMITTED, - "قيد التنفيذ": OrderStatusn.PURPLE, - "مكتمل": OrderStatusn.TENTACLED -}); - -enum PaymentMethodSystemName { PAYMENTS_PAY_FORT, PAYMENTS_CASH_ON_DELIVERY } - -final paymentMethodSystemNameValues = EnumValues({ - "Payments.CashOnDelivery": PaymentMethodSystemName.PAYMENTS_CASH_ON_DELIVERY, - "Payments.PayFort": PaymentMethodSystemName.PAYMENTS_PAY_FORT -}); - -enum PaymentName { CREDIT_DEBIT_CARD_PAYFORT, CASH_ON_DELIVERY_COD } - -final paymentNameValues = EnumValues({ - "Cash On Delivery (COD)": PaymentName.CASH_ON_DELIVERY_COD, - "Credit / Debit Card Payfort": PaymentName.CREDIT_DEBIT_CARD_PAYFORT -}); - -enum PaymentStatus { PAID, PENDING } - -final paymentStatusValues = EnumValues({ - "Paid": PaymentStatus.PAID, - "Pending": PaymentStatus.PENDING -}); - -enum PaymentStatusn { EMPTY, PAYMENT_STATUSN } - -final paymentStatusnValues = EnumValues({ - "تم الدفع": PaymentStatusn.EMPTY, - "قيد الإنتظار": PaymentStatusn.PAYMENT_STATUSN -}); - -enum PreferDeliveryTime { THE_1000_AM_330_PM, THE_530_PM_730_PM } - -final preferDeliveryTimeValues = EnumValues({ - "10:00 AM - 3:30 PM": PreferDeliveryTime.THE_1000_AM_330_PM, - "5:30 PM - 7:30 PM": PreferDeliveryTime.THE_530_PM_730_PM -}); - -enum PreferDeliveryTimen { THE_1000330, THE_530730 } - -final preferDeliveryTimenValues = EnumValues({ - "10:00 ص - 3:30 م": PreferDeliveryTimen.THE_1000330, - "5:30 م - 7:30 م": PreferDeliveryTimen.THE_530730 -}); - -enum ShippingMethod { EMPTY, FIXED_PRICE } - -final shippingMethodValues = EnumValues({ - "سعر ثابت ": ShippingMethod.EMPTY, - "Fixed Price": ShippingMethod.FIXED_PRICE -}); - -enum ShippingRateComputationMethodSystemName { SHIPPING_FIXED_OR_BY_WEIGHT } - -final shippingRateComputationMethodSystemNameValues = EnumValues({ - "Shipping.FixedOrByWeight": ShippingRateComputationMethodSystemName.SHIPPING_FIXED_OR_BY_WEIGHT -}); - -enum ShippingStatus { NOT_YET_SHIPPED } - -final shippingStatusValues = EnumValues({ - "NotYetShipped": ShippingStatus.NOT_YET_SHIPPED -}); - -enum ShippingStatusn { EMPTY } - -final shippingStatusnValues = EnumValues({ - "لم يتم شحنها بعد": ShippingStatusn.EMPTY -}); - -class EnumValues { - Map map; - Map reverseMap; - - EnumValues(this.map); - - Map get reverse { - if (reverseMap == null) { - reverseMap = map.map((k, v) => new MapEntry(v, k)); - } - return reverseMap; - } -} - - - diff --git a/lib/core/model/pharmacies/payment-checkout-data.dart b/lib/core/model/pharmacies/payment-checkout-data.dart deleted file mode 100644 index dd9e0e54..00000000 --- a/lib/core/model/pharmacies/payment-checkout-data.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; -import 'package:flutter/material.dart'; - -import 'ShippingOption.dart'; - -class PaymentCheckoutData with ChangeNotifier{ - Addresses address; - PaymentOption paymentOption; - LacumAccountInformation lacumInformation; - bool cartDataVisible; - ShippingOption shippingOption; - int usedLakumPoints; - - PaymentCheckoutData({this.address, this.paymentOption, this.lacumInformation, this.cartDataVisible = false, this.shippingOption, this.usedLakumPoints = 0}); - - void updateData() { - notifyListeners(); - } -} diff --git a/lib/core/model/pharmacy/brands_model.dart b/lib/core/model/pharmacy/brands_model.dart deleted file mode 100644 index 03cd689e..00000000 --- a/lib/core/model/pharmacy/brands_model.dart +++ /dev/null @@ -1,24 +0,0 @@ -class BrandsModel { - String id; - String name; - String namen; - Null image; - - BrandsModel({this.id, this.name, this.namen, this.image}); - - BrandsModel.fromJson(Map json) { - id = json['id']; - name = json['name']; - namen = json['namen']; - image = json['image']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; - data['namen'] = this.namen; - data['image'] = this.image; - return data; - } -} diff --git a/lib/core/model/pharmacy/categorise_parent_model.dart b/lib/core/model/pharmacy/categorise_parent_model.dart deleted file mode 100644 index 82c5b55f..00000000 --- a/lib/core/model/pharmacy/categorise_parent_model.dart +++ /dev/null @@ -1,75 +0,0 @@ -class CategoriseParentModel { - String id; - String name; - String namen; - List localizedNames; - dynamic description; - int parentCategoryId; - int displayOrder; - dynamic image; - bool isLeaf; - - CategoriseParentModel( - {this.id, - this.name, - this.namen, - this.localizedNames, - this.description, - this.parentCategoryId, - this.displayOrder, - this.image, - this.isLeaf}); - - CategoriseParentModel.fromJson(Map json) { - id = json['id']; - name = json['name']; - namen = json['namen']; - if (json['localized_names'] != null) { - localizedNames = new List(); - json['localized_names'].forEach((v) { - localizedNames.add(new LocalizedNames.fromJson(v)); - }); - } - description = json['description']; - parentCategoryId = json['parent_category_id']; - displayOrder = json['display_order']; - image = json['image']; - isLeaf = json['is_leaf']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; - data['namen'] = this.namen; - if (this.localizedNames != null) { - data['localized_names'] = - this.localizedNames.map((v) => v.toJson()).toList(); - } - data['description'] = this.description; - data['parent_category_id'] = this.parentCategoryId; - data['display_order'] = this.displayOrder; - data['image'] = this.image; - data['is_leaf'] = this.isLeaf; - return data; - } -} - -class LocalizedNames { - int languageId; - String localizedName; - - LocalizedNames({this.languageId, this.localizedName}); - - LocalizedNames.fromJson(Map json) { - languageId = json['language_id']; - localizedName = json['localized_name']; - } - - Map toJson() { - final Map data = new Map(); - data['language_id'] = this.languageId; - data['localized_name'] = this.localizedName; - return data; - } -} diff --git a/lib/core/model/pharmacy/final_products_model.dart b/lib/core/model/pharmacy/final_products_model.dart deleted file mode 100644 index 52ab1d2d..00000000 --- a/lib/core/model/pharmacy/final_products_model.dart +++ /dev/null @@ -1,184 +0,0 @@ -class FinalProductsModel { - String id; - String name; - String namen; - List localizedNames; - String shortDescription; - String fullDescription; - String fullDescriptionn; - dynamic approvedRatingSum; - dynamic approvedTotalReviews; - String sku; - bool isRx; - dynamic rxMessage; - dynamic rxMessagen; - dynamic stockQuantity; - String stockAvailability; - String stockAvailabilityn; - bool allowBackInStockSubscriptions; - dynamic orderMinimumQuantity; - dynamic orderMaximumQuantity; - dynamic price; - dynamic oldPrice; - dynamic discountName; - dynamic discountNamen; - dynamic discountPercentage; - dynamic displayOrder; - List discountIds; - List reviews; - List images; - - FinalProductsModel( - {this.id, - this.name, - this.namen, - this.localizedNames, - this.shortDescription, - this.fullDescription, - this.fullDescriptionn, - this.approvedRatingSum, - this.approvedTotalReviews, - this.sku, - this.isRx, - this.rxMessage, - this.rxMessagen, - this.stockQuantity, - this.stockAvailability, - this.stockAvailabilityn, - this.allowBackInStockSubscriptions, - this.orderMinimumQuantity, - this.orderMaximumQuantity, - this.price, - this.oldPrice, - this.discountName, - this.discountNamen, - this.discountPercentage, - this.displayOrder, - this.discountIds, - this.reviews, - this.images}); - - FinalProductsModel.fromJson(Map json) { - id = json['id']; - name = json['name']; - if (json['images'] != null) { - images = new List(); - json['images'].forEach((v) { - images.add(new Images.fromJson(v)); - }); - } - namen = json['namen']; - if (json['localized_names'] != null) { - localizedNames = new List(); - json['localized_names'].forEach((v) { - localizedNames.add(new LocalizedNames.fromJson(v)); - }); - } - shortDescription = json['short_description']; - fullDescription = json['full_description']; - fullDescriptionn = json['full_descriptionn']; - approvedRatingSum = json['approved_rating_sum']; - approvedTotalReviews = json['approved_total_reviews']; - sku = json['sku']; - isRx = json['is_rx']; - rxMessage = json['rx_message']; - rxMessagen = json['rx_messagen']; - stockQuantity = json['stock_quantity']; - stockAvailability = json['stock_availability']; - stockAvailabilityn = json['stock_availabilityn']; - allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; - orderMinimumQuantity = json['order_minimum_quantity']; - orderMaximumQuantity = json['order_maximum_quantity']; - price = json['price']; - oldPrice = json['old_price']; - discountName = json['discount_name']; - discountNamen = json['discount_namen']; - discountPercentage = json['discount_percentage']; - displayOrder = json['display_order']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; - data['namen'] = this.namen; - if (this.localizedNames != null) { - data['localized_names'] = - this.localizedNames.map((v) => v.toJson()).toList(); - } - data['short_description'] = this.shortDescription; - data['full_description'] = this.fullDescription; - data['full_descriptionn'] = this.fullDescriptionn; - data['approved_rating_sum'] = this.approvedRatingSum; - data['approved_total_reviews'] = this.approvedTotalReviews; - data['sku'] = this.sku; - data['is_rx'] = this.isRx; - data['rx_message'] = this.rxMessage; - data['rx_messagen'] = this.rxMessagen; - data['stock_quantity'] = this.stockQuantity; - data['stock_availability'] = this.stockAvailability; - data['stock_availabilityn'] = this.stockAvailabilityn; - data['allow_back_in_stock_subscriptions'] = - this.allowBackInStockSubscriptions; - data['order_minimum_quantity'] = this.orderMinimumQuantity; - data['order_maximum_quantity'] = this.orderMaximumQuantity; - data['price'] = this.price; - data['old_price'] = this.oldPrice; - data['discount_name'] = this.discountName; - data['discount_namen'] = this.discountNamen; - data['discount_percentage'] = this.discountPercentage; - data['display_order'] = this.displayOrder; - - if (this.images != null) { - data['images'] = this.images.map((v) => v.toJson()).toList(); - } - return data; - } -} - -class LocalizedNames { - int languageId; - String localizedName; - - LocalizedNames({this.languageId, this.localizedName}); - - LocalizedNames.fromJson(Map json) { - languageId = json['language_id']; - localizedName = json['localized_name']; - } - - Map toJson() { - final Map data = new Map(); - data['language_id'] = this.languageId; - data['localized_name'] = this.localizedName; - return data; - } -} - -class Images { - int id; - int position; - String src; - String thumb; - String attachment; - - Images({this.id, this.position, this.src, this.thumb, this.attachment}); - - Images.fromJson(Map json) { - id = json['id']; - position = json['position']; - src = json['src']; - thumb = json['thumb']; - attachment = json['attachment']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['position'] = this.position; - data['src'] = this.src; - data['thumb'] = this.thumb; - data['attachment'] = this.attachment; - return data; - } -} diff --git a/lib/core/model/pharmacy/offer_products_model.dart b/lib/core/model/pharmacy/offer_products_model.dart deleted file mode 100644 index f41b731b..00000000 --- a/lib/core/model/pharmacy/offer_products_model.dart +++ /dev/null @@ -1,579 +0,0 @@ -class OfferProductsModel { - String id; - bool visibleIndividually; - String name; - String namen; - List localizedNames; - String shortDescription; - String shortDescriptionn; - String fullDescription; - String fullDescriptionn; - bool markasNew; - bool showOnHomePage; - dynamic metaKeywords; - dynamic metaDescription; - dynamic metaTitle; - bool allowCustomerReviews; - dynamic approvedRatingSum; - dynamic notApprovedRatingSum; - dynamic approvedTotalReviews; - dynamic notApprovedTotalReviews; - String sku; - bool isRx; - bool prescriptionRequired; - dynamic rxMessage; - dynamic rxMessagen; - dynamic manufacturerPartNumber; - dynamic gtin; - bool isGiftCard; - bool requireOtherProducts; - bool automaticallyAddRequiredProducts; - bool isDownload; - bool unlimitedDownloads; - dynamic maxNumberOfDownloads; - dynamic downloadExpirationDays; - bool hasSampleDownload; - bool hasUserAgreement; - bool isRecurring; - dynamic recurringCycleLength; - dynamic recurringTotalCycles; - bool isRental; - dynamic rentalPriceLength; - bool isShipEnabled; - bool isFreeShipping; - bool shipSeparately; - dynamic additionalShippingCharge; - bool isTaxExempt; - bool isTelecommunicationsOrBroadcastingOrElectronicServices; - bool useMultipleWarehouses; - dynamic manageInventoryMethodId; - dynamic stockQuantity; - String stockAvailability; - String stockAvailabilityn; - bool displayStockAvailability; - bool displayStockQuantity; - dynamic minStockQuantity; - dynamic notifyAdminForQuantityBelow; - bool allowBackInStockSubscriptions; - dynamic orderMinimumQuantity; - dynamic orderMaximumQuantity; - dynamic allowedQuantities; - bool allowAddingOnlyExistingAttributeCombinations; - bool disableBuyButton; - bool disableWishlistButton; - bool availableForPreOrder; - dynamic preOrderAvailabilityStartDateTimeUtc; - bool callForPrice; - dynamic price; - dynamic oldPrice; - dynamic productCost; - dynamic specialPrice; - dynamic specialPriceStartDateTimeUtc; - dynamic specialPriceEndDateTimeUtc; - bool customerEntersPrice; - dynamic minimumCustomerEnteredPrice; - dynamic maximumCustomerEnteredPrice; - bool basepriceEnabled; - dynamic basepriceAmount; - dynamic basepriceBaseAmount; - bool hasTierPrices; - bool hasDiscountsApplied; - String discountName; - String discountNamen; - String discountDescription; - String discountDescriptionn; - dynamic discountPercentage; - String currency; - String currencyn; - dynamic weight; - dynamic length; - dynamic width; - dynamic height; - dynamic availableStartDateTimeUtc; - dynamic availableEndDateTimeUtc; - dynamic displayOrder; - bool published; - bool deleted; - String createdOnUtc; - String updatedOnUtc; - String productType; - dynamic parentGroupedProductId; - List roleIds; - List discountIds; - List storeIds; - List manufacturerIds; - List reviews; - List images; - List attributes; - List specifications; - List associatedProductIds; - List tags; - dynamic vendorId; - String seName; - - OfferProductsModel( - {this.id, - this.visibleIndividually, - this.name, - this.namen, - this.localizedNames, - this.shortDescription, - this.shortDescriptionn, - this.fullDescription, - this.fullDescriptionn, - this.markasNew, - this.showOnHomePage, - this.metaKeywords, - this.metaDescription, - this.metaTitle, - this.allowCustomerReviews, - this.approvedRatingSum, - this.notApprovedRatingSum, - this.approvedTotalReviews, - this.notApprovedTotalReviews, - this.sku, - this.isRx, - this.prescriptionRequired, - this.rxMessage, - this.rxMessagen, - this.manufacturerPartNumber, - this.gtin, - this.isGiftCard, - this.requireOtherProducts, - this.automaticallyAddRequiredProducts, - this.isDownload, - this.unlimitedDownloads, - this.maxNumberOfDownloads, - this.downloadExpirationDays, - this.hasSampleDownload, - this.hasUserAgreement, - this.isRecurring, - this.recurringCycleLength, - this.recurringTotalCycles, - this.isRental, - this.rentalPriceLength, - this.isShipEnabled, - this.isFreeShipping, - this.shipSeparately, - this.additionalShippingCharge, - this.isTaxExempt, - this.isTelecommunicationsOrBroadcastingOrElectronicServices, - this.useMultipleWarehouses, - this.manageInventoryMethodId, - this.stockQuantity, - this.stockAvailability, - this.stockAvailabilityn, - this.displayStockAvailability, - this.displayStockQuantity, - this.minStockQuantity, - this.notifyAdminForQuantityBelow, - this.allowBackInStockSubscriptions, - this.orderMinimumQuantity, - this.orderMaximumQuantity, - this.allowedQuantities, - this.allowAddingOnlyExistingAttributeCombinations, - this.disableBuyButton, - this.disableWishlistButton, - this.availableForPreOrder, - this.preOrderAvailabilityStartDateTimeUtc, - this.callForPrice, - this.price, - this.oldPrice, - this.productCost, - this.specialPrice, - this.specialPriceStartDateTimeUtc, - this.specialPriceEndDateTimeUtc, - this.customerEntersPrice, - this.minimumCustomerEnteredPrice, - this.maximumCustomerEnteredPrice, - this.basepriceEnabled, - this.basepriceAmount, - this.basepriceBaseAmount, - this.hasTierPrices, - this.hasDiscountsApplied, - this.discountName, - this.discountNamen, - this.discountDescription, - this.discountDescriptionn, - this.discountPercentage, - this.currency, - this.currencyn, - this.weight, - this.length, - this.width, - this.height, - this.availableStartDateTimeUtc, - this.availableEndDateTimeUtc, - this.displayOrder, - this.published, - this.deleted, - this.createdOnUtc, - this.updatedOnUtc, - this.productType, - this.parentGroupedProductId, - this.roleIds, - this.discountIds, - this.storeIds, - this.manufacturerIds, - this.reviews, - this.images, - this.attributes, - this.specifications, - this.associatedProductIds, - this.tags, - this.vendorId, - this.seName}); - - OfferProductsModel.fromJson(Map json) { - id = json['id']; - visibleIndividually = json['visible_individually']; - name = json['name']; - namen = json['namen']; - if (json['localized_names'] != null) { - localizedNames = new List(); - json['localized_names'].forEach((v) { - localizedNames.add(new LocalizedNames.fromJson(v)); - }); - } - shortDescription = json['short_description']; - shortDescriptionn = json['short_descriptionn']; - fullDescription = json['full_description']; - fullDescriptionn = json['full_descriptionn']; - markasNew = json['markas_new']; - showOnHomePage = json['show_on_home_page']; - metaKeywords = json['meta_keywords']; - metaDescription = json['meta_description']; - metaTitle = json['meta_title']; - allowCustomerReviews = json['allow_customer_reviews']; - approvedRatingSum = json['approved_rating_sum']; - notApprovedRatingSum = json['not_approved_rating_sum']; - approvedTotalReviews = json['approved_total_reviews']; - notApprovedTotalReviews = json['not_approved_total_reviews']; - sku = json['sku']; - isRx = json['is_rx']; - prescriptionRequired = json['prescription_required']; - rxMessage = json['rx_message']; - rxMessagen = json['rx_messagen']; - manufacturerPartNumber = json['manufacturer_part_number']; - gtin = json['gtin']; - isGiftCard = json['is_gift_card']; - requireOtherProducts = json['require_other_products']; - automaticallyAddRequiredProducts = - json['automatically_add_required_products']; - isDownload = json['is_download']; - unlimitedDownloads = json['unlimited_downloads']; - maxNumberOfDownloads = json['max_number_of_downloads']; - downloadExpirationDays = json['download_expiration_days']; - hasSampleDownload = json['has_sample_download']; - hasUserAgreement = json['has_user_agreement']; - isRecurring = json['is_recurring']; - recurringCycleLength = json['recurring_cycle_length']; - recurringTotalCycles = json['recurring_total_cycles']; - isRental = json['is_rental']; - rentalPriceLength = json['rental_price_length']; - isShipEnabled = json['is_ship_enabled']; - isFreeShipping = json['is_free_shipping']; - shipSeparately = json['ship_separately']; - additionalShippingCharge = json['additional_shipping_charge']; - isTaxExempt = json['is_tax_exempt']; - isTelecommunicationsOrBroadcastingOrElectronicServices = - json['is_telecommunications_or_broadcasting_or_electronic_services']; - useMultipleWarehouses = json['use_multiple_warehouses']; - manageInventoryMethodId = json['manage_inventory_method_id']; - stockQuantity = json['stock_quantity']; - stockAvailability = json['stock_availability']; - stockAvailabilityn = json['stock_availabilityn']; - displayStockAvailability = json['display_stock_availability']; - displayStockQuantity = json['display_stock_quantity']; - minStockQuantity = json['min_stock_quantity']; - notifyAdminForQuantityBelow = json['notify_admin_for_quantity_below']; - allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; - orderMinimumQuantity = json['order_minimum_quantity']; - orderMaximumQuantity = json['order_maximum_quantity']; - allowedQuantities = json['allowed_quantities']; - allowAddingOnlyExistingAttributeCombinations = - json['allow_adding_only_existing_attribute_combinations']; - disableBuyButton = json['disable_buy_button']; - disableWishlistButton = json['disable_wishlist_button']; - availableForPreOrder = json['available_for_pre_order']; - preOrderAvailabilityStartDateTimeUtc = - json['pre_order_availability_start_date_time_utc']; - callForPrice = json['call_for_price']; - price = json['price']; - oldPrice = json['old_price']; - productCost = json['product_cost']; - specialPrice = json['special_price']; - specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc']; - specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc']; - customerEntersPrice = json['customer_enters_price']; - minimumCustomerEnteredPrice = json['minimum_customer_entered_price']; - maximumCustomerEnteredPrice = json['maximum_customer_entered_price']; - basepriceEnabled = json['baseprice_enabled']; - basepriceAmount = json['baseprice_amount']; - basepriceBaseAmount = json['baseprice_base_amount']; - hasTierPrices = json['has_tier_prices']; - hasDiscountsApplied = json['has_discounts_applied']; - discountName = json['discount_name']; - discountNamen = json['discount_namen']; - discountDescription = json['discount_description']; - discountDescriptionn = json['discount_Descriptionn']; - discountPercentage = json['discount_percentage']; - currency = json['currency']; - currencyn = json['currencyn']; - weight = json['weight']; - length = json['length']; - width = json['width']; - height = json['height']; - availableStartDateTimeUtc = json['available_start_date_time_utc']; - availableEndDateTimeUtc = json['available_end_date_time_utc']; - displayOrder = json['display_order']; - published = json['published']; - deleted = json['deleted']; - createdOnUtc = json['created_on_utc']; - updatedOnUtc = json['updated_on_utc']; - productType = json['product_type']; - parentGroupedProductId = json['parent_grouped_product_id']; - - discountIds = json['discount_ids'].cast(); - - if (json['images'] != null) { - images = new List(); - json['images'].forEach((v) { - images.add(new Images.fromJson(v)); - }); - } - - vendorId = json['vendor_id']; - seName = json['se_name']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['visible_individually'] = this.visibleIndividually; - data['name'] = this.name; - data['namen'] = this.namen; - if (this.localizedNames != null) { - data['localized_names'] = - this.localizedNames.map((v) => v.toJson()).toList(); - } - data['short_description'] = this.shortDescription; - data['short_descriptionn'] = this.shortDescriptionn; - data['full_description'] = this.fullDescription; - data['full_descriptionn'] = this.fullDescriptionn; - data['markas_new'] = this.markasNew; - data['show_on_home_page'] = this.showOnHomePage; - data['meta_keywords'] = this.metaKeywords; - data['meta_description'] = this.metaDescription; - data['meta_title'] = this.metaTitle; - data['allow_customer_reviews'] = this.allowCustomerReviews; - data['approved_rating_sum'] = this.approvedRatingSum; - data['not_approved_rating_sum'] = this.notApprovedRatingSum; - data['approved_total_reviews'] = this.approvedTotalReviews; - data['not_approved_total_reviews'] = this.notApprovedTotalReviews; - data['sku'] = this.sku; - data['is_rx'] = this.isRx; - data['prescription_required'] = this.prescriptionRequired; - data['rx_message'] = this.rxMessage; - data['rx_messagen'] = this.rxMessagen; - data['manufacturer_part_number'] = this.manufacturerPartNumber; - data['gtin'] = this.gtin; - data['is_gift_card'] = this.isGiftCard; - data['require_other_products'] = this.requireOtherProducts; - data['automatically_add_required_products'] = - this.automaticallyAddRequiredProducts; - data['is_download'] = this.isDownload; - data['unlimited_downloads'] = this.unlimitedDownloads; - data['max_number_of_downloads'] = this.maxNumberOfDownloads; - data['download_expiration_days'] = this.downloadExpirationDays; - data['has_sample_download'] = this.hasSampleDownload; - data['has_user_agreement'] = this.hasUserAgreement; - data['is_recurring'] = this.isRecurring; - data['recurring_cycle_length'] = this.recurringCycleLength; - data['recurring_total_cycles'] = this.recurringTotalCycles; - data['is_rental'] = this.isRental; - data['rental_price_length'] = this.rentalPriceLength; - data['is_ship_enabled'] = this.isShipEnabled; - data['is_free_shipping'] = this.isFreeShipping; - data['ship_separately'] = this.shipSeparately; - data['additional_shipping_charge'] = this.additionalShippingCharge; - data['is_tax_exempt'] = this.isTaxExempt; - data['is_telecommunications_or_broadcasting_or_electronic_services'] = - this.isTelecommunicationsOrBroadcastingOrElectronicServices; - data['use_multiple_warehouses'] = this.useMultipleWarehouses; - data['manage_inventory_method_id'] = this.manageInventoryMethodId; - data['stock_quantity'] = this.stockQuantity; - data['stock_availability'] = this.stockAvailability; - data['stock_availabilityn'] = this.stockAvailabilityn; - data['display_stock_availability'] = this.displayStockAvailability; - data['display_stock_quantity'] = this.displayStockQuantity; - data['min_stock_quantity'] = this.minStockQuantity; - data['notify_admin_for_quantity_below'] = this.notifyAdminForQuantityBelow; - data['allow_back_in_stock_subscriptions'] = - this.allowBackInStockSubscriptions; - data['order_minimum_quantity'] = this.orderMinimumQuantity; - data['order_maximum_quantity'] = this.orderMaximumQuantity; - data['allowed_quantities'] = this.allowedQuantities; - data['allow_adding_only_existing_attribute_combinations'] = - this.allowAddingOnlyExistingAttributeCombinations; - data['disable_buy_button'] = this.disableBuyButton; - data['disable_wishlist_button'] = this.disableWishlistButton; - data['available_for_pre_order'] = this.availableForPreOrder; - data['pre_order_availability_start_date_time_utc'] = - this.preOrderAvailabilityStartDateTimeUtc; - data['call_for_price'] = this.callForPrice; - data['price'] = this.price; - data['old_price'] = this.oldPrice; - data['product_cost'] = this.productCost; - data['special_price'] = this.specialPrice; - data['special_price_start_date_time_utc'] = - this.specialPriceStartDateTimeUtc; - data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc; - data['customer_enters_price'] = this.customerEntersPrice; - data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice; - data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice; - data['baseprice_enabled'] = this.basepriceEnabled; - data['baseprice_amount'] = this.basepriceAmount; - data['baseprice_base_amount'] = this.basepriceBaseAmount; - data['has_tier_prices'] = this.hasTierPrices; - data['has_discounts_applied'] = this.hasDiscountsApplied; - data['discount_name'] = this.discountName; - data['discount_namen'] = this.discountNamen; - data['discount_description'] = this.discountDescription; - data['discount_Descriptionn'] = this.discountDescriptionn; - data['discount_percentage'] = this.discountPercentage; - data['currency'] = this.currency; - data['currencyn'] = this.currencyn; - data['weight'] = this.weight; - data['length'] = this.length; - data['width'] = this.width; - data['height'] = this.height; - data['available_start_date_time_utc'] = this.availableStartDateTimeUtc; - data['available_end_date_time_utc'] = this.availableEndDateTimeUtc; - data['display_order'] = this.displayOrder; - data['published'] = this.published; - data['deleted'] = this.deleted; - data['created_on_utc'] = this.createdOnUtc; - data['updated_on_utc'] = this.updatedOnUtc; - data['product_type'] = this.productType; - data['parent_grouped_product_id'] = this.parentGroupedProductId; - if (this.roleIds != null) { - data['role_ids'] = this.roleIds.map((v) => v.toJson()).toList(); - } - data['discount_ids'] = this.discountIds; - if (this.storeIds != null) { - data['store_ids'] = this.storeIds.map((v) => v.toJson()).toList(); - } - if (this.manufacturerIds != null) { - data['manufacturer_ids'] = - this.manufacturerIds.map((v) => v.toJson()).toList(); - } - if (this.reviews != null) { - data['reviews'] = this.reviews.map((v) => v.toJson()).toList(); - } - if (this.images != null) { - data['images'] = this.images.map((v) => v.toJson()).toList(); - } - if (this.attributes != null) { - data['attributes'] = this.attributes.map((v) => v.toJson()).toList(); - } - if (this.specifications != null) { - data['specifications'] = - this.specifications.map((v) => v.toJson()).toList(); - } - if (this.associatedProductIds != null) { - data['associated_product_ids'] = - this.associatedProductIds.map((v) => v.toJson()).toList(); - } - if (this.tags != null) { - data['tags'] = this.tags.map((v) => v.toJson()).toList(); - } - data['vendor_id'] = this.vendorId; - data['se_name'] = this.seName; - return data; - } -} - -class LocalizedNames { - int languageId; - String localizedName; - - LocalizedNames({this.languageId, this.localizedName}); - - LocalizedNames.fromJson(Map json) { - languageId = json['language_id']; - localizedName = json['localized_name']; - } - - Map toJson() { - final Map data = new Map(); - data['language_id'] = this.languageId; - data['localized_name'] = this.localizedName; - return data; - } -} - -class Images { - int id; - int position; - String src; - String thumb; - String attachment; - - Images({this.id, this.position, this.src, this.thumb, this.attachment}); - - Images.fromJson(Map json) { - id = json['id']; - position = json['position']; - src = json['src']; - thumb = json['thumb']; - attachment = json['attachment']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['position'] = this.position; - data['src'] = this.src; - data['thumb'] = this.thumb; - data['attachment'] = this.attachment; - return data; - } -} - -class Specifications { - int id; - int displayOrder; - String defaultValue; - String defaultValuen; - String name; - String nameN; - - Specifications( - {this.id, - this.displayOrder, - this.defaultValue, - this.defaultValuen, - this.name, - this.nameN}); - - Specifications.fromJson(Map json) { - id = json['id']; - displayOrder = json['display_order']; - defaultValue = json['default_value']; - defaultValuen = json['default_valuen']; - name = json['name']; - nameN = json['nameN']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['display_order'] = this.displayOrder; - data['default_value'] = this.defaultValue; - data['default_valuen'] = this.defaultValuen; - data['name'] = this.name; - data['nameN'] = this.nameN; - return data; - } -} diff --git a/lib/core/model/pharmacy/offers_model.dart b/lib/core/model/pharmacy/offers_model.dart deleted file mode 100644 index 3add1d3d..00000000 --- a/lib/core/model/pharmacy/offers_model.dart +++ /dev/null @@ -1,175 +0,0 @@ -class OffersModel { - String id; - String name; - String namen; - List localizedNames; - Null description; - int categoryTemplateId; - String metaKeywords; - String metaDescription; - String metaTitle; - int parentCategoryId; - int pageSize; - String pageSizeOptions; - Null priceRanges; - bool showOnHomePage; - bool includeInTopMenu; - Null hasDiscountsApplied; - bool published; - bool deleted; - int displayOrder; - String createdOnUtc; - String updatedOnUtc; - List roleIds; - List discountIds; - List storeIds; - Image image; - String seName; - bool isLeaf; - - OffersModel( - {this.id, - this.name, - this.namen, - this.localizedNames, - this.description, - this.categoryTemplateId, - this.metaKeywords, - this.metaDescription, - this.metaTitle, - this.parentCategoryId, - this.pageSize, - this.pageSizeOptions, - this.priceRanges, - this.showOnHomePage, - this.includeInTopMenu, - this.hasDiscountsApplied, - this.published, - this.deleted, - this.displayOrder, - this.createdOnUtc, - this.updatedOnUtc, - this.roleIds, - this.discountIds, - this.storeIds, - this.image, - this.seName, - this.isLeaf}); - - OffersModel.fromJson(Map json) { - id = json['id']; - name = json['name']; - namen = json['namen']; - if (json['localized_names'] != null) { - localizedNames = new List(); - json['localized_names'].forEach((v) { - localizedNames.add(new LocalizedNames.fromJson(v)); - }); - } - description = json['description']; - categoryTemplateId = json['category_template_id']; - metaKeywords = json['meta_keywords']; - metaDescription = json['meta_description']; - metaTitle = json['meta_title']; - parentCategoryId = json['parent_category_id']; - pageSize = json['page_size']; - pageSizeOptions = json['page_size_options']; - priceRanges = json['price_ranges']; - showOnHomePage = json['show_on_home_page']; - includeInTopMenu = json['include_in_top_menu']; - hasDiscountsApplied = json['has_discounts_applied']; - published = json['published']; - deleted = json['deleted']; - displayOrder = json['display_order']; - createdOnUtc = json['created_on_utc']; - updatedOnUtc = json['updated_on_utc']; - - image = json['image'] != null ? new Image.fromJson(json['image']) : null; - seName = json['se_name']; - isLeaf = json['is_leaf']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; - data['namen'] = this.namen; - if (this.localizedNames != null) { - data['localized_names'] = - this.localizedNames.map((v) => v.toJson()).toList(); - } - data['description'] = this.description; - data['category_template_id'] = this.categoryTemplateId; - data['meta_keywords'] = this.metaKeywords; - data['meta_description'] = this.metaDescription; - data['meta_title'] = this.metaTitle; - data['parent_category_id'] = this.parentCategoryId; - data['page_size'] = this.pageSize; - data['page_size_options'] = this.pageSizeOptions; - data['price_ranges'] = this.priceRanges; - data['show_on_home_page'] = this.showOnHomePage; - data['include_in_top_menu'] = this.includeInTopMenu; - data['has_discounts_applied'] = this.hasDiscountsApplied; - data['published'] = this.published; - data['deleted'] = this.deleted; - data['display_order'] = this.displayOrder; - data['created_on_utc'] = this.createdOnUtc; - data['updated_on_utc'] = this.updatedOnUtc; - if (this.roleIds != null) { - data['role_ids'] = this.roleIds.map((v) => v.toJson()).toList(); - } - if (this.discountIds != null) { - data['discount_ids'] = this.discountIds.map((v) => v.toJson()).toList(); - } - if (this.storeIds != null) { - data['store_ids'] = this.storeIds.map((v) => v.toJson()).toList(); - } - if (this.image != null) { - data['image'] = this.image.toJson(); - } - data['se_name'] = this.seName; - data['is_leaf'] = this.isLeaf; - return data; - } -} - -class LocalizedNames { - int languageId; - String localizedName; - - LocalizedNames({this.languageId, this.localizedName}); - - LocalizedNames.fromJson(Map json) { - languageId = json['language_id']; - localizedName = json['localized_name']; - } - - Map toJson() { - final Map data = new Map(); - data['language_id'] = this.languageId; - data['localized_name'] = this.localizedName; - return data; - } -} - -class Image { - String src; - Null thumb; - Null attachment; - - Image({this.src, this.thumb, this.attachment}); - - Image.fromJson(Map json) { - src = json['src']; - thumb = json['thumb']; - attachment = json['attachment']; - } - - Map toJson() { - final Map data = new Map(); - data['src'] = this.src; - data['thumb'] = this.thumb; - data['attachment'] = this.attachment; - return data; - } -} diff --git a/lib/core/model/pharmacy/parent_products_model.dart b/lib/core/model/pharmacy/parent_products_model.dart deleted file mode 100644 index e962c290..00000000 --- a/lib/core/model/pharmacy/parent_products_model.dart +++ /dev/null @@ -1,566 +0,0 @@ -class ParentProductsModel { - dynamic id; - dynamic visibleIndividually; - dynamic name; - dynamic namen; - List localizedNames; - dynamic shortDescription; - dynamic shortDescriptionn; - dynamic fullDescription; - dynamic fullDescriptionn; - dynamic markasNew; - dynamic showOnHomePage; - dynamic metaKeywords; - dynamic metaDescription; - dynamic metaTitle; - dynamic allowCustomerReviews; - dynamic approvedRatingSum; - dynamic notApprovedRatingSum; - dynamic approvedTotalReviews; - dynamic notApprovedTotalReviews; - dynamic sku; - dynamic isRx; - dynamic prescriptionRequired; - dynamic rxMessage; - dynamic rxMessagen; - dynamic manufacturerPartNumber; - dynamic gtin; - dynamic isGiftCard; - dynamic requireOtherProducts; - dynamic automaticallyAddRequiredProducts; - dynamic isDownload; - dynamic unlimitedDownloads; - dynamic maxNumberOfDownloads; - dynamic downloadExpirationDays; - dynamic hasSampleDownload; - dynamic hasUserAgreement; - dynamic isRecurring; - dynamic recurringCycleLength; - dynamic recurringTotalCycles; - dynamic isRental; - dynamic rentalPriceLength; - dynamic isShipEnabled; - dynamic isFreeShipping; - dynamic shipSeparately; - dynamic additionalShippingCharge; - dynamic isTaxExempt; - dynamic isTelecommunicationsOrBroadcastingOrElectronicServices; - dynamic useMultipleWarehouses; - dynamic manageInventoryMethodId; - dynamic stockQuantity; - dynamic stockAvailability; - dynamic stockAvailabilityn; - dynamic displayStockAvailability; - dynamic displayStockQuantity; - dynamic minStockQuantity; - dynamic notifyAdminForQuantityBelow; - dynamic allowBackInStockSubscriptions; - dynamic orderMinimumQuantity; - dynamic orderMaximumQuantity; - dynamic allowedQuantities; - dynamic allowAddingOnlyExistingAttributeCombinations; - dynamic disableBuyButton; - dynamic disableWishlistButton; - dynamic availableForPreOrder; - dynamic preOrderAvailabilityStartDateTimeUtc; - dynamic callForPrice; - dynamic price; - dynamic oldPrice; - dynamic productCost; - dynamic specialPrice; - dynamic specialPriceStartDateTimeUtc; - dynamic specialPriceEndDateTimeUtc; - dynamic customerEntersPrice; - dynamic minimumCustomerEnteredPrice; - dynamic maximumCustomerEnteredPrice; - dynamic basepriceEnabled; - dynamic basepriceAmount; - dynamic basepriceBaseAmount; - dynamic hasTierPrices; - dynamic hasDiscountsApplied; - dynamic discountName; - dynamic discountNamen; - dynamic discountDescription; - dynamic discountDescriptionn; - dynamic discountPercentage; - dynamic currency; - dynamic currencyn; - dynamic weight; - dynamic length; - dynamic width; - dynamic height; - dynamic availableStartDateTimeUtc; - dynamic availableEndDateTimeUtc; - dynamic displayOrder; - dynamic published; - dynamic deleted; - dynamic createdOnUtc; - dynamic updatedOnUtc; - dynamic productType; - dynamic parentGroupedProductId; - List roleIds; - List discountIds; - List storeIds; - List manufacturerIds; - List reviews; - List images; - List attributes; - List specifications; - List associatedProductIds; - List tags; - dynamic vendorId; - String seName; - - ParentProductsModel( - {this.id, - this.visibleIndividually, - this.name, - this.namen, - this.localizedNames, - this.shortDescription, - this.shortDescriptionn, - this.fullDescription, - this.fullDescriptionn, - this.markasNew, - this.showOnHomePage, - this.metaKeywords, - this.metaDescription, - this.metaTitle, - this.allowCustomerReviews, - this.approvedRatingSum, - this.notApprovedRatingSum, - this.approvedTotalReviews, - this.notApprovedTotalReviews, - this.sku, - this.isRx, - this.prescriptionRequired, - this.rxMessage, - this.rxMessagen, - this.manufacturerPartNumber, - this.gtin, - this.isGiftCard, - this.requireOtherProducts, - this.automaticallyAddRequiredProducts, - this.isDownload, - this.unlimitedDownloads, - this.maxNumberOfDownloads, - this.downloadExpirationDays, - this.hasSampleDownload, - this.hasUserAgreement, - this.isRecurring, - this.recurringCycleLength, - this.recurringTotalCycles, - this.isRental, - this.rentalPriceLength, - this.isShipEnabled, - this.isFreeShipping, - this.shipSeparately, - this.additionalShippingCharge, - this.isTaxExempt, - this.isTelecommunicationsOrBroadcastingOrElectronicServices, - this.useMultipleWarehouses, - this.manageInventoryMethodId, - this.stockQuantity, - this.stockAvailability, - this.stockAvailabilityn, - this.displayStockAvailability, - this.displayStockQuantity, - this.minStockQuantity, - this.notifyAdminForQuantityBelow, - this.allowBackInStockSubscriptions, - this.orderMinimumQuantity, - this.orderMaximumQuantity, - this.allowedQuantities, - this.allowAddingOnlyExistingAttributeCombinations, - this.disableBuyButton, - this.disableWishlistButton, - this.availableForPreOrder, - this.preOrderAvailabilityStartDateTimeUtc, - this.callForPrice, - this.price, - this.oldPrice, - this.productCost, - this.specialPrice, - this.specialPriceStartDateTimeUtc, - this.specialPriceEndDateTimeUtc, - this.customerEntersPrice, - this.minimumCustomerEnteredPrice, - this.maximumCustomerEnteredPrice, - this.basepriceEnabled, - this.basepriceAmount, - this.basepriceBaseAmount, - this.hasTierPrices, - this.hasDiscountsApplied, - this.discountName, - this.discountNamen, - this.discountDescription, - this.discountDescriptionn, - this.discountPercentage, - this.currency, - this.currencyn, - this.weight, - this.length, - this.width, - this.height, - this.availableStartDateTimeUtc, - this.availableEndDateTimeUtc, - this.displayOrder, - this.published, - this.deleted, - this.createdOnUtc, - this.updatedOnUtc, - this.productType, - this.parentGroupedProductId, - this.roleIds, - this.discountIds, - this.storeIds, - this.manufacturerIds, - this.reviews, - this.images, - this.attributes, - this.specifications, - this.associatedProductIds, - this.tags, - this.vendorId, - this.seName}); - - ParentProductsModel.fromJson(Map json) { - id = json['id']; - visibleIndividually = json['visible_individually']; - name = json['name']; - if (json['images'] != null) { - images = new List(); - json['images'].forEach((v) { - images.add(new Images.fromJson(v)); - }); - } - namen = json['namen']; - if (json['localized_names'] != null) { - localizedNames = new List(); - json['localized_names'].forEach((v) { - localizedNames.add(new LocalizedNames.fromJson(v)); - }); - } - shortDescription = json['short_description']; - shortDescriptionn = json['short_descriptionn']; - fullDescription = json['full_description']; - fullDescriptionn = json['full_descriptionn']; - markasNew = json['markas_new']; - showOnHomePage = json['show_on_home_page']; - metaKeywords = json['meta_keywords']; - metaDescription = json['meta_description']; - metaTitle = json['meta_title']; - allowCustomerReviews = json['allow_customer_reviews']; - approvedRatingSum = json['approved_rating_sum']; - notApprovedRatingSum = json['not_approved_rating_sum']; - approvedTotalReviews = json['approved_total_reviews']; - notApprovedTotalReviews = json['not_approved_total_reviews']; - sku = json['sku']; - isRx = json['is_rx']; - prescriptionRequired = json['prescription_required']; - rxMessage = json['rx_message']; - rxMessagen = json['rx_messagen']; - manufacturerPartNumber = json['manufacturer_part_number']; - gtin = json['gtin']; - isGiftCard = json['is_gift_card']; - requireOtherProducts = json['require_other_products']; - automaticallyAddRequiredProducts = - json['automatically_add_required_products']; - isDownload = json['is_download']; - unlimitedDownloads = json['unlimited_downloads']; - maxNumberOfDownloads = json['max_number_of_downloads']; - downloadExpirationDays = json['download_expiration_days']; - hasSampleDownload = json['has_sample_download']; - hasUserAgreement = json['has_user_agreement']; - isRecurring = json['is_recurring']; - recurringCycleLength = json['recurring_cycle_length']; - recurringTotalCycles = json['recurring_total_cycles']; - isRental = json['is_rental']; - rentalPriceLength = json['rental_price_length']; - isShipEnabled = json['is_ship_enabled']; - isFreeShipping = json['is_free_shipping']; - shipSeparately = json['ship_separately']; - additionalShippingCharge = json['additional_shipping_charge']; - isTaxExempt = json['is_tax_exempt']; - isTelecommunicationsOrBroadcastingOrElectronicServices = - json['is_telecommunications_or_broadcasting_or_electronic_services']; - useMultipleWarehouses = json['use_multiple_warehouses']; - manageInventoryMethodId = json['manage_inventory_method_id']; - stockQuantity = json['stock_quantity']; - stockAvailability = json['stock_availability']; - stockAvailabilityn = json['stock_availabilityn']; - displayStockAvailability = json['display_stock_availability']; - displayStockQuantity = json['display_stock_quantity']; - minStockQuantity = json['min_stock_quantity']; - notifyAdminForQuantityBelow = json['notify_admin_for_quantity_below']; - allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; - orderMinimumQuantity = json['order_minimum_quantity']; - orderMaximumQuantity = json['order_maximum_quantity']; - allowedQuantities = json['allowed_quantities']; - allowAddingOnlyExistingAttributeCombinations = - json['allow_adding_only_existing_attribute_combinations']; - disableBuyButton = json['disable_buy_button']; - disableWishlistButton = json['disable_wishlist_button']; - availableForPreOrder = json['available_for_pre_order']; - preOrderAvailabilityStartDateTimeUtc = - json['pre_order_availability_start_date_time_utc']; - callForPrice = json['call_for_price']; - price = json['price']; - oldPrice = json['old_price']; - productCost = json['product_cost']; - specialPrice = json['special_price']; - specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc']; - specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc']; - customerEntersPrice = json['customer_enters_price']; - minimumCustomerEnteredPrice = json['minimum_customer_entered_price']; - maximumCustomerEnteredPrice = json['maximum_customer_entered_price']; - basepriceEnabled = json['baseprice_enabled']; - basepriceAmount = json['baseprice_amount']; - basepriceBaseAmount = json['baseprice_base_amount']; - hasTierPrices = json['has_tier_prices']; - hasDiscountsApplied = json['has_discounts_applied']; - discountName = json['discount_name']; - discountNamen = json['discount_namen']; - discountDescription = json['discount_description']; - discountDescriptionn = json['discount_Descriptionn']; - discountPercentage = json['discount_percentage']; - currency = json['currency']; - currencyn = json['currencyn']; - weight = json['weight']; - length = json['length']; - width = json['width']; - height = json['height']; - availableStartDateTimeUtc = json['available_start_date_time_utc']; - availableEndDateTimeUtc = json['available_end_date_time_utc']; - displayOrder = json['display_order']; - published = json['published']; - deleted = json['deleted']; - createdOnUtc = json['created_on_utc']; - updatedOnUtc = json['updated_on_utc']; - productType = json['product_type']; - parentGroupedProductId = json['parent_grouped_product_id']; - - manufacturerIds = json['manufacturer_ids'].cast(); - - if (json['specifications'] != null) { - specifications = new List(); - json['specifications'].forEach((v) { - specifications.add(new Specifications.fromJson(v)); - }); - } - - vendorId = json['vendor_id']; - seName = json['se_name']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['visible_individually'] = this.visibleIndividually; - data['name'] = this.name; - data['namen'] = this.namen; - if (this.localizedNames != null) { - data['localized_names'] = - this.localizedNames.map((v) => v.toJson()).toList(); - } - data['short_description'] = this.shortDescription; - data['short_descriptionn'] = this.shortDescriptionn; - data['full_description'] = this.fullDescription; - data['full_descriptionn'] = this.fullDescriptionn; - data['markas_new'] = this.markasNew; - data['show_on_home_page'] = this.showOnHomePage; - data['meta_keywords'] = this.metaKeywords; - data['meta_description'] = this.metaDescription; - data['meta_title'] = this.metaTitle; - data['allow_customer_reviews'] = this.allowCustomerReviews; - data['approved_rating_sum'] = this.approvedRatingSum; - data['not_approved_rating_sum'] = this.notApprovedRatingSum; - data['approved_total_reviews'] = this.approvedTotalReviews; - data['not_approved_total_reviews'] = this.notApprovedTotalReviews; - data['sku'] = this.sku; - data['is_rx'] = this.isRx; - data['prescription_required'] = this.prescriptionRequired; - data['rx_message'] = this.rxMessage; - data['rx_messagen'] = this.rxMessagen; - data['manufacturer_part_number'] = this.manufacturerPartNumber; - data['gtin'] = this.gtin; - data['is_gift_card'] = this.isGiftCard; - data['require_other_products'] = this.requireOtherProducts; - data['automatically_add_required_products'] = - this.automaticallyAddRequiredProducts; - data['is_download'] = this.isDownload; - data['unlimited_downloads'] = this.unlimitedDownloads; - data['max_number_of_downloads'] = this.maxNumberOfDownloads; - data['download_expiration_days'] = this.downloadExpirationDays; - data['has_sample_download'] = this.hasSampleDownload; - data['has_user_agreement'] = this.hasUserAgreement; - data['is_recurring'] = this.isRecurring; - data['recurring_cycle_length'] = this.recurringCycleLength; - data['recurring_total_cycles'] = this.recurringTotalCycles; - data['is_rental'] = this.isRental; - data['rental_price_length'] = this.rentalPriceLength; - data['is_ship_enabled'] = this.isShipEnabled; - data['is_free_shipping'] = this.isFreeShipping; - data['ship_separately'] = this.shipSeparately; - data['additional_shipping_charge'] = this.additionalShippingCharge; - data['is_tax_exempt'] = this.isTaxExempt; - data['is_telecommunications_or_broadcasting_or_electronic_services'] = - this.isTelecommunicationsOrBroadcastingOrElectronicServices; - data['use_multiple_warehouses'] = this.useMultipleWarehouses; - data['manage_inventory_method_id'] = this.manageInventoryMethodId; - data['stock_quantity'] = this.stockQuantity; - data['stock_availability'] = this.stockAvailability; - data['stock_availabilityn'] = this.stockAvailabilityn; - data['display_stock_availability'] = this.displayStockAvailability; - data['display_stock_quantity'] = this.displayStockQuantity; - data['min_stock_quantity'] = this.minStockQuantity; - data['notify_admin_for_quantity_below'] = this.notifyAdminForQuantityBelow; - data['allow_back_in_stock_subscriptions'] = - this.allowBackInStockSubscriptions; - data['order_minimum_quantity'] = this.orderMinimumQuantity; - data['order_maximum_quantity'] = this.orderMaximumQuantity; - data['allowed_quantities'] = this.allowedQuantities; - data['allow_adding_only_existing_attribute_combinations'] = - this.allowAddingOnlyExistingAttributeCombinations; - data['disable_buy_button'] = this.disableBuyButton; - data['disable_wishlist_button'] = this.disableWishlistButton; - data['available_for_pre_order'] = this.availableForPreOrder; - data['pre_order_availability_start_date_time_utc'] = - this.preOrderAvailabilityStartDateTimeUtc; - data['call_for_price'] = this.callForPrice; - data['price'] = this.price; - data['old_price'] = this.oldPrice; - data['product_cost'] = this.productCost; - data['special_price'] = this.specialPrice; - data['special_price_start_date_time_utc'] = - this.specialPriceStartDateTimeUtc; - data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc; - data['customer_enters_price'] = this.customerEntersPrice; - data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice; - data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice; - data['baseprice_enabled'] = this.basepriceEnabled; - data['baseprice_amount'] = this.basepriceAmount; - data['baseprice_base_amount'] = this.basepriceBaseAmount; - data['has_tier_prices'] = this.hasTierPrices; - data['has_discounts_applied'] = this.hasDiscountsApplied; - data['discount_name'] = this.discountName; - data['discount_namen'] = this.discountNamen; - data['discount_description'] = this.discountDescription; - data['discount_Descriptionn'] = this.discountDescriptionn; - data['discount_percentage'] = this.discountPercentage; - data['currency'] = this.currency; - data['currencyn'] = this.currencyn; - data['weight'] = this.weight; - data['length'] = this.length; - data['width'] = this.width; - data['height'] = this.height; - data['available_start_date_time_utc'] = this.availableStartDateTimeUtc; - data['available_end_date_time_utc'] = this.availableEndDateTimeUtc; - data['display_order'] = this.displayOrder; - data['published'] = this.published; - data['deleted'] = this.deleted; - data['created_on_utc'] = this.createdOnUtc; - data['updated_on_utc'] = this.updatedOnUtc; - data['product_type'] = this.productType; - data['parent_grouped_product_id'] = this.parentGroupedProductId; - - data['manufacturer_ids'] = this.manufacturerIds; - - if (this.images != null) { - data['images'] = this.images.map((v) => v.toJson()).toList(); - } - - if (this.specifications != null) { - data['specifications'] = - this.specifications.map((v) => v.toJson()).toList(); - } - - data['vendor_id'] = this.vendorId; - data['se_name'] = this.seName; - return data; - } -} - -class LocalizedNames { - int languageId; - String localizedName; - - LocalizedNames({this.languageId, this.localizedName}); - - LocalizedNames.fromJson(Map json) { - languageId = json['language_id']; - localizedName = json['localized_name']; - } - - Map toJson() { - final Map data = new Map(); - data['language_id'] = this.languageId; - data['localized_name'] = this.localizedName; - return data; - } -} - -class Images { - int id; - int position; - String src; - String thumb; - String attachment; - - Images({this.id, this.position, this.src, this.thumb, this.attachment}); - - Images.fromJson(Map json) { - id = json['id']; - position = json['position']; - src = json['src']; - thumb = json['thumb']; - attachment = json['attachment']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['position'] = this.position; - data['src'] = this.src; - data['thumb'] = this.thumb; - data['attachment'] = this.attachment; - return data; - } -} - -class Specifications { - int id; - int displayOrder; - String defaultValue; - String defaultValuen; - String name; - String nameN; - - Specifications( - {this.id, - this.displayOrder, - this.defaultValue, - this.defaultValuen, - this.name, - this.nameN}); - - Specifications.fromJson(Map json) { - id = json['id']; - displayOrder = json['display_order']; - defaultValue = json['default_value']; - defaultValuen = json['default_valuen']; - name = json['name']; - nameN = json['nameN']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['display_order'] = this.displayOrder; - data['default_value'] = this.defaultValue; - data['default_valuen'] = this.defaultValuen; - data['name'] = this.name; - data['nameN'] = this.nameN; - return data; - } -} diff --git a/lib/core/model/pharmacy/pharmacy_categorise.dart b/lib/core/model/pharmacy/pharmacy_categorise.dart deleted file mode 100644 index 33ac26f1..00000000 --- a/lib/core/model/pharmacy/pharmacy_categorise.dart +++ /dev/null @@ -1,103 +0,0 @@ -class PharmacyCategorise { - dynamic id; - String name; - dynamic namen; - List localizedNames; - dynamic description; - dynamic parentCategoryId; - dynamic displayOrder; - dynamic image; - dynamic isLeaf; - - PharmacyCategorise( - {this.id, - this.name, - this.namen, - this.localizedNames, - this.description, - this.parentCategoryId, - this.displayOrder, - this.image, - this.isLeaf}); - - PharmacyCategorise.fromJson(Map json) { - try { - id = json['id']; - name = json['name']; - namen = json['namen']; - if (json['localized_names'] != null) { - localizedNames = new List(); - json['localized_names'].forEach((v) { - localizedNames.add(new LocalizedNames.fromJson(v)); - }); - } - description = json['description']; - parentCategoryId = json['parent_category_id']; - displayOrder = json['display_order']; - image = json['image'] != null ? new Image.fromJson(json['image']) : null; - isLeaf = json['is_leaf']; - } catch (e) { - print(e); - } - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; - data['namen'] = this.namen; - if (this.localizedNames != null) { - data['localized_names'] = - this.localizedNames.map((v) => v.toJson()).toList(); - } - data['description'] = this.description; - data['parent_category_id'] = this.parentCategoryId; - data['display_order'] = this.displayOrder; - if (this.image != null) { - data['image'] = this.image.toJson(); - } - data['is_leaf'] = this.isLeaf; - return data; - } -} - -class LocalizedNames { - int languageId; - String localizedName; - - LocalizedNames({this.languageId, this.localizedName}); - - LocalizedNames.fromJson(Map json) { - languageId = json['language_id']; - localizedName = json['localized_name']; - } - - Map toJson() { - final Map data = new Map(); - data['language_id'] = this.languageId; - data['localized_name'] = this.localizedName; - return data; - } -} - -class Image { - String src; - Null thumb; - Null attachment; - - Image({this.src, this.thumb, this.attachment}); - - Image.fromJson(Map json) { - src = json['src']; - thumb = json['thumb']; - attachment = json['attachment']; - } - - Map toJson() { - final Map data = new Map(); - data['src'] = this.src; - data['thumb'] = this.thumb; - data['attachment'] = this.attachment; - return data; - } -} diff --git a/lib/core/model/pharmacy/scan_qr_model.dart b/lib/core/model/pharmacy/scan_qr_model.dart deleted file mode 100644 index 71e25e8d..00000000 --- a/lib/core/model/pharmacy/scan_qr_model.dart +++ /dev/null @@ -1,584 +0,0 @@ -class ScanQrModel { - String id; - bool visibleIndividually; - String name; - String namen; - List localizedNames; - String shortDescription; - String shortDescriptionn; - String fullDescription; - String fullDescriptionn; - bool markasNew; - bool showOnHomePage; - dynamic metaKeywords; - dynamic metaDescription; - dynamic metaTitle; - bool allowCustomerReviews; - dynamic approvedRatingSum; - dynamic notApprovedRatingSum; - dynamic approvedTotalReviews; - dynamic notApprovedTotalReviews; - String sku; - bool isRx; - bool prescriptionRequired; - dynamic rxMessage; - dynamic rxMessagen; - dynamic manufacturerPartNumber; - dynamic gtin; - bool isGiftCard; - bool requireOtherProducts; - bool automaticallyAddRequiredProducts; - bool isDownload; - bool unlimitedDownloads; - dynamic maxNumberOfDownloads; - dynamic downloadExpirationDays; - bool hasSampleDownload; - bool hasUserAgreement; - bool isRecurring; - dynamic recurringCycleLength; - dynamic recurringTotalCycles; - bool isRental; - dynamic rentalPriceLength; - bool isShipEnabled; - bool isFreeShipping; - bool shipSeparately; - dynamic additionalShippingCharge; - bool isTaxExempt; - bool isTelecommunicationsOrBroadcastingOrElectronicServices; - bool useMultipleWarehouses; - dynamic manageInventoryMethodId; - dynamic stockQuantity; - String stockAvailability; - String stockAvailabilityn; - bool displayStockAvailability; - bool displayStockQuantity; - dynamic minStockQuantity; - dynamic notifyAdminForQuantityBelow; - bool allowBackInStockSubscriptions; - dynamic orderMinimumQuantity; - dynamic orderMaximumQuantity; - dynamic allowedQuantities; - bool allowAddingOnlyExistingAttributeCombinations; - bool disableBuyButton; - bool disableWishlistButton; - bool availableForPreOrder; - dynamic preOrderAvailabilityStartDateTimeUtc; - bool callForPrice; - dynamic price; - dynamic oldPrice; - dynamic productCost; - dynamic specialPrice; - dynamic specialPriceStartDateTimeUtc; - dynamic specialPriceEndDateTimeUtc; - bool customerEntersPrice; - dynamic minimumCustomerEnteredPrice; - dynamic maximumCustomerEnteredPrice; - bool basepriceEnabled; - dynamic basepriceAmount; - dynamic basepriceBaseAmount; - bool hasTierPrices; - bool hasDiscountsApplied; - dynamic discountName; - dynamic discountNamen; - dynamic discountDescription; - dynamic discountDescriptionn; - dynamic discountPercentage; - String currency; - String currencyn; - double weight; - dynamic length; - dynamic width; - dynamic height; - dynamic availableStartDateTimeUtc; - dynamic availableEndDateTimeUtc; - dynamic displayOrder; - bool published; - bool deleted; - String createdOnUtc; - String updatedOnUtc; - String productType; - dynamic parentGroupedProductId; - List roleIds; - List discountIds; - List storeIds; - List manufacturerIds; - List reviews; - List images; - List attributes; - List specifications; - List associatedProductIds; - List tags; - dynamic vendorId; - String seName; - - ScanQrModel( - {this.id, - this.visibleIndividually, - this.name, - this.namen, - this.localizedNames, - this.shortDescription, - this.shortDescriptionn, - this.fullDescription, - this.fullDescriptionn, - this.markasNew, - this.showOnHomePage, - this.metaKeywords, - this.metaDescription, - this.metaTitle, - this.allowCustomerReviews, - this.approvedRatingSum, - this.notApprovedRatingSum, - this.approvedTotalReviews, - this.notApprovedTotalReviews, - this.sku, - this.isRx, - this.prescriptionRequired, - this.rxMessage, - this.rxMessagen, - this.manufacturerPartNumber, - this.gtin, - this.isGiftCard, - this.requireOtherProducts, - this.automaticallyAddRequiredProducts, - this.isDownload, - this.unlimitedDownloads, - this.maxNumberOfDownloads, - this.downloadExpirationDays, - this.hasSampleDownload, - this.hasUserAgreement, - this.isRecurring, - this.recurringCycleLength, - this.recurringTotalCycles, - this.isRental, - this.rentalPriceLength, - this.isShipEnabled, - this.isFreeShipping, - this.shipSeparately, - this.additionalShippingCharge, - this.isTaxExempt, - this.isTelecommunicationsOrBroadcastingOrElectronicServices, - this.useMultipleWarehouses, - this.manageInventoryMethodId, - this.stockQuantity, - this.stockAvailability, - this.stockAvailabilityn, - this.displayStockAvailability, - this.displayStockQuantity, - this.minStockQuantity, - this.notifyAdminForQuantityBelow, - this.allowBackInStockSubscriptions, - this.orderMinimumQuantity, - this.orderMaximumQuantity, - this.allowedQuantities, - this.allowAddingOnlyExistingAttributeCombinations, - this.disableBuyButton, - this.disableWishlistButton, - this.availableForPreOrder, - this.preOrderAvailabilityStartDateTimeUtc, - this.callForPrice, - this.price, - this.oldPrice, - this.productCost, - this.specialPrice, - this.specialPriceStartDateTimeUtc, - this.specialPriceEndDateTimeUtc, - this.customerEntersPrice, - this.minimumCustomerEnteredPrice, - this.maximumCustomerEnteredPrice, - this.basepriceEnabled, - this.basepriceAmount, - this.basepriceBaseAmount, - this.hasTierPrices, - this.hasDiscountsApplied, - this.discountName, - this.discountNamen, - this.discountDescription, - this.discountDescriptionn, - this.discountPercentage, - this.currency, - this.currencyn, - this.weight, - this.length, - this.width, - this.height, - this.availableStartDateTimeUtc, - this.availableEndDateTimeUtc, - this.displayOrder, - this.published, - this.deleted, - this.createdOnUtc, - this.updatedOnUtc, - this.productType, - this.parentGroupedProductId, - this.roleIds, - this.discountIds, - this.storeIds, - this.manufacturerIds, - this.reviews, - this.images, - this.attributes, - this.specifications, - this.associatedProductIds, - this.tags, - this.vendorId, - this.seName}); - - ScanQrModel.fromJson(Map json) { - id = json['id']; - visibleIndividually = json['visible_individually']; - name = json['name']; - namen = json['namen']; - if (json['localized_names'] != null) { - localizedNames = new List(); - json['localized_names'].forEach((v) { - localizedNames.add(new LocalizedNames.fromJson(v)); - }); - } - shortDescription = json['short_description']; - shortDescriptionn = json['short_descriptionn']; - fullDescription = json['full_description']; - fullDescriptionn = json['full_descriptionn']; - markasNew = json['markas_new']; - showOnHomePage = json['show_on_home_page']; - metaKeywords = json['meta_keywords']; - metaDescription = json['meta_description']; - metaTitle = json['meta_title']; - allowCustomerReviews = json['allow_customer_reviews']; - approvedRatingSum = json['approved_rating_sum']; - notApprovedRatingSum = json['not_approved_rating_sum']; - approvedTotalReviews = json['approved_total_reviews']; - notApprovedTotalReviews = json['not_approved_total_reviews']; - sku = json['sku']; - isRx = json['is_rx']; - prescriptionRequired = json['prescription_required']; - rxMessage = json['rx_message']; - rxMessagen = json['rx_messagen']; - manufacturerPartNumber = json['manufacturer_part_number']; - gtin = json['gtin']; - isGiftCard = json['is_gift_card']; - requireOtherProducts = json['require_other_products']; - automaticallyAddRequiredProducts = - json['automatically_add_required_products']; - isDownload = json['is_download']; - unlimitedDownloads = json['unlimited_downloads']; - maxNumberOfDownloads = json['max_number_of_downloads']; - downloadExpirationDays = json['download_expiration_days']; - hasSampleDownload = json['has_sample_download']; - hasUserAgreement = json['has_user_agreement']; - isRecurring = json['is_recurring']; - recurringCycleLength = json['recurring_cycle_length']; - recurringTotalCycles = json['recurring_total_cycles']; - isRental = json['is_rental']; - rentalPriceLength = json['rental_price_length']; - isShipEnabled = json['is_ship_enabled']; - isFreeShipping = json['is_free_shipping']; - shipSeparately = json['ship_separately']; - additionalShippingCharge = json['additional_shipping_charge']; - isTaxExempt = json['is_tax_exempt']; - isTelecommunicationsOrBroadcastingOrElectronicServices = - json['is_telecommunications_or_broadcasting_or_electronic_services']; - useMultipleWarehouses = json['use_multiple_warehouses']; - manageInventoryMethodId = json['manage_inventory_method_id']; - stockQuantity = json['stock_quantity']; - stockAvailability = json['stock_availability']; - stockAvailabilityn = json['stock_availabilityn']; - displayStockAvailability = json['display_stock_availability']; - displayStockQuantity = json['display_stock_quantity']; - minStockQuantity = json['min_stock_quantity']; - notifyAdminForQuantityBelow = json['notify_admin_for_quantity_below']; - allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; - orderMinimumQuantity = json['order_minimum_quantity']; - orderMaximumQuantity = json['order_maximum_quantity']; - allowedQuantities = json['allowed_quantities']; - allowAddingOnlyExistingAttributeCombinations = - json['allow_adding_only_existing_attribute_combinations']; - disableBuyButton = json['disable_buy_button']; - disableWishlistButton = json['disable_wishlist_button']; - availableForPreOrder = json['available_for_pre_order']; - preOrderAvailabilityStartDateTimeUtc = - json['pre_order_availability_start_date_time_utc']; - callForPrice = json['call_for_price']; - price = json['price']; - oldPrice = json['old_price']; - productCost = json['product_cost']; - specialPrice = json['special_price']; - specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc']; - specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc']; - customerEntersPrice = json['customer_enters_price']; - minimumCustomerEnteredPrice = json['minimum_customer_entered_price']; - maximumCustomerEnteredPrice = json['maximum_customer_entered_price']; - basepriceEnabled = json['baseprice_enabled']; - basepriceAmount = json['baseprice_amount']; - basepriceBaseAmount = json['baseprice_base_amount']; - hasTierPrices = json['has_tier_prices']; - hasDiscountsApplied = json['has_discounts_applied']; - discountName = json['discount_name']; - discountNamen = json['discount_namen']; - discountDescription = json['discount_description']; - discountDescriptionn = json['discount_Descriptionn']; - discountPercentage = json['discount_percentage']; - currency = json['currency']; - currencyn = json['currencyn']; - weight = json['weight']; - length = json['length']; - width = json['width']; - height = json['height']; - availableStartDateTimeUtc = json['available_start_date_time_utc']; - availableEndDateTimeUtc = json['available_end_date_time_utc']; - displayOrder = json['display_order']; - published = json['published']; - deleted = json['deleted']; - createdOnUtc = json['created_on_utc']; - updatedOnUtc = json['updated_on_utc']; - productType = json['product_type']; - parentGroupedProductId = json['parent_grouped_product_id']; - if (json['role_ids'] != null) { - roleIds = new List(); - } - if (json['discount_ids'] != null) { - discountIds = new List(); - } - if (json['store_ids'] != null) { - storeIds = new List(); - } - manufacturerIds = json['manufacturer_ids'].cast(); - if (json['reviews'] != null) { - reviews = new List(); - } - if (json['images'] != null) { - images = new List(); - json['images'].forEach((v) { - images.add(new Images.fromJson(v)); - }); - } - if (json['attributes'] != null) { - attributes = new List(); - } - if (json['specifications'] != null) { - specifications = new List(); - json['specifications'].forEach((v) { - specifications.add(new Specifications.fromJson(v)); - }); - } - if (json['associated_product_ids'] != null) { - associatedProductIds = new List(); - } - if (json['tags'] != null) { - tags = new List(); - } - vendorId = json['vendor_id']; - seName = json['se_name']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['visible_individually'] = this.visibleIndividually; - data['name'] = this.name; - data['namen'] = this.namen; - if (this.localizedNames != null) { - data['localized_names'] = - this.localizedNames.map((v) => v.toJson()).toList(); - } - data['short_description'] = this.shortDescription; - data['short_descriptionn'] = this.shortDescriptionn; - data['full_description'] = this.fullDescription; - data['full_descriptionn'] = this.fullDescriptionn; - data['markas_new'] = this.markasNew; - data['show_on_home_page'] = this.showOnHomePage; - data['meta_keywords'] = this.metaKeywords; - data['meta_description'] = this.metaDescription; - data['meta_title'] = this.metaTitle; - data['allow_customer_reviews'] = this.allowCustomerReviews; - data['approved_rating_sum'] = this.approvedRatingSum; - data['not_approved_rating_sum'] = this.notApprovedRatingSum; - data['approved_total_reviews'] = this.approvedTotalReviews; - data['not_approved_total_reviews'] = this.notApprovedTotalReviews; - data['sku'] = this.sku; - data['is_rx'] = this.isRx; - data['prescription_required'] = this.prescriptionRequired; - data['rx_message'] = this.rxMessage; - data['rx_messagen'] = this.rxMessagen; - data['manufacturer_part_number'] = this.manufacturerPartNumber; - data['gtin'] = this.gtin; - data['is_gift_card'] = this.isGiftCard; - data['require_other_products'] = this.requireOtherProducts; - data['automatically_add_required_products'] = - this.automaticallyAddRequiredProducts; - data['is_download'] = this.isDownload; - data['unlimited_downloads'] = this.unlimitedDownloads; - data['max_number_of_downloads'] = this.maxNumberOfDownloads; - data['download_expiration_days'] = this.downloadExpirationDays; - data['has_sample_download'] = this.hasSampleDownload; - data['has_user_agreement'] = this.hasUserAgreement; - data['is_recurring'] = this.isRecurring; - data['recurring_cycle_length'] = this.recurringCycleLength; - data['recurring_total_cycles'] = this.recurringTotalCycles; - data['is_rental'] = this.isRental; - data['rental_price_length'] = this.rentalPriceLength; - data['is_ship_enabled'] = this.isShipEnabled; - data['is_free_shipping'] = this.isFreeShipping; - data['ship_separately'] = this.shipSeparately; - data['additional_shipping_charge'] = this.additionalShippingCharge; - data['is_tax_exempt'] = this.isTaxExempt; - data['is_telecommunications_or_broadcasting_or_electronic_services'] = - this.isTelecommunicationsOrBroadcastingOrElectronicServices; - data['use_multiple_warehouses'] = this.useMultipleWarehouses; - data['manage_inventory_method_id'] = this.manageInventoryMethodId; - data['stock_quantity'] = this.stockQuantity; - data['stock_availability'] = this.stockAvailability; - data['stock_availabilityn'] = this.stockAvailabilityn; - data['display_stock_availability'] = this.displayStockAvailability; - data['display_stock_quantity'] = this.displayStockQuantity; - data['min_stock_quantity'] = this.minStockQuantity; - data['notify_admin_for_quantity_below'] = this.notifyAdminForQuantityBelow; - data['allow_back_in_stock_subscriptions'] = - this.allowBackInStockSubscriptions; - data['order_minimum_quantity'] = this.orderMinimumQuantity; - data['order_maximum_quantity'] = this.orderMaximumQuantity; - data['allowed_quantities'] = this.allowedQuantities; - data['allow_adding_only_existing_attribute_combinations'] = - this.allowAddingOnlyExistingAttributeCombinations; - data['disable_buy_button'] = this.disableBuyButton; - data['disable_wishlist_button'] = this.disableWishlistButton; - data['available_for_pre_order'] = this.availableForPreOrder; - data['pre_order_availability_start_date_time_utc'] = - this.preOrderAvailabilityStartDateTimeUtc; - data['call_for_price'] = this.callForPrice; - data['price'] = this.price; - data['old_price'] = this.oldPrice; - data['product_cost'] = this.productCost; - data['special_price'] = this.specialPrice; - data['special_price_start_date_time_utc'] = - this.specialPriceStartDateTimeUtc; - data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc; - data['customer_enters_price'] = this.customerEntersPrice; - data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice; - data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice; - data['baseprice_enabled'] = this.basepriceEnabled; - data['baseprice_amount'] = this.basepriceAmount; - data['baseprice_base_amount'] = this.basepriceBaseAmount; - data['has_tier_prices'] = this.hasTierPrices; - data['has_discounts_applied'] = this.hasDiscountsApplied; - data['discount_name'] = this.discountName; - data['discount_namen'] = this.discountNamen; - data['discount_description'] = this.discountDescription; - data['discount_Descriptionn'] = this.discountDescriptionn; - data['discount_percentage'] = this.discountPercentage; - data['currency'] = this.currency; - data['currencyn'] = this.currencyn; - data['weight'] = this.weight; - data['length'] = this.length; - data['width'] = this.width; - data['height'] = this.height; - data['available_start_date_time_utc'] = this.availableStartDateTimeUtc; - data['available_end_date_time_utc'] = this.availableEndDateTimeUtc; - data['display_order'] = this.displayOrder; - data['published'] = this.published; - data['deleted'] = this.deleted; - data['created_on_utc'] = this.createdOnUtc; - data['updated_on_utc'] = this.updatedOnUtc; - data['product_type'] = this.productType; - data['parent_grouped_product_id'] = this.parentGroupedProductId; - - data['manufacturer_ids'] = this.manufacturerIds; - - if (this.images != null) { - data['images'] = this.images.map((v) => v.toJson()).toList(); - } - - if (this.specifications != null) { - data['specifications'] = - this.specifications.map((v) => v.toJson()).toList(); - } - - data['vendor_id'] = this.vendorId; - data['se_name'] = this.seName; - return data; - } -} - -class LocalizedNames { - int languageId; - String localizedName; - - LocalizedNames({this.languageId, this.localizedName}); - - LocalizedNames.fromJson(Map json) { - languageId = json['language_id']; - localizedName = json['localized_name']; - } - - Map toJson() { - final Map data = new Map(); - data['language_id'] = this.languageId; - data['localized_name'] = this.localizedName; - return data; - } -} - -class Images { - int id; - int position; - String src; - String thumb; - String attachment; - - Images({this.id, this.position, this.src, this.thumb, this.attachment}); - - Images.fromJson(Map json) { - id = json['id']; - position = json['position']; - src = json['src']; - thumb = json['thumb']; - attachment = json['attachment']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['position'] = this.position; - data['src'] = this.src; - data['thumb'] = this.thumb; - data['attachment'] = this.attachment; - return data; - } -} - -class Specifications { - int id; - int displayOrder; - String defaultValue; - String defaultValuen; - String name; - String nameN; - - Specifications( - {this.id, - this.displayOrder, - this.defaultValue, - this.defaultValuen, - this.name, - this.nameN}); - - Specifications.fromJson(Map json) { - id = json['id']; - displayOrder = json['display_order']; - defaultValue = json['default_value']; - defaultValuen = json['default_valuen']; - name = json['name']; - nameN = json['nameN']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['display_order'] = this.displayOrder; - data['default_value'] = this.defaultValue; - data['default_valuen'] = this.defaultValuen; - data['name'] = this.name; - data['nameN'] = this.nameN; - return data; - } -} diff --git a/lib/core/model/pharmacy/sub_categories_model.dart b/lib/core/model/pharmacy/sub_categories_model.dart deleted file mode 100644 index 916ec023..00000000 --- a/lib/core/model/pharmacy/sub_categories_model.dart +++ /dev/null @@ -1,75 +0,0 @@ -class SubCategoriesModel { - String id; - String name; - String namen; - List localizedNames; - String description; - int parentCategoryId; - int displayOrder; - dynamic image; - bool isLeaf; - - SubCategoriesModel( - {this.id, - this.name, - this.namen, - this.localizedNames, - this.description, - this.parentCategoryId, - this.displayOrder, - this.image, - this.isLeaf}); - - SubCategoriesModel.fromJson(Map json) { - id = json['id']; - name = json['name']; - namen = json['namen']; - if (json['localized_names'] != null) { - localizedNames = new List(); - json['localized_names'].forEach((v) { - localizedNames.add(new LocalizedNames.fromJson(v)); - }); - } - description = json['description']; - parentCategoryId = json['parent_category_id']; - displayOrder = json['display_order']; - image = json['image']; - isLeaf = json['is_leaf']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; - data['namen'] = this.namen; - if (this.localizedNames != null) { - data['localized_names'] = - this.localizedNames.map((v) => v.toJson()).toList(); - } - data['description'] = this.description; - data['parent_category_id'] = this.parentCategoryId; - data['display_order'] = this.displayOrder; - data['image'] = this.image; - data['is_leaf'] = this.isLeaf; - return data; - } -} - -class LocalizedNames { - int languageId; - String localizedName; - - LocalizedNames({this.languageId, this.localizedName}); - - LocalizedNames.fromJson(Map json) { - languageId = json['language_id']; - localizedName = json['localized_name']; - } - - Map toJson() { - final Map data = new Map(); - data['language_id'] = this.languageId; - data['localized_name'] = this.localizedName; - return data; - } -} diff --git a/lib/core/model/pharmacy/sub_products_model.dart b/lib/core/model/pharmacy/sub_products_model.dart deleted file mode 100644 index 6e8964c9..00000000 --- a/lib/core/model/pharmacy/sub_products_model.dart +++ /dev/null @@ -1,562 +0,0 @@ -class SubProductsModel { - String id; - bool visibleIndividually; - String name; - String namen; - List localizedNames; - String shortDescription; - String shortDescriptionn; - String fullDescription; - String fullDescriptionn; - bool markasNew; - bool showOnHomePage; - dynamic metaKeywords; - dynamic metaDescription; - dynamic metaTitle; - bool allowCustomerReviews; - dynamic approvedRatingSum; - dynamic notApprovedRatingSum; - dynamic approvedTotalReviews; - dynamic notApprovedTotalReviews; - String sku; - bool isRx; - bool prescriptionRequired; - dynamic rxMessage; - dynamic rxMessagen; - dynamic manufacturerPartNumber; - dynamic gtin; - bool isGiftCard; - bool requireOtherProducts; - bool automaticallyAddRequiredProducts; - bool isDownload; - bool unlimitedDownloads; - dynamic maxNumberOfDownloads; - dynamic downloadExpirationDays; - bool hasSampleDownload; - bool hasUserAgreement; - bool isRecurring; - dynamic recurringCycleLength; - dynamic recurringTotalCycles; - bool isRental; - dynamic rentalPriceLength; - bool isShipEnabled; - bool isFreeShipping; - bool shipSeparately; - dynamic additionalShippingCharge; - bool isTaxExempt; - bool isTelecommunicationsOrBroadcastingOrElectronicServices; - bool useMultipleWarehouses; - dynamic manageInventoryMethodId; - dynamic stockQuantity; - String stockAvailability; - String stockAvailabilityn; - bool displayStockAvailability; - bool displayStockQuantity; - dynamic minStockQuantity; - dynamic notifyAdminForQuantityBelow; - bool allowBackInStockSubscriptions; - dynamic orderMinimumQuantity; - dynamic orderMaximumQuantity; - dynamic allowedQuantities; - bool allowAddingOnlyExistingAttributeCombinations; - bool disableBuyButton; - bool disableWishlistButton; - bool availableForPreOrder; - dynamic preOrderAvailabilityStartDateTimeUtc; - bool callForPrice; - dynamic price; - dynamic oldPrice; - dynamic productCost; - dynamic specialPrice; - dynamic specialPriceStartDateTimeUtc; - dynamic specialPriceEndDateTimeUtc; - bool customerEntersPrice; - dynamic minimumCustomerEnteredPrice; - dynamic maximumCustomerEnteredPrice; - bool basepriceEnabled; - dynamic basepriceAmount; - dynamic basepriceBaseAmount; - bool hasTierPrices; - bool hasDiscountsApplied; - dynamic discountName; - dynamic discountNamen; - dynamic discountDescription; - dynamic discountDescriptionn; - dynamic discountPercentage; - String currency; - String currencyn; - double weight; - dynamic length; - dynamic width; - dynamic height; - dynamic availableStartDateTimeUtc; - dynamic availableEndDateTimeUtc; - dynamic displayOrder; - bool published; - bool deleted; - String createdOnUtc; - String updatedOnUtc; - String productType; - dynamic parentGroupedProductId; - List roleIds; - List discountIds; - List storeIds; - List manufacturerIds; - List reviews; - List images; - List attributes; - List specifications; - List associatedProductIds; - List tags; - dynamic vendorId; - String seName; - - SubProductsModel( - {this.id, - this.visibleIndividually, - this.name, - this.namen, - this.localizedNames, - this.shortDescription, - this.shortDescriptionn, - this.fullDescription, - this.fullDescriptionn, - this.markasNew, - this.showOnHomePage, - this.metaKeywords, - this.metaDescription, - this.metaTitle, - this.allowCustomerReviews, - this.approvedRatingSum, - this.notApprovedRatingSum, - this.approvedTotalReviews, - this.notApprovedTotalReviews, - this.sku, - this.isRx, - this.prescriptionRequired, - this.rxMessage, - this.rxMessagen, - this.manufacturerPartNumber, - this.gtin, - this.isGiftCard, - this.requireOtherProducts, - this.automaticallyAddRequiredProducts, - this.isDownload, - this.unlimitedDownloads, - this.maxNumberOfDownloads, - this.downloadExpirationDays, - this.hasSampleDownload, - this.hasUserAgreement, - this.isRecurring, - this.recurringCycleLength, - this.recurringTotalCycles, - this.isRental, - this.rentalPriceLength, - this.isShipEnabled, - this.isFreeShipping, - this.shipSeparately, - this.additionalShippingCharge, - this.isTaxExempt, - this.isTelecommunicationsOrBroadcastingOrElectronicServices, - this.useMultipleWarehouses, - this.manageInventoryMethodId, - this.stockQuantity, - this.stockAvailability, - this.stockAvailabilityn, - this.displayStockAvailability, - this.displayStockQuantity, - this.minStockQuantity, - this.notifyAdminForQuantityBelow, - this.allowBackInStockSubscriptions, - this.orderMinimumQuantity, - this.orderMaximumQuantity, - this.allowedQuantities, - this.allowAddingOnlyExistingAttributeCombinations, - this.disableBuyButton, - this.disableWishlistButton, - this.availableForPreOrder, - this.preOrderAvailabilityStartDateTimeUtc, - this.callForPrice, - this.price, - this.oldPrice, - this.productCost, - this.specialPrice, - this.specialPriceStartDateTimeUtc, - this.specialPriceEndDateTimeUtc, - this.customerEntersPrice, - this.minimumCustomerEnteredPrice, - this.maximumCustomerEnteredPrice, - this.basepriceEnabled, - this.basepriceAmount, - this.basepriceBaseAmount, - this.hasTierPrices, - this.hasDiscountsApplied, - this.discountName, - this.discountNamen, - this.discountDescription, - this.discountDescriptionn, - this.discountPercentage, - this.currency, - this.currencyn, - this.weight, - this.length, - this.width, - this.height, - this.availableStartDateTimeUtc, - this.availableEndDateTimeUtc, - this.displayOrder, - this.published, - this.deleted, - this.createdOnUtc, - this.updatedOnUtc, - this.productType, - this.parentGroupedProductId, - this.roleIds, - this.discountIds, - this.storeIds, - this.manufacturerIds, - this.reviews, - this.images, - this.attributes, - this.specifications, - this.associatedProductIds, - this.tags, - this.vendorId, - this.seName}); - - SubProductsModel.fromJson(Map json) { - id = json['id']; - visibleIndividually = json['visible_individually']; - name = json['name']; - if (json['images'] != null) { - images = new List(); - json['images'].forEach((v) { - images.add(new Images.fromJson(v)); - }); - } - namen = json['namen']; - if (json['localized_names'] != null) { - localizedNames = new List(); - json['localized_names'].forEach((v) { - localizedNames.add(new LocalizedNames.fromJson(v)); - }); - } - shortDescription = json['short_description']; - shortDescriptionn = json['short_descriptionn']; - fullDescription = json['full_description']; - fullDescriptionn = json['full_descriptionn']; - markasNew = json['markas_new']; - showOnHomePage = json['show_on_home_page']; - metaKeywords = json['meta_keywords']; - metaDescription = json['meta_description']; - metaTitle = json['meta_title']; - allowCustomerReviews = json['allow_customer_reviews']; - approvedRatingSum = json['approved_rating_sum']; - notApprovedRatingSum = json['not_approved_rating_sum']; - approvedTotalReviews = json['approved_total_reviews']; - notApprovedTotalReviews = json['not_approved_total_reviews']; - sku = json['sku']; - isRx = json['is_rx']; - prescriptionRequired = json['prescription_required']; - rxMessage = json['rx_message']; - rxMessagen = json['rx_messagen']; - manufacturerPartNumber = json['manufacturer_part_number']; - gtin = json['gtin']; - isGiftCard = json['is_gift_card']; - requireOtherProducts = json['require_other_products']; - automaticallyAddRequiredProducts = - json['automatically_add_required_products']; - isDownload = json['is_download']; - unlimitedDownloads = json['unlimited_downloads']; - maxNumberOfDownloads = json['max_number_of_downloads']; - downloadExpirationDays = json['download_expiration_days']; - hasSampleDownload = json['has_sample_download']; - hasUserAgreement = json['has_user_agreement']; - isRecurring = json['is_recurring']; - recurringCycleLength = json['recurring_cycle_length']; - recurringTotalCycles = json['recurring_total_cycles']; - isRental = json['is_rental']; - rentalPriceLength = json['rental_price_length']; - isShipEnabled = json['is_ship_enabled']; - isFreeShipping = json['is_free_shipping']; - shipSeparately = json['ship_separately']; - additionalShippingCharge = json['additional_shipping_charge']; - isTaxExempt = json['is_tax_exempt']; - isTelecommunicationsOrBroadcastingOrElectronicServices = - json['is_telecommunications_or_broadcasting_or_electronic_services']; - useMultipleWarehouses = json['use_multiple_warehouses']; - manageInventoryMethodId = json['manage_inventory_method_id']; - stockQuantity = json['stock_quantity']; - stockAvailability = json['stock_availability']; - stockAvailabilityn = json['stock_availabilityn']; - displayStockAvailability = json['display_stock_availability']; - displayStockQuantity = json['display_stock_quantity']; - minStockQuantity = json['min_stock_quantity']; - notifyAdminForQuantityBelow = json['notify_admin_for_quantity_below']; - allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; - orderMinimumQuantity = json['order_minimum_quantity']; - orderMaximumQuantity = json['order_maximum_quantity']; - allowedQuantities = json['allowed_quantities']; - allowAddingOnlyExistingAttributeCombinations = - json['allow_adding_only_existing_attribute_combinations']; - disableBuyButton = json['disable_buy_button']; - disableWishlistButton = json['disable_wishlist_button']; - availableForPreOrder = json['available_for_pre_order']; - preOrderAvailabilityStartDateTimeUtc = - json['pre_order_availability_start_date_time_utc']; - callForPrice = json['call_for_price']; - price = json['price']; - oldPrice = json['old_price']; - productCost = json['product_cost']; - specialPrice = json['special_price']; - specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc']; - specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc']; - customerEntersPrice = json['customer_enters_price']; - minimumCustomerEnteredPrice = json['minimum_customer_entered_price']; - maximumCustomerEnteredPrice = json['maximum_customer_entered_price']; - basepriceEnabled = json['baseprice_enabled']; - basepriceAmount = json['baseprice_amount']; - basepriceBaseAmount = json['baseprice_base_amount']; - hasTierPrices = json['has_tier_prices']; - hasDiscountsApplied = json['has_discounts_applied']; - discountName = json['discount_name']; - discountNamen = json['discount_namen']; - discountDescription = json['discount_description']; - discountDescriptionn = json['discount_Descriptionn']; - discountPercentage = json['discount_percentage']; - currency = json['currency']; - currencyn = json['currencyn']; - weight = json['weight']; - length = json['length']; - width = json['width']; - height = json['height']; - availableStartDateTimeUtc = json['available_start_date_time_utc']; - availableEndDateTimeUtc = json['available_end_date_time_utc']; - displayOrder = json['display_order']; - published = json['published']; - deleted = json['deleted']; - createdOnUtc = json['created_on_utc']; - updatedOnUtc = json['updated_on_utc']; - productType = json['product_type']; - parentGroupedProductId = json['parent_grouped_product_id']; - - manufacturerIds = json['manufacturer_ids'].cast(); - - if (json['specifications'] != null) { - specifications = new List(); - json['specifications'].forEach((v) { - specifications.add(new Specifications.fromJson(v)); - }); - } - - vendorId = json['vendor_id']; - seName = json['se_name']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['visible_individually'] = this.visibleIndividually; - data['name'] = this.name; - data['namen'] = this.namen; - if (this.localizedNames != null) { - data['localized_names'] = - this.localizedNames.map((v) => v.toJson()).toList(); - } - data['short_description'] = this.shortDescription; - data['short_descriptionn'] = this.shortDescriptionn; - data['full_description'] = this.fullDescription; - data['full_descriptionn'] = this.fullDescriptionn; - data['markas_new'] = this.markasNew; - data['show_on_home_page'] = this.showOnHomePage; - data['meta_keywords'] = this.metaKeywords; - data['meta_description'] = this.metaDescription; - data['meta_title'] = this.metaTitle; - data['allow_customer_reviews'] = this.allowCustomerReviews; - data['approved_rating_sum'] = this.approvedRatingSum; - data['not_approved_rating_sum'] = this.notApprovedRatingSum; - data['approved_total_reviews'] = this.approvedTotalReviews; - data['not_approved_total_reviews'] = this.notApprovedTotalReviews; - data['sku'] = this.sku; - data['is_rx'] = this.isRx; - data['prescription_required'] = this.prescriptionRequired; - data['rx_message'] = this.rxMessage; - data['rx_messagen'] = this.rxMessagen; - data['manufacturer_part_number'] = this.manufacturerPartNumber; - data['gtin'] = this.gtin; - data['is_gift_card'] = this.isGiftCard; - data['require_other_products'] = this.requireOtherProducts; - data['automatically_add_required_products'] = - this.automaticallyAddRequiredProducts; - data['is_download'] = this.isDownload; - data['unlimited_downloads'] = this.unlimitedDownloads; - data['max_number_of_downloads'] = this.maxNumberOfDownloads; - data['download_expiration_days'] = this.downloadExpirationDays; - data['has_sample_download'] = this.hasSampleDownload; - data['has_user_agreement'] = this.hasUserAgreement; - data['is_recurring'] = this.isRecurring; - data['recurring_cycle_length'] = this.recurringCycleLength; - data['recurring_total_cycles'] = this.recurringTotalCycles; - data['is_rental'] = this.isRental; - data['rental_price_length'] = this.rentalPriceLength; - data['is_ship_enabled'] = this.isShipEnabled; - data['is_free_shipping'] = this.isFreeShipping; - data['ship_separately'] = this.shipSeparately; - data['additional_shipping_charge'] = this.additionalShippingCharge; - data['is_tax_exempt'] = this.isTaxExempt; - data['is_telecommunications_or_broadcasting_or_electronic_services'] = - this.isTelecommunicationsOrBroadcastingOrElectronicServices; - data['use_multiple_warehouses'] = this.useMultipleWarehouses; - data['manage_inventory_method_id'] = this.manageInventoryMethodId; - data['stock_quantity'] = this.stockQuantity; - data['stock_availability'] = this.stockAvailability; - data['stock_availabilityn'] = this.stockAvailabilityn; - data['display_stock_availability'] = this.displayStockAvailability; - data['display_stock_quantity'] = this.displayStockQuantity; - data['min_stock_quantity'] = this.minStockQuantity; - data['notify_admin_for_quantity_below'] = this.notifyAdminForQuantityBelow; - data['allow_back_in_stock_subscriptions'] = - this.allowBackInStockSubscriptions; - data['order_minimum_quantity'] = this.orderMinimumQuantity; - data['order_maximum_quantity'] = this.orderMaximumQuantity; - data['allowed_quantities'] = this.allowedQuantities; - data['allow_adding_only_existing_attribute_combinations'] = - this.allowAddingOnlyExistingAttributeCombinations; - data['disable_buy_button'] = this.disableBuyButton; - data['disable_wishlist_button'] = this.disableWishlistButton; - data['available_for_pre_order'] = this.availableForPreOrder; - data['pre_order_availability_start_date_time_utc'] = - this.preOrderAvailabilityStartDateTimeUtc; - data['call_for_price'] = this.callForPrice; - data['price'] = this.price; - data['old_price'] = this.oldPrice; - data['product_cost'] = this.productCost; - data['special_price'] = this.specialPrice; - data['special_price_start_date_time_utc'] = - this.specialPriceStartDateTimeUtc; - data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc; - data['customer_enters_price'] = this.customerEntersPrice; - data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice; - data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice; - data['baseprice_enabled'] = this.basepriceEnabled; - data['baseprice_amount'] = this.basepriceAmount; - data['baseprice_base_amount'] = this.basepriceBaseAmount; - data['has_tier_prices'] = this.hasTierPrices; - data['has_discounts_applied'] = this.hasDiscountsApplied; - data['discount_name'] = this.discountName; - data['discount_namen'] = this.discountNamen; - data['discount_description'] = this.discountDescription; - data['discount_Descriptionn'] = this.discountDescriptionn; - data['discount_percentage'] = this.discountPercentage; - data['currency'] = this.currency; - data['currencyn'] = this.currencyn; - data['weight'] = this.weight; - data['length'] = this.length; - data['width'] = this.width; - data['height'] = this.height; - data['available_start_date_time_utc'] = this.availableStartDateTimeUtc; - data['available_end_date_time_utc'] = this.availableEndDateTimeUtc; - data['display_order'] = this.displayOrder; - data['published'] = this.published; - data['deleted'] = this.deleted; - data['created_on_utc'] = this.createdOnUtc; - data['updated_on_utc'] = this.updatedOnUtc; - data['product_type'] = this.productType; - data['parent_grouped_product_id'] = this.parentGroupedProductId; - - data['manufacturer_ids'] = this.manufacturerIds; - - if (this.specifications != null) { - data['specifications'] = - this.specifications.map((v) => v.toJson()).toList(); - } - - data['vendor_id'] = this.vendorId; - data['se_name'] = this.seName; - return data; - } -} - -class LocalizedNames { - int languageId; - String localizedName; - - LocalizedNames({this.languageId, this.localizedName}); - - LocalizedNames.fromJson(Map json) { - languageId = json['language_id']; - localizedName = json['localized_name']; - } - - Map toJson() { - final Map data = new Map(); - data['language_id'] = this.languageId; - data['localized_name'] = this.localizedName; - return data; - } -} - -class Images { - int id; - int position; - String src; - String thumb; - String attachment; - - Images({this.id, this.position, this.src, this.thumb, this.attachment}); - - Images.fromJson(Map json) { - id = json['id']; - position = json['position']; - src = json['src']; - thumb = json['thumb']; - attachment = json['attachment']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['position'] = this.position; - data['src'] = this.src; - data['thumb'] = this.thumb; - data['attachment'] = this.attachment; - return data; - } -} - -class Specifications { - int id; - int displayOrder; - String defaultValue; - String defaultValuen; - String name; - String nameN; - - Specifications( - {this.id, - this.displayOrder, - this.defaultValue, - this.defaultValuen, - this.name, - this.nameN}); - - Specifications.fromJson(Map json) { - id = json['id']; - displayOrder = json['display_order']; - defaultValue = json['default_value']; - defaultValuen = json['default_valuen']; - name = json['name']; - nameN = json['nameN']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['display_order'] = this.displayOrder; - data['default_value'] = this.defaultValue; - data['default_valuen'] = this.defaultValuen; - data['name'] = this.name; - data['nameN'] = this.nameN; - return data; - } -} diff --git a/lib/core/model/search_products_model.dart b/lib/core/model/search_products_model.dart deleted file mode 100644 index d63fd4b0..00000000 --- a/lib/core/model/search_products_model.dart +++ /dev/null @@ -1,185 +0,0 @@ -class SearchProductsModel { - String id; - String name; - String namen; - List localizedNames; - String shortDescription; - String fullDescription; - String fullDescriptionn; - dynamic approvedRatingSum; - dynamic approvedTotalReviews; - String sku; - bool isRx; - dynamic rxMessage; - dynamic rxMessagen; - dynamic stockQuantity; - String stockAvailability; - String stockAvailabilityn; - bool allowBackInStockSubscriptions; - dynamic orderMinimumQuantity; - dynamic orderMaximumQuantity; - double price; - dynamic oldPrice; - dynamic discountName; - dynamic discountNamen; - dynamic discountPercentage; - dynamic displayOrder; - List discountIds; - List reviews; - List images; - - SearchProductsModel( - {this.id, - this.name, - this.namen, - this.localizedNames, - this.shortDescription, - this.fullDescription, - this.fullDescriptionn, - this.approvedRatingSum, - this.approvedTotalReviews, - this.sku, - this.isRx, - this.rxMessage, - this.rxMessagen, - this.stockQuantity, - this.stockAvailability, - this.stockAvailabilityn, - this.allowBackInStockSubscriptions, - this.orderMinimumQuantity, - this.orderMaximumQuantity, - this.price, - this.oldPrice, - this.discountName, - this.discountNamen, - this.discountPercentage, - this.displayOrder, - this.discountIds, - this.reviews, - this.images}); - - SearchProductsModel.fromJson(Map json) { - id = json['id']; - name = json['name']; - namen = json['namen']; - if (json['localized_names'] != null) { - localizedNames = new List(); - json['localized_names'].forEach((v) { - localizedNames.add(new LocalizedNames.fromJson(v)); - }); - } - shortDescription = json['short_description']; - fullDescription = json['full_description']; - fullDescriptionn = json['full_descriptionn']; - approvedRatingSum = json['approved_rating_sum']; - approvedTotalReviews = json['approved_total_reviews']; - sku = json['sku']; - isRx = json['is_rx']; - rxMessage = json['rx_message']; - rxMessagen = json['rx_messagen']; - stockQuantity = json['stock_quantity']; - stockAvailability = json['stock_availability']; - stockAvailabilityn = json['stock_availabilityn']; - allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; - orderMinimumQuantity = json['order_minimum_quantity']; - orderMaximumQuantity = json['order_maximum_quantity']; - price = json['price']; - oldPrice = json['old_price']; - discountName = json['discount_name']; - discountNamen = json['discount_namen']; - discountPercentage = json['discount_percentage']; - displayOrder = json['display_order']; - - if (json['images'] != null) { - images = new List(); - json['images'].forEach((v) { - images.add(new Images.fromJson(v)); - }); - } - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; - data['namen'] = this.namen; - if (this.localizedNames != null) { - data['localized_names'] = - this.localizedNames.map((v) => v.toJson()).toList(); - } - data['short_description'] = this.shortDescription; - data['full_description'] = this.fullDescription; - data['full_descriptionn'] = this.fullDescriptionn; - data['approved_rating_sum'] = this.approvedRatingSum; - data['approved_total_reviews'] = this.approvedTotalReviews; - data['sku'] = this.sku; - data['is_rx'] = this.isRx; - data['rx_message'] = this.rxMessage; - data['rx_messagen'] = this.rxMessagen; - data['stock_quantity'] = this.stockQuantity; - data['stock_availability'] = this.stockAvailability; - data['stock_availabilityn'] = this.stockAvailabilityn; - data['allow_back_in_stock_subscriptions'] = - this.allowBackInStockSubscriptions; - data['order_minimum_quantity'] = this.orderMinimumQuantity; - data['order_maximum_quantity'] = this.orderMaximumQuantity; - data['price'] = this.price; - data['old_price'] = this.oldPrice; - data['discount_name'] = this.discountName; - data['discount_namen'] = this.discountNamen; - data['discount_percentage'] = this.discountPercentage; - data['display_order'] = this.displayOrder; - - if (this.images != null) { - data['images'] = this.images.map((v) => v.toJson()).toList(); - } - return data; - } -} - -class LocalizedNames { - int languageId; - String localizedName; - - LocalizedNames({this.languageId, this.localizedName}); - - LocalizedNames.fromJson(Map json) { - languageId = json['language_id']; - localizedName = json['localized_name']; - } - - Map toJson() { - final Map data = new Map(); - data['language_id'] = this.languageId; - data['localized_name'] = this.localizedName; - return data; - } -} - -class Images { - int id; - int position; - String src; - String thumb; - String attachment; - - Images({this.id, this.position, this.src, this.thumb, this.attachment}); - - Images.fromJson(Map json) { - id = json['id']; - position = json['position']; - src = json['src']; - thumb = json['thumb']; - attachment = json['attachment']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['position'] = this.position; - data['src'] = this.src; - data['thumb'] = this.thumb; - data['attachment'] = this.attachment; - return data; - } -} diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 8e9c6067..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') @@ -147,33 +147,24 @@ class BaseAppClient { } else if (parsed['Result'] == 'OK') { onSuccess(parsed, statusCode); } else { - if (parsed != null) { - onSuccess(parsed, statusCode); - } else { - onFailure( - parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); - logout(); - } + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); } else if (!parsed['IsAuthenticated']) { - // await logout(); + await logout(); //helpers.showErrorToast('Your session expired Please login agian'); } else { if (parsed['SameClinicApptList'] != null) { onSuccess(parsed, statusCode); } else { - if (parsed['message'] != null) { - onFailure(parsed['message'] ?? parsed['message'], statusCode); - } else { - onFailure( - parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); - } + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } } } @@ -183,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); } } @@ -234,41 +226,8 @@ class BaseAppClient { } } - getPharmacy(String endPoint, - {Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - bool isAllowAny = false, - Map queryParams}) async { - String url = PHARMACY_BASE_URL + endPoint; - if (queryParams != null) { - String queryString = Uri(queryParameters: queryParams).query; - url += '?' + queryString; - } - - print("URL : $url"); - - if (await Utils.checkConnection()) { - final response = await http.get(url.trim(), headers: { - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }); - final int statusCode = response.statusCode; - print("statusCode :$statusCode"); - - if (statusCode < 200 || statusCode >= 400 || json == null) { - onFailure('Error While Fetching data', statusCode); - } else { - var parsed = json.decode(response.body.toString()); - onSuccess(parsed, statusCode); - } - } else { - onFailure('Please Check The Internet Connection', -1); - } - } - logout() async { await sharedPref.remove(LOGIN_TOKEN_ID); - await sharedPref.remove(PHARMACY_CUSTOMER_ID); await authenticatedUserObject.getUser(); Provider.of(AppGlobal.context, listen: false).isLogin = false; diff --git a/lib/core/service/offers_service.dart b/lib/core/service/offers_service.dart deleted file mode 100644 index 2247c833..00000000 --- a/lib/core/service/offers_service.dart +++ /dev/null @@ -1,56 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/offer_products_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/offers_model.dart'; - -import 'base_service.dart'; - -class OffersCategoriseService extends BaseService { - List _offersList = List(); - List get offersList => _offersList; - List _offerProducts = List(); - List get offersProducts => _offerProducts; - - clearCategorise() { - _offerProducts.clear(); - } - - // clearCategorise2() { - // _offersList.clear(); - // } - - Future getOffersCategorise() async { - hasError = false; - _offersList.clear(); - await baseAppClient.get( - GET_OFFERS_CATEGORISE, - onSuccess: (dynamic response, int statusCode) { - response['categories'].forEach((item) { - _offersList.add(OffersModel.fromJson(item)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); - } - - Future getOffersProducts({String id}) async { - hasError = false; - _offerProducts.clear(); - String endPoint = - id != null ? GET_OFFERS_PRODUCTS + "$id" : GET_OFFERS_PRODUCTS + "1"; - await baseAppClient.get( - endPoint, - onSuccess: (dynamic response, int statusCode) { - response['products'].forEach((item) { - _offerProducts.add(OfferProductsModel.fromJson(item)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); - } -} diff --git a/lib/core/service/parmacyModule/lacum-registration-service.dart b/lib/core/service/parmacyModule/lacum-registration-service.dart deleted file mode 100644 index b3e64e69..00000000 --- a/lib/core/service/parmacyModule/lacum-registration-service.dart +++ /dev/null @@ -1,50 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/ListUserAgreement.dart'; - -import 'lacum-service.dart'; - -class LacumRegistrationService extends LacumService{ - - ListUserAgreement listUserAgreement; - - Future getLacumAccountInformationById(String patientIdentificationNo) async { - hasError = false; - super.error = ""; - - Map body = Map(); - body['IdentificationNo'] = patientIdentificationNo; - - try { - await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION, - onSuccess: (response, statusCode) async { - lacumInformation = LacumAccountInformation.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } catch (error) { - throw error; - } - } - - Future getUserTermsAndConditionsForEPharmcy() async { - hasError = false; - super.error = ""; - - Map body = Map(); - - try { - await baseAppClient.post(LAKUM_GET_USER_TERMS_AND_CONDITIONS, - onSuccess: (response, statusCode) async { - listUserAgreement = ListUserAgreement.fromJson(response['ListUserAgreement'][0]); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } catch (error) { - throw error; - } - } - -} \ No newline at end of file diff --git a/lib/core/service/parmacyModule/lacum-service.dart b/lib/core/service/parmacyModule/lacum-service.dart deleted file mode 100644 index c7117303..00000000 --- a/lib/core/service/parmacyModule/lacum-service.dart +++ /dev/null @@ -1,133 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; -import 'package:diplomaticquarterapp/core/service/base_service.dart'; - -class LacumService extends BaseService{ - bool isFinished = true; - bool hasError = false; - String errorMsg = ''; - String successMsg = ''; - - LacumAccountInformation lacumInformation; - LacumAccountInformation lacumGroupInformation; - - Future getLacumAccountInformation() async { - hasError = false; - super.error = ""; - - Map body = Map(); - body['IdentificationNo'] = user.patientIdentificationNo; - - try { - await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION, - onSuccess: (response, statusCode) async { - lacumInformation = LacumAccountInformation.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } catch (error) { - throw error; - } - } - - Future getLacumGroupInformation() async { - hasError = false; - super.error = ""; - - Map body = Map(); - body['IdentificationNo'] = user.patientIdentificationNo; - body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}"; - body['IsDetailsRequired'] = true; - - try { - await baseAppClient.post(GET_LACUM_GROUP_INFORMATION, - onSuccess: (response, statusCode) async { - lacumGroupInformation = LacumAccountInformation.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } catch (error) { - throw error; - } - } - - Future makeAccountActivate() async { - hasError = false; - super.error = ""; - int yahalaAccountNo = lacumInformation.yahalaAccountNo; - - Map body = Map(); - body['CreatedBy'] = 103; - body['YahalaAccountNumber'] = yahalaAccountNo; - - try { - await baseAppClient.post(LACUM_ACCOUNT_ACTIVATE, - onSuccess: (response, statusCode) async { - // lacumInformation = LacumAccountInformation.fromJson(response); - // lacumInformation.yahalaAccountNo = yahalaAccountNo; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } catch (error) { - throw error; - } - } - - Future makeAccountDeactivate() async { - hasError = false; - super.error = ""; - int yahalaAccountNo = lacumInformation.yahalaAccountNo; - - Map body = Map(); - body['CreatedBy'] = 103; - body['YahalaAccountNumber'] = yahalaAccountNo; - - try { - await baseAppClient.post(LACUM_ACCOUNT_DEACTIVATE, - onSuccess: (response, statusCode) async { - // lacumInformation = LacumAccountInformation.fromJson(response); - // lacumInformation.yahalaAccountNo = yahalaAccountNo; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } catch (error) { - throw error; - } - } - - Future createLakumAccount(String name, String phone, int accountID, String patientIdentificationID, var prefLang) async { - hasError = false; - super.error = ""; - if(prefLang == null){ - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); - prefLang = languageID == 'ar' ? 1 : 2; - } - - - Map body = Map(); - body['PrefLang'] = prefLang; - body['AccountID'] = accountID; - body['FullName'] = name; - body['MobileNo'] = phone; - body['PatientIdentificationID'] = patientIdentificationID; - body['PatientID'] = user.patientID; - - try { - await baseAppClient.post(CREATE_LAKUM_ACCOUNT, - onSuccess: (response, statusCode) async { - successMsg = LacumAccountInformation.fromJson(response).message; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } catch (error) { - throw error; - } - } -} \ No newline at end of file diff --git a/lib/core/service/parmacyModule/lacum-transfer-service.dart b/lib/core/service/parmacyModule/lacum-transfer-service.dart deleted file mode 100644 index b15696f9..00000000 --- a/lib/core/service/parmacyModule/lacum-transfer-service.dart +++ /dev/null @@ -1,57 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; - -import 'lacum-service.dart'; - -class LacumTransferService extends LacumService{ - LacumAccountInformation lacumReceiverInformation; - - Future getLacumGroupDataBuAccountId(String accountId) async { - hasError = false; - super.error = ""; - - Map body = Map(); - body['IdentificationNo'] = user.patientIdentificationNo; - body['AccountNumber'] = accountId; - - try { - await baseAppClient.post(GET_LACUM_GROUP_INFORMATION, - onSuccess: (response, statusCode) async { - lacumReceiverInformation = LacumAccountInformation.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - return null; - }, body: body); - } catch (error) { - throw error; - } - } - - Future transferYaHalaLoyaltyPoints(String points) async { - hasError = false; - super.error = ""; - - Map body = Map(); - body['MobileNo'] = lacumGroupInformation.lakumInquiryInformationObjVersion.mobileNumber; - body['UserName'] = lacumGroupInformation.lakumInquiryInformationObjVersion.memberName; - body['YaHalaSenderAccNumber'] = lacumGroupInformation.lakumInquiryInformationObjVersion.accountNumber; - body['Yahala_IdentificationNo'] = lacumGroupInformation.lakumInquiryInformationObjVersion.memberUniversalId; - body['YaHalaPointsToTransfer'] = points; - body['YaHalaReceiverAccNumber'] = lacumReceiverInformation.lakumInquiryInformationObjVersion.accountNumber; - body['YaHalaReceiverMobileNumber'] = lacumReceiverInformation.lakumInquiryInformationObjVersion.mobileNumber; - body['YaHalaReceiverName'] = lacumReceiverInformation.lakumInquiryInformationObjVersion.memberName; - - try { - await baseAppClient.post(TRANSFER_YAHALA_LOYALITY_POINTS, - onSuccess: (response, statusCode) async { - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } catch (error) { - throw error; - } - } - -} \ No newline at end of file diff --git a/lib/core/service/parmacyModule/order-preview-service.dart b/lib/core/service/parmacyModule/order-preview-service.dart index 5648ff6d..1f3f9ddd 100644 --- a/lib/core/service/parmacyModule/order-preview-service.dart +++ b/lib/core/service/parmacyModule/order-preview-service.dart @@ -1,248 +1,29 @@ import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; -class OrderPreviewService extends BaseService { +class OrderPreviewService extends BaseService{ bool isFinished = true; bool hasError = false; String errorMsg = ''; List addresses = List(); - LacumAccountInformation lacumInformation; - LacumAccountInformation lacumGroupInformation; - Future getAddresses() async { - var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); - Map queryParams = {'fields': 'addresses'}; + Future getBannerListList() async { hasError = false; try { - await baseAppClient.get("$GET_CUSTOMERS_ADDRESSES$customerId", + await baseAppClient.get(GET_CUSTOMERS_ADDRESSES, onSuccess: (dynamic response, int statusCode) { - addresses.clear(); - response['customers'][0]['addresses'].forEach((item) { - addresses.add(Addresses.fromJson(item)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, queryParams: queryParams); - } catch (error) { - throw error; - } - } - - Future getShippingOption(Addresses selectedAddress) async { - var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); - Map queryParams = Map(); - dynamic localRes; - hasError = false; - try { - await baseAppClient.get("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}", - onSuccess: (dynamic response, int statusCode) { - localRes = response['shipping_option'][0]; + addresses.clear(); + response['customers'][0]['addresses'].forEach((item) { + addresses.add(Addresses.fromJson(item)); + }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, queryParams: queryParams); + }); } catch (error) { throw error; } - return Future.value(localRes); - } - - Future getShoppingCart() async { - var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); - Map queryParams = {'shopping_cart_type': '1'}; - dynamic localRes; - hasError = false; - try { - await baseAppClient.get("$GET_SHOPPING_CART$customerId", - onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, queryParams: queryParams); - } catch (error) { - throw error; - } - return Future.value(localRes); - } - - Future changeProductQuantity( - String productId, ShoppingCart product) async { - hasError = false; - super.error = ""; - dynamic localRes; - Map choppingCartObject = Map(); - choppingCartObject['id'] = product.id; - choppingCartObject['quantity'] = product.quantity; - choppingCartObject['shopping_cart_type'] = "1"; - choppingCartObject['product_id'] = product.productId; - choppingCartObject['customer_id'] = product.customerId; - - Map body = Map(); - body["shopping_cart_item"] = choppingCartObject; - - await baseAppClient.post("$GET_SHOPPING_CART$productId", - onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - - return Future.value(localRes); - } - - Future deleteProduct(String productId) async { - hasError = false; - super.error = ""; - dynamic localRes; - - Map body = Map(); - - await baseAppClient.post("$DELETE_SHOPPING_CART$productId", - onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - - return Future.value(localRes); - } - - Future deleteShoppingCart() async { - var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); - - hasError = false; - super.error = ""; - dynamic localRes; - - await baseAppClient.get("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart", - onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }); - - return Future.value(localRes); - } - - Future getLacumAccountInformation() async { - hasError = false; - super.error = ""; - - Map body = Map(); - body['IdentificationNo'] = user.patientIdentificationNo; - - try { - await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION, - onSuccess: (response, statusCode) async { - lacumInformation = LacumAccountInformation.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } catch (error) { - throw error; - } - } - - Future getLacumGroupInformation() async { - hasError = false; - super.error = ""; - - Map body = Map(); - body['IdentificationNo'] = user.patientIdentificationNo; - body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}"; - - try { - await baseAppClient.post(GET_LACUM_GROUP_INFORMATION, - onSuccess: (response, statusCode) async { - lacumGroupInformation = LacumAccountInformation.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } catch (error) { - throw error; - } - } - - Future makeOrder(PaymentCheckoutData paymentCheckoutData, List shoppingCarts) async { - paymentCheckoutData.address.isChecked = true; - hasError = false; - super.error = ""; - - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); - var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); - - Map orderBody = Map(); - orderBody['rx_attachments'] = ""; - orderBody['customer_language_id'] = languageID == 'ar' ? 1 : 2; - orderBody['billing_address'] = paymentCheckoutData.address; - orderBody['pick_up_in_store'] = false; - orderBody['payment_method_system_name'] = "Payments.PayFort"; - orderBody['shipping_method'] = languageID == 'ar' ? paymentCheckoutData.shippingOption.namen : paymentCheckoutData.shippingOption.name ; - orderBody['shipping_rate_computation_method_system_name'] = paymentCheckoutData.shippingOption.shippingRateComputationMethodSystemName; - orderBody['customer_id'] = customerId; - orderBody['custom_values_xml'] = "PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}"; - orderBody['shippingOption'] = paymentCheckoutData.shippingOption; - orderBody['shipping_address'] = paymentCheckoutData.address; - orderBody['lakum_amount'] = paymentCheckoutData.usedLakumPoints; - - List> itemsList = List(); - shoppingCarts.forEach((item) { - Map orderItemsBody = Map(); - orderItemsBody['product_id'] = item.product.id; - orderItemsBody['quantity'] = item.quantity; - itemsList.add(orderItemsBody); - }); - orderBody['order_items'] = itemsList; - - Map body = Map(); - body['order'] = orderBody; - - try { - await baseAppClient.post(ORDER_SHOPPING_CART, - onSuccess: (response, statusCode) async { - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } catch (error) { - throw error; - } - } - - String getPaymentOptionName(PaymentOption paymentOption) { - switch (paymentOption.index) { - case 0: - return "MADA"; - break; - case 1: - return "SADAD"; - break; - case 2: - return "VISA"; - break; - case 3: - return "MASTERCARD"; - break; - case 4: - return "INSTALLMENT"; - break; - default: - return ""; - } } -} +} \ No newline at end of file diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index c3bce324..8584e140 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -4,10 +4,8 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; class PharmacyModuleService extends BaseService { - final AppSharedPreferences sharedPref = AppSharedPreferences(); bool isFinished = true; bool hasError = false; String errorMsg = ''; @@ -17,55 +15,6 @@ class PharmacyModuleService extends BaseService { List bestSellerProducts = List(); List lastVisitedProducts = List(); - Future makeVerifyCustomer(dynamic data) async { - Map queryParams = {'FileNumber': data['PatientID'].toString()}; - hasError = false; - try { - await baseAppClient.get(PHARMACY_VERIFY_CUSTOMER, - onSuccess: (dynamic response, int statusCode) { - if (response['UserName'] != null) { - sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString()); - print(response); - } else { - createUser(); - } - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, queryParams: queryParams); - } catch (error) { - throw error; - } - } - - Future createUser() async { - var data = await sharedPref.getObject(USER_PROFILE); - var languageID = await sharedPref.getString(APP_LANGUAGE); - Map queryParams = { - 'Phone': data['MobileNumber'], - 'Email': data['EmailAddress'], - 'FileNumber': data['PatientID'].toString(), - 'Language': languageID.toString(), - 'Gender': data['Gender'].toString(), - 'FirstName': data['FirstName'], - 'LastName': data['LastName'], - 'LanguageId': languageID.toString(), - 'CountryCode': data['ZipCode'], - }; - hasError = false; - try { - await baseAppClient.get(PHARMACY_CREATE_CUSTOMER, - onSuccess: (dynamic response, int statusCode) { - if (!response['IsRegistered']) {} - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, queryParams: queryParams); - } catch (error) { - throw error; - } - } - Future getBannerListList() async { hasError = false; try { @@ -91,10 +40,7 @@ class PharmacyModuleService extends BaseService { onSuccess: (dynamic response, int statusCode) { manufacturerList.clear(); response['manufacturer'].forEach((item) { - Manufacturer manufacturer = Manufacturer.fromJson(item); - if(manufacturer.image != null){ - manufacturerList.add(Manufacturer.fromJson(item)); - } + manufacturerList.add(Manufacturer.fromJson(item)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -135,14 +81,14 @@ class PharmacyModuleService extends BaseService { try { await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", onSuccess: (dynamic response, int statusCode) { - lastVisitedProducts.clear(); - response['products'].forEach((item) { - lastVisitedProducts.add(PharmacyProduct.fromJson(item)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }); + lastVisitedProducts.clear(); + response['products'].forEach((item) { + lastVisitedProducts.add(PharmacyProduct.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); } catch (error) { throw error; } diff --git a/lib/core/service/parmacyModule/terms-condition-service.dart b/lib/core/service/parmacyModule/terms-condition-service.dart deleted file mode 100644 index 68fac632..00000000 --- a/lib/core/service/parmacyModule/terms-condition-service.dart +++ /dev/null @@ -1,33 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/ListUserAgreement.dart'; - -import '../base_service.dart'; - -class TermsConditionService extends BaseService{ - bool isFinished = true; - bool hasError = false; - String errorMsg = ''; - String successMsg = ''; - - ListUserAgreement listUserAgreement; - - Future getUserTermsAndConditionsForEPharmcy() async { - hasError = false; - super.error = ""; - - Map body = Map(); - - try { - await baseAppClient.post(LAKUM_GET_USER_TERMS_AND_CONDITIONS, - onSuccess: (response, statusCode) async { - listUserAgreement = ListUserAgreement.fromJson(response['ListUserAgreement'][0]); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } catch (error) { - throw error; - } - } - -} \ No newline at end of file diff --git a/lib/core/service/pharmacy_categorise_service.dart b/lib/core/service/pharmacy_categorise_service.dart deleted file mode 100644 index b55a755d..00000000 --- a/lib/core/service/pharmacy_categorise_service.dart +++ /dev/null @@ -1,225 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/brands_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/final_products_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/parent_products_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/pharmacy_categorise.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/scan_qr_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/sub_categories_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/sub_products_model.dart'; -import 'package:diplomaticquarterapp/core/model/search_products_model.dart'; - -import 'base_service.dart'; - -class PharmacyCategoriseService extends BaseService { - //service one - List _categoriseList = List(); - List get categoriseList => _categoriseList; - - //service two - List _parentCategoriseList = List(); - List get parentCategoriseList => _parentCategoriseList; - - //service three - List _parentProductsList = List(); - List get parentProductsList => _parentProductsList; - - //service four - List _subCategoriseList = List(); - List get subCategoriseList => _subCategoriseList; - - //service five - List _subProductsList = List(); - List get subProductsList => _subProductsList; - - //service six - List _finalProducts = List(); - List get finalProducts => _finalProducts; - - //service 7 - - List _brandsList = List(); - List get brandsList => _brandsList; - - // service 8 - - List _searchList = List(); - List get searchList => _searchList; - - List _scanList = List(); - List get scanList => _scanList; - - clearSearchList() { - _searchList.clear(); - } - - Future getCategorise() async { - hasError = false; - _categoriseList.clear(); - await baseAppClient.get( - GET_PHARMACY_CATEGORISE, - onSuccess: (dynamic response, int statusCode) { - response['categories'].forEach((item) { - _categoriseList.add(PharmacyCategorise.fromJson(item)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); - } - - Future scanQr({String id}) async { - hasError = false; - _scanList.clear(); - String endPoint = id != null ? SCAN_QR_CODE + "$id" : SCAN_QR_CODE + ""; - await baseAppClient.get( - endPoint, - onSuccess: (dynamic response, int statusCode) { - response['products'].forEach((item) { - _scanList.add(ScanQrModel.fromJson(item)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); - } - - Future searchProducts({String productName}) async { - hasError = false; - _searchList.clear(); - String endPoint = productName != null - ? GET_SEARCH_PRODUCTS + "$productName" + '&language_id=1' - : GET_SEARCH_PRODUCTS + ""; - await baseAppClient.get( - endPoint, - onSuccess: (dynamic response, int statusCode) { - response['products'].forEach((item) { - _searchList.add(SearchProductsModel.fromJson(item)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); - } - - Future getBrands() async { - hasError = false; - _brandsList.clear(); - await baseAppClient.get( - GET_BRANDS_LIST, - onSuccess: (dynamic response, int statusCode) { - response['manufacturer'].forEach((item) { - _brandsList.add(BrandsModel.fromJson(item)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); - } - - Future getCategoriseParent({String id}) async { - hasError = false; - _parentCategoriseList.clear(); - String endPoint = - id != null ? GET_CATEGORISE_PARENT + "$id" : GET_CATEGORISE_PARENT + ""; - await baseAppClient.get( - endPoint, - onSuccess: (dynamic response, int statusCode) { - response['categories'].forEach((item) { - _parentCategoriseList.add(CategoriseParentModel.fromJson(item)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); - } - - Future getParentProducts({String id}) async { - hasError = false; - _parentProductsList.clear(); - String endPoint = id != null - ? GET_PARENT_PRODUCTS + "$id" + '&page=1&limit=50' - : GET_PARENT_PRODUCTS + ""; - await baseAppClient.get( - endPoint, - onSuccess: (dynamic response, int statusCode) { - response['products'].forEach((item) { - _parentProductsList.add(ParentProductsModel.fromJson(item)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); - } - - Future getSubCategorise({String id}) async { - hasError = false; - _subCategoriseList.clear(); - - String endPoint = - id != null ? GET_SUB_CATEGORISE + "$id" : GET_SUB_CATEGORISE + ""; - await baseAppClient.get( - endPoint, - onSuccess: (dynamic response, int statusCode) { - response['categories'].forEach((item) { - _subCategoriseList.add(SubCategoriesModel.fromJson(item)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); - } - - Future getSubProducts({String id}) async { - hasError = false; - _subProductsList.clear(); - String endPoint = id != null - ? GET_SUB_PRODUCTS + "$id" + '&page=1&limit=50' - : GET_SUB_PRODUCTS + ""; - await baseAppClient.get( - endPoint, - onSuccess: (dynamic response, int statusCode) { - response['products'].forEach((item) { - _subProductsList.add(SubProductsModel.fromJson(item)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); - } - - Future getFinalProducts({String id}) async { - hasError = false; - _finalProducts.clear(); - String endPoint = - id != null ? GET_FINAL_PRODUCTS + "$id" : GET_FINAL_PRODUCTS + ""; - await baseAppClient.get( - endPoint, - onSuccess: (dynamic response, int statusCode) { - response['products'].forEach((item) { - _finalProducts.add(FinalProductsModel.fromJson(item)); - }); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); - } -} 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/offers_Categorise_view_model.dart b/lib/core/viewModels/offers_Categorise_view_model.dart deleted file mode 100644 index b63dd553..00000000 --- a/lib/core/viewModels/offers_Categorise_view_model.dart +++ /dev/null @@ -1,48 +0,0 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/offer_products_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/offers_model.dart'; -import 'package:diplomaticquarterapp/core/service/offers_service.dart'; -import 'package:diplomaticquarterapp/locator.dart'; - -import 'base_view_model.dart'; - -class OffersCategoriseViewModel extends BaseViewModel { - bool hasError = false; - - OffersCategoriseService _offersCategoriseService = - locator(); - List get categorise => _offersCategoriseService.offersList; - - List get products => - _offersCategoriseService.offersProducts; - - Future getOffersCategorise() async { - hasError = false; - _offersCategoriseService.clearCategorise(); - setState(ViewState.Busy); - await _offersCategoriseService.getOffersCategorise(); - if (_offersCategoriseService.hasError) { - error = _offersCategoriseService.error; - setState(ViewState.ErrorLocal); - } else - await getOffersProducts(); - } - - Future getOffersProducts({String i}) async { - hasError = false; - - setState(ViewState.Busy); - await _offersCategoriseService.getOffersProducts(id: i); - if (_offersCategoriseService.hasError) { - error = _offersCategoriseService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } -} -// await _offersCategoriseService.getOffersProducts(); -// if (_offersCategoriseService.hasError) { -// error = _offersCategoriseService.error; -// setState(ViewState.ErrorLocal); -// } else -// setState(ViewState.Idle); diff --git a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart index 06295188..00f4819b 100644 --- a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart @@ -1,11 +1,3 @@ -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/ShippingOption.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart'; import '../../../locator.dart'; @@ -13,183 +5,4 @@ import '../base_view_model.dart'; class OrderPreviewViewModel extends BaseViewModel { OrderPreviewService _orderService = locator(); - - List get addresses => _orderService.addresses; - LacumAccountInformation get lacumInformation => - _orderService.lacumInformation; - ShoppingCartResponse cartResponse = ShoppingCartResponse(); - PaymentCheckoutData paymentCheckoutData = PaymentCheckoutData(); - double totalAdditionalShippingCharge = 0; - - Future getOrderPreviewData() async { - setState(ViewState.Busy); - await _orderService.getAddresses(); - if (_orderService.hasError) { - error = _orderService.error; - setState(ViewState.Error); - } else { - getShoppingCart(); - } - } - - getShoppingCart() async { - setState(ViewState.Busy); - await _orderService.getShoppingCart().then((res) { - _handleGetShoppingCartResponse(res); - }); - if (_orderService.hasError) { - error = _orderService.error; - setState(ViewState.Error); - } else { - if (paymentCheckoutData != null) { - paymentCheckoutData.cartDataVisible = true; - } - setState(ViewState.Idle); - } - } - - changeProductQuantity(ShoppingCart product) async { - setState(ViewState.Busy); - await _orderService.changeProductQuantity(product.id, product).then((res) { - _handleGetShoppingCartResponse(res); - }); - if (_orderService.hasError) { - error = _orderService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - deleteProduct(ShoppingCart product) async { - setState(ViewState.Busy); - await _orderService.deleteProduct(product.id).then((res) { - _handleGetShoppingCartResponse(res); - }); - if (_orderService.hasError) { - error = _orderService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - deleteShoppingCart() async { - setState(ViewState.Busy); - await _orderService.deleteShoppingCart().then((res) { - _handleGetShoppingCartResponse(res); - }); - if (_orderService.hasError) { - error = _orderService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - _handleGetShoppingCartResponse(Map res) { - totalAdditionalShippingCharge = 0; - if (res == null) { - error = "response is null"; - setState(ViewState.Error); - return; - } - print(res); - cartResponse.itemCount = res["item_count"]; - cartResponse.quantityCount = res["quantity_count"]; - cartResponse.subtotal = res["subtotal"]; - cartResponse.subtotalWithVat = res["subtotal_with_vat"]; - cartResponse.subtotalVatAmount = res["subtotal_vat_amount"]; - cartResponse.subtotalVatRate = res["subtotal_vat_rate"]; - cartResponse.shoppingCarts = List(); - res["shopping_carts"].forEach((item) { - ShoppingCart shoppingCart = ShoppingCart.fromJson(item); - cartResponse.shoppingCarts.add(shoppingCart); - totalAdditionalShippingCharge += shoppingCart.product.additionalShippingCharge; - }); - cartResponse.updateShoppingCard(); - } - - String getPaymentOptionImage(PaymentOption paymentOption) { - String assetFile = "assets/images/pharmacy_module/payment/"; - switch (paymentOption.index) { - case 0: - return "${assetFile}mada.png"; - break; - case 1: - return "${assetFile}sadad.png"; - break; - case 2: - return "${assetFile}visa.png"; - break; - case 3: - return "${assetFile}mastercard.png"; - break; - case 4: - return "${assetFile}installment.png"; - break; - default: - return ""; - } - } - - String getPaymentOptionName(PaymentOption paymentOption) { - return _orderService.getPaymentOptionName(paymentOption); - } - - getInformationsByAddress() async { - await getLacumAccountInformation(); - await getShippingOption(); - } - - getLacumAccountInformation() async { - setState(ViewState.Busy); - await _orderService.getLacumAccountInformation(); - if (_orderService.hasError) { - error = _orderService.error; - setState(ViewState.Error); - } else { - getLacumGroupData(); - } - } - - Future getLacumGroupData() async { - setState(ViewState.Busy); - await _orderService.getLacumGroupInformation(); - paymentCheckoutData.lacumInformation = _orderService.lacumGroupInformation; - paymentCheckoutData.usedLakumPoints = paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount; - if (_orderService.hasError) { - error = _orderService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - getShippingOption() async { - setState(ViewState.Busy); - await _orderService.getShippingOption(paymentCheckoutData.address).then((res) { - paymentCheckoutData.shippingOption = ShippingOption.fromJson(res); - paymentCheckoutData.updateData(); - }); - if (_orderService.hasError) { - error = _orderService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - Future makeOrder() async { - setState(ViewState.Busy); - await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts); - if (_orderService.hasError) { - error = _orderService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } } - -enum PaymentOption { meda, sadad, visa, mastercard, installments } diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart deleted file mode 100644 index 75a178fa..00000000 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ /dev/null @@ -1,24 +0,0 @@ - -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyAddressesModel.dart'; -import '../../../locator.dart'; -import '../base_view_model.dart'; - -class PharmacyAddressesViewModel extends BaseViewModel { - PharmacyAddressService _PharmacyAddressService = locator(); - - List get address => _PharmacyAddressService.address; - - - Future getAddress() async { - setState(ViewState.Busy); - await _PharmacyAddressService.getAddress(); - if (_PharmacyAddressService.hasError) { - error = _PharmacyAddressService.error; - setState(ViewState.Error); - } else { - - } - } -} \ No newline at end of file diff --git a/lib/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart b/lib/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart deleted file mode 100644 index f8f5ea05..00000000 --- a/lib/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart +++ /dev/null @@ -1,55 +0,0 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/ListUserAgreement.dart'; -import 'package:diplomaticquarterapp/core/service/parmacyModule/lacum-registration-service.dart'; -import 'package:diplomaticquarterapp/core/service/parmacyModule/lacum-transfer-service.dart'; - -import '../../../locator.dart'; -import 'lacum-viewmodel.dart'; - -class LacumRegistrationViewModel extends LacumViewModel { - LacumRegistrationService _lacumService = locator(); - - ListUserAgreement get listUserAgreement => _lacumService.listUserAgreement; - - Future checkLacumAccountActivation(String patientIdentificationNo) async { - setState(ViewState.Busy); - await _lacumService.getLacumAccountInformationById(patientIdentificationNo); - if (_lacumService.hasError) { - error = _lacumService.error; - setState(ViewState.Error); - } else { - if(_lacumService.lacumInformation.yahalaAccountNo != 0){ - error = "The account has already been activated"; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - } - - Future getUserTermsAndConditionsForEPharmcy() async { - setState(ViewState.Busy); - await _lacumService.getUserTermsAndConditionsForEPharmcy(); - if (_lacumService.hasError) { - error = _lacumService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - Future createNewLakumAccount(String name, String phone, String identificationNo, int languageId) async { - setState(ViewState.Busy); - await _lacumService.createLakumAccount(name, phone, 0, identificationNo, languageId); - if (_lacumService.hasError) { - error = _lacumService.error; - setState(ViewState.Error); - return 404; - } else { - setState(ViewState.Idle); - return 200; - } - } - -} diff --git a/lib/core/viewModels/pharmacyModule/lacum-trasnfer-viewModel.dart b/lib/core/viewModels/pharmacyModule/lacum-trasnfer-viewModel.dart deleted file mode 100644 index cd19a40f..00000000 --- a/lib/core/viewModels/pharmacyModule/lacum-trasnfer-viewModel.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; -import 'package:diplomaticquarterapp/core/service/parmacyModule/lacum-transfer-service.dart'; - -import '../../../locator.dart'; -import 'lacum-viewmodel.dart'; - -class LacumTranferViewModel extends LacumViewModel { - LacumTransferService _lacumService = locator(); - - LacumAccountInformation get lacumReceiverInformation => - _lacumService.lacumReceiverInformation; - - Future getLacumGroupDataBuAccountId(String accountId) async { - setState(ViewState.Busy); - await _lacumService.getLacumGroupDataBuAccountId(accountId); - if (_lacumService.hasError) { - error = _lacumService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - Future transferYaHalaLoyaltyPoints(String points) async { - setState(ViewState.Busy); - await _lacumService.transferYaHalaLoyaltyPoints(points); - if (_lacumService.hasError) { - error = _lacumService.error; - setState(ViewState.Error); - return 404; - } else { - setState(ViewState.Idle); - return 200; - } - } - - setLakumData(LacumAccountInformation lacumInformation, LacumAccountInformation lacumGroupInformation){ - _lacumService.lacumInformation = lacumInformation; - _lacumService.lacumGroupInformation = lacumGroupInformation; - } -} diff --git a/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart b/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart deleted file mode 100644 index ba8d70d9..00000000 --- a/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart +++ /dev/null @@ -1,111 +0,0 @@ -import 'dart:typed_data'; - -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; -import 'package:diplomaticquarterapp/core/service/parmacyModule/lacum-service.dart'; -import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'dart:async'; -import 'dart:convert' as convert; - -import '../../../locator.dart'; -import '../base_view_model.dart'; - -class LacumViewModel extends BaseViewModel { - LacumService _lacumService = locator(); - - LacumAccountInformation get lacumInformation => - _lacumService.lacumInformation; - - LacumAccountInformation get lacumGroupInformation => - _lacumService.lacumGroupInformation; - - Future getLacumData() async { - await getLacumAccountData(); - getLacumGroupData(); - } - - Future getLacumAccountData() async { - setState(ViewState.Busy); - await _lacumService.getLacumAccountInformation(); - if (_lacumService.hasError) { - error = _lacumService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - Future getLacumGroupData() async { - setState(ViewState.Busy); - await _lacumService.getLacumGroupInformation(); - if (_lacumService.hasError) { - error = _lacumService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - Future makeAccountActivate() async { - setState(ViewState.Busy); - await _lacumService.makeAccountActivate(); - if (_lacumService.hasError) { - error = _lacumService.error; - setState(ViewState.Error); - } else { - lacumGroupInformation.lakumInquiryInformationObjVersion.accountStatus = "Active"; - getLacumAccountData(); - } - } - - Future makeAccountDeactivate() async { - setState(ViewState.Busy); - await _lacumService.makeAccountDeactivate(); - if (_lacumService.hasError) { - error = _lacumService.error; - setState(ViewState.Error); - } else { - lacumGroupInformation.lakumInquiryInformationObjVersion.accountStatus = "Cancelled"; - getLacumAccountData(); - } - } - - Future createLakumAccount(String name, String phone) async { - setState(ViewState.Busy); - await _lacumService.createLakumAccount(name, phone, lacumInformation.yahalaAccountNo, lacumInformation.identificationNo, null); - if (_lacumService.hasError) { - error = _lacumService.error; - setState(ViewState.Error); - return 404; - } else { - setState(ViewState.Idle); - return 200; - } - } - - String formatCreatedDateToString() { - DateTime createdDate = DateUtil.convertStringToDate( - lacumGroupInformation.lakumInquiryInformationObjVersion.createdDate); - return DateUtil.getFormattedDate(createdDate, "MMM dd,yyyy"); - } - - Uint8List convertBase64ToBarCodeImage() { - try { - final _byteImage = convert.base64Decode( - lacumGroupInformation.lakumInquiryInformationObjVersion.barCode); - return _byteImage; - } catch (e) { - print(e); - return null; - } - } - - setLakumData(LacumAccountInformation lacumInformation, LacumAccountInformation lacumGroupInformation){ - _lacumService.lacumInformation = lacumInformation; - _lacumService.lacumGroupInformation = lacumGroupInformation; - } - - clearLakumGroupData(){ - _lacumService.lacumGroupInformation = null; - } -} diff --git a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart deleted file mode 100644 index beb62a53..00000000 --- a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart +++ /dev/null @@ -1,39 +0,0 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; -import '../../../locator.dart'; -import '../base_view_model.dart'; - -class OrderModelViewModel extends BaseViewModel { - OrderService _orderService = locator(); - List get order => _orderService.orderList; - - OrderDetailsService _orderDetailsService = locator(); - List get orderDetails => _orderDetailsService.orderDetails; - - - - - Future getOrder(id, pageId) async { - setState(ViewState.Busy); - await _orderService.getOrder(id,pageId); - if (_orderService.hasError) { - error = _orderService.error; - setState(ViewState.Error); - } else { - - } - } - - Future getOrderDetails(orderId) async { - setState(ViewState.Busy); - await _orderDetailsService.getOrderDetails(orderId); - if (_orderDetailsService.hasError) { - error = _orderDetailsService.error; - setState(ViewState.Error); - } else { - - } - } -} \ No newline at end of file diff --git a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart index 4dfc6a26..f8c574f7 100644 --- a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; @@ -22,25 +21,6 @@ class PharmacyModuleViewModel extends BaseViewModel { _pharmacyService.lastVisitedProducts; Future getPharmacyHomeData() async { - setState(ViewState.Busy); - var data = await sharedPref.getObject(USER_PROFILE); - var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); - - if (authenticatedUserObject.isLogin && data != null && customerId == null) { - await _pharmacyService.makeVerifyCustomer(data); - // here must call getShoppingCard() - if (_pharmacyService.hasError) { - error = _pharmacyService.error; - setState(ViewState.Error); - } else { - await getBannerList(); - } - } else { - await getBannerList(); - } - } - - Future getBannerList() async { setState(ViewState.Busy); await _pharmacyService.getBannerListList(); if (_pharmacyService.hasError) { @@ -67,7 +47,6 @@ class PharmacyModuleViewModel extends BaseViewModel { error = _pharmacyService.error; setState(ViewState.Error); } else { - setState(ViewState.Idle); _getBestSellerProducts(); } } @@ -91,18 +70,4 @@ class PharmacyModuleViewModel extends BaseViewModel { setState(ViewState.Idle); } } - - Future checkUserIsActivated() async { - if (authenticatedUserObject.isLogin) { - var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); - if (customerId != null) { - return true; - } else { - return false; - } - } else { - // go to login page - return false; - } - } } diff --git a/lib/core/viewModels/pharmacyModule/tems-condition-viewmodel.dart b/lib/core/viewModels/pharmacyModule/tems-condition-viewmodel.dart deleted file mode 100644 index 6a5bd476..00000000 --- a/lib/core/viewModels/pharmacyModule/tems-condition-viewmodel.dart +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/ListUserAgreement.dart'; -import 'package:diplomaticquarterapp/core/service/parmacyModule/terms-condition-service.dart'; -import 'dart:async'; - -import '../../../locator.dart'; -import '../base_view_model.dart'; - -class TermsConditionViewModel extends BaseViewModel { - TermsConditionService _termsConditionService = locator(); - - ListUserAgreement get listUserAgreement => _termsConditionService.listUserAgreement; - - Future getUserTermsAndConditionsForEPharmcy() async { - setState(ViewState.Busy); - await _termsConditionService.getUserTermsAndConditionsForEPharmcy(); - if (_termsConditionService.hasError) { - error = _termsConditionService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } -} diff --git a/lib/core/viewModels/pharmacy_categorise_view_model.dart b/lib/core/viewModels/pharmacy_categorise_view_model.dart deleted file mode 100644 index 81179091..00000000 --- a/lib/core/viewModels/pharmacy_categorise_view_model.dart +++ /dev/null @@ -1,158 +0,0 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/brands_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/final_products_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/parent_products_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/pharmacy_categorise.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/scan_qr_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/sub_categories_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacy/sub_products_model.dart'; -import 'package:diplomaticquarterapp/core/model/search_products_model.dart'; - -import 'package:diplomaticquarterapp/core/service/pharmacy_categorise_service.dart'; -import 'package:diplomaticquarterapp/locator.dart'; - -import 'base_view_model.dart'; - -class PharmacyCategoriseViewModel extends BaseViewModel { - bool hasError = false; - PharmacyCategoriseService _pharmacyCategoriseService = - locator(); - - List get categorise => - _pharmacyCategoriseService.categoriseList; - - List get categoriseParent => - _pharmacyCategoriseService.parentCategoriseList; - - List get parentProducts => - _pharmacyCategoriseService.parentProductsList; - - List get subCategorise => - _pharmacyCategoriseService.subCategoriseList; - - List get subProducts => - _pharmacyCategoriseService.subProductsList; - - List get finalProducts => - _pharmacyCategoriseService.finalProducts; - List get brandsList => _pharmacyCategoriseService.brandsList; - - List get searchList => - _pharmacyCategoriseService.searchList; - - List get scanList => _pharmacyCategoriseService.scanList; - - Future getCategorise() async { - hasError = false; - // _insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _pharmacyCategoriseService.getCategorise(); - if (_pharmacyCategoriseService.hasError) { - error = _pharmacyCategoriseService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future getBrands() async { - hasError = false; - // _insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _pharmacyCategoriseService.getBrands(); - if (_pharmacyCategoriseService.hasError) { - error = _pharmacyCategoriseService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future scanQr({String id}) async { - hasError = false; - // _insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _pharmacyCategoriseService.scanQr(id: id); - if (_pharmacyCategoriseService.hasError) { - error = _pharmacyCategoriseService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - clearSearchList() { - _pharmacyCategoriseService.clearSearchList(); - } - - Future searchProducts({String productName}) async { - hasError = false; - _pharmacyCategoriseService.clearSearchList(); - setState(ViewState.Busy); - await _pharmacyCategoriseService.searchProducts(productName: productName); - if (_pharmacyCategoriseService.hasError) { - error = _pharmacyCategoriseService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future getCategoriseParent({String i}) async { - hasError = false; - // _insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _pharmacyCategoriseService.getCategoriseParent(id: i); - if (_pharmacyCategoriseService.hasError) { - error = _pharmacyCategoriseService.error; - setState(ViewState.ErrorLocal); - } else - await getParentProducts(i: i); - await getBrands(); - } - - Future getParentProducts({String i}) async { - hasError = false; - // _insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _pharmacyCategoriseService.getParentProducts(id: i); - if (_pharmacyCategoriseService.hasError) { - error = _pharmacyCategoriseService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future getSubCategorise({String i}) async { - hasError = false; - // _insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _pharmacyCategoriseService.getSubCategorise(id: i); - if (_pharmacyCategoriseService.hasError) { - error = _pharmacyCategoriseService.error; - setState(ViewState.ErrorLocal); - } else - getSubProducts(i: i); - } - - Future getSubProducts({String i}) async { - hasError = false; - // _insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _pharmacyCategoriseService.getSubProducts(id: i); - if (_pharmacyCategoriseService.hasError) { - error = _pharmacyCategoriseService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future getFinalProducts({String i}) async { - hasError = false; - // _insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _pharmacyCategoriseService.getFinalProducts(id: i); - if (_pharmacyCategoriseService.hasError) { - error = _pharmacyCategoriseService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } -} diff --git a/lib/locator.dart b/lib/locator.dart index 6864379e..b0b999be 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -6,9 +6,9 @@ import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_informa 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/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; +// import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; +// import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; +// import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; @@ -48,17 +48,11 @@ import 'core/service/medical/prescriptions_service.dart'; import 'core/service/medical/radiology_service.dart'; import 'core/service/medical/reports_monthly_service.dart'; import 'core/service/medical/vital_sign_service.dart'; -import 'core/service/parmacyModule/lacum-registration-service.dart'; -import 'core/service/parmacyModule/lacum-service.dart'; -import 'core/service/parmacyModule/lacum-transfer-service.dart'; import 'core/service/parmacyModule/order-preview-service.dart'; import 'core/service/notifications_service.dart'; -import 'core/service/parmacyModule/terms-condition-service.dart'; import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'core/service/parmacyModule/parmacy_module_service.dart'; -import 'core/service/offers_service.dart'; -import 'core/service/pharmacy_categorise_service.dart'; import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/blooddonation/blood_details_view_model.dart'; @@ -91,23 +85,15 @@ import 'core/viewModels/medical/vital_sign_view_model.dart'; import 'core/viewModels/medical/reports_view_model.dart'; import 'core/viewModels/medical/weight_pressure_view_model.dart'; import 'core/viewModels/notifications_view_model.dart'; -import 'core/viewModels/offers_Categorise_view_model.dart'; import 'core/viewModels/pharmacies_view_model.dart'; import 'core/service/pharmacies_service.dart'; import 'core/service/insurance_service.dart'; import 'core/viewModels/insurance_card_View_model.dart'; import 'core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; -import 'core/viewModels/pharmacyModule/lacum-registration-viewModel.dart'; -import 'core/viewModels/pharmacyModule/lacum-trasnfer-viewModel.dart'; -import 'core/viewModels/pharmacyModule/lacum-viewmodel.dart'; import 'core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; -import 'core/viewModels/pharmacyModule/tems-condition-viewmodel.dart'; -import 'core/viewModels/pharmacy_categorise_view_model.dart'; import 'core/viewModels/qr_view_model.dart'; import 'core/viewModels/vaccine_view_model.dart'; import 'core/service/vaccine_service.dart'; -import 'services/pharmacy_services/orderDetails_service.dart'; -import 'services/pharmacy_services/pharmacyAddress_service.dart'; GetIt locator = GetIt.instance; @@ -137,7 +123,6 @@ void setupLocator() { locator.registerLazySingleton(() => EReferralService()); locator.registerLazySingleton(() => HomeHealthCareService()); locator.registerLazySingleton(() => CMCService()); - locator.registerLazySingleton(() => PatientSickLeaveService()); locator.registerLazySingleton(() => MyBalanceService()); locator.registerLazySingleton(() => BloodSugarService()); @@ -150,32 +135,24 @@ void setupLocator() { locator.registerLazySingleton(() => FindusService()); locator.registerLazySingleton(() => LiveChatService()); locator.registerLazySingleton(() => H2OService()); - locator.registerLazySingleton(() => BloodDonationService()); locator.registerLazySingleton(() => BloodDetailsService()); locator.registerLazySingleton(() => ChildVaccinesService()); locator.registerLazySingleton(() => UserInformationService()); locator.registerLazySingleton(() => CreteNewBabyService()); locator.registerLazySingleton(() => DeleteBabyService()); - locator.registerLazySingleton(() => VaccinationTableService()); //pharmacy - locator.registerLazySingleton(() => PharmacyCategoriseService()); - locator.registerLazySingleton(() => OffersCategoriseService()); + // locator.registerLazySingleton(() => PharmacyCategoriseService()); + // locator.registerLazySingleton(() => OffersCategoriseService()); locator.registerLazySingleton(() => NotificationService()); locator.registerLazySingleton(() => WeatherService()); locator.registerLazySingleton(() => PharmacyModuleService()); locator.registerLazySingleton(() => OrderPreviewService()); - locator.registerLazySingleton(() => LacumService()); - locator.registerLazySingleton(() => LacumTransferService()); - locator.registerLazySingleton(() => LacumRegistrationService()); - locator.registerLazySingleton(() => OrderService()); - locator.registerLazySingleton(() => PharmacyAddressService()); - locator.registerLazySingleton(() => OrderDetailsService()); locator.registerLazySingleton(() => CustomerAddressesService()); - locator.registerLazySingleton(() => TermsConditionService()); + // locator.registerLazySingleton(() => TermsConditionService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -207,10 +184,6 @@ void setupLocator() { locator.registerFactory(() => ChildVaccinesViewModel()); locator.registerFactory(() => UserInformationViewModel()); locator.registerFactory(() => VaccinationTableViewModel()); - locator.registerFactory(() => OrderModelViewModel()); - locator.registerFactory(() => PharmacyAddressesViewModel()); - locator.registerFactory(() => TermsConditionViewModel()); - locator.registerFactory(() => AddNewChildViewModel()); locator.registerFactory(() => H2OViewModel()); locator.registerFactory(() => BloodSugarViewMode()); @@ -227,11 +200,8 @@ void setupLocator() { locator.registerFactory(() => PharmacyModuleViewModel()); locator.registerFactory(() => OrderPreviewViewModel()); - locator.registerFactory(() => LacumViewModel()); - locator.registerFactory(() => LacumTranferViewModel()); - locator.registerFactory(() => LacumRegistrationViewModel()); //pharmacy - locator.registerFactory(() => PharmacyCategoriseViewModel()); - locator.registerFactory(() => OffersCategoriseViewModel()); + // locator.registerFactory(() => PharmacyCategoriseViewModel()); + // locator.registerFactory(() => OffersCategoriseViewModel()); } 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/models/id-name-pair.dart b/lib/models/id-name-pair.dart deleted file mode 100644 index 00336572..00000000 --- a/lib/models/id-name-pair.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:flutter/material.dart'; - -class IdNamePair with ChangeNotifier{ - var id; - var name; - - IdNamePair(this.id, this.name); - - void updateData() { - notifyListeners(); - } -} \ No newline at end of file diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 00052db4..e2a1fb39 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -48,6 +48,7 @@ class _AllHabibMedicalServiceState extends State { AuthenticatedUser authUser = new AuthenticatedUser(); LocationUtils locationUtils; var weather = '--'; + @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { @@ -65,7 +66,7 @@ class _AllHabibMedicalServiceState extends State { isShowAppBar: true, appBarTitle: TranslationBase.of(context).alhabiServices, isShowDecPage: false, - isHelp:false, + isHelp: false, body: Column( children: [ Expanded( @@ -252,7 +253,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( @@ -345,20 +346,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( @@ -368,7 +372,7 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: 'assets/images/new-design/find_us_icon.png', - title: 'Find Us', + title: TranslationBase.of(context).findUs, ), ], ), @@ -385,6 +389,7 @@ class _AllHabibMedicalServiceState extends State { setState(() { authUser = data; }); + print(authUser.patientID); } var data = await this.sharedPref.getObject(WEATHER); weather = data != null ? data['Temperature'].toString() + '\u2103' : '--'; diff --git a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart index 2f2540e8..a63125d0 100644 --- a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart +++ b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart @@ -12,6 +12,7 @@ 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 @@ -124,7 +125,7 @@ class _HospitalsPageState extends State { return WeatherSlider(data); }).toList())) ])) - : Container()), + : Center(child: AppCircularProgressIndicator())), ); } 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 1eaa02da..bb91a79e 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -32,7 +32,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 92e6bc9e..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() { @@ -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 57632c46..3dd9123b 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -80,7 +80,7 @@ class _MyFamily extends State with TickerProviderStateMixin { return AppScaffold( appBarTitle: TranslationBase.of(context).myFamilyFiles, isShowAppBar: widget.isAppbarVisible, - // imagesInfo: imagesInfo, + imagesInfo: imagesInfo, description: TranslationBase.of(context).familyInfo, body: Scaffold( extendBodyBehindAppBar: true, @@ -167,38 +167,38 @@ class _MyFamily extends State with TickerProviderStateMixin { ), ); - return AppScaffold( - appBarTitle: TranslationBase.of(context).myFamilyFiles, - isShowAppBar: widget.isAppbarVisible, - body: SingleChildScrollView( - child: Container( - height: SizeConfig.screenHeight * .9, - width: SizeConfig.realScreenWidth, - padding: EdgeInsets.all(20), - child: Stack( - children: [ - TabBar( - controller: _tabController, - indicatorColor: Colors.red, - tabs: [ - Tab( - // padding: EdgeInsets.all(6), - child: AppText(TranslationBase.of(context).family)), - Tab( - // padding: EdgeInsets.all(6), - child: - AppText(TranslationBase.of(context).request)), - ], - ), - TabBarView( - controller: _tabController, - children: [ - myFamilyDetails(context), - myFamilyRequest(context) - ], - ) - ], - )))); + // return AppScaffold( + // appBarTitle: TranslationBase.of(context).myFamilyFiles, + // isShowAppBar: widget.isAppbarVisible, + // body: SingleChildScrollView( + // child: Container( + // height: SizeConfig.screenHeight * .9, + // width: SizeConfig.realScreenWidth, + // padding: EdgeInsets.all(20), + // child: Stack( + // children: [ + // TabBar( + // controller: _tabController, + // indicatorColor: Colors.red, + // tabs: [ + // Tab( + // // padding: EdgeInsets.all(6), + // child: AppText(TranslationBase.of(context).family)), + // Tab( + // // padding: EdgeInsets.all(6), + // child: + // AppText(TranslationBase.of(context).request)), + // ], + // ), + // TabBarView( + // controller: _tabController, + // children: [ + // myFamilyDetails(context), + // myFamilyRequest(context) + // ], + // ) + // ], + // )))); } Widget myFamilyDetails(context) { 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/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 93069f1e..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.455) / 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(7.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: Alignment.bottomRight, - margin: - EdgeInsets.fromLTRB(0.0, 10.0, 10.0, 7.0), - child: Image.asset(e.icon, - width: 40.0, height: 40.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/base/base_view.dart b/lib/pages/base/base_view.dart index 80fe1b41..38b70e23 100644 --- a/lib/pages/base/base_view.dart +++ b/lib/pages/base/base_view.dart @@ -33,10 +33,10 @@ class _BaseViewState extends State> { @override void initState() { - if (widget.allowAny && widget.onModelReady != null) { + if(widget.allowAny && widget.onModelReady != null){ widget.onModelReady(model); - } else if (widget.onModelReady != null && - Provider.of(context, listen: false).isLogin) { + } + else if (widget.onModelReady != null && Provider.of(context, listen: false).isLogin) { widget.onModelReady(model); } super.initState(); diff --git a/lib/pages/final_products_page.dart b/lib/pages/final_products_page.dart deleted file mode 100644 index 03adee97..00000000 --- a/lib/pages/final_products_page.dart +++ /dev/null @@ -1,480 +0,0 @@ -import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; -import 'package:flutter/material.dart'; - -import 'base/base_view.dart'; - -class FinalProductsPage extends StatefulWidget { - String id; - FinalProductsPage({this.id}); - @override - _FinalProductsPageState createState() => _FinalProductsPageState(id: id); -} - -class _FinalProductsPageState extends State { - String id; - _FinalProductsPageState({this.id}); - String categoriseName = "Personal Care"; - bool styleOne = true; - bool styleTwo = false; - Icon styleIcon = Icon( - Icons.widgets_sharp, - color: Colors.blue, - size: 29.0, - ); - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getFinalProducts(i: id), - builder: (BuildContext context, PharmacyCategoriseViewModel model, - Widget child) => - PharmacyAppScaffold( - appBarTitle: 'Products', - isBottomBar: false, - isShowAppBar: true, - backgroundColor: Colors.white, - isShowDecPage: false, - baseViewModel: model, - body: Container( - height: MediaQuery.of(context).size.height * 5.87, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ -//Expanded widget heree if nassery - - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Texts( - 'Products', - fontWeight: FontWeight.w600, - ), - ), - Row( - children: [ - Container( - height: 44.0, - child: VerticalDivider( - color: Colors.black45, - thickness: 1.0, - //width: 0.3, - // indent: 0.0, - ), - ), - Padding( - padding: EdgeInsets.all(8.0), - child: InkWell( - child: styleIcon, - onTap: () { - setState(() { - if (styleOne == true) { - styleOne = false; - styleTwo = true; - styleIcon = Icon( - Icons.auto_awesome_mosaic, - color: Colors.blue, - size: 29.0, - ); - } else { - styleOne = true; - styleTwo = false; - styleIcon = Icon( - Icons.widgets_sharp, - color: Colors.blue, - size: 29.0, - ); - } - }); - }, - ), - ), - ], - ), - ], - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - styleOne == true - ? Expanded( - child: Container( - height: MediaQuery.of(context).size.height * 3.90, - child: GridView.builder( - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 0.5, - mainAxisSpacing: 2.0, - childAspectRatio: 1.0, - ), - itemCount: model.finalProducts.length, - itemBuilder: (BuildContext context, int index) { - return NetworkBaseView( - baseViewModel: model, - child: Card( - color: model.finalProducts[index] - .discountName != - null - ? Color(0xffFFFF00) - : Colors.white, - elevation: 0, - shape: Border( - right: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - left: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - bottom: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - top: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - ), - margin: EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(110.0), - ), - color: Colors.white, - ), - padding: EdgeInsets.symmetric( - horizontal: 0), - width: MediaQuery.of(context) - .size - .width / - 3, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Stack( - children: [ - Container( - margin: EdgeInsets.fromLTRB( - 0, 16, 0, 0), - alignment: Alignment.center, - child: Image.network( - model.finalProducts[index] - .images.isNotEmpty - ? model - .finalProducts[ - index] - .images[0] - .thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.cover, - height: 80, - ), - ), - Container( - width: model - .finalProducts[ - index] - .rxMessage != - null - ? MediaQuery.of(context) - .size - .width / - 2.8 - : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: - BorderRadius.only( - topLeft: Radius - .circular(6)), - ), - child: Texts( - model.finalProducts[index] - .rxMessage != - null - ? model - .finalProducts[ - index] - .rxMessage - : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w600, - ), - ), - ], - ), - Container( - margin: EdgeInsets.symmetric( - horizontal: 6, - vertical: 0, - ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - if (model - .finalProducts[ - index] - .discountName != - null) - Container( - width: double.infinity, - height: 13.0, - decoration: - BoxDecoration( - color: - Color(0xff5AB145), - ), - child: Center( - child: Texts( - model - .finalProducts[ - index] - .discountName, - regular: true, - color: Colors.white, - fontSize: 10.4, - ), - ), - ), - Texts( - model.finalProducts[index] - .name, - regular: true, - fontSize: 12, - fontWeight: - FontWeight.w400, - ), - Padding( - padding: - const EdgeInsets.only( - top: 4, - bottom: 4), - child: Texts( - "SAR ${model.finalProducts[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ - StarRating( - totalAverage: model - .finalProducts[ - index] - .approvedRatingSum > - 0 - ? (model.finalProducts[index].approvedRatingSum - .toDouble() / - model - .finalProducts[index] - .approvedRatingSum - .toDouble()) - .toDouble() - : 0, - forceStars: true), - Texts( - "(${model.finalProducts[index].approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ) - ], - ), - ], - ), - ), - ], - ), - ), - )); - }, - ), - ), - ) - : Expanded( - child: Container( - height: MediaQuery.of(context).size.height * 5.0, - child: ListView.builder( - itemCount: model.finalProducts.length, - itemBuilder: - (BuildContext context, int index) { - return Card( - child: Row( - children: [ - Stack( - children: [ - Column( - children: [ - Container( - decoration: BoxDecoration(), - child: Padding( - padding: EdgeInsets.only( - left: 9.0, - top: 8.0, - right: 10.0, - ), - ), - ), - Container( - margin: EdgeInsets.fromLTRB( - 0, 0, 0, 0), - alignment: Alignment.center, - child: Image.network( - model.finalProducts[index] - .images.isNotEmpty - ? model - .finalProducts[ - index] - .images[0] - .thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.contain, - height: 80, - ), - ), - ], - ), - Column( - children: [ - Container( - width: model - .finalProducts[ - index] - .rxMessage != - null - ? MediaQuery.of(context) - .size - .width / - 3.5 - : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: - BorderRadius.only( - topLeft: Radius - .circular(6)), - ), - child: Texts( - model.finalProducts[index] - .rxMessage != - null - ? model - .finalProducts[ - index] - .rxMessage - : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w600, - ), - ), - ], - ), - ], - ), - Container( - height: 100.0, - margin: EdgeInsets.symmetric( - horizontal: 6, - vertical: 0, - ), - child: Column( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SizedBox( - height: 4.0, - ), - Container( - height: 35.0, - width: 250.0, - child: Texts( - model.finalProducts[index] - .name, - regular: true, - fontSize: 13.2, - fontWeight: FontWeight.w500, - maxLines: 2, - ), - ), - SizedBox( - height: 8.0, - ), - Padding( - padding: - const EdgeInsets.only( - top: 4, bottom: 4), - child: Texts( - "SAR ${model.finalProducts[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ - StarRating( - totalAverage: model - .finalProducts[ - index] - .approvedRatingSum > - 0 - ? (model - .finalProducts[ - index] - .approvedRatingSum - .toDouble() / - model - .finalProducts[ - index] - .approvedRatingSum - .toDouble()) - .toDouble() - : 0, - forceStars: true), - Texts( - "(${model.finalProducts[index].approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ) - ], - ), - ], - ), - ), - ], - ), - ); - }), - ), - ) - ], - ), - ), - )); - } -} 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 20e678b7..f938480b 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -14,13 +14,6 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -32,8 +25,6 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -import 'landing_page_pharmcy.dart'; - class HomePage extends StatefulWidget { final Function goToMyProfile; @@ -63,7 +54,7 @@ class _HomePageState extends State { onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, wi) => AppScaffold( isShowDecPage: false, - isHelp:true, + isHelp: true, body: Container( width: double.infinity, child: SingleChildScrollView( @@ -506,8 +497,8 @@ class _HomePageState extends State { opacity: 0.5, ), DashboardItem( - // onTap: () => Navigator.push( - // context, FadePage(page: PharmacyPage())), + //onTap: () => Navigator.push(context, FadePage(page: PharmacyPage())), + child: Center( child: Padding( padding: const EdgeInsets.all(15.0), @@ -534,10 +525,6 @@ class _HomePageState extends State { ), height: MediaQuery.of(context).size.width * 0.4, imageName: 'al-habib_onlne_pharmacy_bg.png', - onTap: () => Navigator.push( - context, - FadePage(page: LandingPagePharmacy()), - ), ), DashboardItem( onTap: () { @@ -781,7 +768,7 @@ class _HomePageState extends State { ), ), height: 106, - imageName: 'rectangle.png', + imageName: 'contact_us_bg.png', opacity: 0.5, color: Colors.grey[700], width: MediaQuery.of(context).size.width * 0.45, @@ -790,7 +777,7 @@ class _HomePageState extends State { ), ), SizedBox( - height: 80, + height: 120, ) ], ), diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart deleted file mode 100644 index 4308e186..00000000 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ /dev/null @@ -1,162 +0,0 @@ -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/parent_categorise_page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart'; -import 'package:diplomaticquarterapp/pages/search_products_page.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; -import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.dart'; -import 'package:flutter/material.dart'; - -import '../offers_categorise_page.dart'; - -class LandingPagePharmacy extends StatefulWidget { - @override - _LandingPagePharmacyState createState() => _LandingPagePharmacyState(); -} - -class _LandingPagePharmacyState extends State { - int currentTab = 0; - PageController pageController; - ProjectViewModel projectProvider; - - _changeCurrentTab(int tab) { - setState(() { - currentTab = tab; - pageController.jumpToPage(tab); - }); - } - - void initState() { - super.initState(); - pageController = PageController(keepPage: true); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: currentTab == 0 || currentTab == 1 - ? AppBar( - backgroundColor: Color(0xff5AB145), - elevation: 0, - title: Container( - height: MediaQuery.of(context).size.height * 0.056, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - color: Colors.white, - ), - child: InkWell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Row( - //crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Icon(Icons.search, size: 25.0), - SizedBox( - width: 15.0, - ), - Texts( - TranslationBase.of(context).searchProductHere, - fontSize: 13, - ) - ], - ), - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => SearchProductsPage()), - ); - }, - ), - ), - leading: Builder( - builder: (BuildContext context) { - return Container( - height: 2.0, - width: 10.0, - child: Image.asset( - 'assets/images/pharmacy_logo.png', - ), - ); - }, - ), - actions: [ - // IconButton( - // iconSize: 70, - // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', - // height: 100, width: 100, fit: BoxFit.cover), - // onPressed: () { - // triggerRobot(); - // } //do something, - // ) - ], - centerTitle: true, - ) - : currentTab == 4 - ? null - : AppBar( - backgroundColor: Color(0xff5AB145), - elevation: 0, - textTheme: TextTheme( - headline6: TextStyle( - color: Colors.white, fontWeight: FontWeight.bold), - ), - title: Text(getText(currentTab).toUpperCase()), - leading: Builder( - builder: (BuildContext context) { - return IconButton( - icon: Icon(Icons.arrow_back), - color: Colors.white, - onPressed: () => Scaffold.of(context).openDrawer(), - ); - }, - ), - actions: [ - // IconButton( - // iconSize: 70, - // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', - // height: 100, width: 100, fit: BoxFit.cover), - // onPressed: () { - // triggerRobot(); - // } //do something, - // ) - ], - centerTitle: true, - ), - extendBody: false, - body: PageView( - physics: NeverScrollableScrollPhysics(), - controller: pageController, - children: [ - PharmacyPage(), - PharmacyCategorisePage(), - OffersCategorisePage(), - Container( - child: Text('text'), - ), - CartOrderPage(), - ], // Please do not remove the BookingOptions from this array - ), - bottomNavigationBar: BottomNavPharmacyBar( - changeIndex: _changeCurrentTab, - index: currentTab, - ), - ); - } - - getText(currentTab) { - switch (currentTab) { - case 2: - return 'Wishlist'; - case 3: - return 'My Account'; - case 4: - return 'Shopping Cart'; - } - } -} 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 c200fecf..50cada42 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -261,6 +261,7 @@ class _ConfirmLogin extends State { } authenticateUser(type, isActive) { + GifLoaderDialogUtils.showMyDialog(context); if (type == 2 || type == 3) { fingrePrintBefore = type; } @@ -307,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 @@ -552,7 +552,6 @@ class _ConfirmLogin extends State { } checkIfUserAgreedBefore(CheckActivationCode result) { - print(result); if (result.isNeedUserAgreement == true) { //move to agreement page. } else { 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 828218a8..5304bb9b 100644 --- a/lib/pages/medical/vital_sign/vital_sign_item.dart +++ b/lib/pages/medical/vital_sign/vital_sign_item.dart @@ -80,8 +80,7 @@ class VitalSignItem extends StatelessWidget { TextSpan( text: " " + unit, style: TextStyle( - color: - Theme.of(context).textTheme.headline1.color, + color: HexColor('#B8382C'), ), ), ]), diff --git a/lib/pages/offers_categorise_page.dart b/lib/pages/offers_categorise_page.dart deleted file mode 100644 index 782ea018..00000000 --- a/lib/pages/offers_categorise_page.dart +++ /dev/null @@ -1,620 +0,0 @@ -import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/viewModels/offers_Categorise_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -import 'base/base_view.dart'; - -class OffersCategorisePage extends StatefulWidget { - @override - _OffersCategorisePageState createState() => _OffersCategorisePageState(); -} - -class _OffersCategorisePageState extends State { - String categoriseName = "Personal Care"; - bool styleOne = true; - bool styleTwo = false; - Icon styleIcon = Icon( - Icons.widgets_sharp, - color: Colors.blue, - size: 29.0, - ); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectProvider = Provider.of(context); - return BaseView( - onModelReady: (model) => model.getOffersCategorise(), - builder: (BuildContext context, OffersCategoriseViewModel model, - Widget child) => - PharmacyAppScaffold( - appBarTitle: 'Offers', - isShowAppBar: true, - backgroundColor: Colors.white, - isShowDecPage: false, - baseViewModel: model, - body: Container( - //height: MediaQuery.of(context).size.height * 0.57, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(10.0), - child: Container( - child: Texts( - 'Categories', - fontWeight: FontWeight.w800, - ), - ), - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - //Expanded widget heree if nassery - Container( - height: MediaQuery.of(context).size.height * 0.20, - child: ListView.builder( - scrollDirection: Axis.horizontal, - itemCount: model.categorise.length, - itemBuilder: (BuildContext context, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - InkWell( - child: Column( - children: [ - Container( - height: 60.0, - width: 65.0, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.orange.shade200 - .withOpacity(0.45), - ), - child: Icon( - Icons.apps_sharp, - size: 32.0, - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.2, - height: MediaQuery.of(context) - .size - .height * - 0.09, - child: Center( - child: Texts( - model.categorise[index].name, - fontWeight: FontWeight.w600, - fontSize: 13.8, - ), - ), - ), - ], - ), - onTap: () { - model.getOffersProducts( - i: model.categorise[index].id); - String ids = model.categorise[index].id; - - categoriseName = - model.categorise[index].name; - }), - ], - ), - ); - }), - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Texts( - categoriseName, - fontWeight: FontWeight.w800, - ), - ), - Row( - children: [ - Container( - height: 44.0, - child: VerticalDivider( - color: Colors.black45, - thickness: 0.7, - //width: 0.3, - // indent: 0.0, - ), - ), - Padding( - padding: EdgeInsets.all(8.0), - child: InkWell( - child: styleIcon, - onTap: () { - setState(() { - if (styleOne == true) { - styleOne = false; - styleTwo = true; - styleIcon = Icon( - Icons.auto_awesome_mosaic, - color: Colors.blue, - size: 29.0, - ); - } else { - styleOne = true; - styleTwo = false; - styleIcon = Icon( - Icons.widgets_sharp, - color: Colors.blue, - size: 29.0, - ); - } - }); - }, - ), - ), - ], - ), - ], - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - styleOne == true - ? Expanded( - child: Container( - height: MediaQuery.of(context).size.height * 0.50, - child: GridView.builder( - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 0.5, - mainAxisSpacing: 2.0, - childAspectRatio: 0.85, - ), - itemCount: model.products.length, - itemBuilder: (BuildContext context, int index) { - return NetworkBaseView( - baseViewModel: model, - child: Card( - color: model.products[index] - .discountName != - null - ? Color(0xffFFFF00) - : Colors.white, - elevation: 0, - shape: Border( - right: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - left: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - bottom: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - top: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - ), - margin: EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - child: Container( - height: 250.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(110.0), - ), - color: Colors.white, - ), - padding: EdgeInsets.symmetric( - horizontal: 0), - width: MediaQuery.of(context) - .size - .width / - 3, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Stack( - children: [ - if (model.products[index] - .discountName != - null) - RotatedBox( - quarterTurns: 4, - child: Container( - decoration: - BoxDecoration(), - child: Padding( - padding: - EdgeInsets.only( - right: 5.0, - top: 20.0, - bottom: 5.0, - ), - child: Texts( - 'offer' - .toUpperCase(), - color: Colors.red, - fontSize: 13.0, - fontWeight: - FontWeight.w900, - ), - ), - transform: new Matrix4 - .rotationZ( - 5.837200), - ), - ), - Container( - margin: EdgeInsets.fromLTRB( - 0, 16, 0, 0), - alignment: Alignment.center, - child: Image.network( - model.products[index] - .images.isNotEmpty - ? model - .products[index] - .images[0] - .thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.cover, - height: 80, - ), - ), - Container( - width: model.products[index] - .rxMessage != - null - ? MediaQuery.of(context) - .size - .width / - 5 - : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: - BorderRadius.only( - topLeft: Radius - .circular(6)), - ), - child: Texts( - model.products[index] - .rxMessage != - null - ? model - .products[index] - .rxMessage - : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ), - ), - ], - ), - Container( - margin: EdgeInsets.symmetric( - horizontal: 6, - vertical: 0, - ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - if (model.products[index] - .discountName != - null) - Container( - width: double.infinity, - height: 22.0, - decoration: - BoxDecoration( - color: - Color(0xff5AB145), - ), - child: Center( - child: Texts( - model - .products[index] - .discountName, - regular: true, - color: Colors.white, - fontSize: 12.0, - fontWeight: - FontWeight.w700, - ), - ), - ), - Texts( - model - .products[index].name, - regular: true, - fontSize: 12.58, - fontWeight: - FontWeight.w600, - ), - Padding( - padding: - const EdgeInsets.only( - top: 4, - bottom: 4), - child: Texts( - "SAR ${model.products[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ - StarRating( - totalAverage: model - .products[ - index] - .approvedRatingSum > - 0 - ? (model.products[index].approvedRatingSum - .toDouble() / - model - .products[index] - .approvedRatingSum - .toDouble()) - .toDouble() - : 0, - forceStars: true), - Texts( - "(${model.products[index].approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ) - ], - ), - ], - ), - ), - ], - ), - ), - )); - }, - ), - ), - ) - : Expanded( - child: Container( - child: ListView.builder( - itemCount: model.products.length, - itemBuilder: - (BuildContext context, int index) { - return Card( - // color: - // model.products[index].discountName != - // null - // ? Color(0xffFFFF00) - // : Colors.white, - child: Row( - children: [ - Stack( - children: [ - Column( - children: [ - if (model.products[index] - .discountName != - null) - Container( - decoration: - BoxDecoration(), - child: Padding( - padding: - EdgeInsets.only( - left: 9.0, - top: 8.0, - right: 10.0, - ), - child: Container( - color: Colors.yellow, - height: 25.0, - width: 70.0, - child: Center( - child: Texts( - 'offer' - .toUpperCase(), - color: Colors.red, - fontSize: 13.0, - fontWeight: - FontWeight - .w900, - ), - ), - ), - ), - transform: - new Matrix4.rotationZ( - 6.15099), - ), - Container( - margin: EdgeInsets.fromLTRB( - 0, 0, 0, 0), - alignment: Alignment.center, - child: Image.network( - model.products[index] - .images.isNotEmpty - ? model - .products[index] - .images[0] - .thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.cover, - height: 80, - ), - ), - ], - ), - Column( - children: [ - Container( - width: model.products[index] - .rxMessage != - null - ? MediaQuery.of(context) - .size - .width / - 5 - : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: - BorderRadius.only( - topLeft: Radius - .circular(6)), - ), - child: Texts( - model.products[index] - .rxMessage != - null - ? model - .products[index] - .rxMessage - : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ), - ), - ], - ), - ], - ), - Container( - margin: EdgeInsets.symmetric( - horizontal: 6, - vertical: 0, - ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - if (model.products[index] - .discountName != - null) - Container( - width: 250.0, - height: 22.5, - decoration: BoxDecoration( - color: Color(0xff5AB145), - ), - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 5.5, - ), - child: Texts( - model.products[index] - .discountName, - regular: true, - color: Colors.white, - fontSize: 12.0, - fontWeight: - FontWeight.w700, - ), - ), - ), - SizedBox( - height: 4.0, - ), - Texts( - model.products[index].name, - regular: true, - fontSize: 14.0, - fontWeight: FontWeight.w600, - ), - SizedBox( - height: 8.0, - ), - Padding( - padding: - const EdgeInsets.only( - top: 4, bottom: 4), - child: Texts( - "SAR ${model.products[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ - StarRating( - totalAverage: model - .products[ - index] - .approvedRatingSum > - 0 - ? (model - .products[ - index] - .approvedRatingSum - .toDouble() / - model - .products[ - index] - .approvedRatingSum - .toDouble()) - .toDouble() - : 0, - forceStars: true), - Texts( - "(${model.products[index].approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w500, - ) - ], - ), - ], - ), - ), - ], - ), - ); - }), - ), - ) - ], - ), - ), - )); - } -} diff --git a/lib/pages/parent_categorise_page.dart b/lib/pages/parent_categorise_page.dart deleted file mode 100644 index 4acb3b68..00000000 --- a/lib/pages/parent_categorise_page.dart +++ /dev/null @@ -1,1032 +0,0 @@ -import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/sub_categorise_page.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:giffy_dialog/giffy_dialog.dart'; - -import 'base/base_view.dart'; -import 'final_products_page.dart'; - -class ParentCategorisePage extends StatefulWidget { - String id; - String titleName; - ParentCategorisePage({this.id, this.titleName}); - @override - _ParentCategorisePageState createState() => - _ParentCategorisePageState(id: id, titleName: titleName); -} - -class _ParentCategorisePageState extends State { - String id; - String titleName; - _ParentCategorisePageState({this.id, this.titleName}); - Map values = {'huusam': false, 'ali': false, 'noor': false}; - bool checkedBrands = false; - bool checkedCategorise = false; - String categoriseName = "Personal Care"; - bool styleOne = true; - bool styleTwo = false; - Icon styleIcon = Icon( - Icons.widgets_sharp, - color: Colors.blue, - size: 29.0, - ); - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( - onModelReady: (model) => model.getCategoriseParent(i: id), - builder: (BuildContext context, PharmacyCategoriseViewModel model, - Widget child) => - PharmacyAppScaffold( - appBarTitle: titleName, - isBottomBar: false, - isShowAppBar: true, - backgroundColor: Colors.white, - isShowDecPage: false, - baseViewModel: model, - body: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 5.90, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: Image.network( - id == '1' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089188_personal-care_2.png' - : id == '2' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089189_skin-care_2.png' - : id == '3' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089190_health-care_2.png' - : id == '4' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089191_sexual-health_2.png' - : id == '5' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089192_beauty_2.png' - : id == '6' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089193_baby-child_2.png' - : id == '7' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089194_vitamins-supplements_2.png' - : id == '8' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png' - : id == '9' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png' - : id == '10' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png' - : '', - fit: BoxFit.fill, - height: 160.0, - width: double.infinity), - ), - if (model.categoriseParent.length > 8) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: EdgeInsets.all(10.0), - child: InkWell( - child: Container( - child: Texts( - 'View All Categories', - fontWeight: FontWeight.w300, - ), - ), - onTap: () { - showModalBottomSheet( - isScrollControlled: true, - context: context, - builder: (BuildContext context) { - return Container( - height: MediaQuery.of(context) - .size - .height * - 0.89, - color: Colors.white, - child: Center( - child: ListView.builder( - scrollDirection: - Axis.vertical, - itemCount: model - .categoriseParent.length, - itemBuilder: - (BuildContext context, - int index) { - return Container( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: InkWell( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Texts(model - .categoriseParent[ - index] - .name), - Divider( - thickness: 0.6, - color: Colors - .black12, - ) - ], - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: - (context) => - SubCategorisePage( - title: - model.categoriseParent[index].name, - id: model.categoriseParent[index].id, - parentId: - id, - )), - ); - }, - ), - ), - ); - }), - ), - ); - }, - ); - }, - ), - ), - Icon(Icons.arrow_forward) - ], - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - ], - ), - -//Expanded widget heree if nassery - Padding( - padding: EdgeInsets.only(top: 35.0), - child: Container( - height: MediaQuery.of(context).size.height * 0.2, - child: Center( - child: ListView.builder( - scrollDirection: Axis.horizontal, - itemCount: model.categoriseParent.length > 8 - ? 8 - : model.categoriseParent.length, - itemBuilder: (BuildContext context, int index) { - return Padding( - padding: - EdgeInsets.symmetric(horizontal: 8.0), - child: InkWell( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.symmetric( - horizontal: 13.0), - child: Container( - height: 60.0, - width: 65.0, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.orange.shade200 - .withOpacity(0.45), - ), - child: Center( - child: Icon( - Icons.apps_sharp, - size: 32.0, - ), - ), - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.197, - height: MediaQuery.of(context) - .size - .height * - 0.08, - child: Center( - child: Texts( - projectViewModel.isArabic - ? model - .categoriseParent[index] - .namen - : model - .categoriseParent[index] - .name, - fontSize: 13.4, - fontWeight: FontWeight.w600, - maxLines: 3, - ), - ), - ), - ], - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - SubCategorisePage( - title: model - .categoriseParent[index] - .name, - id: model - .categoriseParent[index] - .id, - parentId: id, - )), - ); - print(id); - }, - ), - ); - }), - ), - ), - ), - - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - InkWell( - child: Row( - children: [ - Icon( - Icons.wrap_text, - ), - SizedBox( - width: 10.0, - ), - Texts( - 'Refine', - fontWeight: FontWeight.w600, - ), - ], - ), - onTap: () { - showModalBottomSheet( - isScrollControlled: true, - context: context, - builder: (BuildContext context) { - return DraggableScrollableSheet( - initialChildSize: 0.95, - maxChildSize: 0.95, - minChildSize: 0.9, - builder: (BuildContext context, - ScrollController scrollController) { - return SingleChildScrollView( - controller: scrollController, - child: Container( - height: MediaQuery.of(context) - .size - .height * - 1.95, - child: Column( - children: [ - Padding( - padding: - EdgeInsets.all(8.0), - child: Row( - children: [ - Icon( - Icons.wrap_text, - ), - SizedBox( - width: 10.0, - ), - Texts( - 'Refine', - fontWeight: - FontWeight.w600, - ), - SizedBox( - width: 250.0, - ), - InkWell( - child: Texts( - 'Close', - color: Colors.red, - fontWeight: - FontWeight.w600, - fontSize: 15.0, - ), - onTap: () { - Navigator.pop( - context); - }, - ), - ], - ), - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - Column( - children: [ - ExpansionTile( - title: - Texts('Categorise'), - children: [ - Container( - height: 350, - child: ListView - .builder( - controller: - scrollController, - scrollDirection: - Axis - .vertical, - shrinkWrap: - true, - itemCount: model - .categoriseParent - .length, - itemBuilder: - (BuildContext - context, - int index) { - return CheckboxListTile( - tristate: - true, - title: Texts(model - .categoriseParent[index] - .name), - controlAffinity: - ListTileControlAffinity.leading, - value: - checkedCategorise, - onChanged: - (bool - value) { - setState( - () { - checkedCategorise = - value; - }); - }, - ); - }), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - ExpansionTile( - title: Texts('Brands'), - children: [ - Container( - height: 350, - child: ListView - .builder( - scrollDirection: - Axis - .vertical, - shrinkWrap: - true, - itemCount: model - .brandsList - .length, - itemBuilder: - (BuildContext - context, - int index) { - return CheckboxListTile( - tristate: - true, - title: Texts(model - .brandsList[index] - .name), - controlAffinity: - ListTileControlAffinity.leading, - value: - checkedBrands, - onChanged: - (bool - value) { - setState( - () { - checkedBrands = - value; - }); - }, - autofocus: - true, - ); - }), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - ExpansionTile( - title: Texts('Price'), - children: [ - Container( - color: Color( - 0xffEEEEEE), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceAround, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - Texts( - 'Min'), - Container( - color: Colors - .white, - width: - 200, - height: - 40, - child: - TextFormField( - decoration: - InputDecoration( - border: - OutlineInputBorder(), - ), - ), - ), - ], - ), - Column( - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - Texts( - 'Max'), - Container( - color: Colors - .white, - width: - 200, - height: - 40, - child: - TextFormField( - decoration: - InputDecoration( - border: - OutlineInputBorder(), - ), - ), - ), - ], - ), - ], - ), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - SizedBox( - height: MediaQuery.of( - context) - .size - .height * - 0.4, - ), - Padding( - padding: - EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - children: [ - Container( - width: 100, - child: Button( - label: 'Reset', - backgroundColor: - Colors.red, - ), - ), - SizedBox( - width: 30, - ), - Container( - width: 200, - child: Button( - label: 'Apply', - backgroundColor: - Colors - .green, - ), - ), - ], - ), - ), - ], - ), - ], - ), - ), - ); - }); - }, - ); - }, - ), - Row( - children: [ - Container( - height: 44.0, - child: VerticalDivider( - color: Colors.black45, - thickness: 1.0, -//width: 0.3, -// indent: 0.0, - ), - ), - Padding( - padding: EdgeInsets.all(8.0), - child: InkWell( - child: styleIcon, - onTap: () { - setState(() { - if (styleOne == true) { - styleOne = false; - styleTwo = true; - styleIcon = Icon( - Icons.auto_awesome_mosaic, - color: Colors.blue, - size: 29.0, - ); - } else { - styleOne = true; - styleTwo = false; - styleIcon = Icon( - Icons.widgets_sharp, - color: Colors.blue, - size: 29.0, - ); - } - }); - }, - ), - ), - ], - ), - ], - ), - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - styleOne == true - ? Container( - height: MediaQuery.of(context).size.height * 4.89, - child: GridView.builder( - physics: NeverScrollableScrollPhysics(), - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 0.5, - mainAxisSpacing: 2.0, - childAspectRatio: 0.9, - ), - itemCount: model.parentProducts.length, - itemBuilder: (BuildContext context, int index) { - return NetworkBaseView( - baseViewModel: model, - child: Card( - color: model.parentProducts[index] - .discountName != - null - ? Color(0xffFFFF00) - : Colors.white, - elevation: 0, - shape: Border( - right: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - left: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - bottom: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - top: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - ), - margin: EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(110.0), - ), - color: Colors.white, - ), - padding: EdgeInsets.symmetric( - horizontal: 0), - width: MediaQuery.of(context) - .size - .width / - 3, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Stack( - children: [ - if (model - .parentProducts[index] - .discountName != - null) - RotatedBox( - quarterTurns: 4, - child: Container( - decoration: - BoxDecoration(), - child: Padding( - padding: - EdgeInsets.only( - right: 5.0, - top: 20.0, - bottom: 5.0, - ), - child: Texts( - 'offer' - .toUpperCase(), - color: Colors.red, - fontSize: 13.0, - fontWeight: - FontWeight.w900, - ), - ), - transform: new Matrix4 - .rotationZ( - 5.837200), - ), - ), - Container( - margin: EdgeInsets.fromLTRB( - 0, 16, 0, 0), - alignment: Alignment.center, - child: Image.network( - model - .parentProducts[ - index] - .images - .isNotEmpty - ? model - .parentProducts[ - index] - .images[0] - .thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.cover, - height: 80, - ), - ), - Container( - width: model - .parentProducts[ - index] - .rxMessage != - null - ? MediaQuery.of(context) - .size - .width / - 5 - : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: - BorderRadius.only( - topLeft: Radius - .circular(6)), - ), - child: Texts( - model - .parentProducts[ - index] - .rxMessage != - null - ? model - .parentProducts[ - index] - .rxMessage - : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ), - ), - ], - ), - Container( - margin: EdgeInsets.symmetric( - horizontal: 6, - vertical: 0, - ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - if (model - .parentProducts[ - index] - .discountName != - null) - Container( - width: double.infinity, - height: 13.0, - decoration: - BoxDecoration( - color: - Color(0xff5AB145), - ), - child: Center( - child: Texts( - model - .parentProducts[ - index] - .discountName, - regular: true, - color: Colors.white, - fontSize: 10.4, - ), - ), - ), - Texts( - model - .parentProducts[index] - .name, - regular: true, - fontSize: 12, - fontWeight: - FontWeight.w700, - ), - Padding( - padding: - const EdgeInsets.only( - top: 4, - bottom: 4), - child: Texts( - "SAR ${model.parentProducts[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ - StarRating( - totalAverage: model - .parentProducts[ - index] - .approvedRatingSum > - 0 - ? (model.parentProducts[index].approvedRatingSum - .toDouble() / - model - .parentProducts[index] - .approvedRatingSum - .toDouble()) - .toDouble() - : 0, - forceStars: true), - Texts( - "(${model.parentProducts[index].approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ) - ], - ), - ], - ), - ), - ], - ), - ), - )); - }, - ), - ) - : Container( - height: MediaQuery.of(context).size.height * 5.0, - child: ListView.builder( - physics: NeverScrollableScrollPhysics(), - itemCount: model.parentProducts.length, - itemBuilder: - (BuildContext context, int index) { - return Card( - child: Row( - children: [ - Stack( - children: [ - Column( - children: [ - Container( - decoration: BoxDecoration(), - child: Padding( - padding: EdgeInsets.only( - left: 9.0, - top: 8.0, - right: 10.0, - ), - ), - ), - Container( - margin: EdgeInsets.fromLTRB( - 0, 0, 0, 0), - alignment: Alignment.center, - child: Image.network( - model - .parentProducts[ - index] - .images - .isNotEmpty - ? model - .parentProducts[ - index] - .images[0] - .thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.contain, - height: 80, - ), - ), - ], - ), - Column( - children: [ - Container( - width: model - .parentProducts[ - index] - .rxMessage != - null - ? MediaQuery.of(context) - .size - .width / - 5 - : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: - BorderRadius.only( - topLeft: Radius - .circular(6)), - ), - child: Texts( - model - .parentProducts[ - index] - .rxMessage != - null - ? model - .parentProducts[ - index] - .rxMessage - : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ), - ), - ], - ), - ], - ), - Container( - height: 100.0, - margin: EdgeInsets.symmetric( - horizontal: 6, - vertical: 0, - ), - child: Column( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SizedBox( - height: 4.0, - ), - Texts( - model.parentProducts[index] - .name, - regular: true, - fontSize: 13.2, - fontWeight: FontWeight.w500, - maxLines: 5, - ), - SizedBox( - height: 8.0, - ), - Padding( - padding: - const EdgeInsets.only( - top: 4, bottom: 4), - child: Texts( - "SAR ${model.parentProducts[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ - StarRating( - totalAverage: model - .parentProducts[ - index] - .approvedRatingSum > - 0 - ? (model - .parentProducts[ - index] - .approvedRatingSum - .toDouble() / - model - .parentProducts[ - index] - .approvedRatingSum - .toDouble()) - .toDouble() - : 0, - forceStars: true), - Texts( - "(${model.parentProducts[index].approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ) - ], - ), - ], - ), - ), - ], - ), - ); - }), - ) - ], - ), - ), - ), - )); - } -} 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/screens/address-select-page.dart b/lib/pages/pharmacies/screens/address-select-page.dart deleted file mode 100644 index 6c39ba3f..00000000 --- a/lib/pages/pharmacies/screens/address-select-page.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; - -class AddressSelectPageTest extends StatelessWidget { - final List addresses; - - AddressSelectPageTest(this.addresses); - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: "test", - isShowAppBar: true, - isShowDecPage: false, - body: Column( - children: [ - Container( - child: RaisedButton( - onPressed: () => {Navigator.pop(context, addresses[0])}, - child: new Text( - "Set address", - style: new TextStyle(color: Colors.white, fontSize: 14), - ), - color: Colors.blueAccent, - disabledColor: Colors.blueAccent, - ), - ), - ], - ), - ); - } -} diff --git a/lib/pages/pharmacies/screens/cart-order-page.dart b/lib/pages/pharmacies/screens/cart-order-page.dart deleted file mode 100644 index d8a274d7..00000000 --- a/lib/pages/pharmacies/screens/cart-order-page.dart +++ /dev/null @@ -1,366 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-preview.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderItem.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class CartOrderPage extends StatelessWidget { - @override - Widget build(BuildContext context) { - final mediaQuery = MediaQuery.of(context); - - PreferredSizeWidget appBarWidget = - AppBarWidget(TranslationBase.of(context).shoppingCart, null, true); - final height = mediaQuery.size.height - - appBarWidget.preferredSize.height - - mediaQuery.padding.top; - - return BaseView( - onModelReady: (model) => model.getOrderPreviewData(), - builder: (_, model, wi) => ChangeNotifierProvider.value( - value: model.cartResponse, - child: AppScaffold( - title: TranslationBase.of(context).shoppingCart, - isShowAppBar: true, - isShowDecPage: false, - isPharmacy: true, - baseViewModel: model, - appBarWidget: appBarWidget, - backgroundColor: Colors.white, - body: !(model.cartResponse.shoppingCarts == null || - model.cartResponse.shoppingCarts.length == 0) - ? Container( - height: height * 0.85, - width: double.infinity, - child: Consumer( - builder: (ctx, cart, _) => Container( - child: SingleChildScrollView( - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - GestureIconButton( - TranslationBase.of(context).deleteAllItems, - Icon( - Icons.delete_outline_sharp, - color: Colors.grey.shade700, - ), - onTap: () => {model.deleteShoppingCart()}, - ), - const Divider( - color: Color(0xFFD6D6D6), - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Container( - child: Column( - children: [ - ...List.generate( - cart.shoppingCarts != null - ? cart.shoppingCarts.length - : 0, - (index) => ProductOrderItem( - cart.shoppingCarts[index], () { - print(cart.shoppingCarts[index] - .quantity); - model.changeProductQuantity( - cart.shoppingCarts[index]); - }, - () => model.deleteProduct( - cart.shoppingCarts[index]))) - ], - ), - ), - const Divider( - color: Color(0xFFD6D6D6), - height: 20, - thickness: 2, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts( - "Subtotal", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - Texts( - "SAR ${(cart.subtotal).toStringAsFixed(2)}", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - ], - ), - const Divider( - color: Color(0xFFD6D6D6), - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts( - "VAT (15%)", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - Texts( - "SAR ${(cart.subtotalVatAmount).toStringAsFixed(2)}", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - ], - ), - const Divider( - color: Color(0xFFD6D6D6), - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts( - TranslationBase.of(context).total, - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Texts( - "SAR ${(cart.subtotal).toStringAsFixed(2)}", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ], - ), - const Divider( - color: Color(0xFFD6D6D6), - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Image.asset( - "assets/images/pharmacy_module/payment_image.png", - width: mediaQuery.size.width - 20, - height: 30.0, - fit: BoxFit.scaleDown, - ) - ], - ), - ), - ), - ), - ), - ) - : Container(), - bottomSheet: Container( - height: !(model.cartResponse.shoppingCarts == null || - model.cartResponse.shoppingCarts.length == 0) ? height * 0.15 : 0, - color: Colors.white, - child: OrderBottomWidget(model.addresses, height), - ), - ), - ), - ); - } -} - -class OrderBottomWidget extends StatefulWidget { - final List addresses; - final double height; - - OrderBottomWidget(this.addresses, this.height); - - @override - _OrderBottomWidgetState createState() => _OrderBottomWidgetState(); -} - -class _OrderBottomWidgetState extends State { - bool isAgree = false; - - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0), - child: Consumer( - builder: (ctx, cart, _) => !(cart.shoppingCarts == null || - cart.shoppingCarts.length == 0) - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Divider( - color: Color(0xFFD6D6D6), - height: 1, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Container( - height: widget.height * 0.070, - color: Color(0xffe6ffe0), - padding: EdgeInsets.symmetric(horizontal: 4), - child: Expanded( - child: Row( - children: [ - InkWell( - onTap: () { - setState(() { - isAgree = !isAgree; - }); - }, - child: Container( - width: 25.0, - height: widget.height * 0.070, - decoration: new BoxDecoration( - color: !isAgree ? Color(0xffeeeeee) : Colors.green, - shape: BoxShape.circle, - ), - child: !isAgree - ? null - : Padding( - padding: const EdgeInsets.all(0.0), - child: Icon( - Icons.check, - color: Colors.white, - size: 25, - ), - ), - ), - ), - Expanded( - child: Container( - padding: EdgeInsets.symmetric(horizontal: 4), - margin: const EdgeInsets.symmetric(vertical: 4), - child: Texts( - "I agree with the terms of service and I adhere to them unconditionally", - fontSize: 13, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ), - InkWell( - onTap: () => { - Navigator.push( - context, - FadePage( - page: PharmacyTermsConditions())) - }, - child: Container( - child: Icon( - Icons.info, - size: 25, - color: Color(0xff005aff), - ), - ), - ), - ], - ), - ), - ), - Container( - height: widget.height * 0.065, - margin: EdgeInsets.symmetric(vertical: 2), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.symmetric( - horizontal: 0, vertical: 4), - child: Row( - children: [ - Texts( - "SAR ${(cart.subtotal).toStringAsFixed(2)}", - fontSize: 14, - fontWeight: FontWeight.bold, - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 4), - child: Texts( - "(inclusive VAT)", - fontSize: 8, - color: Colors.grey, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - ), - Texts( - "${cart.quantityCount} item(s)", - fontSize: 10, - color: Colors.grey, - fontWeight: FontWeight.bold, - ), - ], - ), - RaisedButton( - onPressed: isAgree - ? () => { - Navigator.push( - context, - FadePage( - page: OrderPreviewPage( - widget.addresses))) - } - : null, - child: new Text( - "CHECK OUT", - style: new TextStyle( - color: isAgree - ? Colors.white - : Colors.grey.shade300, - fontSize: 14), - ), - color: Color(0xff005aff), - disabledColor: Color(0xff005aff), - ), - /* SecondaryButton( - label: "CHECK OUT", - color: Colors.blueAccent, - textColor: Colors.white, - onTap: (() { - Navigator.push( - context, FadePage(page: OrderPreviewPage(widget.addresses))); - }), - disabled: isAgree ? false : true, - )*/ - ], - ), - ) - ], - ) - : Container(), - )); - } -} diff --git a/lib/pages/pharmacies/screens/cart-order-preview.dart b/lib/pages/pharmacies/screens/cart-order-preview.dart deleted file mode 100644 index aed2dbc5..00000000 --- a/lib/pages/pharmacies/screens/cart-order-preview.dart +++ /dev/null @@ -1,815 +0,0 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/address-select-page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:flutter/scheduler.dart'; - -class OrderPreviewPage extends StatelessWidget { - final List addresses; - - OrderPreviewPage(this.addresses); - - @override - Widget build(BuildContext context) { - PreferredSizeWidget appBarWidget = AppBarWidget("Check out", null, true); - final mediaQuery = MediaQuery.of(context); - final height = mediaQuery.size.height - - appBarWidget.preferredSize.height - - mediaQuery.padding.top; - - return BaseView( - onModelReady: (model) => model.getShoppingCart(), - builder: (_, model, wi) => ChangeNotifierProvider.value( - value: model.paymentCheckoutData, - child: AppScaffold( - title: "Check out", - isShowAppBar: true, - isShowDecPage: false, - appBarWidget: appBarWidget, - backgroundColor: Colors.white, - baseViewModel: model, - body: Container( - height: height * 0.90, - child: SingleChildScrollView( - child: Container( - color: Color(0xFFF1F1F1), - child: Column( - children: [ - SelectAddressWidget(model, addresses), - SizedBox( - height: 10, - ), - SelectPaymentOptionWidget(model), - SizedBox( - height: 10, - ), - Consumer( - builder: (ctx, paymentData, _) => - paymentData.lacumInformation != null - ? Container( - child: Column( - children: [ - LakumWidget(model), - SizedBox( - height: 10, - ), - ], - ), - ) - : Container()), - Container( - color: Colors.white, - width: double.infinity, - padding: EdgeInsets.all(8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).reviewOrder, - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ...List.generate( - model.cartResponse.shoppingCarts != null - ? model.cartResponse.shoppingCarts.length - : 0, - (index) => ProductOrderPreviewItem( - model.cartResponse.shoppingCarts[index]), - ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.all(8), - child: model.cartResponse.subtotal != null - ? Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context) - .orderSummary, - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - SizedBox( - height: 20, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts( - "Subtotal", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - Texts( - "SAR ${(model.cartResponse.subtotal).toStringAsFixed(2)}", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - ], - ), - const Divider( - color: Color(0xFFD6D6D6), - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts( - "Shipping", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - Texts( - "SAR ${(model.totalAdditionalShippingCharge).toStringAsFixed(2)}", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - ], - ), - const Divider( - color: Color(0xFFD6D6D6), - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts( - "VAT (15%)", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - Texts( - "SAR ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - ], - ), - const Divider( - color: Color(0xFFD6D6D6), - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts( - TranslationBase.of(context).total, - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Texts( - "SAR ${(model.cartResponse.subtotal).toStringAsFixed(2)}", - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - ], - ), - SizedBox( - height: 10, - ), - ], - ) - : Container(), - ) - ], - ), - ), - ), - ), - bottomSheet: Container( - height: model.cartResponse.shoppingCarts != null ? height * 0.10 : 0, - color: Colors.white, - child: PaymentBottomWidget(model), - ), - ), - )); - } -} - -class SelectAddressWidget extends StatefulWidget { - final OrderPreviewViewModel model; - final List addresses; - - SelectAddressWidget(this.model, this.addresses); - - @override - _SelectAddressWidgetState createState() => _SelectAddressWidgetState(); -} - -class _SelectAddressWidgetState extends State { - Addresses address; - - _navigateToAddressPage() { - Navigator.push( - context, FadePage(page: AddressSelectPageTest(widget.addresses))) - .then((result) { - address = result; - widget.model.paymentCheckoutData.address = address; - widget.model.getInformationsByAddress(); - /* setState(() { - if (result != null) { - address = result; - widget.model.paymentCheckoutData.address = address; - widget.model.getInformationsByAddress(); - } - })*/ - }); - } - - @override - void initState() { - if (widget.model.paymentCheckoutData.address != null) { - address = widget.model.paymentCheckoutData.address; - } - super.initState(); - } - - @override - Widget build(BuildContext context) { - return Consumer( - builder: (ctx, paymentData, _) => Container( - color: Colors.white, - child: address == null - ? InkWell( - onTap: () => {_navigateToAddressPage()}, - child: Container( - margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12), - child: Row( - children: [ - Image.asset( - "assets/images/pharmacy_module/ic_shipping_address.png", - width: 30.0, - height: 30.0, - fit: BoxFit.scaleDown, - ), - Expanded( - child: Container( - padding: - EdgeInsets.symmetric(vertical: 0, horizontal: 6), - child: Texts( - TranslationBase.of(context).selectAddress, - fontSize: 14, - fontWeight: FontWeight.bold, - color: Color(0xff0000ff), - ), - ), - ), - Icon( - Icons.arrow_forward_ios, - size: 20, - color: Colors.grey.shade400, - ), - ], - ), - ), - ) - : Container( - child: Container( - margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Image.asset( - "assets/images/pharmacy_module/ic_shipping_mark.png", - width: 30.0, - height: 30.0, - fit: BoxFit.scaleDown, - ), - Expanded( - child: Container( - padding: EdgeInsets.symmetric( - vertical: 0, horizontal: 6), - child: Texts( - TranslationBase.of(context).shippingAddress, - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ), - ), - InkWell( - onTap: () => {_navigateToAddressPage()}, - child: Texts( - TranslationBase.of(context).changeAddress, - fontSize: 12, - fontWeight: FontWeight.normal, - color: Color(0xff0000ff), - ), - ), - ], - ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: Texts( - "${address.firstName} ${address.lastName}", - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: Texts( - "${address.address1} ${address.address2} ${address.address2},, ${address.city}, ${address.country} ${address.zipPostalCode}", - fontSize: 12, - fontWeight: FontWeight.normal, - color: Colors.grey.shade500, - ), - ), - Row( - children: [ - Container( - margin: const EdgeInsets.only(right: 8), - child: Icon( - Icons.phone, - size: 20, - color: Colors.black, - ), - ), - Texts( - "${address.phoneNumber}", - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.grey, - ), - ], - ), - Container( - margin: EdgeInsets.symmetric(vertical: 8), - child: SizedBox( - height: 2, - width: double.infinity, - child: Container( - color: Color(0xffefefef), - ), - ), - ), - Row( - children: [ - Image.asset( - "assets/images/pharmacy_module/ic_shipping_truck.png", - width: 30.0, - height: 30.0, - fit: BoxFit.scaleDown, - ), - Container( - padding: EdgeInsets.symmetric( - vertical: 0, horizontal: 6), - child: Texts( - "SHIP BY:", - fontSize: 12, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ), - Container( - child: Image.asset( - paymentData.shippingOption - .shippingRateComputationMethodSystemName == - "Shipping.FixedOrByWeight" - ? "assets/images/pharmacy_module/payment/hmg_shipping_logo.png" - : "assets/images/pharmacy_module/payment/aramex_shipping_logo.png", - fit: BoxFit.contain, - ), - margin: EdgeInsets.symmetric(horizontal: 8), - ), - ], - ), - ], - ), - ), - ), // ic_shipping_mark.png - ), - ); - } -} - -class SelectPaymentOptionWidget extends StatefulWidget { - final OrderPreviewViewModel model; - - SelectPaymentOptionWidget(this.model); - - @override - _SelectPaymentOptionWidgetState createState() => - _SelectPaymentOptionWidgetState(); -} - -class _SelectPaymentOptionWidgetState extends State { - PaymentOption paymentOption; - - _navigateToPaymentOption() { - Navigator.push(context, FadePage(page: PaymentMethodSelectPage())) - .then((result) => { - setState(() { - if (result != null) { - paymentOption = result; - widget.model.paymentCheckoutData.paymentOption = - paymentOption; - widget.model.paymentCheckoutData.updateData(); - } - }) - }); - } - - @override - void initState() { - if (widget.model.paymentCheckoutData.paymentOption != null) { - paymentOption = widget.model.paymentCheckoutData.paymentOption; - } - super.initState(); - } - - @override - Widget build(BuildContext context) { - return Container( - color: Colors.white, - child: paymentOption == null - ? InkWell( - onTap: () => {_navigateToPaymentOption()}, - child: Container( - margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12), - child: Row( - children: [ - Image.asset( - "assets/images/pharmacy_module/ic_payment_option.png", - width: 30.0, - height: 30.0, - fit: BoxFit.scaleDown, - ), - Expanded( - child: Container( - padding: - EdgeInsets.symmetric(vertical: 0, horizontal: 6), - child: Texts( - TranslationBase.of(context).selectPaymentOption, - fontSize: 14, - fontWeight: FontWeight.bold, - color: Color(0xff0000ff), - ), - ), - ), - Icon( - Icons.arrow_forward_ios, - size: 20, - color: Colors.grey.shade400, - ), - ], - ), - ), - ) - : Container( - margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12), - child: Row( - children: [ - Image.asset( - "assets/images/pharmacy_module/ic_payment_option.png", - width: 30.0, - height: 30.0, - fit: BoxFit.scaleDown, - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 8), - padding: EdgeInsets.symmetric(horizontal: 4, vertical: 0), - decoration: new BoxDecoration( - color: Colors.grey.shade100, - shape: BoxShape.rectangle, - ), - child: Image.asset( - widget.model.getPaymentOptionImage(paymentOption), - width: 30.0, - height: 30.0, - fit: BoxFit.scaleDown, - ), - ), - Expanded( - child: Container( - padding: EdgeInsets.symmetric(vertical: 0, horizontal: 6), - child: Texts( - widget.model.getPaymentOptionName(paymentOption), - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ), - ), - InkWell( - onTap: () => {_navigateToPaymentOption()}, - child: Texts( - TranslationBase.of(context).changeMethod, - fontSize: 12, - fontWeight: FontWeight.normal, - color: Color(0xff0000ff), - ), - ), - ], - ), - ), - ); - } -} - -class LakumWidget extends StatefulWidget { - final OrderPreviewViewModel model; - - LakumWidget(this.model); - - @override - _LakumWidgetState createState() => _LakumWidgetState(); -} - -class _LakumWidgetState extends State { - TextEditingController _pointsController = new TextEditingController(); - - @override - Widget build(BuildContext context) { - return Container( - color: Colors.white, - padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), - child: Row( - children: [ - Image.asset( - "assets/images/pharmacy_module/lakum/lakum_checkout.png", - width: 30.0, - fit: BoxFit.scaleDown, - ), - Container( - decoration: BoxDecoration(color: Color(0x99ffffff)), - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "Lakum Points", - fontSize: 12, - fontWeight: FontWeight.bold, - ), - Texts( - "${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount}", - fontSize: 12, - fontWeight: FontWeight.normal, - ), - ], - ), - ), - Expanded( - child: Container( - decoration: BoxDecoration(color: Color(0x99ffffff)), - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Texts( - "Riyal", - fontSize: 12, - fontWeight: FontWeight.bold, - ), - Container( - margin: EdgeInsets.only(left: 4), - width: 60, - height: 40, - child: TextField( - decoration: InputDecoration( - border: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.black, width: 0.2), - gapPadding: 0, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8)), - ), - disabledBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.black, width: 0.4), - gapPadding: 0, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8)), - ), - ), - controller: _pointsController, - keyboardType: TextInputType.number, - style: TextStyle( - fontSize: 14, - color: widget - .model - .paymentCheckoutData - .lacumInformation - .lakumInquiryInformationObjVersion - .pointsBalanceAmount > - 0 - ? Colors.black - : Colors.grey, - ), - enabled: widget - .model - .paymentCheckoutData - .lacumInformation - .lakumInquiryInformationObjVersion - .pointsBalanceAmount == - 0 - ? false - : true, - onChanged: (val) { - var value = int.tryParse(val); - if (value != null && - value <= - widget - .model - .paymentCheckoutData - .lacumInformation - .lakumInquiryInformationObjVersion - .pointsBalanceAmount) { - widget.model.paymentCheckoutData.usedLakumPoints = - value; - } else { - widget.model.paymentCheckoutData.usedLakumPoints = 0; - } - _pointsController.text = - "${widget.model.paymentCheckoutData.usedLakumPoints}"; - }, - ), - ), - Container( - height: 40, - padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12), - decoration: new BoxDecoration( - color: Color(0xff3666E0), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.only( - topRight: Radius.circular(6), - bottomRight: Radius.circular(6)), - border: Border.fromBorderSide(BorderSide( - color: Color(0xff3666E0), - width: 0.8, - )), - ), - child: Texts( - "USE", - fontSize: 12, - color: Colors.white, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - ), - ), - ], - ), - ); - } -} - -class PaymentBottomWidget extends StatelessWidget { - final OrderPreviewViewModel model; - - PaymentBottomWidget(this.model); - - @override - Widget build(BuildContext context) { - final scaffold = Scaffold.of(context); - - return Container( - margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0), - child: Consumer( - builder: (ctx, paymentData, _) => paymentData.cartDataVisible - ? Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - margin: - EdgeInsets.symmetric(horizontal: 0, vertical: 4), - child: Row( - children: [ - Texts( - "SAR ${(model.cartResponse.subtotal).toStringAsFixed(2)}", - fontSize: 14, - fontWeight: FontWeight.bold, - color: Color(0xff929295), - ), - Padding( - padding: - const EdgeInsets.symmetric(horizontal: 4), - child: Texts( - "(inclusive VAT)", - fontSize: 8, - color: Color(0xff929295), - fontWeight: FontWeight.w600, - ), - ), - ], - ), - ), - Texts( - "${model.cartResponse.quantityCount} item(s)", - fontSize: 10, - color: Colors.grey, - fontWeight: FontWeight.bold, - ), - ], - ), - Container( - child: RaisedButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), - side: BorderSide( - color: Color(0xff929295), - width: 1, - ), - ), - onPressed: (paymentData.address != null && - paymentData.paymentOption != null) - ? () => { - model.makeOrder().then((_) { - if (model.state != ViewState.Idle) { - SnackBar snackBar = SnackBar( - content: Text( - 'Order has been placed successfully!!')); - scaffold.showSnackBar(snackBar); - } - - // Navigator.pushAndRemoveUntil( - // context, - // MaterialPageRoute( - // builder: (context) => - // PharmacyPage()), - // (Route r) => false); - }) - } - : null, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 16), - child: new Text( - "PROCEED TO PAY", - style: new TextStyle( - color: (paymentData.address != null && - paymentData.paymentOption != null) - ? Colors.white - : Colors.grey.shade400, - fontWeight: FontWeight.bold, - fontSize: 12), - ), - ), - color: (paymentData.address != null && - paymentData.paymentOption != null) - ? Colors.green - : Color(0xff929295), - disabledColor: (paymentData.address != null && - paymentData.paymentOption != null) - ? Colors.green - : Color(0xff929295), - ), - ), - ], - ), - ) - : Container(), - ), - ); - } -} diff --git a/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart b/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart deleted file mode 100644 index fc1270c0..00000000 --- a/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart +++ /dev/null @@ -1,101 +0,0 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/material.dart'; - -import 'lacum-registration-page.dart'; - -class LakumActivationVidaPage extends StatelessWidget { - TextEditingController _identificationNumberController = - new TextEditingController(); - - @override - Widget build(BuildContext context) { - final mediaQuery = MediaQuery.of(context); - - return BaseView( - builder: (_, model, wi) => AppScaffold( - title: "Acount Activation", - isShowAppBar: true, - isShowDecPage: false, - backgroundColor: Colors.white, - baseViewModel: model, - body: Container( - margin: EdgeInsets.symmetric(vertical: 16, horizontal: 12), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Texts( - " This service allows you to activate your LAKUM account after registering through the Vida system. ", - fontSize: 14, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: TextField( - controller: _identificationNumberController, - decoration: new InputDecoration( - hintText: 'Enter Identification Number', - ), - style: TextStyle( - fontSize: 16, - color: Colors.grey.shade700, - ), - ), - ), - ], - ), - Container( - margin: EdgeInsets.only(top: 4), - child: BorderedButton( - TranslationBase.of(context).accountActivation, - backgroundColor: - _identificationNumberController.text != null && - _identificationNumberController.text != "" - ? Color(0xff60686b) - : Color(0xffb0b4b5), - textColor: Colors.white, - fontSize: 16, - hPadding: 8, - vPadding: 12, - handler: _identificationNumberController.text != null && - _identificationNumberController.text != "" - ? () { - model - .checkLacumAccountActivation( - _identificationNumberController.text) - .then((_) => { - if (model.state == ViewState.Idle) - { - Navigator.push( - context, - FadePage( - page: LakumRegistrationPage( - _identificationNumberController - .text))) - .then((status) => { - if (status == 200) - {Navigator.pop(context, "")} - // back to previous page - }) - } - }); - } - : null, - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/pages/pharmacies/screens/lacum-registration-page.dart b/lib/pages/pharmacies/screens/lacum-registration-page.dart deleted file mode 100644 index 53b9705d..00000000 --- a/lib/pages/pharmacies/screens/lacum-registration-page.dart +++ /dev/null @@ -1,236 +0,0 @@ -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart'; -import 'package:diplomaticquarterapp/models/id-name-pair.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/dialogs/radio-group-dialog.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/material.dart'; - -import 'lakum-terms-conditions-page.dart'; - -class LakumRegistrationPage extends StatefulWidget { - final String patientIdentificationNo; - - LakumRegistrationPage(this.patientIdentificationNo); - - @override - _LakumRegistrationPageState createState() => _LakumRegistrationPageState(); -} - -class _LakumRegistrationPageState extends State { - final TextEditingController _firstNameController = TextEditingController(); - - final TextEditingController _lastNameController = TextEditingController(); - - final TextEditingController _mobileNumberController = TextEditingController(); - - List languages = List(); - - IdNamePair selectedLanguage; - - @override - Widget build(BuildContext context) { - final mediaQuery = MediaQuery.of(context); - PreferredSizeWidget appBarWidget = AppBarWidget("Lakum", null, true); - languages.clear(); - languages.add(IdNamePair(1, TranslationBase.of(context).arabic)); - languages.add(IdNamePair(2, TranslationBase.of(context).english)); - - bool canSubmit = _firstNameController.text != null && - _firstNameController.text != "" && - _lastNameController.text != null && - _lastNameController.text != "" && - _mobileNumberController.text != null && - _mobileNumberController.text != "" && - selectedLanguage != null; - - return BaseView( - builder: (_, model, wi) => AppScaffold( - title: "Register Lakum", - isShowAppBar: true, - isShowDecPage: false, - backgroundColor: Colors.white, - appBarWidget: appBarWidget, - baseViewModel: model, - body: Container( - width: double.infinity, - child: SingleChildScrollView( - child: SizedBox( - height: mediaQuery.size.height - - appBarWidget.preferredSize.height - - mediaQuery.padding.top, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - Column( - children: [ - Image.asset( - "assets/images/pharmacy_module/lakum/lakum_card_front_bg.png", - fit: BoxFit.fill, - height: 150, - width: mediaQuery.size.width, - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context).firstName, - fontSize: 13, - fontWeight: FontWeight.normal, - color: Color(0xff8a8a8a), - ), - TextField( - controller: _firstNameController, - style: TextStyle( - fontSize: 16, - color: Colors.black, - ), - ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context).lastName, - fontSize: 13, - fontWeight: FontWeight.normal, - color: Color(0xff8a8a8a), - ), - TextField( - controller: _lastNameController, - style: TextStyle( - fontSize: 16, - color: Colors.black, - ), - ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context).mobileNumber, - fontSize: 13, - fontWeight: FontWeight.normal, - color: Color(0xff8a8a8a), - ), - TextField( - controller: _mobileNumberController, - style: TextStyle( - fontSize: 16, - color: Colors.black, - ), - ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context) - .prefferedLanguage, - fontSize: 13, - fontWeight: FontWeight.normal, - color: Color(0xff8a8a8a), - ), - InkWell( - onTap: () { - RadioGroupDialog dialog = - new RadioGroupDialog( - context: context, - title: TranslationBase.of(context) - .prefferedLanguage, - okText: - TranslationBase.of(context) - .confirm, - cancelText: - TranslationBase.of(context) - .cancel_nocaps, - list: languages, - okFunction: (selectedValue) { - setState(() { - selectedLanguage = - selectedValue; - }); - print( - "selectedLanguage = ${selectedValue.name}"); - }, - cancelFunction: () => {}); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - }, - child: TextField( - enabled: false, - decoration: InputDecoration( - suffixIcon: - Icon(Icons.arrow_drop_down), - hintText: selectedLanguage == null - ? "${TranslationBase.of(context).prefferedLanguage}" - : "${selectedLanguage.name}", - hintStyle: TextStyle( - fontSize: 16, - color: Colors.black, - )), - style: TextStyle( - fontSize: 16, - color: Colors.grey.shade700, - ), - ), - ), - ], - ), - ), - ], - ), - Container( - color: Colors.green, - margin: EdgeInsets.all(8), - child: BorderedButton( - TranslationBase.of(context).register, - backgroundColor: canSubmit - ? Color(0xff339933) - : Color(0xff99cc99), - textColor: Colors.white, - fontSize: 16, - hPadding: 8, - vPadding: 12, - handler: canSubmit - ? () { - Navigator.push( - context, - FadePage( - page: LakumTermsConditions( - widget - .patientIdentificationNo, - _firstNameController.text, - _lastNameController.text, - _mobileNumberController - .text, - selectedLanguage.id))) - .then((status) => { - if (status == 200) - {Navigator.pop(context, "")} - // back to previous page - }); - } - : null, - ), - ), - ], - ), - ), - ), - ), - )); - } -} diff --git a/lib/pages/pharmacies/screens/lacum-setting-page.dart b/lib/pages/pharmacies/screens/lacum-setting-page.dart deleted file mode 100644 index 91e4c965..00000000 --- a/lib/pages/pharmacies/screens/lacum-setting-page.dart +++ /dev/null @@ -1,240 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lacum-banner-widget.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; - -class LakumSettingPage extends StatefulWidget { - final LacumAccountInformation lacumInformation; - final LacumAccountInformation lacumGroupInformation; - - LakumSettingPage(this.lacumInformation, this.lacumGroupInformation); - - @override - _LakumSettingPageState createState() => _LakumSettingPageState(); -} - -class _LakumSettingPageState extends State { - bool _lakumAccountActivated = false; - TextEditingController _nameController = new TextEditingController(); - TextEditingController _phoneController = new TextEditingController(); - - @override - void initState() { - _lakumAccountActivated = widget.lacumGroupInformation - .lakumInquiryInformationObjVersion.accountStatus == - "Active"; - super.initState(); - _nameController.text = widget.lacumGroupInformation.lakumInquiryInformationObjVersion.memberName; - _phoneController.text = widget.lacumGroupInformation.lakumInquiryInformationObjVersion.mobileNumber; - } - - @override - Widget build(BuildContext context) { - final mediaQuery = MediaQuery.of(context); - PreferredSizeWidget appBarWidget = AppBarWidget("Lakum", null, true); - - return BaseView( - onModelReady: (model) => model.setLakumData( - widget.lacumInformation, widget.lacumGroupInformation), - builder: (_, model, wi) => AppScaffold( - title: "Lakum", - isShowAppBar: true, - isShowDecPage: false, - backgroundColor: Colors.white, - appBarWidget: appBarWidget, - baseViewModel: model, - body: Container( - width: double.infinity, - child: SingleChildScrollView( - child: SizedBox( - height: mediaQuery.size.height - - appBarWidget.preferredSize.height - - mediaQuery.padding.top, - child: _buildSettingScreen(mediaQuery, model), - ), - ), - ), - ), - ); - } - - _buildSettingScreen(MediaQueryData mediaQuery, LacumViewModel model) { - bool canUpdate = (_nameController.text != "" && - _phoneController.text != "" && - (_nameController.text != widget.lacumGroupInformation.lakumInquiryInformationObjVersion.memberName || - _phoneController.text != widget.lacumGroupInformation.lakumInquiryInformationObjVersion.mobileNumber)); - - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Stack( - children: [ - Container( - height: mediaQuery.size.height * 0.15, - color: Colors.green, - ), - Column( - children: [ - SizedBox( - height: mediaQuery.size.height * 0.05, - ), - Container( - width: mediaQuery.size.width * 1, - child: LakumBannerWidget(model, mediaQuery, false)), - ], - ) - ], - ), - SizedBox( - height: 20, - ), - SizedBox( - height: 1, - width: double.infinity, - child: Container( - color: Color(0xffefefef), - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - "Activate LAKUM Account", - fontSize: 16, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - Switch.adaptive( - activeColor: Color.fromRGBO(51, 153, 51, 1), - inactiveThumbColor: Colors.red, - activeTrackColor: Colors.grey, - inactiveTrackColor: Colors.grey, - value: _lakumAccountActivated, - onChanged: (val) { - if (_lakumAccountActivated) { - model.makeAccountDeactivate(); - } else { - model.makeAccountActivate(); - } - setState(() { - _lakumAccountActivated = val; - }); - }, - ), - ], - ), - ), - SizedBox( - height: 30, - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).name, - fontSize: 13, - fontWeight: _lakumAccountActivated - ? FontWeight.bold - : FontWeight.normal, - color: Colors.grey.shade400, - ), - _lakumAccountActivated - ? TextField( - controller: _nameController, - enabled: _lakumAccountActivated ? true : false, - style: TextStyle( - fontSize: 16, - color: _lakumAccountActivated - ? Colors.black - : Colors.white38, - ), - ) - : Texts( - _nameController.text, - fontSize: 16, - color: Colors.grey.shade600, - ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context).mobileNumber, - fontSize: 13, - fontWeight: _lakumAccountActivated - ? FontWeight.bold - : FontWeight.normal, - color: Colors.grey.shade400, - ), - _lakumAccountActivated - ? TextField( - controller: _phoneController, - enabled: _lakumAccountActivated ? true : false, - keyboardType: TextInputType.phone, - style: TextStyle( - fontSize: 16, - color: _lakumAccountActivated - ? Colors.black - : Colors.white38, - ), - ) - : Texts( - _phoneController.text, - fontSize: 16, - color: Colors.grey.shade600, - ), - ], - ), - ), - ], - ), - Container( - child: Column( - children: [ - SizedBox( - height: 2, - width: double.infinity, - child: Container( - color: Color(0xffefefef), - ), - ), - Container( - margin: EdgeInsets.all(8), - child: BorderedButton( - TranslationBase.of(context).save, - backgroundColor: - canUpdate ? Color(0xff60686b) : Color(0xffb0b4b5), - textColor: Colors.white, - fontSize: 16, - hPadding: 8, - vPadding: 12, - handler: canUpdate - ? () { - model.createLakumAccount(_nameController.text, _phoneController.text).then((status) => { - if (status == 200) {Navigator.pop(context, "")} - // back to previous page - }); - } - : null, - ), - ) - ], - ), - ), - ], - ); - } -} diff --git a/lib/pages/pharmacies/screens/lacum-transfer-page.dart b/lib/pages/pharmacies/screens/lacum-transfer-page.dart deleted file mode 100644 index 0671f80a..00000000 --- a/lib/pages/pharmacies/screens/lacum-transfer-page.dart +++ /dev/null @@ -1,317 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-trasnfer-viewModel.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; - -class LacumTransferPage extends StatefulWidget { - final LacumAccountInformation lacumInformation; - final LacumAccountInformation lacumGroupInformation; - - LacumTransferPage(this.lacumInformation, this.lacumGroupInformation); - - @override - _LacumTransferPageState createState() => _LacumTransferPageState(); -} - -class _LacumTransferPageState extends State { - TextEditingController _beneficieryAccountController = - new TextEditingController(); - TextEditingController _transferPointsController = new TextEditingController(); - - @override - void initState() { - super.initState(); - _beneficieryAccountController.text = ""; - _transferPointsController.text = "0"; - } - - @override - Widget build(BuildContext context) { - final mediaQuery = MediaQuery.of(context); - PreferredSizeWidget appBarWidget = AppBarWidget("Lakum", null, true); - - return BaseView( - onModelReady: (model) => model.setLakumData( - widget.lacumInformation, widget.lacumGroupInformation), - builder: (_, model, wi) => AppScaffold( - title: "Lakum", - isShowAppBar: true, - isShowDecPage: false, - backgroundColor: Colors.white, - appBarWidget: appBarWidget, - baseViewModel: model, - body: Container( - width: double.infinity, - child: SingleChildScrollView( - child: SizedBox( - height: - mediaQuery.size.height - 58 - mediaQuery.padding.top, - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - children: [ - Row( - children: [ - Container( - height: 100, - width: mediaQuery.size.width / 2 - 26, - padding: EdgeInsets.only( - top: 12, left: 8, right: 8, bottom: 4), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.fromBorderSide(BorderSide( - color: Color(0xffe1e1e1), - width: 0.4, - )), - color: Color(0xff6294ed), - ), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - children: [ - Container( - child: Texts( - "Point Balance", - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ), - ], - ), - ), - Expanded( - child: Container( - padding: EdgeInsets.symmetric( - vertical: 8), - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Texts( - "0", - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ], - ), - ), - ) - ], - ), - ), - SizedBox( - width: 20, - ), - Container( - height: 100, - width: mediaQuery.size.width / 2 - 26, - padding: EdgeInsets.only( - top: 12, left: 8, right: 8, bottom: 4), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.fromBorderSide(BorderSide( - color: Color(0xffe1e1e1), - width: 0.4, - )), - color: Color(0xff339933), - ), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - children: [ - Container( - child: Texts( - "Riyal Balance", - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ), - ], - ), - ), - Expanded( - child: Container( - padding: EdgeInsets.symmetric( - vertical: 8), - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Texts( - "0", - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ], - ), - ), - ) - ], - ), - ), - ], - ), - Container( - margin: EdgeInsets.only(top: 16), - child: TextField( - controller: _beneficieryAccountController, - decoration: new InputDecoration( - hintText: 'Enter Beneficiary Account No.', - ), - style: TextStyle( - fontSize: 16, - color: Colors.grey.shade700, - ), - ), - ), - Container( - margin: EdgeInsets.only(top: 4), - child: BorderedButton( - TranslationBase.of(context).checkBeneficiary, - backgroundColor: - _beneficieryAccountController.text != "" - ? Color(0xff60686b) - : Color(0xffb0b4b5), - textColor: Colors.white, - fontSize: 16, - hPadding: 8, - vPadding: 12, - handler: - _beneficieryAccountController.text != "" - ? () { - model.getLacumGroupDataBuAccountId( - _beneficieryAccountController - .text); - } - : null, - ), - ), - (model.lacumReceiverInformation != null && - model.lacumReceiverInformation - .lakumInquiryInformationObjVersion != - null) - ? Container( - margin: EdgeInsets.only(top: 8), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context) - .beneficiaryName, - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8), - child: TextField( - enabled: false, - decoration: new InputDecoration( - hintText: - "${model.lacumReceiverInformation.lakumInquiryInformationObjVersion.memberName}", - hintStyle: TextStyle( - fontSize: 16, - color: Colors.grey.shade600, - )), - style: TextStyle( - fontSize: 16, - color: Colors.grey.shade700, - ), - ), - ), - SizedBox( - height: 10, - width: double.infinity, - ), - Texts( - "Point's to Transfer :", - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8), - child: TextField( - controller: - _transferPointsController, - decoration: new InputDecoration( - focusColor: Colors.green, - hintStyle: TextStyle( - fontSize: 16, - color: Colors.grey.shade600, - )), - style: TextStyle( - fontSize: 16, - color: Colors.grey.shade700, - ), - ), - ), - ], - ), - ) - : Container() - ], - ), - if (model.lacumReceiverInformation != null && - model.lacumReceiverInformation - .lakumInquiryInformationObjVersion != - null) - Container( - margin: EdgeInsets.all(8), - child: BorderedButton( - "LACUM TRANSFER", - backgroundColor: Color(0xff339933), - textColor: Colors.white, - fontSize: 18, - hPadding: 8, - radius: 12, - vPadding: 16, - fontWeight: FontWeight.w600, - handler: () { - model - .transferYaHalaLoyaltyPoints( - _transferPointsController.text) - .then((status) => { - if (status == 200) - {Navigator.pop(context, "")} - // back to previous page - }); - }, - ), - ) - ], - ), - ), - ), - ), - ), - )); - } -} diff --git a/lib/pages/pharmacies/screens/lakum-main-page.dart b/lib/pages/pharmacies/screens/lakum-main-page.dart deleted file mode 100644 index adbb07c2..00000000 --- a/lib/pages/pharmacies/screens/lakum-main-page.dart +++ /dev/null @@ -1,555 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/PointsAmountPerYear.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-setting-page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-transfer-page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-points-year-page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lacum-banner-widget.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/material.dart'; - -import 'lacum-activitaion-vida-page.dart'; - -class LakumMainPage extends StatelessWidget { - @override - Widget build(BuildContext context) { - final mediaQuery = MediaQuery.of(context); - - return BaseView( - onModelReady: (model) => model.getLacumData(), - builder: (_, model, wi) => AppScaffold( - title: "Lakum", - isShowAppBar: true, - isPharmacy: true, - isShowDecPage: false, - backgroundColor: Colors.white, - baseViewModel: model, - appBarIcons: _buildAppBarICons(context, model), - // preferredSize: mediaQuery.size.height * 0.20, - body: Container( - width: double.infinity, - child: SingleChildScrollView( - child: (model.lacumGroupInformation != null && - model.lacumGroupInformation - .lakumInquiryInformationObjVersion != - null) - ? Column( - children: [ - Stack( - children: [ - Container( - height: mediaQuery.size.height * 0.15, - color: Colors.green, - ), - Column( - children: [ - SizedBox( - height: mediaQuery.size.height * 0.05, - ), - Container( - width: mediaQuery.size.width * 1, - child: LakumBannerWidget( - model, mediaQuery, true)), - ], - ) - ], - ), - SizedBox( - height: 20, - ), - LakumHomeButtons(mediaQuery, model), - SizedBox( - height: 20, - ), - Container( - height: 100, - margin: EdgeInsets.symmetric(horizontal: 16), - child: ListView( - scrollDirection: Axis.horizontal, - children: [ - LacumPointsWidget( - mediaQuery, - 1, - TranslationBase.of(context).balance, - model - .lacumGroupInformation - .lakumInquiryInformationObjVersion - .pointsBalanceAmount, - model - .lacumGroupInformation - .lakumInquiryInformationObjVersion - .pointsBalance, - null), - SizedBox( - width: 8, - ), - LacumPointsWidget( - mediaQuery, - 2, - TranslationBase.of(context).gained, - model - .lacumGroupInformation - .lakumInquiryInformationObjVersion - .pointsBalanceAmount, - model - .lacumGroupInformation - .lakumInquiryInformationObjVersion - .gainedPoints, - model - .lacumGroupInformation - .lakumInquiryInformationObjVersion - .gainedPointsAmountPerYear), - SizedBox( - width: 8, - ), - LacumPointsWidget( - mediaQuery, - 3, - TranslationBase.of(context).consumed, - model - .lacumGroupInformation - .lakumInquiryInformationObjVersion - .consumedPointsAmount != - null - ? int.parse(model - .lacumGroupInformation - .lakumInquiryInformationObjVersion - .consumedPointsAmount) - : 0, - model - .lacumGroupInformation - .lakumInquiryInformationObjVersion - .consumedPoints, - model - .lacumGroupInformation - .lakumInquiryInformationObjVersion - .consumedPointsAmountPerYear), - SizedBox( - width: 8, - ), - LacumPointsWidget( - mediaQuery, - 4, - TranslationBase.of(context).transferred, - 0, - model - .lacumGroupInformation - .lakumInquiryInformationObjVersion - .transferPoints, - model - .lacumGroupInformation - .lakumInquiryInformationObjVersion - .transferPointsAmountPerYear), - ], - ), - ), - SizedBox( - height: 20, - ), - SizedBox( - height: 8, - width: double.infinity, - child: Container( - color: Color(0xffefefef), - ), - ), - Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 8), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Image.asset( - "assets/images/pharmacy_module/lakum/expired_icon.png", - fit: BoxFit.fill, - width: 25, - height: 25, - ), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 8), - child: Texts( - "Expired", - fontSize: 14, - ), - ) - ], - ), - Texts( - "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.expiredPoints} Points", - fontWeight: FontWeight.bold, - fontSize: 14, - ), - ], - ), - ), - SizedBox( - height: 2, - width: double.infinity, - child: Container( - color: Color(0xffefefef), - ), - ), - Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 8), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Image.asset( - "assets/images/pharmacy_module/lakum/waiting_gained_icon.png", - fit: BoxFit.fill, - width: 20, - height: 25, - ), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 8), - child: Texts( - "Waiting gained", - fontSize: 14, - ), - ) - ], - ), - Texts( - "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} Points", - fontWeight: FontWeight.bold, - fontSize: 14, - ), - ], - ), - ), - SizedBox( - height: 2, - width: double.infinity, - child: Container( - color: Color(0xffefefef), - ), - ), - Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 8), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Image.asset( - "assets/images/pharmacy_module/lakum/will_be_expired_icon.png", - fit: BoxFit.fill, - width: 25, - height: 25, - ), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 8), - child: Texts( - "Will Be Expired", - fontSize: 14, - ), - ) - ], - ), - Texts( - "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsWillBeExpired} Points", - fontWeight: FontWeight.bold, - fontSize: 14, - ), - ], - ), - ), - SizedBox( - height: 2, - width: double.infinity, - child: Container( - color: Color(0xffefefef), - ), - ), - ], - ) - : Container(), - ), - ), - )); - } -} - -List _buildAppBarICons(BuildContext context, LacumViewModel model) { - return [ - IconButton( - icon: Icon(Icons.settings), - color: Colors.white, - onPressed: () { - Navigator.push( - context, - FadePage( - page: LakumSettingPage( - model.lacumInformation, model.lacumGroupInformation))) - .then((result) => {model.getLacumGroupData()}); - }, - ), - ]; -} - -class LakumHomeButtons extends StatelessWidget { - final MediaQueryData mediaQuery; - final LacumViewModel model; - - LakumHomeButtons(this.mediaQuery, this.model); - - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.symmetric(horizontal: 16), - child: Row( - children: [ - Expanded( - child: InkWell( - onTap: () { - print("Account activate click"); - Navigator.push( - context, FadePage(page: LakumActivationVidaPage())) - .then((result) => {model.getLacumGroupData()}); - }, - child: Container( - padding: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.fromBorderSide(BorderSide( - color: Color(0xffe1e1e1), - width: 0.4, - )), - color: Color(0xffe1e1e1)), - height: mediaQuery.size.height * 0.08, - child: Row( - children: [ - Image.asset( - "assets/images/pharmacy_module/lakum/Account_activation_icon.png", - fit: BoxFit.fill, - width: 30, - height: 30, - ), - Expanded( - child: Container( - padding: EdgeInsets.symmetric(horizontal: 16), - child: Texts( - "Account Activation", - fontSize: 14, - fontWeight: FontWeight.bold, - ), - ), - ) - ], - ), - ), - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: InkWell( - onTap: () { - print("Lacum transfer click"); - Navigator.push( - context, - FadePage( - page: LacumTransferPage(model.lacumInformation, - model.lacumGroupInformation))) - .then((result) => {model.getLacumGroupData()}); - }, - child: Container( - padding: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.fromBorderSide(BorderSide( - color: Color(0xffe1e1e1), - width: 0.4, - )), - color: Color(0xffe1e1e1)), - height: mediaQuery.size.height * 0.08, - child: Row( - children: [ - Image.asset( - "assets/images/pharmacy_module/lakum/Lakum_transfer_icon.png", - fit: BoxFit.fill, - width: 35, - height: 30, - ), - Expanded( - child: Container( - padding: EdgeInsets.symmetric(horizontal: 16), - child: Texts( - "Lakum Transfer", - fontSize: 14, - fontWeight: FontWeight.bold, - ), - ), - ) - ], - ), - ), - ), - ), - ], - ), - ); - } -} - -class LacumPointsWidget extends StatelessWidget { - final MediaQueryData mediaQuery; - final int pointType; // 1. balance, 2. gained, 3. consume, 4. transfer - final String title; - final int riyal; - final int point; - Color titleColor; - final List pointsAmountPerYear; - - LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal, - this.point, this.pointsAmountPerYear) { - if (pointType == 1) { - titleColor = Color(0xffefefef); - } else if (pointType == 2) { - titleColor = Color(0xff004bcc); - } else if (pointType == 3) { - titleColor = Color(0xff339933); - } else { - titleColor = Color(0xffffa500); - } - } - - @override - Widget build(BuildContext context) { - return InkWell( - onTap: () { - if (pointType != 1) { - if (pointsAmountPerYear != null && pointsAmountPerYear.length > 0) { - Navigator.push(context, - FadePage(page: LakumPointsYearPage(pointsAmountPerYear))); - } else { - // show snackBar No Details Points are there - } - } - }, - child: Container( - width: mediaQuery.size.width / 2 - 16, - padding: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 4), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.fromBorderSide(BorderSide( - color: Color(0xffe1e1e1), - width: 0.4, - )), - color: pointType == 1 ? Color(0xff004bcc) : Color(0xffefefef), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - child: Texts( - title, - fontSize: 14, - fontWeight: FontWeight.bold, - color: titleColor, - ), - ), - if (pointType != 1) - Icon( - Icons.arrow_forward, - color: titleColor, - ) - ], - ), - ], - ), - ), - Expanded( - child: Row( - children: [ - if (pointType != 4) - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "RIYAL", - fontSize: 13, - fontWeight: FontWeight.bold, - color: pointType == 1 ? Colors.white : Colors.black, - ), - SizedBox( - height: 4, - ), - Texts( - "$riyal", - fontSize: 13, - fontWeight: FontWeight.bold, - color: pointType == 1 ? Colors.white : Colors.black, - ), - ], - ), - ), - if (pointType != 4) - SizedBox( - child: Container( - color: pointType == 1 ? Colors.white : Colors.grey, - ), - width: 1, - ), - Expanded( - child: Container( - margin: EdgeInsets.only(left: 4), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "POINT", - fontSize: 12, - fontWeight: FontWeight.bold, - color: pointType == 1 ? Colors.white : Colors.black, - ), - SizedBox( - height: 4, - ), - Texts( - "$point", - fontSize: 12, - fontWeight: FontWeight.bold, - color: pointType == 1 ? Colors.white : Colors.black, - ), - ], - ), - ), - ), - ], - ), - ) - ], - ), - ), - ); - } -} diff --git a/lib/pages/pharmacies/screens/lakum-points-month-page.dart b/lib/pages/pharmacies/screens/lakum-points-month-page.dart deleted file mode 100644 index 47270eee..00000000 --- a/lib/pages/pharmacies/screens/lakum-points-month-page.dart +++ /dev/null @@ -1,271 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/PointsAmountPerMonth.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lakum-point-table-row-widget.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class LakumPointMonthPage extends StatefulWidget { - final PointsAmountPerMonth pointsAmountPerMonth; - final int year; - int expandedItemIndex = -1; - - LakumPointMonthPage(this.pointsAmountPerMonth, this.year); - - @override - _LakumPointsMonthPageState createState() => _LakumPointsMonthPageState(); -} - -class _LakumPointsMonthPageState extends State { - @override - Widget build(BuildContext context) { - final mediaQuery = MediaQuery.of(context); - - return BaseView( - builder: (_, model, wi) => AppScaffold( - title: "Lakum points", - isShowAppBar: true, - isShowDecPage: false, - backgroundColor: Colors.white, - baseViewModel: model, - body: Container( - width: double.infinity, - child: SingleChildScrollView( - child: Column( - children: [ - Container( - height: mediaQuery.size.height * 0.25, - child: Stack( - children: [ - Image.asset( - "assets/images/pharmacy_module/lakum/lakum_card_front_bg.png", - fit: BoxFit.fill, - width: mediaQuery.size.width * 1.0, - ), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - height: mediaQuery.size.height * 0.06, - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 24), - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).month, - color: Colors.grey.shade600, - fontSize: 16, - ), - Texts( - "${widget.pointsAmountPerMonth.month}, ${widget.year}", - color: Colors.grey.shade700, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ], - ), - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Texts( - TranslationBase.of(context).point, - color: Colors.grey.shade600, - fontSize: 16, - ), - Texts( - "${widget.pointsAmountPerMonth.pointsPerMonth}", - color: Colors.grey.shade700, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ], - ), - ), - SizedBox( - child: Container( - color: Colors.grey, - ), - width: 1, - ), - Expanded( - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Texts( - TranslationBase.of(context).riyal, - color: Colors.grey.shade600, - fontSize: 16, - ), - Texts( - "${widget.pointsAmountPerMonth.amountPerMonth}", - color: Colors.grey.shade700, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ], - ), - ), - ], - ), - ), - ], - ), - ), - ], - ), - ], - ), - ), - SizedBox( - height: 10, - ), - LakumPointTableRowWidget(true, "DAY", 0, 0, null, 0), - ...List.generate( - widget.pointsAmountPerMonth.pointsAmountPerday.length, - (index) => LakumPointTableRowWidget( - false, - widget.pointsAmountPerMonth.pointsAmountPerday[index].day, - widget.pointsAmountPerMonth.pointsAmountPerday[index] - .pointsPerDay, - widget.pointsAmountPerMonth.pointsAmountPerday[index] - .amountPerDay, - () { - setState(() { - if (widget.expandedItemIndex == index) { - widget.expandedItemIndex = -1; - } else { - widget.expandedItemIndex = index; - } - }); - }, - index, - expandFlag: widget.expandedItemIndex == index, - collapsed: Column( - children: [ - ...List.generate( - widget.pointsAmountPerMonth.pointsAmountPerday[index] - .pointsDetails.length, - (index) => DayPointsDetailWidget( - widget - .pointsAmountPerMonth - .pointsAmountPerday[index] - .pointsDetails[index] - .subTransactionTypeDescription, - widget - .pointsAmountPerMonth - .pointsAmountPerday[index] - .pointsDetails[index].purchasePoints, - widget - .pointsAmountPerMonth - .pointsAmountPerday[index] - .pointsDetails[index].amount), - ), - ], - ), - ), - ), - ], - ), - ), - ), - ), - ); - } -} - -class DayPointsDetailWidget extends StatelessWidget { - final String rowTitle; - final double points; - final double riyal; - - DayPointsDetailWidget(this.rowTitle, this.points, this.riyal); - - @override - Widget build(BuildContext context) { - return Container( - color: Color(0xffe4e4e4), - padding: EdgeInsets.symmetric(vertical: 0, horizontal: 12), - child: Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: Row( - children: [ - Expanded( - child: Container( - child: Column( - children: [ - Texts( - "TYPE", - fontSize: 12, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 4, - ), - Texts( - rowTitle, - fontSize: 14, - fontWeight: FontWeight.normal, - ), - ], - crossAxisAlignment: CrossAxisAlignment.start, - ), - )), - Expanded( - - child: Container( - child: Texts( - "$points", - fontSize: 14, - fontWeight: FontWeight.normal, - ), - )), - Expanded( - child: Container( - child: Texts( - "$riyal", - fontSize: 14, - fontWeight: FontWeight.normal, - ), - )), - Expanded(child: Container()), - ], - ), - ), - const Divider( - color: Color(0xFFD6D6D6), - height: 1, - thickness: 1, - indent: 0, - endIndent: 0, - ), - ], - ), - ); - } -} diff --git a/lib/pages/pharmacies/screens/lakum-points-year-page.dart b/lib/pages/pharmacies/screens/lakum-points-year-page.dart deleted file mode 100644 index f7b6d9e6..00000000 --- a/lib/pages/pharmacies/screens/lakum-points-year-page.dart +++ /dev/null @@ -1,201 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/PointsAmountPerYear.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lakum-point-table-row-widget.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/material.dart'; - -import 'lakum-points-month-page.dart'; - -class LakumPointsYearPage extends StatefulWidget { - final List pointsAmountPerYear; - int selectedIndexYear = 0; - - LakumPointsYearPage(this.pointsAmountPerYear); - - @override - _LakumPointsYearPageState createState() => _LakumPointsYearPageState(); -} - -class _LakumPointsYearPageState extends State { - @override - Widget build(BuildContext context) { - final mediaQuery = MediaQuery.of(context); - - return BaseView( - builder: (_, model, wi) => AppScaffold( - title: "Lakum points", - isShowAppBar: true, - isShowDecPage: false, - backgroundColor: Colors.white, - baseViewModel: model, - body: Container( - width: double.infinity, - child: SingleChildScrollView( - child: Column( - children: [ - Container( - height: 100, - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: ListView( - scrollDirection: Axis.horizontal, - children: [ - ...List.generate( - widget.pointsAmountPerYear.length, - (index) => LacumPointsYearWidget( - mediaQuery, - widget.selectedIndexYear == index, - widget.pointsAmountPerYear[index], () { - setState(() { - widget.selectedIndexYear = index; - }); - })), - ], - ), - ), - SizedBox( - height: 0, - ), - LakumPointTableRowWidget(true, "MONTH", 0, 0, null, 0), - ...List.generate( - widget.pointsAmountPerYear[widget.selectedIndexYear] - .pointsAmountPerMonth.length, - (index) => LakumPointTableRowWidget( - false, - widget.pointsAmountPerYear[widget.selectedIndexYear] - .pointsAmountPerMonth[index].month, - widget.pointsAmountPerYear[widget.selectedIndexYear] - .pointsAmountPerMonth[index].pointsPerMonth, - widget.pointsAmountPerYear[widget.selectedIndexYear] - .pointsAmountPerMonth[index].amountPerMonth, - (){ - Navigator.push(context, - FadePage(page: LakumPointMonthPage(widget.pointsAmountPerYear[widget.selectedIndexYear] - .pointsAmountPerMonth[index], widget.pointsAmountPerYear[widget.selectedIndexYear].year))); - }, - index), - ), - ], - ), - ), - ), - ), - ); - } -} - -class LacumPointsYearWidget extends StatelessWidget { - final MediaQueryData mediaQuery; - final bool isSelected; - final PointsAmountPerYear yearPoints; - final Function yearOnTap; - - LacumPointsYearWidget( - this.mediaQuery, this.isSelected, this.yearPoints, this.yearOnTap); - - @override - Widget build(BuildContext context) { - return InkWell( - onTap: yearOnTap, - child: Container( - width: mediaQuery.size.width / 2 - 16, - padding: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 4), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.fromBorderSide(BorderSide( - color: Color(0xffe1e1e1), - width: 0.4, - )), - color: isSelected ? Color(0xff004bcc) : Color(0xffefefef), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - child: Texts( - "YEAR: ${yearPoints.year}", - fontSize: 14, - fontWeight: FontWeight.bold, - color: isSelected ? Colors.white : Colors.black, - ), - ), - ], - ), - ], - ), - ), - Expanded( - child: Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(left: 4), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "POINT", - fontSize: 12, - fontWeight: FontWeight.bold, - color: isSelected ? Colors.white : Colors.black, - ), - SizedBox( - height: 4, - ), - Texts( - "${yearPoints.pointsPerYear}", - fontSize: 12, - fontWeight: FontWeight.bold, - color: isSelected ? Colors.white : Colors.black, - ), - ], - ), - ), - ), - SizedBox( - child: Container( - color: isSelected ? Colors.white : Colors.grey, - ), - width: 1, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Texts( - "RIYAL", - fontSize: 13, - fontWeight: FontWeight.bold, - color: isSelected ? Colors.white : Colors.black, - ), - SizedBox( - height: 4, - ), - Texts( - "${yearPoints.amountPerYear}", - fontSize: 13, - fontWeight: FontWeight.bold, - color: isSelected ? Colors.white : Colors.black, - ), - ], - ), - ), - ], - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/pages/pharmacies/screens/lakum-terms-conditions-page.dart b/lib/pages/pharmacies/screens/lakum-terms-conditions-page.dart deleted file mode 100644 index 30c3bb6e..00000000 --- a/lib/pages/pharmacies/screens/lakum-terms-conditions-page.dart +++ /dev/null @@ -1,84 +0,0 @@ -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_html/flutter_html.dart'; -import 'package:provider/provider.dart'; - -class LakumTermsConditions extends StatelessWidget { - final String firstName, lastName, mobileNo, identificationNo; - final int languageId; - - LakumTermsConditions(this.identificationNo, this.firstName, this.lastName, - this.mobileNo, this.languageId); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectProvider = Provider.of(context); - - final mediaQuery = MediaQuery.of(context); - PreferredSizeWidget appBarWidget = AppBarWidget("Lakum", null, true); - double height = mediaQuery.size.height - - appBarWidget.preferredSize.height - - mediaQuery.padding.top; - - return BaseView( - onModelReady: (model) => model.getUserTermsAndConditionsForEPharmcy(), - builder: (_, model, wi) => AppScaffold( - appBarTitle: "Register Lakum", - isShowAppBar: true, - isShowDecPage: false, - backgroundColor: Colors.white, - baseViewModel: model, - appBarWidget: appBarWidget, - body: Container( - margin: EdgeInsets.all(8), - width: double.infinity, - child: Stack( - children: [ - SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (model.listUserAgreement != null && - model.listUserAgreement.userAgreementLAKUM != - null) - Html( - data: projectProvider.isArabic - ? model.listUserAgreement.userAgreementLAKUMn - : model.listUserAgreement.userAgreementLAKUM, - ), - ], - ), - ), - Align( - alignment: Alignment.bottomCenter, - child: Container( - height: 50, - margin: EdgeInsets.all(8), - child: BorderedButton( - TranslationBase.of(context).acceptLbl, - backgroundColor: Color(0xff60686b), - textColor: Colors.white, - fontSize: 16, - hPadding: 8, - vPadding: 12, - handler: () { - model.createNewLakumAccount("$firstName $lastName", mobileNo, identificationNo, languageId).then((status) => { - if (status == 200) {Navigator.pop(context, "")} - // back to previous page - }); - }, - ), - ), - ), - ], - ), - ), - )); - } -} diff --git a/lib/pages/pharmacies/screens/order-preview-page.dart b/lib/pages/pharmacies/screens/order-preview-page.dart new file mode 100644 index 00000000..d9646fcf --- /dev/null +++ b/lib/pages/pharmacies/screens/order-preview-page.dart @@ -0,0 +1,48 @@ +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class OrderPreviewPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, wi) => AppScaffold( + title: "Shopping Cart", + isShowAppBar: true, + isShowDecPage: false, + baseViewModel: model, + backgroundColor: Colors.white, + body: Container( + width: double.infinity, + child: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureIconButton( + TranslationBase.of(context).deleteAllItems, + Icon(Icons.delete_outline_sharp, color: Colors.grey.shade800,), + onTap: () => {}, + ), + const Divider( + color: Colors.grey, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + + ], + ), + ), + ), + ), + ), + ); + } +} + diff --git a/lib/pages/pharmacies/screens/payment-method-select-page.dart b/lib/pages/pharmacies/screens/payment-method-select-page.dart deleted file mode 100644 index 8cdbaf3c..00000000 --- a/lib/pages/pharmacies/screens/payment-method-select-page.dart +++ /dev/null @@ -1,202 +0,0 @@ -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; - -class PaymentMethodSelectPage extends StatefulWidget { - @override - _PaymentMethodSelectPageState createState() => - _PaymentMethodSelectPageState(); -} - -class _PaymentMethodSelectPageState extends State { - PaymentOption selectedPaymentOption; - - @override - Widget build(BuildContext context) { - Size screenSize = MediaQuery.of(context).size; - double cardWidth = screenSize.width / 2 - 32; - - return AppScaffold( - title: "Payment method", - isShowAppBar: true, - isShowDecPage: false, - body: Container( - width: double.infinity, - margin: EdgeInsets.symmetric(horizontal: 0, vertical: 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Center( - child: Texts( - TranslationBase.of(context).selectPaymentOption, - fontSize: 20, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 0, vertical: 16), - child: Column( - children: [ - Row( - children: [ - PaymentMethodCard( - cardWidth, - selectedPaymentOption, - PaymentOption.meda, - () => { - setState(() { - selectedPaymentOption = PaymentOption.meda; - }) - }), - PaymentMethodCard( - cardWidth, - selectedPaymentOption, - PaymentOption.sadad, - () => { - setState(() { - selectedPaymentOption = PaymentOption.sadad; - }) - }), - ], - ), - Row( - children: [ - PaymentMethodCard( - cardWidth, - selectedPaymentOption, - PaymentOption.visa, - () => { - setState(() { - selectedPaymentOption = PaymentOption.visa; - }) - }), - PaymentMethodCard( - cardWidth, - selectedPaymentOption, - PaymentOption.mastercard, - () => { - setState(() { - selectedPaymentOption = - PaymentOption.mastercard; - }) - }), - ], - ), - PaymentMethodCard( - (cardWidth * 2 + 32), - selectedPaymentOption, - PaymentOption.installments, - () => { - setState(() { - selectedPaymentOption = - PaymentOption.installments; - }) - }), - ], - ), - ), - ], - ), - ), - bottomSheet: Container( - height: screenSize.height * 0.08, - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: BorderedButton( - TranslationBase.of(context).next, - backgroundColor: Color(0xff5AB154), - textColor: Colors.white, - fontSize: 16, - hPadding: 8, - vPadding: 12, - handler: selectedPaymentOption != null - ? () => {Navigator.pop(context, selectedPaymentOption)} - : null, - ), - ), - ); - } -} - -class PaymentMethodCard extends StatelessWidget { - final double cardWidth; - final PaymentOption selectedPaymentOption; - final PaymentOption paymentOption; - final Function selectMethod; - - PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, - this.paymentOption, this.selectMethod); - - @override - Widget build(BuildContext context) { - bool isSelected = false; - if (selectedPaymentOption != null && - selectedPaymentOption == paymentOption) { - isSelected = true; - } - - return InkWell( - onTap: selectMethod, - child: Container( - margin: EdgeInsets.symmetric(horizontal: 2, vertical: 0), - child: Stack( - children: [ - Container( - padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), - margin: EdgeInsets.symmetric(horizontal: 14, vertical: 8), - decoration: new BoxDecoration( - color: Colors.grey.shade100, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.fromBorderSide(BorderSide( - color: isSelected ? Color(0xff20BC11) : Colors.grey.shade300, - width: 0.8, - )), - ), - width: cardWidth, - child: Image.asset( - getPaymentOptionImage(paymentOption), - fit: BoxFit.cover, - ), - ), - if (isSelected) - Positioned( - right: 1, - child: Icon( - Icons.check_circle, - color: Color(0xff20BC11), - size: 30, - ), - ), - ], - ), - ), - ); - } - - String getPaymentOptionImage(PaymentOption paymentOption) { - String assetFile = "assets/images/pharmacy_module/payment/"; - switch (paymentOption.index) { - case 0: - return "${assetFile}mada.png"; - break; - case 1: - return "${assetFile}sadad.png"; - break; - case 2: - return "${assetFile}visa.png"; - break; - case 3: - return "${assetFile}mastercard.png"; - break; - case 4: - return "${assetFile}installment.png"; - break; - default: - return ""; - } - } -} diff --git a/lib/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart b/lib/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart deleted file mode 100644 index 87c1b97c..00000000 --- a/lib/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/tems-condition-viewmodel.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_html/flutter_html.dart'; -import 'package:provider/provider.dart'; - -class PharmacyTermsConditions extends StatelessWidget { - @override - Widget build(BuildContext context) { - ProjectViewModel projectProvider = Provider.of(context); - - return BaseView( - onModelReady: (model) => model.getUserTermsAndConditionsForEPharmcy(), - builder: (_, model, wi) => AppScaffold( - appBarTitle: TranslationBase.of(context).termOfService, - isShowAppBar: true, - isShowDecPage: false, - isPharmacy: true, - backgroundColor: Colors.white, - baseViewModel: model, - body: Container( - margin: EdgeInsets.all(8), - width: double.infinity, - child: Stack( - children: [ - SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - if (model.listUserAgreement != null && - model.listUserAgreement.userAgreementLAKUM != - null) - Html( - data: projectProvider.isArabic - ? model.listUserAgreement.userAgreementTxtn - : model.listUserAgreement.userAgreementTxt, - ), - ], - ), - ), - ], - ), - ), - )); - } -} diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index 32a610f8..2ae2be65 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -2,9 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; -import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/order-preview-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/BannerPager.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/manufacturerItem.dart'; @@ -15,17 +13,16 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'lacum-activitaion-vida-page.dart'; - class PharmacyPage extends StatelessWidget { + @override Widget build(BuildContext context) { return BaseView( + // onModelReady: (model) => model.getPharmacyHomeData(), onModelReady: (model) => model.getPharmacyHomeData(), - allowAny: true, builder: (_, model, wi) => AppScaffold( title: "", - isShowAppBar: false, + isShowAppBar: true, isShowDecPage: false, baseViewModel: model, backgroundColor: Colors.white, @@ -36,7 +33,8 @@ class PharmacyPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ BannerPager(model), - GridViewButtons(model), + GridViewButtons(), + /*BannerPager(model.getBannerImagesUrl()),*/ Container( margin: EdgeInsets.fromLTRB(10, 0, 10, 0), child: Row( @@ -50,9 +48,8 @@ class PharmacyPage extends StatelessWidget { TranslationBase.of(context).viewAll, hasBorder: true, vPadding: 6, - hPadding: 4, borderColor: Colors.green, - textColor: Colors.green, + color: Colors.green, handler: () {}, ), ], @@ -80,18 +77,15 @@ class PharmacyPage extends StatelessWidget { TranslationBase.of(context).viewAll, hasBorder: true, vPadding: 6, - hPadding: 4, borderColor: Colors.green, - textColor: Colors.green, + color: Colors.green, handler: () {}, ), ], ), ), Container( - height: model.lastVisitedProducts.length > 0 - ? MediaQuery.of(context).size.height / 4 + 20 - : 0, + height: model.lastVisitedProducts.length > 0 ? MediaQuery.of(context).size.height / 4 : 0, child: ListView.builder( itemBuilder: (ctx, i) => ProductTileItem(model.lastVisitedProducts[i]), @@ -112,16 +106,15 @@ class PharmacyPage extends StatelessWidget { TranslationBase.of(context).viewAll, hasBorder: true, borderColor: Colors.green, - textColor: Colors.green, + color: Colors.green, vPadding: 6, - hPadding: 4, handler: () {}, ), ], ), ), Container( - height: MediaQuery.of(context).size.height / 4 + 20, + height: MediaQuery.of(context).size.height / 4, child: ListView.builder( itemBuilder: (ctx, i) => ProductTileItem(model.bestSellerProduct[i]), @@ -139,10 +132,6 @@ class PharmacyPage extends StatelessWidget { } class GridViewButtons extends StatelessWidget { - final PharmacyModuleViewModel model; - - GridViewButtons(this.model); - @override Widget build(BuildContext context) { final gridHeight = (MediaQuery.of(context).size.width * 0.3) * 1.8; @@ -164,25 +153,17 @@ class GridViewButtons extends StatelessWidget { opacity: 0.8, child: GridViewCard( TranslationBase.of(context).offersAndPromotions, - 'assets/images/pharmacy_module/offer_icon.png', () { - Navigator.push(context, FadePage(page: OffersCategorisePage())); - }), + 'assets/images/pharmacy_module/offer_icon.png', + () { + Navigator.push(context, FadePage(page: OrderPreviewPage())); + }), ), DashboardItem( imageName: 'pharmacy_module/bg_2.png', opacity: 0, hasColorFilter: false, child: GridViewCard(TranslationBase.of(context).medicationRefill, - 'assets/images/pharmacy_module/medication_icon.png', () { - model.checkUserIsActivated().then((isActivated) { - if (isActivated) { - Navigator.push(context, FadePage(page: LakumMainPage())); - } else { - Navigator.push( - context, FadePage(page: LakumActivationVidaPage())); - } - }); - }), + 'assets/images/pharmacy_module/medication_icon.png', () {}), ), DashboardItem( imageName: 'pharmacy_module/bg_3.png', @@ -238,16 +219,11 @@ class GridViewCard extends StatelessWidget { ), ), ), - Row( - children: [ - BorderedButton( - TranslationBase.of(context).viewAll, - handler: handler, - tPadding: 0, - bPadding: 0, - ), - Expanded(child: Container()), - ], + Expanded( + child: BorderedButton( + TranslationBase.of(context).viewAll, + handler: handler, + ), ), ], ), diff --git a/lib/pages/pharmacies/widgets/BannerPager.dart b/lib/pages/pharmacies/widgets/BannerPager.dart index 0f29014d..989c7557 100644 --- a/lib/pages/pharmacies/widgets/BannerPager.dart +++ b/lib/pages/pharmacies/widgets/BannerPager.dart @@ -26,7 +26,6 @@ class _BannerPagerState extends State { enlargeCenterPage: true, enableInfiniteScroll: false, initialPage: 0, - viewportFraction: 0.8, autoPlay: true, autoPlayInterval: Duration(seconds: 3), autoPlayAnimationDuration: Duration(milliseconds: 800), diff --git a/lib/pages/pharmacies/widgets/ProductOrderItem.dart b/lib/pages/pharmacies/widgets/ProductOrderItem.dart index 92e2c39d..81b6068a 100644 --- a/lib/pages/pharmacies/widgets/ProductOrderItem.dart +++ b/lib/pages/pharmacies/widgets/ProductOrderItem.dart @@ -1,239 +1,13 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class ProductOrderItem extends StatefulWidget { - final ShoppingCart item; - final VoidCallback changeCartItems; - final VoidCallback deleteCartItems; - - ProductOrderItem(this.item, this.changeCartItems, this.deleteCartItems); - - @override - _ProductOrderItemState createState() => _ProductOrderItemState(); -} - -class _ProductOrderItemState extends State { - TextEditingController _quantityController = new TextEditingController(); - String _totalPrice = "0"; - - @override - void initState() { - _quantityController.text = "${widget.item.quantity}"; - _totalPrice = - "${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}"; - super.initState(); - } +class ProductOrderItem extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectProvider = Provider.of(context); - - return Column( - children: [ - ListTile( - leading: InkWell( - onTap: () => {widget.deleteCartItems()}, - child: Icon( - Icons.delete_outline_sharp, - color: Colors.grey.shade700, - ), - ), - title: Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - (widget.item.product.images != null && widget.item.product.images.length > 0) - ? Image.network( - widget.item.product.images[0].src, - fit: BoxFit.cover, - height: 80, - ) - : Image.asset( - "assets/images/no_image.png", - fit: BoxFit.cover, - height: 80, - ), - Expanded( - child: Container( - margin: - const EdgeInsets.symmetric(vertical: 8, horizontal: 8), - child: Container( - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: Texts( - projectProvider.isArabic - ? widget.item.product.namen - : widget.item.product.name, - regular: true, - textAlign: TextAlign.justify, - fontSize: 12, - fontWeight: FontWeight.w400, - ), - margin: const EdgeInsets.only(bottom: 4), - ), - Container( - child: Texts( - "${(widget.item.product.price).toStringAsFixed(2)} ${projectProvider.isArabic ? widget.item.currencyn : widget.item.currency}", - fontSize: 14, - fontWeight: FontWeight.bold, - ), - margin: const EdgeInsets.only(bottom: 4), - ), - Row( - children: [ - InkWell( - onTap: () => - {_quantityOnChangeClick(Operation.dec)}, - child: Container( - width: 25, - height: 25, - child: Center( - child: Texts( - "-", - color: Colors.grey.shade400, - )), - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey.shade400, - width: 1.0, - ), - ), - ), - ), - Container( - margin: - const EdgeInsets.symmetric(horizontal: 4), - width: 25, - height: 25, - color: Colors.grey.shade300, - child: Center( - child: TextField( - cursorColor: Colors.black, - keyboardType: TextInputType.number, - controller: _quantityController, - textAlign: TextAlign.center, - onChanged: (text) { - setState(() { - var value = int.tryParse(text); - if (value == null) { - widget.item.quantity = 0; - } else { - widget.item.quantity = int.parse(text); - } - _totalPrice = - "${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}"; - }); - }, - )), - ), - InkWell( - onTap: () => - {_quantityOnChangeClick(Operation.inc)}, - child: Container( - width: 25, - height: 25, - child: Center( - child: Texts( - "+", - color: Colors.grey.shade400, - )), - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey.shade400, - width: 1.0, - ), - ), - ), - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Texts( - TranslationBase.of(context).total, - color: Colors.grey.shade500, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - Texts( - "$_totalPrice ${projectProvider.isArabic ? widget.item.currencyn : widget.item.currency}", - fontSize: 12, - fontWeight: FontWeight.bold, - ) - ], - ), - ) - ], - ) - ], - ), - ), - ), - ) - ], - ), - ), - ), - const Divider( - color: Color(0xFFD6D6D6), - height: 15, - thickness: 1, - indent: 0, - endIndent: 0, - ), - ], + return ListTile( + leading: Icon( + Icons.delete_outline_sharp, + color: Colors.grey.shade800, + ), ); } - - _quantityOnChangeClick(Operation operation) { - int newValue = 0; - setState(() { - switch (operation) { - case Operation.inc: - { - newValue = widget.item.quantity + 1; - } - break; - - case Operation.dec: - { - newValue = widget.item.quantity - 1; - } - break; - default: - { - //statements; - } - break; - } - if (newValue > 0) { - widget.item.quantity = newValue; - _quantityController.text = "${widget.item.quantity}"; - _totalPrice = - "${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}"; - } - }); - if (newValue > 0) { - widget.changeCartItems(); - } - } - - @override - void dispose() { - // Clean up the controller when the widget is removed from the - // widget tree. - _quantityController.dispose(); - super.dispose(); - } } - -enum Operation { inc, dec } diff --git a/lib/pages/pharmacies/widgets/ProductOrderPreviewItem.dart b/lib/pages/pharmacies/widgets/ProductOrderPreviewItem.dart deleted file mode 100644 index d38f437c..00000000 --- a/lib/pages/pharmacies/widgets/ProductOrderPreviewItem.dart +++ /dev/null @@ -1,111 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class ProductOrderPreviewItem extends StatelessWidget { - final ShoppingCart item; - - ProductOrderPreviewItem(this.item); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectProvider = Provider.of(context); - - return Container( - margin: EdgeInsets.only(top: 16), - child: Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - (item.product.images != null && item.product.images.length > 0) - ? Image.network( - item.product.images[0].src, - fit: BoxFit.cover, - height: 80, - ) - : Image.asset( - "assets/images/no_image.png", - fit: BoxFit.cover, - height: 80, - ), - Expanded( - child: Container( - margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 8), - child: Container( - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: Texts( - projectProvider.isArabic - ? item.product.namen - : item.product.name, - regular: true, - textAlign: TextAlign.justify, - fontSize: 12, - fontWeight: FontWeight.w400, - ), - margin: const EdgeInsets.only(bottom: 4), - ), - Container( - child: Texts( - "${(item.product.price).toStringAsFixed(2)} ${projectProvider.isArabic ? item.currencyn : item.currency}", - fontSize: 14, - fontWeight: FontWeight.bold, - ), - margin: const EdgeInsets.only(bottom: 4), - ), - Container( - width: double.infinity, - alignment: Alignment.centerRight, - child: Texts( - TranslationBase.of(context).total, - color: Colors.grey.shade700, - fontWeight: FontWeight.bold, - fontSize: 13, - ), - ), - Row( - children: [ - Texts( - "QTY: ${item.quantity}", - color: Colors.grey.shade500, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - Expanded( - child: Container( - alignment: Alignment.centerRight, - child: Texts( - "${(item.product.price * item.quantity).toStringAsFixed(2)} ${projectProvider.isArabic ? item.currencyn : item.currency}", - fontSize: 14, - fontWeight: FontWeight.bold, - ), - ), - ) - ], - ), - ], - ), - ), - )), - ], - ), - const Divider( - color: Color(0xFFD6D6D6), - height: 0, - thickness: 1, - indent: 0, - endIndent: 0, - ), - ], - ), - ); - } -} diff --git a/lib/pages/pharmacies/widgets/ProductTileItem.dart b/lib/pages/pharmacies/widgets/ProductTileItem.dart index 2dea5a93..62493387 100644 --- a/lib/pages/pharmacies/widgets/ProductTileItem.dart +++ b/lib/pages/pharmacies/widgets/ProductTileItem.dart @@ -23,7 +23,6 @@ class ProductTileItem extends StatelessWidget { void _saveLastVisitProducts() async { String lastVisited = ""; bool isIdExist = false; - // var data = await sharedPref.getObject(USER_PROFILE) ; // data['PatientID'] if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != null) { lastVisited = @@ -70,17 +69,11 @@ class ProductTileItem extends StatelessWidget { Container( margin: EdgeInsets.fromLTRB(0, 16, 0, 0), alignment: Alignment.center, - child: (item.images != null && item.images.length > 0) - ? Image.network( - item.images[0].src, - fit: BoxFit.cover, - height: 80, - ) - : Image.asset( - "assets/images/no_image.png", - fit: BoxFit.cover, - height: 80, - ), + child: Image.network( + item.images[0].src, + fit: BoxFit.cover, + height: 80, + ), ), Container( width: item.rxMessage != null @@ -111,7 +104,7 @@ class ProductTileItem extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - projectProvider.isArabic ? item.namen : item.name, + projectProvider.isArabic ? item.name : item.namen, regular: true, fontSize: 12, fontWeight: FontWeight.w400, @@ -126,21 +119,19 @@ class ProductTileItem extends StatelessWidget { ), Row( children: [ - Expanded( - child: StarRating( - totalAverage: item.approvedTotalReviews > 0 - ? (item.approvedRatingSum.toDouble() / - item.approvedTotalReviews.toDouble()) - .toDouble() - : 0, - forceStars: true), - ), - /*Texts( + StarRating( + totalAverage: item.approvedTotalReviews > 0 + ? (item.approvedRatingSum.toDouble() / + item.approvedTotalReviews.toDouble()) + .toDouble() + : 0, + forceStars: true), + Texts( "(${item.approvedTotalReviews})", regular: true, fontSize: 10, fontWeight: FontWeight.w400, - ),*/ + ) ], ), ], diff --git a/lib/pages/pharmacies/widgets/lacum-banner-widget.dart b/lib/pages/pharmacies/widgets/lacum-banner-widget.dart deleted file mode 100644 index 14a53e72..00000000 --- a/lib/pages/pharmacies/widgets/lacum-banner-widget.dart +++ /dev/null @@ -1,289 +0,0 @@ -import 'package:carousel_slider/carousel_slider.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:flutter/material.dart'; - -class LakumBannerWidget extends StatefulWidget { - final LacumViewModel model; - final MediaQueryData mediaQuery; - final bool isLacumHomePage; - - LakumBannerWidget(this.model, this.mediaQuery, this.isLacumHomePage); - - @override - _LakumBannerWidgetState createState() => _LakumBannerWidgetState(); -} - -class _LakumBannerWidgetState extends State { - int _current = 0; - - @override - Widget build(BuildContext context) { - return Container( - child: Stack( - children: [ - CarouselSlider( - options: CarouselOptions( - enableInfiniteScroll: false, - enlargeCenterPage: false, - viewportFraction: 1.0, - scrollPhysics: widget.isLacumHomePage - ? ScrollPhysics() - : NeverScrollableScrollPhysics(), - initialPage: 0, - onPageChanged: (index, reason) { - setState(() { - _current = index; - }); - }, - ), - items: [ - Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(4), - border: Border.fromBorderSide(BorderSide( - color: Colors.grey, - width: 0.4, - )), - ), - margin: EdgeInsets.symmetric(horizontal: 16), - child: Stack( - children: [ - Image.asset( - "assets/images/pharmacy_module/lakum/lakum_card_front_bg.png", - fit: BoxFit.fill, - width: widget.mediaQuery.size.width * 1.0, - height: widget.mediaQuery.size.width * 1.0, - ), - Container( - margin: EdgeInsets.fromLTRB(12, 70, 12, 4), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - widget.model.lacumGroupInformation.lakumInquiryInformationObjVersion.memberName, - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - Texts( - "${widget.model.lacumInformation.yahalaAccountNo}", - fontSize: 16, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ], - ), - BorderedButton( - widget.model.lacumGroupInformation.lakumInquiryInformationObjVersion.accountStatus == "Active" - ? TranslationBase.of(context).active - : TranslationBase.of(context).inactive, - textColor: widget.model.lacumInformation - .accountStatus == - 1 - ? Colors.green - : Colors.red, - hasBorder: true, - borderColor: widget.model.lacumInformation - .accountStatus == - 1 - ? Colors.green - : Colors.red, - radius: 16, - rPadding: 16, - icon: widget.model.lacumInformation - .accountStatus == - 1 - ? Icon( - Icons.check_circle, - size: 25, - color: Colors.green, - ) - : Image.asset( - "assets/images/pharmacy_module/lakum/inactive_cross.png", - fit: BoxFit.fill, - width: 25, - height: 25, - ), - ), - ], - ), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "IDENTIFICATION #", - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - Texts( - widget.model.lacumInformation - .identificationNo, - fontSize: 16, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Texts( - "MEMBER SINCE", - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - Texts( - widget.model.formatCreatedDateToString(), - fontSize: 16, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ], - ), - ], - ), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "MOBILE #", - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - Texts( - widget.model.lacumGroupInformation.lakumInquiryInformationObjVersion.mobileNumber, - fontSize: 16, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Texts( - TranslationBase.of(context).language, - fontSize: 14, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - Texts( - widget.model.lacumInformation.prefLang == - "1" - ? TranslationBase.of(context).lanEnglish - : TranslationBase.of(context).lanArabic, - fontSize: 16, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ], - ), - ], - ), - ], - ), - ), - ], - ), - ), - widget.isLacumHomePage - ? Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(4), - border: Border.fromBorderSide(BorderSide( - color: Colors.grey, - width: 0.4, - )), - ), - margin: EdgeInsets.symmetric(horizontal: 16), - child: Stack( - children: [ - Image.asset( - "assets/images/pharmacy_module/lakum/lakum_card_front_bg.png", - fit: BoxFit.fill, - width: widget.mediaQuery.size.width * 1.0, - height: widget.mediaQuery.size.width * 1.0, - ), - Container( - margin: EdgeInsets.fromLTRB(12, 70, 12, 4), - child: widget.model.convertBase64ToBarCodeImage() != - null - ? Image.memory( - widget.model.convertBase64ToBarCodeImage()) - : Container(), - ), - ], - ), - ) - : Container(), - ], - ), - widget.isLacumHomePage - ? Positioned( - bottom: 1, - left: 1, - right: 1, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - width: _current == 0 ? 12.0 : 8.0, - height: 4.0, - margin: EdgeInsets.symmetric( - vertical: 0.0, horizontal: 2.0), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: _current == 0 - ? Color(0xff5ab145) - : Color.fromRGBO(0, 0, 0, 0.4), - ), - ), - Container( - width: _current == 1 ? 12.0 : 8.0, - height: 4.0, - margin: EdgeInsets.symmetric( - vertical: 0.0, horizontal: 2.0), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: _current == 1 - ? Color(0xff5ab145) - : Color.fromRGBO(0, 0, 0, 0.4), - ), - ), - ], - ), - ), - ) - : Container(), - ], - ), - ); - } -} \ No newline at end of file diff --git a/lib/pages/pharmacies/widgets/lakum-point-table-row-widget.dart b/lib/pages/pharmacies/widgets/lakum-point-table-row-widget.dart deleted file mode 100644 index 6e4e2309..00000000 --- a/lib/pages/pharmacies/widgets/lakum-point-table-row-widget.dart +++ /dev/null @@ -1,116 +0,0 @@ -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; -import 'package:diplomaticquarterapp/widgets/others/points-expandable-notifier.dart'; -import 'package:expandable/expandable.dart'; -import 'package:flutter/material.dart'; - -class LakumPointTableRowWidget extends StatefulWidget { - final bool isTableTitle; // true : title , false: row - final String rowTitle; - final double points; - final double riyal; - final Function onTap; - final int rowIndex; - final Widget collapsed; - final bool expandFlag; - - LakumPointTableRowWidget(this.isTableTitle, this.rowTitle, this.points, - this.riyal, this.onTap, this.rowIndex, - {this.collapsed, this.expandFlag = false}); - - @override - _LakumPointTableRowWidgetState createState() => - _LakumPointTableRowWidgetState(); -} - -class _LakumPointTableRowWidgetState extends State { - @override - Widget build(BuildContext context) { - return InkWell( - onTap: widget.onTap, - child: Column( - children: [ - Column( - children: [ - widget.collapsed != null - ? PointsExpandableNotifier( - headerWidget: buildPointRowBody(), - // bodyWidget: widget.collapsed != null ? widget.collapsed : null, - bodyWidget: widget.collapsed, - isExpand: widget.expandFlag, - ) - : buildPointRowBody(), - ], - ), - const Divider( - color: Color(0xFFD6D6D6), - height: 1, - thickness: 1, - indent: 0, - endIndent: 0, - ), - ], - ), - ); - } - - Widget buildPointRowBody() { - bool isEven = widget.rowIndex % 2 == 0; - return Container( - padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), - color: widget.expandFlag ? Color(0xffe4e4e4) : isEven && !widget.isTableTitle ? Color(0xffefefef) : Colors.white, - child: Column( - children: [ - Row( - children: [ - Expanded( - child: Container( - child: Texts( - widget.rowTitle, - fontSize: 14, - fontWeight: - widget.isTableTitle ? FontWeight.bold : FontWeight.normal, - ), - )), - Expanded( - child: Container( - child: Texts( - widget.isTableTitle ? "POINTS" : "${widget.points}", - fontSize: 14, - fontWeight: - widget.isTableTitle ? FontWeight.bold : FontWeight.normal, - ), - )), - Expanded( - child: Container( - child: Texts( - widget.isTableTitle ? "RIYAL" : "${widget.riyal}", - fontSize: 14, - fontWeight: - widget.isTableTitle ? FontWeight.bold : FontWeight.normal, - ), - )), - Expanded( - child: widget.isTableTitle - ? Container() - : Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Icon( - widget.collapsed == null - ? Icons.keyboard_arrow_right - : widget.expandFlag - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - size: 25, - color: Colors.grey.shade700, - ), - ], - )), - ], - ), - ], - ), - ); - } -} diff --git a/lib/pages/pharmacies/wishlist.dart b/lib/pages/pharmacies/wishlist.dart deleted file mode 100644 index 8fa7352d..00000000 --- a/lib/pages/pharmacies/wishlist.dart +++ /dev/null @@ -1,55 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/wishList_service.dart'; -import 'package:diplomaticquarterapp/widgets/pharmacy/product_tile.dart'; - - -void main() => runApp(WishlistPage()); - -class WishlistPage extends StatefulWidget { - - @override - _WishlistPageState createState() => _WishlistPageState(); -} - -class _WishlistPageState extends State { - - @override - void initState(){ - WidgetsBinding.instance.addPostFrameCallback((_) => getWishListItems()); - } - - Widget build(BuildContext context) { - return AppScaffold( - appBarTitle: 'Wishlist page', - isShowAppBar: true, - isPharmacy: true, - body: Container( -// child: productTile(), - child: ListView.builder( - itemCount: 3, - itemBuilder: (BuildContext context, int index) { - return Column( - children: [ - Container( - child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00,), - ), - Divider(height: 1, color: Colors.grey) - ], - ); - }), - ), - ); - } -} - -getWishListItems() { - - print("getWishListItems"); - WishListService service = new WishListService(); - service.getWishlist(AppGlobal.context).then((res) { - print(res); - }); - -} diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart deleted file mode 100644 index 17849c47..00000000 --- a/lib/pages/pharmacy/order/Order.dart +++ /dev/null @@ -1,881 +0,0 @@ -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; - -class OrderPage extends StatefulWidget { - -// orderList({this.customerId, this.pageId}); - - @override - _OrderPageState createState() => _OrderPageState(); -} - -class _OrderPageState extends State with SingleTickerProviderStateMixin{ - String customerId=""; - String page_id=""; - - List delivered = [] ; - List processing = []; - List cancelled = []; - List pending = []; - TabController _tabController; - AppSharedPreferences sharedPref = AppSharedPreferences(); - - @override - void initState() { -// WidgetsBinding.instance.addPostFrameCallback((_) => getOrder()); - - super.initState(); - _tabController = new TabController(length: 4, vsync: this,); - } - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getOrder(customerId, page_id), - builder: (_,model, wi )=> AppScaffold( - appBarTitle:(TranslationBase.of(context).order), -// backgroundColor: Colors.green , -// centerTitle: true, -// title: Text(TranslationBase.of(context).order, style: TextStyle(color:Colors.white)), -// backgroundColor: Colors.green, - isShowAppBar: true, - isPharmacy:true , - body: Container( - child: Column( - children: [ - TabBar( - tabs: [ - Tab(text: TranslationBase.of(context).delivered), -// Tab(text: model.order.length.toString()), - Tab(text: TranslationBase.of(context).processing), - Tab(text: TranslationBase.of(context).pending), - Tab(text: TranslationBase.of(context).cancelled), - ], - controller: _tabController, - ), - Divider( - color: Colors.grey[350], - height: 10, - thickness: 6, - indent: 0, - endIndent: 0, - ), - Expanded( - child: new TabBarView( - physics: NeverScrollableScrollPhysics(), - children: [ - getDeliveredOrder(model), - getProcessingOrder(model), - getPendingOrder(model), - getCancelledOrder(model), - ], - controller: _tabController, - ), - ), - ], - ), - ), - ), - ); - } - - Widget getDeliveredOrder(OrderModelViewModel model){ - return Container( - width: MediaQuery.of(context).size.width, - child: model.order.length != 0 && model.order[0].orderStatusId == 30 - ? SingleChildScrollView( - child: Column( - children: [ - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: 2 , - itemBuilder: (context, index){ - return Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderNumber, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - child: Text(model.order[0].id.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderDate, - style: TextStyle(fontSize: 14.0, - ), - ), - ), - Container( - child: Text(model.order[0].createdOnUtc.toString(), - style: TextStyle(fontSize: 14.0, - ), - ), - ), - ], - ), - ], - ), - ), - Container( - margin: EdgeInsets.all(8.0), - child: InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage())); - }, - child: SvgPicture.asset( - 'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20,), - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - padding: EdgeInsets.only(left: 13.0, right: 13.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.blue[700], - style: BorderStyle.solid, - width: 5.0, - ), - color: Colors.blue[700], - borderRadius: BorderRadius.circular(30.0) - ), - child: Text( - model.order[0].orderStatus.toString(), -// TranslationBase.of(context).delivered, - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - child: Column( -// crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text(model.order[0].orderTotal.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - child: Text('12', - style: TextStyle(fontSize: 14.0, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).itemsNo, - style: TextStyle(fontSize: 14.0, - ), - ), - ), - ], - ), - ], - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, - ), - ], - ), - ); - } - ) - ], - ), - ) - : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/pharmacy/empty_box.svg'), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noOrder, - style: TextStyle( - fontSize: 16.0, - )), - ), - ], - ), - ), - ), - ); - } - - Widget getProcessingOrder(OrderModelViewModel model){ - return Container( - child: model.order.length != 0 && model.order[0].orderStatusId == 20 - ? SingleChildScrollView( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderNumber, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - child: Text(model.order[0].id.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderDate, - style: TextStyle(fontSize: 14.0, - ), - ), - ), - Container( - child: Text(model.order[0].createdOnUtc.toString(), - style: TextStyle(fontSize: 14.0, - ), - ), - ), - ], - ), - ], - ), - ), - Container( - margin: EdgeInsets.all(8), - child: InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage())); - }, - child: SvgPicture.asset( - 'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20,), - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - padding: EdgeInsets.only(left: 13.0, right: 13.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 5.0, - ), - color: Colors.green, - borderRadius: BorderRadius.circular(30.0) - ), - child: Text( - model.order[0].orderStatus.toString(), -// TranslationBase.of(context).processing, - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - child: Column( -// crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text(model.order[0].orderTotal.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - child: Text('12', - style: TextStyle(fontSize: 14.0, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).itemsNo, - style: TextStyle(fontSize: 14.0, - ), - ), - ), - ], - ), - ], - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, - ), - ], - ), - ) - : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/pharmacy/empty_box.svg'), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noOrder, - style: TextStyle( - fontSize: 16.0, - )), - ), - ], - ), - ), - ), - ); - } - - Widget getPendingOrder(OrderModelViewModel model){ - return Container( - child: model.order.length != 0 && model.order[0].orderStatusId == 10 - ? SingleChildScrollView( - child: Column( - children: [ - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: 2 , - itemBuilder: (context, index){ - return Container( - child: SingleChildScrollView( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderNumber, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - child: Text(model.order[0].id.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderDate, - style: TextStyle(fontSize: 14.0, - ), - ), - ), - Container( - child: Text(model.order[0].createdOnUtc.toString(), - style: TextStyle(fontSize: 14.0, - ), - ), - ), - ], - ), - ], - ), - ), - Container( - margin: EdgeInsets.all( 8.0), - child: InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage())); - }, - child: SvgPicture.asset( - 'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20,), - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child:Container( - margin: EdgeInsets.all(8.0), - padding: EdgeInsets.only(left: 13.0, right: 13.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.orange[300], - style: BorderStyle.solid, - width: 5.0, - ), - color: Colors.orange[300], - borderRadius: BorderRadius.circular(30.0) - ), - child: Text( - model.order[0].orderStatus.toString(), - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ), - ), ), - Container( - margin: EdgeInsets.all(8.0), - child: Column( -// crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text(model.order[0].orderTotal.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - child: Text('12', - style: TextStyle(fontSize: 14.0, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).itemsNo, - style: TextStyle(fontSize: 14.0, - ), - ), - ), - ], - ), - ], - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, - ), - ], - ), - ), - - ); - } - ) - ], - ), - ) - : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/pharmacy/empty_box.svg'), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noOrder, - style: TextStyle( - fontSize: 16.0, - )), - ), - ], - ), - ), - ), - - ); - } - - Widget getCancelledOrder(OrderModelViewModel model){ - return Container( - child: model.order.length != 0 && model.order[0].orderStatusId == 40 - ? SingleChildScrollView( - child: Column( - children: [ - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: 2 , - itemBuilder: (context, index){ - return Container( - child: SingleChildScrollView( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all( 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderNumber, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - child: Text(model.order[0].id.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderDate, - style: TextStyle(fontSize: 14.0, - ), - ), - ), - Container( - child: Text(model.order[0].createdOnUtc.toString(), - style: TextStyle(fontSize: 14.0, - ), - ), - ), - ], - ), - ], - ), - ), - Container( - margin: EdgeInsets.all(8.0), - child: InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage())); - }, - child: SvgPicture.asset( - 'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20,), - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child:Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - padding: EdgeInsets.only(left: 10.0, right: 10.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.red[900], - style: BorderStyle.solid, - width: 5.0, - ), - color: Colors.red[900], - borderRadius: BorderRadius.circular(30.0) - ), - child: Text( - model.order[0].orderStatus.toString(), - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ), - ), ), - Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - child: Column( -// crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text(model.order[0].orderTotal.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - child: Text('12', - style: TextStyle(fontSize: 14.0, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).itemsNo, - style: TextStyle(fontSize: 14.0, - ), - ), - ), - ], - ), - ], - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, - ), - ], - ), - ), - - ); - } - ) - ], - ), - ) - : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/pharmacy/empty_box.svg'), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noOrder, - style: TextStyle( - fontSize: 16.0, - )), - ), - ], - ), - ), - ), - ); - } -} - - - - -// filterOrders() { -// for () { -// if (order.order_status_id === 30 || order.order_status_id === 997 || order.order_status_id === 994) { // complete -// this.delivered.push(order); -// } else if (order.order_status_id === 40 || order.order_status_id === 200 || order.order_status_id === 996) { // cancelled & order refunded -// this.cancelled.push(order); -// } else if (order.order_status_id === 10) { // Pending -// this.pending.push(order); -// } else if (order.order_status_id === 20 || order.order_status_id === 995 || order.order_status_id === 998 || order.order_status_id === 999) { // Processing -// this.processing.push(order); -// } else { // Processing & other all other status -// this.other.push(order); -// } -// } -//} - - - diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart deleted file mode 100644 index d406e7f5..00000000 --- a/lib/pages/pharmacy/order/OrderDetails.dart +++ /dev/null @@ -1,475 +0,0 @@ - -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart'; - - - -class OrderDetailsPage extends StatefulWidget { - - @override - _OrderDetailsPageState createState() => _OrderDetailsPageState(); -} - -class _OrderDetailsPageState extends State { - AppSharedPreferences sharedPref = AppSharedPreferences(); - String customerId=""; - String page_id=""; - String orderId="3516"; - @override - void initState() { - WidgetsBinding.instance.addPostFrameCallback((_) => getOrderDetails()); - super.initState(); - } - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady:(model) => model.getOrderDetails(orderId), - builder: (_,model, wi )=> AppScaffold( - appBarTitle: (TranslationBase.of(context).orderDetail), -// title: Text(TranslationBase.of(context).orderDetail, style: TextStyle(color:Colors.white)), -// backgroundColor: Colors.green, - isShowAppBar: true, - isPharmacy:true , - body: Container( - color: Colors.white, - child: SingleChildScrollView( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.fromLTRB(10.0, 15.0, 1.0, 5.0), - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/shipping_mark_icon.svg', - width: 28, - height: 28,), - Text(TranslationBase.of(context).shippingAddress, - style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold, - ), - ), - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 15.0, right: 10.0), - padding: EdgeInsets.only(left: 11.0, right: 11.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.blue, - style: BorderStyle.solid, - width: 5.0, - ), - color: Colors.blue, - borderRadius: BorderRadius.circular(30.0) - ), - child: Text( - TranslationBase.of(context).delivered, - style: TextStyle( - color: Colors.white, - fontSize: 13.0, - fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - Container( - margin: EdgeInsets.only(left: 10.0, top: 13.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('NAME', - style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, - ), - ), - ], - ), - ), - Container( - margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('Cloud Solutions', - style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, - color: Colors.grey, - ), - ), - ], - ), - ), - Row( - children: [ - Container( - margin: EdgeInsets.fromLTRB(10.0, 5.0, 8.0, 5.0), - child: SvgPicture.asset( - 'assets/images/pharmacy/mobile_number_icon.svg', - height: 13,), - ), - Container( - margin: EdgeInsets.only(top: 5.0, bottom: 5.0), - child: Text('588888778', - style: TextStyle(fontSize: 15.0, - ), - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - children: [ - Container( - margin: EdgeInsets.fromLTRB(10.0, 10.0, 5.0, 10.0), - child: SvgPicture.asset( - 'assets/images/pharmacy/shipping_truck_icon.svg', - height: 20, - width: 20,), - ), - Container( - margin: EdgeInsets.all(10.0), - child:Text(TranslationBase.of(context).shippedMethod, - style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - margin: EdgeInsets.only(bottom: 10.0, top: 10.0), - child: SvgPicture.asset( - 'assets/images/pharmacy/hmg_shipping_logo.svg', - height: 25, - width: 25,), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, - ), - Row( - children: [ - Container( - margin: EdgeInsets.fromLTRB(10.0, 10.0, 1.0, 10.0), - child: SvgPicture.asset( - 'assets/images/pharmacy/credit_card_icon.svg', - height: 20, - width: 20,), - ), - Container( - margin: EdgeInsets.all(10.0), - child: SvgPicture.asset( - 'assets/images/pharmacy/credit_card_icon.svg', - height: 20, - width: 20,), - ), - Container( - margin: EdgeInsets.only(bottom: 10.0, top: 10.0), - child:Text('Mada', - style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, - ), - Container( - padding: EdgeInsets.only(bottom: 15.0), - margin: EdgeInsets.only(left: 10.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(TranslationBase.of(context).orderDetail, - style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, - ), - ), - ], - ), - ), - Container( - child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00, - productReviews:4, totalPrice: '10.00', qyt: '3',), - ), - Container( - padding: EdgeInsets.only(bottom: 10.0), - margin: EdgeInsets.only(left: 10.0, top: 5.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(TranslationBase.of(context).orderSummary, - style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, - ), - ), - ], - ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - padding: EdgeInsets.only(bottom: 10.0), - margin: EdgeInsets.only(top: 5.0, left: 10.0 ), - child: Text( - TranslationBase.of(context).subtotal, - style: TextStyle( - fontSize: 13.0, - ), - ), - ), - Container( - padding: EdgeInsets.only(bottom: 10.0), - margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5.0), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 13.0, - ), - ), - ), - Text('343.55', - style: TextStyle(fontSize: 13.0, - ), - ), - ], - ), - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - padding: EdgeInsets.only(bottom: 10.0), - margin: EdgeInsets.only(top: 5.0, left: 10.0 ), - child: Text( - TranslationBase.of(context).shipping, - style: TextStyle( - fontSize: 13.0, - ), - ), - ), - Container( - padding: EdgeInsets.only(bottom: 10.0), - margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5.0), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 13.0, - ), - ), - ), - Text('343.55', - style: TextStyle(fontSize: 13.0, - ), - ), - ], - ), - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - padding: EdgeInsets.only(bottom: 10.0), - margin: EdgeInsets.only(top: 5.0,left: 10.0 ), - child: Text( - TranslationBase.of(context).vat, - style: TextStyle( - fontSize: 13.0, - ), - ), - ), - Container( - padding: EdgeInsets.only(bottom: 10.0), - margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5.0), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 13.0, - ), - ), - ), - Text('343.55', - style: TextStyle(fontSize: 13.0, - ), - ), - ], - ), - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.only(top: 5.0,left: 10.0 ), - child: Text( - TranslationBase.of(context).total, - style: TextStyle( - fontSize: 15.0,fontWeight: FontWeight.bold, - ), - ), - ), - Container( - margin: EdgeInsets.fromLTRB(10.0, 5.0, 5.0, 5.0), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5.0), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 15.0,fontWeight: FontWeight.bold, - ), - ), - ), - Text('343.55', - style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, - ), - ), - ], - ), - ), - ], - ), - InkWell( - onTap: (){ - }, - child: Container( - margin: EdgeInsets.only(top: 20.0), - height: 50.0, - color: Colors.transparent, - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 1.0 - ), - color: Colors.green, - borderRadius: BorderRadius.circular(5.0) - ), - child: Center( - child: Text( - TranslationBase.of(context).payOnline, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - ), - ), - ), - ), - ), - ), - InkWell( - onTap: () { -// confirmDelete(snapshot.data[index]["id"]); - cancelOrder("id"); - }, - child: Container( - height: 50.0, - color: Colors.transparent, - child: Center( - child: Text( - TranslationBase.of(context).cancelOrder, - style: TextStyle( - color: Colors.red[900], - fontWeight: FontWeight.bold, - decoration: TextDecoration.underline - ), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ); - } - cancelOrder(id){ - showDialog( - context: context, - builder: (BuildContext context)=> AlertDialog( - title: Text(TranslationBase.of(context).confirm, - style: TextStyle( - fontWeight: FontWeight.bold, - ),), - content: Text(TranslationBase.of(context).confirmCancellation, - style: TextStyle( - color: Colors.grey, - ),), - actions:[ - FlatButton( - child: Text(TranslationBase.of(context).cancel, - style: TextStyle( - color: Colors.red, - fontWeight: FontWeight.bold, - fontSize: 16, - ),), - onPressed: (){ - Navigator.pop(context); - }, - ), - FlatButton( - child: Text(TranslationBase.of(context).ok, - style: TextStyle( - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 16, - ),), - onPressed: (){ -// http.delete(""https://uat.hmgwebservices.com/epharmacy/api/orders/$id"); - Navigator.push(context, - MaterialPageRoute(builder: (context)=> OrderDetailsPage())); - }, - ), - ], - ) - ); - } -} - - getOrderDetails() { - print("getOrderDetails 5466"); - OrderDetailsService service = new OrderDetailsService(); - service.getOrderDetails(AppGlobal.context).then((res) { - print(res); - }); - } - - - getPayOrder(){ - - } diff --git a/lib/pages/pharmacy/order/ProductReview.dart b/lib/pages/pharmacy/order/ProductReview.dart deleted file mode 100644 index 9de67849..00000000 --- a/lib/pages/pharmacy/order/ProductReview.dart +++ /dev/null @@ -1,312 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; -import 'package:rating_bar/rating_bar.dart'; -import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart'; - -class ProductReviewPage extends StatefulWidget { - - @override - _ProductReviewPageState createState() => _ProductReviewPageState(); -} - -class _ProductReviewPageState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - centerTitle: true, - title: Text(TranslationBase.of(context).writeReview, style: TextStyle(color:Colors.white)), - backgroundColor: Colors.green, - ), - body: Container( - color: Colors.white, - child: SingleChildScrollView( - child: Column( - children: [ -// Container( -// child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00, -// productReviews:4, ), -// ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - margin: EdgeInsets.only(left: 10), - child: Image( - image: - AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'), - fit: BoxFit.cover, - width: 80, - height: 80, - ), - ), - Container( - margin: EdgeInsets.only(top :15.0, bottom: 15.0), - child: Column( - children: [ - Row( - children: [ - Text('medication name', - style: TextStyle(fontSize: 16.0, - ), - ), - ], - ), - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text('90.00', - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text('SAR', - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - Row( - children: [ - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RatingBar.readOnly( - initialRating: 3, - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ), - ), - Container( - child: Text('4.9', - style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text('10 (reviews)', - style: TextStyle(fontSize: 12.0, - ), - ), - ), - ], - ), - ], - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, - ), - Container( - margin: EdgeInsets.only( top: 12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar( - // initialRating: - // this.doctor.actualDoctorRate.toDouble(), - size: 40.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ], - ), - ), - Container( - padding: EdgeInsets.fromLTRB(8.0, 20.0, 8.0,20.0), - child: Column( - children: [ - TextFormField ( - decoration: InputDecoration( - contentPadding: const EdgeInsets.symmetric(vertical: 60.0), - border: InputBorder.none, - hintText: 'Tell us more about product!', - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(5.0), - borderSide: BorderSide(width: 1, color: Colors.grey[400]), - ), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Colors.grey[400], width: 1), - ), - ), - ), - ], - ), - ), - InkWell( - onTap: () { - - }, - child: Container( - height: 50.0, - width: 400.0, - color: Colors.transparent, - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.yellow[700], - style: BorderStyle.solid, - width: 1.0 - ), - color: Colors.yellow[700], - borderRadius: BorderRadius.circular(5.0) - ), - child: Center( - child: Text( - TranslationBase.of(context).shareReview, - style: TextStyle( - color: Colors.white, - fontSize: 16.0, - fontWeight: FontWeight.bold, - ), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ); - } - - //new screen is showing after submitting the review - Widget getReviewedProduct(){ - return Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/check_icon.svg', - width: 28, - height: 28,), - Container( - margin: EdgeInsets.only(left: 10.0), - child: Text(TranslationBase.of(context).reviewSuccessful, - style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold, - ), - ), - ), - ], - ), - Container( - margin: EdgeInsets.only(top:5.0, bottom: 20.0 ), - child: Text(TranslationBase.of(context).reviewShared, - style: TextStyle(fontSize: 15.0, - ), - ), - ), - Container( - margin: EdgeInsets.only(bottom: 30.0, top: 30.0 ), - child: SvgPicture.asset( - 'assets/images/pharmacy/success_review_icon.svg', - width: 100, - height: 100,), - ), - Container( - margin: EdgeInsets.only(left: 20.0, right: 20.0), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/quote_start.svg', - width: 15, - height: 15,), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text(TranslationBase.of(context).reviewComment, - style: TextStyle(fontSize: 15.0, - ), - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/quote_end.svg', - width: 15, - height: 15,), - ], - ), - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 20.0 ), - child: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) { - return PharmacyProfilePage(); - }), - ); - }, - child: Container( - height: 50.0, color: Colors.transparent, - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.orange, - style: BorderStyle.solid, - width: 1.0 - ), - color: Colors.transparent, - borderRadius: BorderRadius.circular(5.0) - ), - child: Center( - child: Text( - TranslationBase.of(context).backMyAccount, - style: TextStyle( - color: Colors.orange, - fontWeight: FontWeight.bold, - ), - ), - ), - ), - ), - ), - ), - ], - ); - } -} diff --git a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart deleted file mode 100644 index 30fd4cd6..00000000 --- a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart +++ /dev/null @@ -1,127 +0,0 @@ -import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_html/style.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:google_maps_flutter/google_maps_flutter.dart'; - -class AddAddressPage extends StatefulWidget { - @override - _AddAddressState createState() => _AddAddressState(); -} - -class _AddAddressState extends State { - - void onMapCreated(controller){ - setState(() { - mapController= controller; - }); - } - void _getAddressFromLatLng() {} - _onMapTypeButtonPressed(){} - _onAddMarkerButtonPressed(){} - - LatLng _initialPosition; - GoogleMapController mapController; - @override - void initState() { - // TODO: implement initState - _initialPosition = LatLng(24.662617030, 46.7334844); - super.initState(); - } - - void _onMapCreated(GoogleMapController controller) { - mapController = controller; - } - - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - centerTitle: true, - title: Text(TranslationBase.of(context).addNewAddress, style: TextStyle(color:Colors.white)), - backgroundColor: Colors.green, - ), - body: Stack( - children: [ - GoogleMap( - zoomControlsEnabled: true, - myLocationButtonEnabled: true, - myLocationEnabled: true, - onMapCreated: _onMapCreated, - onCameraMove: (object) { -// widget.currentLat = object.target.latitude; -// widget.currentLong = object.target.longitude; - }, - onCameraIdle: _getAddressFromLatLng, - padding: EdgeInsets.only(bottom: 90.0), - initialCameraPosition: CameraPosition( - target: _initialPosition, - zoom: 13.0, - ), - ), -// Align( -// alignment: Alignment.topRight, -// child: Column( -// children: [ -// button(_onMapTypeButtonPressed,Icons.map), -// SizedBox( -// height:16.0, -// ), -// button(_onAddMarkerButtonPressed, Icons.add_location) -// ], -// ), -// ), - ] - ), - bottomSheet: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) { - return AddAddressPage(); - }), - ); - }, - child: Container( - height: 50.0, - color: Colors.green, - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 1.0 - ), - color: Colors.green, - borderRadius: BorderRadius.circular(10.0) - ), - child: Center( - child: Text(TranslationBase.of(context).confirmLocation, - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ), - ), - ), - ), - ), - ); - } - - -// Widget button(Function function, IconData icon){ -// return FloatingActionButton( -// onPressed: function, -// materialTapTargetSize: MaterialTapTargetSize.padded, -// backgroundColor: Colors.red, -// child: Icon( -// icon, -// size: 18.0, -// ),); -// } - -} - diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart deleted file mode 100644 index 44df964d..00000000 --- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart +++ /dev/null @@ -1,380 +0,0 @@ - -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; - -class PharmacyAddressesPage extends StatefulWidget{ - @override - _PharmacyAddressesState createState() => _PharmacyAddressesState(); - } - -class _PharmacyAddressesState extends State{ - - int selectedRadio; - bool _value = false; - - AppSharedPreferences sharedPref = AppSharedPreferences(); - - - @override - void initState(){ -// WidgetsBinding.instance.addPostFrameCallback((_) => getAllAddress()); - - super.initState(); - selectedRadio=0; - } - setSelectedRadio(int val){ - setState(() { - selectedRadio = val; - }); - } - - Widget build (BuildContext context){ - return BaseView( - onModelReady: (model) => model.getAddress(), - builder: (_,model, wi )=> AppScaffold( - appBarTitle: "", -// centerTitle: true, -// title: Text(TranslationBase.of(context).changeAddress, style: TextStyle(color:Colors.white)), -// backgroundColor: Colors.green, - isShowAppBar: true, - isPharmacy:true , - body: Container( - child:SingleChildScrollView( - child: Column( - children:[ - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: 5 , - itemBuilder: (context, index){ - return Container( - child: Padding( - padding:EdgeInsets.only(top:10.0, left:5.0, right:5.0, bottom:5.0,), - child: Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - setState(() { - _value = !_value; - }); - }, - child: Container( - margin: EdgeInsets.only(right: 20), - - child: Padding( - padding: const EdgeInsets.all(5.0), - child: _value - ? Container( - child: SvgPicture.asset( - 'assets/images/pharmacy/check_icon.svg', - height: 25, - width: 25,), - ) - : Container( - child: SvgPicture.asset( - 'assets/images/pharmacy/check_icon.svg', - height: 23, - width: 23, - color: Colors.transparent, - ), - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey, - style: BorderStyle.solid, - width: 1.0 - ), - color: Colors.transparent, - borderRadius: BorderRadius.circular(50.0) - ), - ), - ), - ), - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('NAME', - style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, - ), - ), - SizedBox( - height: 5,), - Text('Address', - style: TextStyle(fontSize: 15.0, color: Colors.grey, - ), - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - margin: EdgeInsets.only(bottom: 8), - child: SvgPicture.asset( - 'assets/images/pharmacy/mobile_number_icon.svg', - height: 13,), - ), - Container( - margin: EdgeInsets.only(left: 10, bottom: 8), - child: Text('588888778', - style: TextStyle(fontSize: 15.0, - ), - ), - ), - ], - ), - SizedBox( - height: 15,), - Row( - children: [ - Column( - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) { - return AddAddressPage(); - }), - ); - }, - child: Row( - children: [ - Container( - margin: EdgeInsets.only(right:10, bottom: 15), - child: SvgPicture.asset( - 'assets/images/pharmacy/edit_icon.svg', - height: 15,), - ), - Container( - margin: EdgeInsets.only(right:5, bottom: 15), - padding: EdgeInsets.only(right: 10.0), - child: Text(TranslationBase.of(context).edit, - style: TextStyle(fontSize: 15.0, - color: Colors.blue, - ), - ), - decoration: BoxDecoration( - border: Border( - right: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - ), - ), - ], - ), - ), - ], - ), - Column( - children: [ - InkWell( - onTap: () { -// confirmDelete(snapshot.data[index]["id"]); - confirmDelete("address"); - }, - child: Row( - children: [ - Container( - margin: EdgeInsets.only(left: 15, right: 10, bottom: 15), - child: SvgPicture.asset( - 'assets/images/pharmacy/delete_red_icon.svg', - height: 15,), - ), - Container( - margin: EdgeInsets.only(bottom: 15), - child: Text(TranslationBase.of(context).delete, - style: TextStyle(fontSize: 15.0, - color: Colors.redAccent, - ), - ), - ), - ], - ), - ), - ], - ) - ], - ), - ], - ), - SizedBox( - height: 10, - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 6, - indent: 0, - endIndent: 0, - ), - ], - ), - ), - ); - } - ), - SizedBox( - height: 10, - ), - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) { - return AddAddressPage(); - }), - ); - }, - child: Container( - margin: EdgeInsets.only(bottom: 100.0), - height: 50.0, - color: Colors.transparent, - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 1.0 - ), - color: Colors.transparent, - borderRadius: BorderRadius.circular(5.0) - ), - child: Center( - child: Text( - TranslationBase.of(context).addAddress, - style: TextStyle( - color: Colors.green, - fontWeight: FontWeight.bold, - ), - ), - ), - ), - ), - ), - ], - ), - ), - ), - bottomSheet: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) { - return AddAddressPage(); - }), - ); - }, - child: Container( - height: 50.0, - color: Colors.green, - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 1.0 - ), - color: Colors.green, - borderRadius: BorderRadius.circular(5.0) - ), - child: Center( - child: Text(TranslationBase.of(context).confirmAddress, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - ), - ), - ), - ), - ), - ), - ), - ); - } - confirmDelete(address){ - showDialog( - context: context, - builder: (BuildContext context)=> AlertDialog( - title: Text(TranslationBase.of(context).confirmDeleteMsg, - style: TextStyle( - fontWeight: FontWeight.bold, - ),), - content: Text("address"), - actions:[ - FlatButton( - child: Text(TranslationBase.of(context).cancel, - style: TextStyle( - color: Colors.red, - fontWeight: FontWeight.bold, - fontSize: 16, - ),), - onPressed: (){ - Navigator.pop(context); - }, - ), - FlatButton( - child: Text(TranslationBase.of(context).confirmDelete, - style: TextStyle( - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 16, - ),), - onPressed: (){ -// http.delete("https://uat.hmgwebservices.com/epharmacy/api/Customers/272843?fields=addresses/$id"); - Navigator.push(context, - MaterialPageRoute(builder: (context)=> PharmacyAddressesPage() )); - }, - ), - ], - ) - ); - } -} - -getAllAddress() { -// print("ADDRESSES"); -// PharmacyAddressService service = new PharmacyAddressService(); -// service.getAddress(AppGlobal.context).then((res) { -// print(res); -// }); - -} - - - - getConfirmAddress(){ - - } - getEditAddress(){ - - } - getDeleteAddress(){ - -} - - - - - diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart deleted file mode 100644 index 272ef0d4..00000000 --- a/lib/pages/pharmacy/profile/profile.dart +++ /dev/null @@ -1,384 +0,0 @@ -import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; - -class PharmacyProfilePage extends StatefulWidget { - @override - _ProfilePageState createState() => _ProfilePageState(); -} - -class _ProfilePageState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - centerTitle: true, - title: Text(TranslationBase.of(context).myAccount, style: TextStyle(color:Colors.white)), - backgroundColor: Colors.green, - ), - body: Container( - child:SingleChildScrollView( - child: Column( - children:[ - Container( - child:Row( - children: [ - Container( - padding:EdgeInsets.only(top:20.0, left:10.0, right:10.0, bottom:10.0,), - child: LargeAvatar(name: "profile", url:'' ,), - ), - Container( - child: Column( - children: [ - Text( - TranslationBase.of(context).welcome, - style: TextStyle(fontSize: 14.0, - fontWeight: FontWeight.bold, - color:Colors.grey - ), - ), - Text( - 'NAME', - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold - ), - ), - ], - ), - ) - ], - ), - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 15, - ), - Container( - child:Row( - children: [ - Expanded( - child: InkWell( - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/orders_icon.svg', - width: 50, - height: 50,), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).orders, - style: TextStyle(fontSize: 13.0, - fontWeight: FontWeight.bold,), - ), - ], - ), - ), - ), - Expanded( - child: InkWell( - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/lakum_icon.svg', - width: 50, - height: 50,), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).lakum, - style: TextStyle(fontSize: 13.0, - fontWeight: FontWeight.bold - ), - ), - ], - ), - ), - ), - Expanded( - child: InkWell( - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/wishlist_icon.svg', - width: 50, - height: 50,), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).wishlist, - style: TextStyle(fontSize: 13.0, - fontWeight: FontWeight.bold,), - ), - ], - ), - ), - ), - Expanded( - child: InkWell( - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/review_icon.svg', - width: 50, - height: 50,), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).reviews, - style: TextStyle(fontSize: 13.0, - fontWeight: FontWeight.bold,), - ), - ], - ), - ), - ), - ], - ) - ), - SizedBox( - height: 15, - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 10, - ), - Container( - padding: EdgeInsets.only(left: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).myAccount, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold - ), - ), - SizedBox( - height: 10, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/my_prescription_icon.svg', - width: 28, - height: 28,), - SizedBox( - width: 15, - ), - Text(TranslationBase.of(context).myPrescriptions, - style: TextStyle(fontSize: 13.0, - ), - ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/medication_refill_icon.svg', - width: 28, - height: 28,), - SizedBox( - width: 15, - ), - Text(TranslationBase.of(context).medicationRefill, - style: TextStyle(fontSize: 13.0, - ), - ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/pill_reminder_icon.svg', - width: 30, - height: 30,), - SizedBox( - width: 20, - ), - Text(TranslationBase.of(context).pillReminder, - style: TextStyle(fontSize: 13.0, - ), - ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/my_family_icon.svg', - width: 20, - height: 20,), - SizedBox( - width: 20, - ), - Text(TranslationBase.of(context).family, - style: TextStyle(fontSize: 13.0, - ), - ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/shipping_addresses_icon.svg', - width: 30, - height: 30,), - SizedBox( - width: 20, - ), - Text(TranslationBase.of(context).shippingAddresses, - style: TextStyle(fontSize: 13.0, - ), - ), - ], - ), - ), - ], - ), - ), - SizedBox( - height: 10, - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 10, - ), - Container( - padding: EdgeInsets.only(left: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).reachUs, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/contact_us_icon.svg', - width: 20, - height: 20,), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).contactUs, - style: TextStyle(fontSize: 13.0), - ), - ], - ), - ), - SizedBox( - height: 5, - ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/our_locations_icon.svg', - width: 30, - height: 30,), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).ourLocations, - style: TextStyle(fontSize: 13.0), - ), - ], - ), - ) - ], - ), - ) - ], - ), - ), - ), - ); - }} - - - - diff --git a/lib/pages/pharmacy_categorise.dart b/lib/pages/pharmacy_categorise.dart deleted file mode 100644 index 169fb92d..00000000 --- a/lib/pages/pharmacy_categorise.dart +++ /dev/null @@ -1,238 +0,0 @@ -import 'package:charts_flutter/flutter.dart'; -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart'; -import 'package:diplomaticquarterapp/pages/parent_categorise_page.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:barcode_scan/platform_wrapper.dart'; -import 'package:provider/provider.dart'; -import 'base/base_view.dart'; -import 'final_products_page.dart'; - -class PharmacyCategorisePage extends StatefulWidget { - @override - _PharmacyCategorisePageState createState() => _PharmacyCategorisePageState(); -} - -class _PharmacyCategorisePageState extends State { - String idCategorise; - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( - onModelReady: (model) => model.getCategorise(), - builder: (BuildContext context, PharmacyCategoriseViewModel model, - Widget child) => - AppScaffold( - isShowDecPage: false, - baseViewModel: model, - body: Column( - children: [ - Container( - height: 400, - margin: EdgeInsets.only(bottom: 22), - child: GridView.builder( - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 0.5, - mainAxisSpacing: 1.0, - childAspectRatio: 3.2, - ), - itemCount: model.categorise.length, - itemBuilder: (BuildContext context, int index) { - return Padding( - padding: EdgeInsets.all(4.0), - child: InkWell( - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - color: Colors.grey.withOpacity(0.24), - ), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.0), - child: Texts( - projectViewModel.isArabic - ? model.categorise[index].namen - : model.categorise[index].name, - fontWeight: FontWeight.w600, - ), - ), - ), - onTap: () => { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - model.categorise[index].id != '12' - ? ParentCategorisePage( - id: model.categorise[index].id, - titleName: model.categorise[index].name, - ) - : FinalProductsPage( - id: model.categorise[index].id, - ), - ), - ), - }, - ), - ); - }, - ), - ), - Container( - height: 140, - child: Column( - children: [ - Divider( - height: 2.0, - thickness: 1.0, - color: Colors.black12.withOpacity(0.14)), - SizedBox( - height: 10.0, - ), - Row( - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.all(4.0), - child: Container( - height: 50.0, - width: 55.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - color: Colors.green.shade300.withOpacity(0.34), - ), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.0), - child: Texts( - projectViewModel.isArabic - ? 'الاكثر مبيعا' - : 'Best Sellers', - fontWeight: FontWeight.w600, - ), - ), - ), - ), - ), - Expanded( - child: Padding( - padding: EdgeInsets.all(4.0), - child: Container( - height: 50.0, - width: 55.0, - decoration: BoxDecoration( - color: Colors.orangeAccent.shade200 - .withOpacity(0.34), - borderRadius: BorderRadius.circular(5.0), - ), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.0), - child: Texts( - projectViewModel.isArabic - ? 'الاكثر مشاهدة' - : 'Most Viewed', - fontWeight: FontWeight.w600, - ), - ), - ), - ), - ), - ], - ), - Row( - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.all(4.0), - child: Container( - height: 50.0, - width: 55.0, - decoration: BoxDecoration( - color: Colors.blue.shade200.withOpacity(0.34), - borderRadius: BorderRadius.circular(5.0), - ), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.0), - child: Texts( - projectViewModel.isArabic - ? 'منتجات جديدة' - : 'New Products', - fontWeight: FontWeight.w600, - ), - ), - ), - ), - ), - Expanded( - child: Padding( - padding: EdgeInsets.all(4.0), - child: InkWell( - onTap: () { - _scanQrAndGetPatient(context, model); - }, - child: Container( - height: 50.0, - width: 55.0, - decoration: BoxDecoration( - color: - Colors.purple.shade200.withOpacity(0.34), - borderRadius: BorderRadius.circular(5.0), - ), - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 10.0), - child: Texts( - projectViewModel.isArabic - ? 'شوهد مؤخرا' - : 'Recently Viewed', - fontWeight: FontWeight.w600, - ), - ), - ), - ), - ), - ), - ], - ), - ], - )), - ], - ), - ), - ); - } - - _scanQrAndGetPatient( - BuildContext context, - PharmacyCategoriseViewModel model, - ) async { - /// When give qr we will change this method to get data - /// var result = await BarcodeScanner.scan(); - /// int patientID = get from qr result - var result = await BarcodeScanner.scan(); - if (result.rawContent == "") { - List listOfParams = result.rawContent.split(','); - // ScanQrRequestModel _scanQrRequestModel = ScanQrRequestModel( - // deliveryOrderID: int.parse(listOfParams[0]), groupID: 0); - String patientType = "1"; - await model.scanQr(); - if (model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(model.error); - } else { - AppToast.showSuccessToast(message: model.scanList[0].id); - { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => LandingPagePharmacy()), - ); - } - } - } - } -} diff --git a/lib/pages/search_products_page.dart b/lib/pages/search_products_page.dart deleted file mode 100644 index 45cafd35..00000000 --- a/lib/pages/search_products_page.dart +++ /dev/null @@ -1,287 +0,0 @@ -import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; -import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; -import 'package:flutter/material.dart'; - -import 'base/base_view.dart'; - -class SearchProductsPage extends StatefulWidget { - @override - _SearchProductsPageState createState() => _SearchProductsPageState(); -} - -class _SearchProductsPageState extends State { - final textController = TextEditingController(); - final _formKey = GlobalKey(); - String msg = ''; - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.clearSearchList(), - builder: (BuildContext context, PharmacyCategoriseViewModel model, - Widget child) => - PharmacyAppScaffold( - appBarTitle: 'Search', - isBottomBar: false, - isShowAppBar: true, - backgroundColor: Colors.white, - isShowDecPage: false, - //baseViewModel: model, - body: SingleChildScrollView( - child: Container( - height: SizeConfig.screenHeight, - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.79, - child: Form( - key: _formKey, - child: TextFields( - autoFocus: true, - hintText: 'Search', - fontSize: 19.0, - prefixIcon: Icon(Icons.search), - inputAction: TextInputAction.search, - onSaved: (value) { - //searchMedicine(model, context); - }, - onSubmit: (value) { - searchMedicine(model, context); - msg = 'No Result Found'; - }, - controller: textController, - validator: (value) { - if (value.isEmpty) { - return 'please Enter Product Name'; - } - return null; - }, - ), - ), - ), - SizedBox( - width: 10.0, - ), - InkWell( - child: Texts( - 'Cancel', - fontSize: 17.0, - fontWeight: FontWeight.w500, - ), - onTap: () { - Navigator.pop(context); - }, - ), - - // child: Container( - // child: Button( - // backgroundColor: Colors.green, - // loading: model.state == ViewState.BusyLocal, - // label: 'Search', - // onTap: () { - // searchMedicine(model, context); - // }), - // width: MediaQuery.of(context).size.width * 0.09, - // ), - ], - ), - ), - Center( - child: NetworkBaseView( - baseViewModel: model, - child: model.searchList.isNotEmpty - ? Container( - height: MediaQuery.of(context).size.height * 0.80, - child: GridView.builder( - //physics: NeverScrollableScrollPhysics(), - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 0.5, - mainAxisSpacing: 2.0, - childAspectRatio: 1.0, - ), - itemCount: model.searchList.length, - itemBuilder: (BuildContext context, int index) { - return Card( - color: model.searchList[index].discountName != - null - ? Color(0xffFFFF00) - : Colors.white, - elevation: 0, - shape: Border( - right: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - left: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - bottom: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - top: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - ), - margin: EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(110.0), - ), - color: Colors.white, - ), - padding: - EdgeInsets.symmetric(horizontal: 0), - width: - MediaQuery.of(context).size.width / 3, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Stack( - children: [ - Container( - margin: EdgeInsets.fromLTRB( - 0, 16, 0, 0), - alignment: Alignment.center, - child: Image.network( - model.searchList[index].images - .isNotEmpty - ? model.searchList[index] - .images[0].thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.cover, - height: 80, - ), - ), - Container( - width: model.searchList[index] - .rxMessage != - null - ? MediaQuery.of(context) - .size - .width / - 5 - : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: BorderRadius.only( - topLeft: - Radius.circular(6)), - ), - child: Texts( - model.searchList[index] - .rxMessage != - null - ? model.searchList[index] - .rxMessage - : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: FontWeight.w400, - ), - ), - ], - ), - Container( - margin: EdgeInsets.symmetric( - horizontal: 6, - vertical: 0, - ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - model.searchList[index].name, - regular: true, - fontSize: 12, - fontWeight: FontWeight.w400, - ), - Padding( - padding: const EdgeInsets.only( - top: 4, bottom: 4), - child: Texts( - "SAR ${model.searchList[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ - StarRating( - totalAverage: model - .searchList[ - index] - .approvedRatingSum > - 0 - ? (model - .searchList[ - index] - .approvedRatingSum - .toDouble() / - model - .searchList[ - index] - .approvedRatingSum - .toDouble()) - .toDouble() - : 0, - forceStars: true), - Texts( - "(${model.searchList[index].approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: FontWeight.w400, - ) - ], - ), - ], - ), - ), - ], - ), - ), - ); - }, - ), - ) - : Texts(msg), - ), - ) - ], - ), - ), - ), - ), - ); - } - - searchMedicine(PharmacyCategoriseViewModel model, BuildContext context) { - Utils.hideKeyboard(context); - if (_formKey.currentState.validate()) - model.searchProducts(productName: textController.text); - } -} diff --git a/lib/pages/sub_categorise_page.dart b/lib/pages/sub_categorise_page.dart deleted file mode 100644 index 45c9fd6c..00000000 --- a/lib/pages/sub_categorise_page.dart +++ /dev/null @@ -1,944 +0,0 @@ -import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -import 'base/base_view.dart'; -import 'final_products_page.dart'; - -class SubCategorisePage extends StatefulWidget { - String id; - String title; - String parentId; - - SubCategorisePage({this.id, this.parentId, this.title}); - @override - _SubCategorisePageState createState() => - _SubCategorisePageState(id: id, title: title, parentId: parentId); -} - -class _SubCategorisePageState extends State { - bool checkedBrands = false; - bool checkedCategorise = false; - String id; - String title; - String parentId; - _SubCategorisePageState({this.title, this.parentId, this.id}); - String categoriseName = "Personal Care"; - bool styleOne = true; - bool styleTwo = false; - Icon styleIcon = Icon( - Icons.widgets_sharp, - color: Colors.blue, - size: 29.0, - ); - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getSubCategorise(i: id), - builder: (BuildContext context, PharmacyCategoriseViewModel model, - Widget child) => - PharmacyAppScaffold( - appBarTitle: title, - isBottomBar: false, - isShowAppBar: true, - backgroundColor: Colors.white, - isShowDecPage: false, - baseViewModel: model, - body: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 5.97, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: Image.network( - parentId == '1' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089188_personal-care_2.png' - : parentId == '2' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089189_skin-care_2.png' - : parentId == '3' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089190_health-care_2.png' - : parentId == '4' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089191_sexual-health_2.png' - : parentId == '5' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089192_beauty_2.png' - : parentId == '6' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089193_baby-child_2.png' - : parentId == '7' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089194_vitamins-supplements_2.png' - : parentId == '8' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png' - : parentId == '9' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png' - : parentId == - '10' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png' - : '', - fit: BoxFit.fill, - height: 160.0, - width: double.infinity), - ), - if (model.subCategorise.length > 8) - Column( - children: [ - InkWell( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: EdgeInsets.all(10.0), - child: Container( - child: Texts('View All Categories'), - ), - ), - Icon(Icons.arrow_forward) - ], - ), - onTap: () { - showModalBottomSheet( - isScrollControlled: true, - context: context, - builder: (BuildContext context) { - return Container( - height: - MediaQuery.of(context).size.height * - 0.89, - color: Colors.white, - child: Center( - child: ListView.builder( - scrollDirection: Axis.vertical, - itemCount: - model.subCategorise.length, - itemBuilder: (BuildContext context, - int index) { - return Container( - child: Padding( - padding: EdgeInsets.all(8.0), - child: InkWell( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Texts(model - .subCategorise[ - index] - .name), - Divider( - thickness: 0.6, - color: Colors.black12, - ) - ], - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - FinalProductsPage( - id: model - .subCategorise[ - index] - .id, - ), - ), - ); - }, - ), - ), - ); - }), - ), - ); - }, - ); - }, - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - ], - ), - -//Expanded widget heree if nassery - Padding( - padding: EdgeInsets.only(top: 35.0), - child: Container( - height: MediaQuery.of(context).size.height * 0.2, - child: Center( - child: ListView.builder( - scrollDirection: Axis.horizontal, - itemCount: model.subCategorise.length, - itemBuilder: (BuildContext context, int index) { - return Padding( - padding: - EdgeInsets.symmetric(horizontal: 8.0), - child: InkWell( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.symmetric( - horizontal: 13.0), - child: Container( - height: 60.0, - width: 65.0, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.orange.shade200 - .withOpacity(0.45), - ), - child: Center( - child: Icon( - Icons.apps_sharp, - size: 32.0, - ), - ), - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.17, - height: MediaQuery.of(context) - .size - .height * - 0.10, - child: Center( - child: Texts( - model.subCategorise[index].name, - fontSize: 14, - fontWeight: FontWeight.w600, - maxLines: 2, - ), - ), - ), - ], - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - FinalProductsPage( - id: model.subCategorise[index].id, - ), - ), - ); - }, - ), - ); - }), - ), - ), - ), - - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - InkWell( - child: Row( - children: [ - Icon(Icons.wrap_text), - SizedBox( - width: 10.0, - ), - Texts( - 'Refine', - fontWeight: FontWeight.w600, - ), - ], - ), - onTap: () { - showModalBottomSheet( - isScrollControlled: true, - context: context, - builder: (BuildContext context) { - return DraggableScrollableSheet( - initialChildSize: 0.95, - maxChildSize: 0.95, - minChildSize: 0.9, - builder: (BuildContext context, - ScrollController scrollController) { - return SingleChildScrollView( - controller: scrollController, - child: Container( - height: MediaQuery.of(context) - .size - .height * - 1.95, - child: Column( - children: [ - Padding( - padding: - EdgeInsets.all(8.0), - child: Row( - children: [ - Icon( - Icons.wrap_text, - ), - SizedBox( - width: 10.0, - ), - Texts( - 'Refine', - fontWeight: - FontWeight.w600, - ), - SizedBox( - width: 250.0, - ), - InkWell( - child: Texts( - 'Close', - color: Colors.red, - fontWeight: - FontWeight.w600, - fontSize: 15.0, - ), - onTap: () { - Navigator.pop( - context); - }, - ), - ], - ), - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - Column( - children: [ - ExpansionTile( - title: - Texts('Categorise'), - children: [ - Container( - height: 350, - child: ListView - .builder( - controller: - scrollController, - scrollDirection: - Axis - .vertical, - shrinkWrap: - true, - itemCount: model - .categoriseParent - .length, - itemBuilder: - (BuildContext - context, - int index) { - return CheckboxListTile( - tristate: - true, - title: Texts(model - .categoriseParent[index] - .name), - controlAffinity: - ListTileControlAffinity.leading, - value: - checkedCategorise, - onChanged: - (bool - value) { - setState( - () { - checkedCategorise = - value; - }); - }, - ); - }), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - ExpansionTile( - title: Texts('Brands'), - children: [ - Container( - height: 350, - child: ListView - .builder( - scrollDirection: - Axis - .vertical, - shrinkWrap: - true, - itemCount: model - .brandsList - .length, - itemBuilder: - (BuildContext - context, - int index) { - return CheckboxListTile( - tristate: - true, - title: Texts(model - .brandsList[index] - .name), - controlAffinity: - ListTileControlAffinity.leading, - value: - checkedBrands, - onChanged: - (bool - value) { - setState( - () { - checkedBrands = - value; - }); - }, - autofocus: - true, - ); - }), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - ExpansionTile( - title: Texts('Price'), - children: [ - Container( - color: Color( - 0xffEEEEEE), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceAround, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - Texts( - 'Min'), - Container( - color: Colors - .white, - width: - 200, - height: - 40, - child: - TextFormField( - decoration: - InputDecoration( - border: - OutlineInputBorder(), - ), - ), - ), - ], - ), - Column( - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - Texts( - 'Max'), - Container( - color: Colors - .white, - width: - 200, - height: - 40, - child: - TextFormField( - decoration: - InputDecoration( - border: - OutlineInputBorder(), - ), - ), - ), - ], - ), - ], - ), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - SizedBox( - height: MediaQuery.of( - context) - .size - .height * - 0.4, - ), - Padding( - padding: - EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - children: [ - Container( - width: 100, - child: Button( - label: 'Reset', - backgroundColor: - Colors.red, - ), - ), - SizedBox( - width: 30, - ), - Container( - width: 200, - child: Button( - label: 'Apply', - backgroundColor: - Colors - .green, - ), - ), - ], - ), - ), - ], - ), - ], - ), - ), - ); - }); - }, - ); - }, - ), - Row( - children: [ - Container( - height: 44.0, - child: VerticalDivider( - color: Colors.black45, - thickness: 1.0, - //width: 0.3, - // indent: 0.0, - ), - ), - Padding( - padding: EdgeInsets.all(8.0), - child: InkWell( - child: styleIcon, - onTap: () { - setState(() { - if (styleOne == true) { - styleOne = false; - styleTwo = true; - styleIcon = Icon( - Icons.auto_awesome_mosaic, - color: Colors.blue, - size: 29.0, - ); - } else { - styleOne = true; - styleTwo = false; - styleIcon = Icon( - Icons.widgets_sharp, - color: Colors.blue, - size: 29.0, - ); - } - }); - }, - ), - ), - ], - ), - ], - ), - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - styleOne == true - ? Container( - height: MediaQuery.of(context).size.height * 3.85, - child: GridView.builder( - physics: NeverScrollableScrollPhysics(), - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 0.5, - mainAxisSpacing: 2.0, - childAspectRatio: 1.0, - ), - itemCount: model.subProducts.length, - itemBuilder: (BuildContext context, int index) { - return NetworkBaseView( - baseViewModel: model, - child: Card( - color: model.subProducts[index] - .discountName != - null - ? Color(0xffFFFF00) - : Colors.white, - elevation: 0, - shape: Border( - right: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - left: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - bottom: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - top: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - ), - margin: EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(110.0), - ), - color: Colors.white, - ), - padding: EdgeInsets.symmetric( - horizontal: 0), - width: MediaQuery.of(context) - .size - .width / - 3, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Stack( - children: [ - Container( - margin: EdgeInsets.fromLTRB( - 0, 16, 0, 0), - alignment: Alignment.center, - child: Image.network( - model.subProducts[index] - .images.isNotEmpty - ? model - .subProducts[ - index] - .images[0] - .thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.cover, - height: 80, - ), - ), - Container( - width: model - .subProducts[ - index] - .rxMessage != - null - ? MediaQuery.of(context) - .size - .width / - 5 - : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: - BorderRadius.only( - topLeft: Radius - .circular(6)), - ), - child: Texts( - model.subProducts[index] - .rxMessage != - null - ? model - .subProducts[ - index] - .rxMessage - : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ), - ), - ], - ), - Container( - margin: EdgeInsets.symmetric( - horizontal: 6, - vertical: 0, - ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - model.subProducts[index] - .name, - regular: true, - fontSize: 12, - fontWeight: - FontWeight.w400, - ), - Padding( - padding: - const EdgeInsets.only( - top: 4, - bottom: 4), - child: Texts( - "SAR ${model.subProducts[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ - StarRating( - totalAverage: model - .subProducts[ - index] - .approvedRatingSum > - 0 - ? (model.subProducts[index].approvedRatingSum - .toDouble() / - model - .subProducts[index] - .approvedRatingSum - .toDouble()) - .toDouble() - : 0, - forceStars: true), - Texts( - "(${model.subProducts[index].approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ) - ], - ), - ], - ), - ), - ], - ), - ), - )); - }, - ), - ) - : Container( - height: MediaQuery.of(context).size.height * 5.0, - child: ListView.builder( - physics: NeverScrollableScrollPhysics(), - itemCount: model.subProducts.length, - itemBuilder: - (BuildContext context, int index) { - return Card( - child: Row( - children: [ - Stack( - children: [ - Column( - children: [ - Container( - decoration: BoxDecoration(), - child: Padding( - padding: EdgeInsets.only( - left: 9.0, - top: 8.0, - right: 10.0, - ), - ), - ), - Container( - margin: EdgeInsets.fromLTRB( - 0, 0, 0, 0), - alignment: Alignment.center, - child: Image.network( - model.subProducts[index] - .images.isNotEmpty - ? model - .subProducts[ - index] - .images[0] - .thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.contain, - height: 80, - ), - ), - ], - ), - Column( - children: [ - Container( - width: model - .subProducts[ - index] - .rxMessage != - null - ? MediaQuery.of(context) - .size - .width / - 5 - : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: - BorderRadius.only( - topLeft: Radius - .circular(6)), - ), - child: Texts( - model.subProducts[index] - .rxMessage != - null - ? model - .subProducts[ - index] - .rxMessage - : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ), - ), - ], - ), - ], - ), - Container( - height: 100.0, - margin: EdgeInsets.symmetric( - horizontal: 6, - vertical: 0, - ), - child: Column( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SizedBox( - height: 4.0, - ), - Container( - height: 35.0, - width: 250.0, - child: Texts( - model.subProducts[index] - .name, - regular: true, - fontSize: 13.2, - fontWeight: FontWeight.w500, - maxLines: 2, - ), - ), - SizedBox( - height: 8.0, - ), - Padding( - padding: - const EdgeInsets.only( - top: 4, bottom: 4), - child: Texts( - "SAR ${model.subProducts[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ - StarRating( - totalAverage: model - .subProducts[ - index] - .approvedRatingSum > - 0 - ? (model - .subProducts[ - index] - .approvedRatingSum - .toDouble() / - model - .parentProducts[ - index] - .approvedRatingSum - .toDouble()) - .toDouble() - : 0, - forceStars: true), - Texts( - "(${model.subProducts[index].approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: - FontWeight.w400, - ) - ], - ), - ], - ), - ), - ], - ), - ); - }), - ) - ], - ), - ), - ), - )); - } -} diff --git a/lib/routes.dart b/lib/routes.dart index f336497d..24069e15 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -58,5 +58,7 @@ var routes = { SELECT_GENDER: (_) => SelectGender(), SETTINGS: (_) => Settings(), HEALTH_WEATHER: (_) => HealthWeatherIndicator(), - APP_UPDATE: (_) => AppUpdatePage() + 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 4518cc8b..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; - }, 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/pharmacy_services/orderDetails_service.dart b/lib/services/pharmacy_services/orderDetails_service.dart deleted file mode 100644 index fb58097f..00000000 --- a/lib/services/pharmacy_services/orderDetails_service.dart +++ /dev/null @@ -1,39 +0,0 @@ - -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; -import 'package:diplomaticquarterapp/core/service/base_service.dart'; -import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:flutter/material.dart'; - - -class OrderDetailsService extends BaseService{ - - AppSharedPreferences sharedPref = AppSharedPreferences(); - AppGlobal appGlobal = new AppGlobal(); - - AuthenticatedUser authUser = new AuthenticatedUser(); - AuthProvider authProvider = new AuthProvider(); - - List get orderDetails => orderDetails; - List _orderList = List(); - List get orderList => _orderList; - - - Future getOrderDetails(orderId) async { - print("step 1"); - hasError = false; - await baseAppClient.getPharmacy(GET_ORDER_DETAILS+orderId, - onSuccess: (dynamic response, int statusCode) { - _orderList.clear(); - response['orders'].forEach((item) { - _orderList.add(OrderModel.fromJson(item)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }); - } -} \ No newline at end of file diff --git a/lib/services/pharmacy_services/order_service.dart b/lib/services/pharmacy_services/order_service.dart deleted file mode 100644 index d43d417b..00000000 --- a/lib/services/pharmacy_services/order_service.dart +++ /dev/null @@ -1,61 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/service/base_service.dart'; -import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; - - -class OrderService extends BaseService{ - AppSharedPreferences sharedPref = AppSharedPreferences(); - AppGlobal appGlobal = new AppGlobal(); - AuthenticatedUser authUser = new AuthenticatedUser(); - AuthProvider authProvider = new AuthProvider(); - - List _orderList = List(); - List get orderList => _orderList; -String url =""; - - Future getOrder(custmerId, page_id) async { - print("step 1"); - hasError = false; - url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; -// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$page_id&limit=200&customer_id=$custmerId"; - print(url); - await baseAppClient.getPharmacy(url, - onSuccess: (dynamic response, int statusCode) { - _orderList.clear(); - response['orders'].forEach((item) { - _orderList.add(OrderModel.fromJson(item)); - }); - print(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }); - } - - -// Future getOrder(BuildContext context ) async { -// -// if (await this.sharedPref.getObject(USER_PROFILE) != null) { -// var data = AuthenticatedUser.fromJson( -// await this.sharedPref.getObject(USER_PROFILE)); -// authUser = data; -// } -// -// dynamic localRes; -// String URL; -// URL = GET_ORDER; -// -// await baseAppClient.get(URL, -// onSuccess: (response, statusCode) async { -// localRes = response; -// }, onFailure: (String error, int statusCode) { -// throw error; -// }); -// return Future.value(localRes); -// } -} \ No newline at end of file diff --git a/lib/services/pharmacy_services/pharmacyAddress_service.dart b/lib/services/pharmacy_services/pharmacyAddress_service.dart deleted file mode 100644 index eae5ac8c..00000000 --- a/lib/services/pharmacy_services/pharmacyAddress_service.dart +++ /dev/null @@ -1,36 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/service/base_service.dart'; -import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyAddressesModel.dart'; - - -class PharmacyAddressService extends BaseService{ - List get address => address; - - AppSharedPreferences sharedPref = AppSharedPreferences(); - AppGlobal appGlobal = new AppGlobal(); - AuthenticatedUser authUser = new AuthenticatedUser(); - AuthProvider authProvider = new AuthProvider(); - - List _addressList = List(); - List get reviewList => _addressList; - - - Future getAddress() async { - print("step 1"); - hasError = false; - await baseAppClient.getPharmacy(GET_ORDER, - onSuccess: (dynamic response, int statusCode) { - _addressList.clear(); - response['customers'].forEach((item) { - _addressList.add(PharmacyAddressesModel.fromJson(item)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }); - }} \ No newline at end of file diff --git a/lib/services/pharmacy_services/wishList_service.dart b/lib/services/pharmacy_services/wishList_service.dart deleted file mode 100644 index 0f9687e8..00000000 --- a/lib/services/pharmacy_services/wishList_service.dart +++ /dev/null @@ -1,39 +0,0 @@ - -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/service/base_service.dart'; -import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:flutter/material.dart'; - - -class WishListService extends BaseService { - AppSharedPreferences sharedPref = AppSharedPreferences(); - AppGlobal appGlobal = new AppGlobal(); - - AuthenticatedUser authUser = new AuthenticatedUser(); - AuthProvider authProvider = new AuthProvider(); - - - Future getWishlist(BuildContext context) async { - - if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); - authUser = data; - } - - dynamic localRes; - String URL; - URL = GET_WISHLIST+"272843"+"?shopping_cart_type=2"; - await baseAppClient.get(URL, - onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }); - return Future.value(localRes); - } - -} diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 2d963988..0b2b45d9 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -325,11 +325,6 @@ class DateUtil { return ""; } - static String getFormattedDate(DateTime dateTime, String formattedString){ - return DateFormat(formattedString) - .format(dateTime); - } - static convertISODateToJsonDate(String isoDate) { return "/Date(" + DateFormat('mm-dd-yyy') diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index 1c85d898..5c2d3a3c 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -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 22ad9459..674dca5b 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -692,64 +692,6 @@ class TranslationBase { localizedValues['ServiceInformationButton'][locale.languageCode]; String get serviceInformationTitle => localizedValues['ServiceInformationTitle'][locale.languageCode]; - String get infoLab => localizedValues['info-lab'][locale.languageCode]; - String get infoRadiology => - localizedValues['info-radiology'][locale.languageCode]; - String get orders => localizedValues['orders'][locale.languageCode]; - String get lakum => localizedValues['lakum'][locale.languageCode]; - String get wishlist => localizedValues['wishlist'][locale.languageCode]; - String get reviews => localizedValues['reviews'][locale.languageCode]; - String get myPrescriptions => - localizedValues['myPrescriptions'][locale.languageCode]; - String get medicationRefill => - localizedValues['medicationRefill'][locale.languageCode]; - String get pillReminder => - localizedValues['pillReminder'][locale.languageCode]; - String get shippingAddresses => - localizedValues['shippingAddresses'][locale.languageCode]; - String get reachUs => localizedValues['reachUs'][locale.languageCode]; - String get ourLocations => - localizedValues['ourLocations'][locale.languageCode]; - String get edit => localizedValues['edit'][locale.languageCode]; - String get delete => localizedValues['delete'][locale.languageCode]; - String get addAddress => localizedValues['addAddress'][locale.languageCode]; - String get addNewAddress => - localizedValues['addNewAddress'][locale.languageCode]; - String get order => localizedValues['order'][locale.languageCode]; - String get delivered => localizedValues['delivered'][locale.languageCode]; - String get processing => localizedValues['processing'][locale.languageCode]; - String get pending => localizedValues['pending'][locale.languageCode]; - String get cancelled => localizedValues['cancelled'][locale.languageCode]; - String get writeReview => localizedValues['writeReview'][locale.languageCode]; - String get shareReview => localizedValues['shareReview'][locale.languageCode]; - String get backMyAccount => - localizedValues['backMyAccount'][locale.languageCode]; - String get reviewSuccessful => - localizedValues['reviewSuccessful'][locale.languageCode]; - String get reviewShared => - localizedValues['reviewShared'][locale.languageCode]; - String get reviewComment => - localizedValues['reviewComment'][locale.languageCode]; - String get shippedMethod => - localizedValues['shippedMethod'][locale.languageCode]; - String get orderDetail => localizedValues['orderDetail'][locale.languageCode]; - String get subtotal => localizedValues['subtotal'][locale.languageCode]; - String get shipping => localizedValues['shipping'][locale.languageCode]; - String get vat => localizedValues['vat'][locale.languageCode]; - String get total => localizedValues['total'][locale.languageCode]; - String get sar => localizedValues['sar'][locale.languageCode]; - String get payOnline => localizedValues['payOnline'][locale.languageCode]; - String get cancelOrder => localizedValues['cancelOrder'][locale.languageCode]; - String get confirmAddress => - localizedValues['confirmAddress'][locale.languageCode]; - String get confirmLocation => - localizedValues['confirmLocation'][locale.languageCode]; - String get confirmDeleteMsg => - localizedValues['confirmDeleteMsg'][locale.languageCode]; - String get confirmDelete => - localizedValues['confirmDelete'][locale.languageCode]; - String get confirmCancellation => - localizedValues['confirmCancellation'][locale.languageCode]; String get serviceInformation => localizedValues['ServiceInformation'][locale.languageCode]; String get homeHealthCare => @@ -769,12 +711,17 @@ class TranslationBase { String get orderDate => localizedValues['orderDate'][locale.languageCode]; String get itemsNo => localizedValues['itemsNo'][locale.languageCode]; String get noOrder => localizedValues['noOrder'][locale.languageCode]; + String get infoLab => localizedValues['info-lab'][locale.languageCode]; + String get infoRadiology => + localizedValues['info-radiology'][locale.languageCode]; // pharmacy module - + String get medicationRefill => + localizedValues['medicationRefill'][locale.languageCode]; String get offersAndPromotions => localizedValues['offersAndPromotions'][locale.languageCode]; - + String get myPrescriptions => + localizedValues['myPrescriptions'][locale.languageCode]; String get searchAndScanMedication => localizedValues['searchAndScanMedication'][locale.languageCode]; String get shopByBrands => @@ -784,32 +731,6 @@ class TranslationBase { String get bestSellers => localizedValues['bestSellers'][locale.languageCode]; String get deleteAllItems => localizedValues['deleteAllItems'][locale.languageCode]; - String get selectAddress => - localizedValues['selectAddress'][locale.languageCode]; - String get shippingAddress => - localizedValues['shippingAddress'][locale.languageCode]; - String get changeAddress => - localizedValues['changeAddress'][locale.languageCode]; - String get selectPaymentOption => - localizedValues['selectPaymentOption'][locale.languageCode]; - String get changeMethod => - localizedValues['changeMethod'][locale.languageCode]; - String get reviewOrder => localizedValues['reviewOrder'][locale.languageCode]; - String get orderSummary => - localizedValues['orderSummary'][locale.languageCode]; - String get active => localizedValues['active'][locale.languageCode]; - String get inactive => localizedValues['inactive'][locale.languageCode]; - String get balance => localizedValues['balance'][locale.languageCode]; - String get gained => localizedValues['gained'][locale.languageCode]; - String get consumed => localizedValues['consumed'][locale.languageCode]; - String get transferred => localizedValues['transferred'][locale.languageCode]; - String get checkBeneficiary => - localizedValues['checkBeneficiary'][locale.languageCode]; - String get beneficiaryName => - localizedValues['beneficiaryName'][locale.languageCode]; - String get accountActivation => - localizedValues['accountActivation'][locale.languageCode]; - String get acceptLbl => localizedValues['acceptLbl'][locale.languageCode]; String get termsService => localizedValues['TermsService'][locale.languageCode]; @@ -835,11 +756,6 @@ class TranslationBase { String get selectAge => localizedValues['select-age'][locale.languageCode]; String get iAm => localizedValues['i-am'][locale.languageCode]; String get yearOld => localizedValues['years-old'][locale.languageCode]; - String get categorise => localizedValues['categorise'][locale.languageCode]; - String get cart => localizedValues['cart'][locale.languageCode]; - String get wishList => localizedValues['wishList'][locale.languageCode]; - String get searchProductHere => - localizedValues['searchProductHere'][locale.languageCode]; String get email => localizedValues['email'][locale.languageCode]; String get book => localizedValues['Book'][locale.languageCode]; String get appointmentLabel => @@ -916,7 +832,10 @@ class TranslationBase { localizedValues['accessibility'][locale.languageCode]; String get selectClinic => localizedValues['selectClinic'][locale.languageCode]; + String get reviews => localizedValues['reviews'][locale.languageCode]; + String get orderStatus => localizedValues['orderStatus'][locale.languageCode]; + String get cancelOrder => localizedValues['CancelOrder'][locale.languageCode]; String get findUs => localizedValues['FindUs'][locale.languageCode]; String get feedback => localizedValues['Feedback'][locale.languageCode]; String get liveChat => localizedValues['LiveChat'][locale.languageCode]; @@ -1011,6 +930,7 @@ class TranslationBase { String get addChild => localizedValues['add-child'][locale.languageCode]; String get childName => localizedValues['child-name'][locale.languageCode]; String get childDob => localizedValues['childDob'][locale.languageCode]; + String get delete => localizedValues['delete'][locale.languageCode]; String get deletedChildMes => localizedValues['deleted-child-mes'][locale.languageCode]; String get visit => localizedValues['visit'][locale.languageCode]; @@ -1030,41 +950,6 @@ class TranslationBase { String get appUpdate => localizedValues['appUpdate'][locale.languageCode]; String get ereferralSaveSuccess => localizedValues['ereferralSaveSuccess'][locale.languageCode]; - String get year => localizedValues['Year'][locale.languageCode]; - String get month => localizedValues['Month'][locale.languageCode]; - String get point => localizedValues['point'][locale.languageCode]; - String get riyal => localizedValues['riyal'][locale.languageCode]; - String get termOfService => - localizedValues['termOfService'][locale.languageCode]; - String get shoppingCart => - localizedValues['shoppingCart'][locale.languageCode]; - - String get referralStatus => - localizedValues['referralStatus'][locale.languageCode]; - String get referralDate => - localizedValues['referralDate'][locale.languageCode]; - String get patientName => localizedValues['patientName'][locale.languageCode]; - String get referralNumber => - localizedValues['referralNumber'][locale.languageCode]; - - String get requestID => localizedValues['requestID'][locale.languageCode]; - String get OrderStatus => localizedValues['OrderStatus'][locale.languageCode]; - String get pickupDate => localizedValues['pickupDate'][locale.languageCode]; - String get serviceName => localizedValues['serviceName'][locale.languageCode]; - String get orderLocation => - localizedValues['orderLocation'][locale.languageCode]; - String get selectService => - localizedValues['selectService'][locale.languageCode]; - String get coveredService => - localizedValues['coveredService'][locale.languageCode]; - String get selectedService => - localizedValues['selectedService'][locale.languageCode]; - String get cancelOrderMsg => - localizedValues['cancelOrderMsg'][locale.languageCode]; - String get processDoneSuccessfully => - localizedValues['processDoneSuccessfully'][locale.languageCode]; - String get selectHomeHealthCareServices => - localizedValues['selectHomeHealthCareServices'][locale.languageCode]; String get labResults => localizedValues['labResults'][locale.languageCode]; String get doctorRating => localizedValues['doctorRating'][locale.languageCode]; @@ -1086,6 +971,7 @@ class TranslationBase { 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]; @@ -1126,10 +1012,83 @@ class TranslationBase { localizedValues['info-my-appointments'][locale.languageCode]; String get infoTodo => localizedValues['info-todo'][locale.languageCode]; String get familyInfo => localizedValues['family-info'][locale.languageCode]; - String get help => localizedValues['help'][locale.languageCode]; - String get habibRobotText => localizedValues['habibRobotText'][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]; + String get patientName => localizedValues['patientName'][locale.languageCode]; + String get referralNumber => + localizedValues['referralNumber'][locale.languageCode]; + String get requestID => localizedValues['requestID'][locale.languageCode]; + String get OrderStatus => localizedValues['OrderStatus'][locale.languageCode]; + String get pickupDate => localizedValues['pickupDate'][locale.languageCode]; + String get serviceName => localizedValues['serviceName'][locale.languageCode]; + String get orderLocation => + localizedValues['orderLocation'][locale.languageCode]; + String get selectService => + localizedValues['selectService'][locale.languageCode]; + String get coveredService => + localizedValues['coveredService'][locale.languageCode]; + String get selectedService => + localizedValues['selectedService'][locale.languageCode]; + String get cancelOrderMsg => + localizedValues['cancelOrderMsg'][locale.languageCode]; + String get processDoneSuccessfully => + localizedValues['processDoneSuccessfully'][locale.languageCode]; + String get selectHomeHealthCareServices => + localizedValues['selectHomeHealthCareServices'][locale.languageCode]; + String get help => localizedValues['help'][locale.languageCode]; + String get habibRobotText => + localizedValues['habibRobotText'][locale.languageCode]; + String get selectAddress => + localizedValues['selectAddress'][locale.languageCode]; + String get addNewAddress => + localizedValues['addNewAddress'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 9d65d4b0..3b4b0323 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(); @@ -22,8 +23,8 @@ class _BottomNavBarState extends State { var event = RobotProvider(); _changeIndex(int index) { widget.changeIndex(index); - if(_index==0){ - event.setValue({'isRobotVisible':'true'}); + if (_index == 0) { + event.setValue({'isRobotVisible': 'true'}); } } @@ -36,69 +37,67 @@ class _BottomNavBarState extends State { child: Padding( padding: EdgeInsets.symmetric(horizontal: 18), child: Directionality( - textDirection:TextDirection.ltr, child:Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - - BottomNavigationItem( - icon: DQIcons.my_medical_file, - activeIcon: DQIcons.my_medical_file, - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 1, - name: TranslationBase.of(context).medicalProfile, - ), - - BottomNavigationItem( - icon: DQIcons.family, - activeIcon: DQIcons.family, - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 3, - name: TranslationBase.of(context).myFamily, - ), - if(widget.index == 0) - Expanded( - child: SizedBox( - height: 50, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox(height: 22), - ], + textDirection: TextDirection.ltr, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + BottomNavigationItem( + icon: DQIcons.my_medical_file, + activeIcon: DQIcons.my_medical_file, + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 1, + name: TranslationBase.of(context).medicalProfile, + ), + BottomNavigationItem( + icon: DQIcons.family, + activeIcon: DQIcons.family, + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 3, + name: TranslationBase.of(context).myFamily, + ), + 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: EvaIcons.calendar, + activeIcon: EvaIcons.calendar, + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 4, + name: TranslationBase.of(context).todoList, ), - ), - if(widget.index != 0) - BottomNavigationItem( - icon: EvaIcons.calendar, - activeIcon: EvaIcons.calendar, - changeIndex: _changeIndex, - index: _index, - currentIndex: 2, - name: TranslationBase.of(context).bookAppo, - ), - - BottomNavigationItem( - icon: EvaIcons.calendar, - activeIcon: EvaIcons.calendar, - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 4, - name: TranslationBase.of(context).todoList, - ), - BottomNavigationItem( - icon: DQIcons.roboticon, - activeIcon: DQIcons.roboticon, - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 0, - name: TranslationBase.of(context).help, - ) - ], - )), + BottomNavigationItem( + icon: DQIcons.roboticon, + activeIcon: DQIcons.roboticon, + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 0, + name: TranslationBase.of(context).help, + ) + ], + )), ), ); } diff --git a/lib/widgets/buttons/GestureIconButton.dart b/lib/widgets/buttons/GestureIconButton.dart index 62265985..841d7ea6 100644 --- a/lib/widgets/buttons/GestureIconButton.dart +++ b/lib/widgets/buttons/GestureIconButton.dart @@ -3,12 +3,12 @@ import 'package:flutter/material.dart'; class GestureIconButton extends StatefulWidget { GestureIconButton( - this.label, - this.icon, { - Key key, - this.onTap, - this.backgroundColor, - }) : super(key: key); + this.label, + this.icon, { + Key key, + this.onTap, + this.backgroundColor, + }) : super(key: key); final String label; final Widget icon; @@ -29,7 +29,6 @@ class _GestureIconButtonState extends State { setState(() => _buttonLongPress = !_buttonLongPress), onLongPressEnd: (_) => setState(() => _buttonLongPress = !_buttonLongPress), - onTap: () => {widget.onTap()}, child: Wrap( children: [ Container( diff --git a/lib/widgets/buttons/borderedButton.dart b/lib/widgets/buttons/borderedButton.dart index e297a10e..5e05448e 100644 --- a/lib/widgets/buttons/borderedButton.dart +++ b/lib/widgets/buttons/borderedButton.dart @@ -4,79 +4,55 @@ import 'package:flutter/material.dart'; class BorderedButton extends StatelessWidget { final String text; final Function handler; - final Color textColor; + final Color color; final bool hasBorder; final Color borderColor; final Color backgroundColor; final double vPadding; final double hPadding; - final double radius; - final double lPadding; - final double tPadding; - final double rPadding; - final double bPadding; - final double fontSize; - final Widget icon; - final FontWeight fontWeight; BorderedButton( this.text, { this.handler, - this.textColor, + this.color, this.hasBorder = false, this.borderColor, this.backgroundColor, this.vPadding = 0, this.hPadding = 0, - this.radius = 4.0, - this.lPadding = 4.0, - this.tPadding = 0.0, - this.rPadding = 4.0, - this.bPadding = 0.0, - this.fontSize = 0, - this.icon, - this.fontWeight, }); @override Widget build(BuildContext context) { - return GestureDetector( - onTap: () { - handler(); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, + return Container( + padding: EdgeInsets.symmetric(horizontal: 4, vertical: 4), + child: ButtonTheme( + //adds padding inside the button + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + //limits the touch area to the button area + minWidth: 0, + //wraps child's width + height: 0, + //wraps child's height + child: RaisedButton( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + padding: EdgeInsets.symmetric(horizontal: 12, vertical: vPadding), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(4.0), + side: BorderSide(color: hasBorder ? borderColor : Colors.white, width: 0.8),), color: backgroundColor ?? Colors.white, - borderRadius: BorderRadius.circular(radius), - border: Border.fromBorderSide(BorderSide( - color: hasBorder ? borderColor : Colors.white, - width: 0.8, - )), - ), - child: Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - icon != null ? icon : Container(), - Container( - padding: (hPadding > 0 || vPadding > 0) - ? EdgeInsets.symmetric( - vertical: vPadding, horizontal: hPadding) - : EdgeInsets.fromLTRB( - lPadding, tPadding, rPadding, bPadding), - child: Text( - text, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: fontSize == 0 ? SizeConfig.textMultiplier * 1.6 : fontSize, - fontWeight: fontWeight != null ? fontWeight : FontWeight.normal, - color: textColor ?? Color(0xffc4aa54)), - ), - ), - ], + textColor: color ?? Color(0xffc4aa54), + disabledTextColor: color ?? Colors.black, + disabledColor: backgroundColor ?? Colors.white, + onPressed: handler, + child: Text( + text, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.normal), ), - ), + ), //your original button ), ); } diff --git a/lib/widgets/data_display/text.dart b/lib/widgets/data_display/text.dart index 7afa6966..0515ba58 100644 --- a/lib/widgets/data_display/text.dart +++ b/lib/widgets/data_display/text.dart @@ -217,7 +217,6 @@ class _TextsState extends State { : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, - style: widget.style != null ? _getFontStyle().copyWith( fontStyle: widget.italic ? FontStyle.italic : null, diff --git a/lib/widgets/dialogs/radio-group-dialog.dart b/lib/widgets/dialogs/radio-group-dialog.dart deleted file mode 100644 index 5eff11bd..00000000 --- a/lib/widgets/dialogs/radio-group-dialog.dart +++ /dev/null @@ -1,101 +0,0 @@ -import 'package:diplomaticquarterapp/models/id-name-pair.dart'; -import 'package:flutter/material.dart'; - -// AppToast.showErrorToast(message: "Please select Time Slot to continue"); - -class RadioGroupDialog extends StatefulWidget { - - final BuildContext context; - final title; - final List list; - final okText; - final cancelText; - final Function(IdNamePair) okFunction; - final Function cancelFunction; - IdNamePair selectedValue; - - RadioGroupDialog( - {@required this.context, - @required this.title, - @required this.list, - @required this.okText, - @required this.cancelText, - @required this.okFunction, - @required this.cancelFunction}); - - - @override - RadioGroupState createState() => RadioGroupState(); -} - -class RadioGroupState extends State { - - @override - void initState() { - super.initState(); - widget.selectedValue = widget.selectedValue ?? widget.list[0]; - } - - @override - Widget build(BuildContext context) { - return showAlertDialog(context); - } - - showAlertDialog(BuildContext context) { - // set up the buttons - Widget cancelButton = FlatButton( - child: Text(this.widget.cancelText), - onPressed: () { - Navigator.of(context).pop(); - }); - Widget continueButton = - FlatButton(child: Text(this.widget.okText), onPressed: () { - this.widget.okFunction(widget.selectedValue); - Navigator.of(context).pop(); - }); - - // set up the AlertDialog - AlertDialog alert = AlertDialog( - title: Text(widget.title), - content: createDialogGroup(), - actions: [ - cancelButton, - continueButton, - ], - ); - return alert; - } - - static closeAlertDialog(BuildContext context) { - Navigator.of(context).pop(); - } - - Widget createDialogGroup(){ - return Container( - height: MediaQuery.of(context).size.height * 0.3, - child: SingleChildScrollView( - child: Column( - children: [ - Container( - child: Column( - children: - widget.list.map((data) => RadioListTile( - title: Text("${data.name}"), - groupValue: widget.selectedValue.id, - value: data.id, - onChanged: (val) { - setState(() { - widget.selectedValue = data ; - }); - }, - )).toList(), - ), - ), - - ], - ), - ), - ); - } - -} diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 47e8b892..452611d3 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -17,7 +17,6 @@ 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'; diff --git a/lib/widgets/input/text_field.dart b/lib/widgets/input/text_field.dart index e044bb71..e31ae88a 100644 --- a/lib/widgets/input/text_field.dart +++ b/lib/widgets/input/text_field.dart @@ -73,7 +73,7 @@ class TextFields extends StatefulWidget { this.fontSize = 16.0, this.fontWeight = FontWeight.w700, this.autoValidate = false, - this.fillColor, + this.fillColor, this.hintColor}) : super(key: key); @@ -214,6 +214,7 @@ class _TextFieldsState extends State { blurRadius: focus ? 34.0 : 12.0) ]), child: TextFormField( + keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), autovalidate: widget.autoValidate, @@ -252,12 +253,15 @@ class _TextFieldsState extends State { ] : widget.inputFormatters, decoration: InputDecoration( + counterText: "", hintText: widget.hintText, hintStyle: TextStyle( - fontSize: widget.fontSize, - fontWeight: widget.fontWeight, - color: widget.hintColor ?? Theme.of(context).hintColor, + fontSize: widget.fontSize, + fontWeight: widget.fontWeight, + color: widget.hintColor ?? Theme.of(context).hintColor, + + ), contentPadding: widget.padding != null ? widget.padding 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_pharmacy_widget.dart b/lib/widgets/others/app_scaffold_pharmacy_widget.dart deleted file mode 100644 index 3121dca3..00000000 --- a/lib/widgets/others/app_scaffold_pharmacy_widget.dart +++ /dev/null @@ -1,112 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; -import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; -import 'package:diplomaticquarterapp/routes.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; -import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:provider/provider.dart'; - -import '../../locator.dart'; -import 'floating_button_search.dart'; -import '../progress_indicator/app_loader_widget.dart'; -import 'arrow_back.dart'; -import 'network_base_view.dart'; -import 'not_auh_page.dart'; - -class PharmacyAppScaffold extends StatelessWidget { - final String appBarTitle; - final Widget body; - final Widget bottomSheet; - final bool isLoading; - final bool isShowAppBar; - final bool hasAppBarParam; - final BaseViewModel baseViewModel; - final bool isBottomBar; - final Widget floatingActionButton; - final String title; - final String description; - final bool isShowDecPage; - final Color backgroundColor; - - AuthenticatedUserObject authenticatedUserObject = - locator(); - - PharmacyAppScaffold( - {@required this.body, - this.appBarTitle = '', - this.isLoading = false, - this.isShowAppBar = false, - this.hasAppBarParam, - this.bottomSheet, - this.baseViewModel, - this.floatingActionButton, - this.title, - this.description, - this.isShowDecPage = true, - this.isBottomBar, - this.backgroundColor}); - - @override - Widget build(BuildContext context) { - AppGlobal.context = context; - - return Scaffold( - backgroundColor: - backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, - appBar: isShowAppBar - ? AppBar( - elevation: 0, - backgroundColor: Color(0xff5AB145), - textTheme: TextTheme( - headline6: - TextStyle(color: Colors.white, fontWeight: FontWeight.bold), - ), - title: Text(authenticatedUserObject.isLogin - ? appBarTitle.toUpperCase() - : TranslationBase.of(context).serviceInformationTitle), - leading: Builder( - builder: (BuildContext context) { - return ArrowBack(); - }, - ), - centerTitle: true, - actions: [], - ) - : null, - body: (!authenticatedUserObject.isLogin && isShowDecPage) - ? NotAutPage( - title: appBarTitle, - description: description, - ) - : baseViewModel != null - ? NetworkBaseView( - child: buildBodyWidget(), - baseViewModel: baseViewModel, - ) - : buildBodyWidget(), - bottomSheet: bottomSheet, - floatingActionButton: floatingActionButton ?? floatingActionButton, - // bottomNavigationBar: - // this.isBottomBar == true ? BottomBarSearch() : SizedBox() - // floatingActionButton: FloatingSearchButton(), - ); - } - - buildAppLoaderWidget(bool isLoading) { - return isLoading ? AppLoaderWidget() : Container(); - } - - buildBodyWidget() { - // return body; //Stack(children: [body, buildAppLoaderWidget(isLoading)]); - return Stack(children: [ - body, /*FloatingSearchButton()*/ - ]); - } -} diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index e0e89b45..a1908b6e 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'; @@ -26,7 +27,6 @@ import 'arrow_back.dart'; import 'network_base_view.dart'; import 'not_auh_page.dart'; - class AppScaffold extends StatelessWidget { final String appBarTitle; final Widget body; @@ -49,33 +49,35 @@ class AppScaffold extends StatelessWidget { final List appBarIcons; final PreferredSizeWidget appBarWidget; - ProjectViewModel projectProvider; + + final List imagesInfo; AuthenticatedUserObject authenticatedUserObject = locator(); - - AppScaffold( - {@required this.body, - this.appBarTitle = '', - this.isLoading = false, - this.isShowAppBar = false, - this.hasAppBarParam, - this.bottomSheet, - this.baseViewModel, - this.floatingActionButton, - this.isPharmacy = false, - this.title, - this.description, - this.isShowDecPage = true, - this.isBottomBar, - this.backgroundColor, - this.preferredSize = 0.0, - this.appBarIcons, - this.appBarWidget, - this.image, - this.infoList, - this.isHelp =false}); + AppScaffold({ + @required this.body, + this.appBarTitle = '', + this.isLoading = false, + this.isShowAppBar = false, + this.hasAppBarParam, + this.bottomSheet, + this.baseViewModel, + this.floatingActionButton, + this.isPharmacy = false, + this.title, + this.description, + this.isShowDecPage = true, + this.backgroundColor, + this.isBottomBar, + this.preferredSize = 0.0, + this.appBarIcons, + this.appBarWidget, + this.image, + this.infoList, + this.isHelp = false, + this.imagesInfo, + }); @override Widget build(BuildContext context) { @@ -104,13 +106,67 @@ class AppScaffold extends StatelessWidget { return Scaffold( backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, - appBar: appBar, + appBar: isShowAppBar + ? AppBar( + elevation: 0, + backgroundColor: Theme.of(context).appBarTheme.color, + textTheme: TextTheme( + headline6: + TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + ), + title: Texts( + authenticatedUserObject.isLogin || !isShowDecPage + ? appBarTitle.toUpperCase() + : TranslationBase.of(context).serviceInformationTitle, + color: Colors.white, + bold: true, + ), + leading: Builder( + builder: (BuildContext context) { + return ArrowBack(); + }, + ), + centerTitle: true, + actions: [ + image != null + ? InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: InsuranceUpdate(), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + image, + height: SizeConfig.heightMultiplier * 5, + width: SizeConfig.heightMultiplier * 5, + color: Colors.white, + ), + ), + ) + : IconButton( + icon: Icon(FontAwesomeIcons.home), + color: Colors.white, + onPressed: () { + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute( + builder: (context) => LandingPage()), + (Route r) => false); + }, + ), + ], + ) + : null, body: (!Provider.of(context, listen: false).isLogin && isShowDecPage) ? NotAutPage( title: appBarTitle, description: description, infoList: infoList, + imagesInfo: imagesInfo, ) : baseViewModel != null ? NetworkBaseView( @@ -118,8 +174,12 @@ class AppScaffold extends StatelessWidget { baseViewModel: baseViewModel, ) : buildBodyWidget(context), - bottomSheet: bottomSheet, - // floatingActionButton: floatingActionButton ?? floatingActionButton, + bottomSheet: + (Provider.of(context, listen: false).isLogin || + !isShowDecPage) + ? bottomSheet + : null, + //floatingActionButton: floatingActionButton ?? floatingActionButton, // bottomNavigationBar: // this.isBottomBar == true ? BottomBarSearch() : SizedBox() //floatingActionButton: FloatingSearchButton(), @@ -136,7 +196,6 @@ class AppScaffold extends StatelessWidget { body, isHelp ? RobotIcon() : Container() - /*FloatingSearchButton()*/ ]); } @@ -235,81 +294,84 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget { @override Size get preferredSize => Size(double.maxFinite, 60); } -class RobotIcon extends StatefulWidget { +class RobotIcon extends StatefulWidget { @override _RobotIcon createState() => _RobotIcon(); } class _RobotIcon extends State { var event = RobotProvider(); - bool isAnimation =true; + bool isAnimation = true; @override void initState() { event.controller.stream.listen((p) { if (p['animationEnable'] == 'false') { - setState(() { - if (this.mounted) { + setState(() { + if (this.mounted) { this.isAnimation = false; - } - }); - + } + }); } }); super.initState(); } + @override Widget build(BuildContext context) { return Positioned( - child : - Column( + child: Column( children: [ - - isAnimation ? Container(height:150,width:200,padding:EdgeInsets.all(5),margin:EdgeInsets.only(right:35.0,bottom:0 - ),decoration :BoxDecoration( - borderRadius:BorderRadius.circular(10), - color:Colors.white, - boxShadow: - [BoxShadow( - color: Colors.black, - spreadRadius: - 1 + isAnimation + ? Container( + height: 150, + width: 200, + padding: EdgeInsets.all(5), + margin: EdgeInsets.only(right: 35.0, bottom: 0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + boxShadow: [ + BoxShadow(color: Colors.black, spreadRadius: 1), + ], ), - ], - ), - child:TyperAnimatedTextKit(text:Provider.of(context,listen:false).isArabic == true ? - "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." - : "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.", - textLength: Provider.of(context,listen:false).isArabic== true ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي.".length: "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.".length - ) - - ) : Container(), + child: TyperAnimatedTextKit( + text: Provider.of(context, + listen: false) + .isArabic == + true + ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." + : "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.", + textLength: Provider.of(context, + listen: false) + .isArabic == + true + ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." + .length + : "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." + .length)) + : Container(), Stack( - children: - [ isAnimation ? Positioned(top:0,right:40,child: - Container(height:0,width:0, - decoration: - ShapeDecoration( - color: - Colors.grey, - shape: - MessageBorder( - reverse - : - true - ), - ) - ) - ) :Container(), - FloatingSearchButton() - ], - ) - + children: [ + isAnimation + ? Positioned( + top: 0, + right: 40, + child: Container( + height: 0, + width: 0, + decoration: ShapeDecoration( + color: Colors.grey, + shape: MessageBorder(reverse: true), + ))) + : Container(), + FloatingSearchButton() + ], + ) ], ), - right: -30,bottom:50 - - ); + right: -30, + bottom: 50); } -} \ No newline at end of file +} diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 68311f71..2b4c24ba 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -1,42 +1,37 @@ 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'; @@ -44,7 +39,6 @@ import 'package:speech_to_text/speech_to_text.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'; @@ -75,6 +69,7 @@ class _SearchBot extends State { bool _isInit = true; TextEditingController searchController = TextEditingController(); + @override void initState() { requestPermissions(); @@ -431,10 +426,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 && @@ -482,9 +479,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 e235f28b..cbeaafc5 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -47,6 +47,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/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -61,7 +62,6 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:flutter/cupertino.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; @@ -138,8 +138,9 @@ class _FloatingSearchButton extends State // } // }); } + AuthenticatedUserObject authenticatedUserObject = - locator(); + locator(); VitalSignService _vitalSignService = locator(); @override Widget build(BuildContext context) { @@ -156,13 +157,16 @@ class _FloatingSearchButton extends State child: Stack(children: [ GestureDetector( child: Container( - child:networkImage !=null ? CachedNetworkImage( - imageUrl: networkImage, - placeholder: (context, url) =>Image.asset('assets/images/gif/robot-idle.gif'), - errorWidget: (context, url, error) => Icon(Icons.error), - ) : Image.asset(isAnimationEnable == true - ? 'assets/images/gif/robot-speaking.gif' - : 'assets/images/gif/robot-idle.gif'), + child: networkImage != null + ? CachedNetworkImage( + imageUrl: networkImage, + placeholder: (context, url) => + Image.asset('assets/images/gif/robot-idle.gif'), + errorWidget: (context, url, error) => Icon(Icons.error), + ) + : Image.asset(isAnimationEnable == true + ? 'assets/images/gif/robot-speaking.gif' + : 'assets/images/gif/robot-idle.gif'), ), onTap: () { initSpeechState().then((value) => {startVoiceSearch()}); @@ -702,10 +706,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 && @@ -753,9 +759,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, @@ -840,27 +847,28 @@ class _FloatingSearchButton extends State results['ReturnMessage'] != null) { await flutterTts .setVoice({"name": "en-au-x-aub-network", "locale": "en-AU"}); - await flutterTts.speak(results['ReturnMessage']); + await flutterTts.speak(results['ReturnMessage']); } else if (results['ReturnMessage_Ar'] != null) { await flutterTts .setVoice({"name": "ar-xa-x-ard-network", "locale": "ar"}); - await flutterTts.speak(results['ReturnMessage_Ar']); - + await flutterTts.speak(results['ReturnMessage_Ar']); } this.isAnimationEnable = true; stopAnimation(); } - stopAnimation(){ + + stopAnimation() { flutterTts.setCompletionHandler(() => { - event.setValue({"animationEnable": 'false'}), - setState(() { - this.networkImage = null; - this.isAnimationEnable = false; - }) - }); + event.setValue({"animationEnable": 'false'}), + setState(() { + this.networkImage = null; + this.isAnimationEnable = false; + }) + }); } - signOut() async{ + + signOut() async { authenticatedUserObject.logout(); projectProvider.isLogin = false; await authenticatedUserObject.getUser(); diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index d1684125..3fcb9025 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -1,4 +1,6 @@ +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'; @@ -12,12 +14,22 @@ import 'package:provider/provider.dart'; import '../../splashPage.dart'; -class NotAutPage extends StatelessWidget { +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) { @@ -29,7 +41,7 @@ class NotAutPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - title ?? 'Service', + widget.title ?? 'Service', fontWeight: FontWeight.w800, fontSize: 25, bold: true, @@ -40,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, @@ -69,7 +81,7 @@ class NotAutPage extends StatelessWidget { ), ), SizedBox(width: 6,), - Expanded(child: Texts('${infoList[index]}')) + Expanded(child: Texts('${widget.infoList[index]}')) ], ), SizedBox(height: 12,), @@ -80,6 +92,7 @@ class NotAutPage extends StatelessWidget { SizedBox( height: 22, ), + if(!projectViewModel.isInternetConnection) Center( child: SizedBox( height: MediaQuery.of(context).size.height * 0.55, @@ -89,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, ), diff --git a/lib/widgets/others/points-expandable-notifier.dart b/lib/widgets/others/points-expandable-notifier.dart deleted file mode 100644 index 5f969765..00000000 --- a/lib/widgets/others/points-expandable-notifier.dart +++ /dev/null @@ -1,77 +0,0 @@ -import 'package:expandable/expandable.dart'; -import 'package:flutter/material.dart'; - -class PointsExpandableNotifier extends StatefulWidget { - final Widget headerWidget; - final Widget bodyWidget; - final Widget collapsed; - final bool isExpand; - bool expandFlag = false; - var controller = new ExpandableController(); - - PointsExpandableNotifier( - {this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand}); - - @override - _PointsExpandableNotifierState createState() => - _PointsExpandableNotifierState(); -} - -class _PointsExpandableNotifierState extends State { - @override - Widget build(BuildContext context) { - setState(() { - if (widget.isExpand == true) { - widget.expandFlag = widget.isExpand; - widget.controller.expanded = true; - } - }); - - return ExpandableNotifier( - child: Padding( - padding: const EdgeInsets.only(left: 0, right: 0), - child: Column( - children: [ - SizedBox( - child: widget.headerWidget, - ), - ScrollOnExpand( - scrollOnExpand: true, - scrollOnCollapse: false, - child: ExpandablePanel( - theme: const ExpandableThemeData( - headerAlignment: ExpandablePanelHeaderAlignment.center, - tapBodyToCollapse: true, - ), - // header: widget.headerWidget, - /* - // setState(() { - // widget.expandFlag = !widget.expandFlag; - // if (widget.expandFlag == true) { - // widget.controller.expanded = true; - // } else { - // widget.controller.expanded = false; - // } - // }); - */ - collapsed: Container(), - expanded: widget.bodyWidget, - builder: (_, collapsed, expanded) { - return Padding( - padding: EdgeInsets.only(left: 0, right: 0, bottom: 0), - child: Expandable( - controller: widget.controller, - collapsed: collapsed, - expanded: expanded, - theme: const ExpandableThemeData(crossFadePoint: 0), - ), - ); - }, - ), - ), - ], - ), - ), - ); - } -} 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/bottom_nav_pharmacy_bar.dart b/lib/widgets/pharmacy/bottom_nav_pharmacy_bar.dart deleted file mode 100644 index d9717c38..00000000 --- a/lib/widgets/pharmacy/bottom_nav_pharmacy_bar.dart +++ /dev/null @@ -1,108 +0,0 @@ -import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/material.dart'; - -import 'bottom_nav_pharmacy_home_item.dart'; -import 'bottom_nav_pharmacy_item.dart'; - -class BottomNavPharmacyBar extends StatefulWidget { - final ValueChanged changeIndex; - final int index; - BottomNavPharmacyBar({Key key, this.changeIndex, this.index}) - : super(key: key); - - @override - _BottomNavPharmacyBarState createState() => _BottomNavPharmacyBarState(); -} - -class _BottomNavPharmacyBarState extends State { - int _index = 0; - - _changeIndex(int index) { - widget.changeIndex(index); - } - - @override - Widget build(BuildContext context) { - return BottomAppBar( - elevation: 4, - shape: CircularNotchedRectangle(), - color: Colors.white, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 18), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - BottomNavHomeItem( - icon: EvaIcons.image, - activeIcon: EvaIcons.image, - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 0, - ), - - Container( - height: 65.0, - child: Center( - child: VerticalDivider( - color: Colors.grey, - thickness: 0.5, - width: 0.3, - indent: 25.5, - ), - ), - ), - - BottomNavPharmacyItem( - icon: EvaIcons.list, - activeIcon: EvaIcons.list, - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 1, - title: TranslationBase.of(context).categorise, - ), -// Expanded( -// child: SizedBox( -// height: 50, -// child: Column( -// mainAxisSize: MainAxisSize.min, -// mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// SizedBox(height: 22), -// ], -// ), -// ), -// ), - - // Added Calendar Icon to access book appointment flow - BottomNavPharmacyItem( - icon: EvaIcons.heart, - activeIcon: EvaIcons.heart, - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 2, - title: TranslationBase.of(context).wishList), - - BottomNavPharmacyItem( - icon: EvaIcons.person, - activeIcon: EvaIcons.person, - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 3, - title: TranslationBase.of(context).myAccount, - ), - BottomNavPharmacyItem( - icon: EvaIcons.shoppingCart, - activeIcon: EvaIcons.shoppingCart, - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 4, - title: TranslationBase.of(context).cart) - ], - ), - ), - ); - } -} diff --git a/lib/widgets/pharmacy/bottom_nav_pharmacy_home_item.dart b/lib/widgets/pharmacy/bottom_nav_pharmacy_home_item.dart deleted file mode 100644 index c5c3519b..00000000 --- a/lib/widgets/pharmacy/bottom_nav_pharmacy_home_item.dart +++ /dev/null @@ -1,74 +0,0 @@ -import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; -import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:flutter/material.dart'; - -class BottomNavHomeItem extends StatelessWidget { - final IconData icon; - final Image image; - - final ValueChanged changeIndex; - final int index; - final int currentIndex; - final Function onTap; - final IconData activeIcon; - - BottomNavHomeItem( - {this.icon, - this.changeIndex, - this.index, - this.currentIndex, - this.activeIcon, - this.onTap, - this.image}); - - @override - Widget build(BuildContext context) { - return Expanded( - child: SizedBox( - // height: 72.0, - child: Material( - type: MaterialType.transparency, - child: InkWell( - highlightColor: Colors.transparent, - splashColor: Colors.transparent, - onTap: () => { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => LandingPage()), - ), - }, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox( - height: 15, - ), - currentIndex == index - ? Divider( - // color: Color(0xff5AB145), - thickness: 0.5, - ) - : Divider( - thickness: 0, - ), - Container( - child: Image.asset( - 'assets/images/habib-logo.png', - height: 35.0, - ), - ), - SizedBox( - height: 11, - ), - - // Added TextAlign Property - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart deleted file mode 100644 index 9d46e2eb..00000000 --- a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart +++ /dev/null @@ -1,76 +0,0 @@ -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:flutter/material.dart'; - -class BottomNavPharmacyItem extends StatelessWidget { - final String title; - final IconData icon; - - final ValueChanged changeIndex; - final int index; - final int currentIndex; - final Function onTap; - - final IconData activeIcon; - BottomNavPharmacyItem( - {this.icon, - this.changeIndex, - this.index, - this.currentIndex, - this.activeIcon, - this.title, - this.onTap}); - - @override - Widget build(BuildContext context) { - return Expanded( - child: SizedBox( - // height: 72.0, - child: Material( - type: MaterialType.transparency, - child: InkWell( - highlightColor: Colors.transparent, - splashColor: Colors.transparent, - onTap: () => changeIndex(currentIndex), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox( - height: 15, - ), - currentIndex == index - ? Divider( - color: Color(0xff5AB145), - thickness: 3.5, - ) - : Divider( - thickness: 0, - ), - Container( - child: Icon(currentIndex == index ? activeIcon : icon, - color: currentIndex == index - ? Theme.of(context).primaryColor - : Theme.of(context).primaryColor, - size: 22.0), - ), - SizedBox( - height: 11, - ), - - // Added TextAlign Property - Texts( - title, - textAlign: TextAlign.center, - color: currentIndex == index - ? Theme.of(context).primaryColor - : Theme.of(context).primaryColor, - fontSize: 11, - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart deleted file mode 100644 index e0182f08..00000000 --- a/lib/widgets/pharmacy/product_tile.dart +++ /dev/null @@ -1,230 +0,0 @@ -import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_html/style.dart'; - -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:rating_bar/rating_bar.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; - - - -class productTile extends StatelessWidget { - final String productName; - final String productPrice; - final double productRate; - final int productReviews; - final String qyt; - final String totalPrice; - final bool isOrderDetails; - - - productTile({this.productName, this.productPrice, this.productRate, - this.qyt, this.totalPrice, this.productReviews, - this.isOrderDetails=true}); - - @override - Widget build(BuildContext context) { - return Container( - height: 150, - width: double.infinity, - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 10), - child: Image( - image: - AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'), - fit: BoxFit.cover, - width: 80, - height: 80, - ), - ), - Expanded( - flex: 5, - child: Column( - children: [ - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: TextSpan( - text: - productName, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), - ), - ), - ), - ), - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: TextSpan( - text: 'SAR $productPrice', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), - ), - ), - ), - ), - this.isOrderDetails == false ? Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RatingBar.readOnly( - initialRating: productRate, - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ), - ): Container(), - ], - ), - ), - this.isOrderDetails == false ? Expanded( - flex: 1, - child: Column ( - children: [ - Icon(FontAwesomeIcons.trashAlt, size: 15), - SizedBox(height: 50,), - Icon(FontAwesomeIcons.shoppingCart, size: 15), - ], - ), - ) : Container(), - ], - ), - this.isOrderDetails == true ?Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( -// margin: EdgeInsets.all(5), - child: RichText( - text: TextSpan( - text: 'QYT: $qyt', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.grey, - fontSize: 13), - ), - ), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - TranslationBase.of(context).total, - style: TextStyle( - color: Colors.grey, - fontSize: 13.0, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - RichText( - text: TextSpan( - text: ' $totalPrice SAR', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 15), - ), - ), - ], - ), - ], - ), - ], - ), - ): Container(), - this.isOrderDetails == true ?Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RatingBar.readOnly( - initialRating: productRate, - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ), - ), - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: TextSpan( - text: '($productReviews reviews)', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.grey, - fontSize: 13), - ), - ), - ), - ), - InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => ProductReviewPage())); - }, - child: Container( - padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), - height: 30.0, - decoration: BoxDecoration( - border: Border.all( - color: Colors.orange, - style: BorderStyle.solid, - width: 1.0 - ), - color: Colors.transparent, - borderRadius: BorderRadius.circular(5.0) - ), - child: Text( - TranslationBase.of(context).writeReview, - style: TextStyle( - fontSize:12, - color: Colors.orange, - ), - ), - ), - ), - ], - ) : Container(), - ], - ), - ); - } -} diff --git a/pubspec.yaml b/pubspec.yaml index 51ccbe8f..ad8ab8f6 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 TODO fix it @@ -95,11 +92,14 @@ dependencies: table_calendar: ^2.3.0 # SVG Images - flutter_svg: any + flutter_svg: ^0.18.0 # Location Helper map_launcher: ^0.8.1 + #carousel slider + carousel_slider: ^2.3.1 + #Calendar Events manage_calendar_events: ^1.0.2 @@ -109,8 +109,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 @@ -141,12 +139,15 @@ 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 typewriter: ^0.0.3 +#countdown timer for Upcoming List + flutter_countdown_timer: ^1.4.0 + #Dependencies for video call implementation native_device_orientation: ^0.3.0 enum_to_string: ^1.0.9 @@ -155,9 +156,9 @@ dependencies: after_layout: ^1.0.7 twilio_programmable_video: ^0.5.0+3 cached_network_image: ^2.4.1 + vibration: ^1.7.2 flutter_tts: path: flutter_tts-voice_enhancement - vibration: ^1.7.2 speech_to_text: path: speech_to_text @@ -179,7 +180,6 @@ flutter: # assets: assets: - assets/images/ - - assets/images/pharmacy/ - assets/images/medical/ - assets/images/new-design/ - assets/images/login/