diff --git a/.gitignore b/.gitignore index 4b016310..fd4aca5a 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ app.*.map.json # Exceptions to above rules. !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +health_calculators.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index 99f2b204..759fa6a7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -27,7 +27,7 @@ apply plugin: 'com.google.gms.google-services' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 28 + compileSdkVersion 30 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -41,7 +41,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.cloud.diplomaticquarterapp" minSdkVersion 21 - targetSdkVersion 28 + targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true @@ -72,12 +72,17 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation "com.google.firebase:firebase-messaging:20.3.0" + implementation "com.google.firebase:firebase-messaging:21.0.0" +// implementation ('com.google.firebase:firebase-inappmessaging-display:19.1.2',{ +// exclude group: 'com.google.protobuf',module: 'protobuf-javalite' +// exclude group: 'com.google.protobuf',module: 'protobuf-lite' +// }) implementation 'pub.devrel:easypermissions:0.4.0' - implementation 'com.google.firebase:firebase-inappmessaging-display:17.2.0' + // implementation 'com.google.firebase:firebase-inappmessaging-display:17.2.0' implementation 'com.google.guava:guava:27.0.1-android' // Dependency on local binaries implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'com.google.code.gson:gson:2.8.6' // Dependency on a remote binary // implementation 'com.example.android:app-magic:12.3' diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt index d2fb404a..840075eb 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt @@ -158,7 +158,7 @@ class HMG_Geofence { val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) val json = pref.getString(PREF_KEY_HMG_ZONES, "[]") - val geoZones = GeoZoneModel().listFrom(json) + val geoZones = GeoZoneModel().listFrom(json!!) return geoZones } diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt index 1c661c19..94bf54e6 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt @@ -16,6 +16,7 @@ import androidx.core.app.TaskStackBuilder import com.cloud.diplomaticquarterapp.BuildConfig import com.cloud.diplomaticquarterapp.MainActivity import com.cloud.diplomaticquarterapp.R +import com.cloud.diplomaticquarterapp.geofence.GeoZoneModel import com.github.kittinunf.fuel.core.extensions.jsonBody import com.github.kittinunf.fuel.httpPost import com.google.gson.Gson @@ -69,10 +70,10 @@ class HMGUtils { } } - fun getLanguageCode(context: Context) : Int{ + fun getLanguageCode(context: Context) : Int { val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) val lang = pref.getString(PREF_KEY_LANGUAGE, "ar") - return if(lang == "ar") 2 else 1 + return if (lang == "ar") 2 else 1 } fun defaultHTTPParams(context: Context) : Map{ diff --git a/android/build.gradle b/android/build.gradle index 8e56476b..433bc8ad 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,7 +8,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:4.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.google.gms:google-services:4.3.2' + classpath 'com.google.gms:google-services:4.3.4' } } diff --git a/android/gradle.properties b/android/gradle.properties index 9c0729c9..38c8d454 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,4 @@ - +org.gradle.jvmargs=-Xmx1536M android.enableR8=true android.useAndroidX=true android.enableJetifier=true -org.gradle.jvmargs=-Xmx4608m diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 5660070d..c935be88 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip diff --git a/assets/images/DQ/logo.png b/assets/images/DQ/logo.png new file mode 100644 index 00000000..29719b35 Binary files /dev/null and b/assets/images/DQ/logo.png differ diff --git a/assets/images/DQ/logo_big.png b/assets/images/DQ/logo_big.png new file mode 100644 index 00000000..0d9e4a56 Binary files /dev/null and b/assets/images/DQ/logo_big.png differ diff --git a/assets/images/appointment_booking.png b/assets/images/appointment_booking.png new file mode 100644 index 00000000..14db8d89 Binary files /dev/null and b/assets/images/appointment_booking.png differ diff --git a/assets/images/appointment_booking_en.png b/assets/images/appointment_booking_en.png new file mode 100644 index 00000000..14db8d89 Binary files /dev/null and b/assets/images/appointment_booking_en.png differ diff --git a/assets/images/book_appointment_ar.png b/assets/images/book_appointment_ar.png new file mode 100644 index 00000000..f0bc5aff Binary files /dev/null and b/assets/images/book_appointment_ar.png differ diff --git a/assets/images/book_appointment_arabic.png b/assets/images/book_appointment_arabic.png new file mode 100644 index 00000000..f0bc5aff Binary files /dev/null and b/assets/images/book_appointment_arabic.png differ diff --git a/assets/images/booking_ar.png b/assets/images/booking_ar.png new file mode 100644 index 00000000..b562f288 Binary files /dev/null and b/assets/images/booking_ar.png differ diff --git a/assets/images/booking_en.png b/assets/images/booking_en.png new file mode 100644 index 00000000..a3ffa8be Binary files /dev/null and b/assets/images/booking_en.png differ diff --git a/assets/images/check-in.png b/assets/images/check-in.png new file mode 100644 index 00000000..f6effbeb Binary files /dev/null and b/assets/images/check-in.png differ diff --git a/assets/images/comments.png b/assets/images/comments.png new file mode 100644 index 00000000..353edf4e Binary files /dev/null and b/assets/images/comments.png differ diff --git a/assets/images/device_icon.png b/assets/images/device_icon.png new file mode 100644 index 00000000..8ad55c09 Binary files /dev/null and b/assets/images/device_icon.png differ diff --git a/assets/images/vital_sign_icon.png b/assets/images/medical/vital_sign_icon.png similarity index 100% rename from assets/images/vital_sign_icon.png rename to assets/images/medical/vital_sign_icon.png diff --git a/assets/images/new-design/check-in.png b/assets/images/new-design/check-in.png index 8bed2242..f6effbeb 100644 Binary files a/assets/images/new-design/check-in.png and b/assets/images/new-design/check-in.png differ diff --git a/assets/images/new-design/empty_box.png b/assets/images/new-design/empty_box.png new file mode 100644 index 00000000..af3551fd Binary files /dev/null and b/assets/images/new-design/empty_box.png differ diff --git a/assets/images/new-design/liveCare_white_logo.svg b/assets/images/new-design/liveCare_white_logo.svg new file mode 100644 index 00000000..494b3671 --- /dev/null +++ b/assets/images/new-design/liveCare_white_logo.svg @@ -0,0 +1,40 @@ + + + + + + Online Consultation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new-design/livecare_arabic_logo.svg b/assets/images/new-design/livecare_arabic_logo.svg new file mode 100644 index 00000000..c524a803 --- /dev/null +++ b/assets/images/new-design/livecare_arabic_logo.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + استشارة مباشرة + + diff --git a/assets/images/new-design/livecare_white_logo.png b/assets/images/new-design/livecare_white_logo.png new file mode 100644 index 00000000..dc223965 Binary files /dev/null and b/assets/images/new-design/livecare_white_logo.png differ diff --git a/assets/images/no-data-found.png b/assets/images/no-data-found.png new file mode 100644 index 00000000..a4ced5d3 Binary files /dev/null and b/assets/images/no-data-found.png differ diff --git a/assets/images/no_image.png b/assets/images/no_image.png new file mode 100644 index 00000000..ebe05472 Binary files /dev/null and b/assets/images/no_image.png differ diff --git a/assets/images/offer.png b/assets/images/offer.png new file mode 100644 index 00000000..b9977670 Binary files /dev/null and b/assets/images/offer.png differ diff --git a/assets/images/offer_ar.png b/assets/images/offer_ar.png new file mode 100644 index 00000000..1fdbf749 Binary files /dev/null and b/assets/images/offer_ar.png differ diff --git a/assets/images/online_payment_icon.png b/assets/images/online_payment_icon.png index a6e0150a..6e167ace 100644 Binary files a/assets/images/online_payment_icon.png and b/assets/images/online_payment_icon.png differ diff --git a/assets/images/pharmacy/Group 1206.svg b/assets/images/pharmacy/Group 1206.svg new file mode 100644 index 00000000..ef8f7473 --- /dev/null +++ b/assets/images/pharmacy/Group 1206.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/images/pharmacy/Group 1207.svg b/assets/images/pharmacy/Group 1207.svg new file mode 100644 index 00000000..fd2ffd41 --- /dev/null +++ b/assets/images/pharmacy/Group 1207.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/images/pharmacy/Logo Parmacy-green.png b/assets/images/pharmacy/Logo Parmacy-green.png new file mode 100644 index 00000000..72862b33 Binary files /dev/null and b/assets/images/pharmacy/Logo Parmacy-green.png differ diff --git a/assets/images/pharmacy/aramex_shipping_logo.svg b/assets/images/pharmacy/aramex_shipping_logo.svg new file mode 100644 index 00000000..30cc03b8 --- /dev/null +++ b/assets/images/pharmacy/aramex_shipping_logo.svg @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/assets/images/pharmacy/arrow-left-png.png b/assets/images/pharmacy/arrow-left-png.png new file mode 100644 index 00000000..18d58c87 Binary files /dev/null and b/assets/images/pharmacy/arrow-left-png.png differ diff --git a/assets/images/pharmacy/arrow-left.png b/assets/images/pharmacy/arrow-left.png new file mode 100644 index 00000000..18d58c87 Binary files /dev/null and b/assets/images/pharmacy/arrow-left.png differ diff --git a/assets/images/pharmacy/arrow-right-png.png b/assets/images/pharmacy/arrow-right-png.png new file mode 100644 index 00000000..19af7c0b Binary files /dev/null and b/assets/images/pharmacy/arrow-right-png.png differ diff --git a/assets/images/pharmacy/arrow.png b/assets/images/pharmacy/arrow.png new file mode 100644 index 00000000..19af7c0b Binary files /dev/null and b/assets/images/pharmacy/arrow.png differ diff --git a/assets/images/pharmacy/arrow_lef.png b/assets/images/pharmacy/arrow_lef.png new file mode 100644 index 00000000..19af7c0b Binary files /dev/null and b/assets/images/pharmacy/arrow_lef.png differ diff --git a/assets/images/pharmacy/arrow_left.svg b/assets/images/pharmacy/arrow_left.svg new file mode 100644 index 00000000..00fa7556 --- /dev/null +++ b/assets/images/pharmacy/arrow_left.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/pharmacy/arrow_right.svg b/assets/images/pharmacy/arrow_right.svg new file mode 100644 index 00000000..b4243287 --- /dev/null +++ b/assets/images/pharmacy/arrow_right.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/pharmacy/check_icon.svg b/assets/images/pharmacy/check_icon.svg new file mode 100644 index 00000000..cfa4f441 --- /dev/null +++ b/assets/images/pharmacy/check_icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/pharmacy/compare.png b/assets/images/pharmacy/compare.png new file mode 100644 index 00000000..11a49dfb Binary files /dev/null and b/assets/images/pharmacy/compare.png differ diff --git a/assets/images/pharmacy/contact_us_icon.svg b/assets/images/pharmacy/contact_us_icon.svg new file mode 100644 index 00000000..fa591d47 --- /dev/null +++ b/assets/images/pharmacy/contact_us_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/images/pharmacy/credit_card_icon.svg b/assets/images/pharmacy/credit_card_icon.svg new file mode 100644 index 00000000..9ba6c2bf --- /dev/null +++ b/assets/images/pharmacy/credit_card_icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/pharmacy/delete_red_icon.svg b/assets/images/pharmacy/delete_red_icon.svg new file mode 100644 index 00000000..8897a683 --- /dev/null +++ b/assets/images/pharmacy/delete_red_icon.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/pharmacy/edit_icon.svg b/assets/images/pharmacy/edit_icon.svg new file mode 100644 index 00000000..df7cca2f --- /dev/null +++ b/assets/images/pharmacy/edit_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/pharmacy/empty_box.svg b/assets/images/pharmacy/empty_box.svg new file mode 100644 index 00000000..05816608 --- /dev/null +++ b/assets/images/pharmacy/empty_box.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/images/pharmacy/hmg_shipping_greenlogo.svg b/assets/images/pharmacy/hmg_shipping_greenlogo.svg new file mode 100644 index 00000000..449712a5 --- /dev/null +++ b/assets/images/pharmacy/hmg_shipping_greenlogo.svg @@ -0,0 +1,25 @@ + + + diff --git a/assets/images/pharmacy/hmg_shipping_logo.svg b/assets/images/pharmacy/hmg_shipping_logo.svg new file mode 100644 index 00000000..8e9db3d6 --- /dev/null +++ b/assets/images/pharmacy/hmg_shipping_logo.svg @@ -0,0 +1,17 @@ + + + diff --git a/assets/images/pharmacy/lakum_icon.svg b/assets/images/pharmacy/lakum_icon.svg new file mode 100644 index 00000000..e2b223de --- /dev/null +++ b/assets/images/pharmacy/lakum_icon.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/pharmacy/medication_refill_icon.svg b/assets/images/pharmacy/medication_refill_icon.svg new file mode 100644 index 00000000..d5951130 --- /dev/null +++ b/assets/images/pharmacy/medication_refill_icon.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/pharmacy/mobile_number_icon.svg b/assets/images/pharmacy/mobile_number_icon.svg new file mode 100644 index 00000000..d98aaf29 --- /dev/null +++ b/assets/images/pharmacy/mobile_number_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/pharmacy/my_family_icon.svg b/assets/images/pharmacy/my_family_icon.svg new file mode 100644 index 00000000..838b357e --- /dev/null +++ b/assets/images/pharmacy/my_family_icon.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/pharmacy/my_prescription_icon.svg b/assets/images/pharmacy/my_prescription_icon.svg new file mode 100644 index 00000000..bda0e22e --- /dev/null +++ b/assets/images/pharmacy/my_prescription_icon.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/pharmacy/orders_icon.svg b/assets/images/pharmacy/orders_icon.svg new file mode 100644 index 00000000..f09ae19d --- /dev/null +++ b/assets/images/pharmacy/orders_icon.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/pharmacy/our_locations_icon.svg b/assets/images/pharmacy/our_locations_icon.svg new file mode 100644 index 00000000..2be16631 --- /dev/null +++ b/assets/images/pharmacy/our_locations_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/images/pharmacy/pill_reminder_icon.svg b/assets/images/pharmacy/pill_reminder_icon.svg new file mode 100644 index 00000000..f4fb4ddc --- /dev/null +++ b/assets/images/pharmacy/pill_reminder_icon.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/pharmacy/quote_end.svg b/assets/images/pharmacy/quote_end.svg new file mode 100644 index 00000000..083ff39a --- /dev/null +++ b/assets/images/pharmacy/quote_end.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/pharmacy/quote_start.svg b/assets/images/pharmacy/quote_start.svg new file mode 100644 index 00000000..74216f14 --- /dev/null +++ b/assets/images/pharmacy/quote_start.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/pharmacy/review_icon.svg b/assets/images/pharmacy/review_icon.svg new file mode 100644 index 00000000..bb826f21 --- /dev/null +++ b/assets/images/pharmacy/review_icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/pharmacy/shipping_addresses_icon.svg b/assets/images/pharmacy/shipping_addresses_icon.svg new file mode 100644 index 00000000..ebb8692f --- /dev/null +++ b/assets/images/pharmacy/shipping_addresses_icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/pharmacy/shipping_mark_icon.svg b/assets/images/pharmacy/shipping_mark_icon.svg new file mode 100644 index 00000000..5cf9606b --- /dev/null +++ b/assets/images/pharmacy/shipping_mark_icon.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/assets/images/pharmacy/shipping_truck_icon.svg b/assets/images/pharmacy/shipping_truck_icon.svg new file mode 100644 index 00000000..8ffda974 --- /dev/null +++ b/assets/images/pharmacy/shipping_truck_icon.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/pharmacy/success_check_icon.svg b/assets/images/pharmacy/success_check_icon.svg new file mode 100644 index 00000000..ed1379b8 --- /dev/null +++ b/assets/images/pharmacy/success_check_icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/pharmacy/success_review_icon.svg b/assets/images/pharmacy/success_review_icon.svg new file mode 100644 index 00000000..f6951456 --- /dev/null +++ b/assets/images/pharmacy/success_review_icon.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/pharmacy/terms.png b/assets/images/pharmacy/terms.png new file mode 100644 index 00000000..76cfacab Binary files /dev/null and b/assets/images/pharmacy/terms.png differ diff --git a/assets/images/pharmacy/user.svg b/assets/images/pharmacy/user.svg new file mode 100644 index 00000000..8e978105 --- /dev/null +++ b/assets/images/pharmacy/user.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/pharmacy/user_icon.svg b/assets/images/pharmacy/user_icon.svg new file mode 100644 index 00000000..8e978105 --- /dev/null +++ b/assets/images/pharmacy/user_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/pharmacy/wishklist_icon.svg b/assets/images/pharmacy/wishklist_icon.svg new file mode 100644 index 00000000..cd0ce16d --- /dev/null +++ b/assets/images/pharmacy/wishklist_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/pharmacy/wishlist_icon.svg b/assets/images/pharmacy/wishlist_icon.svg new file mode 100644 index 00000000..910a3ab8 --- /dev/null +++ b/assets/images/pharmacy/wishlist_icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/pharmacy_module/ic_payment_option.png b/assets/images/pharmacy_module/ic_payment_option.png new file mode 100644 index 00000000..5f3fca8f Binary files /dev/null and b/assets/images/pharmacy_module/ic_payment_option.png differ diff --git a/assets/images/pharmacy_module/ic_shipping_address.png b/assets/images/pharmacy_module/ic_shipping_address.png new file mode 100644 index 00000000..9566fb30 Binary files /dev/null and b/assets/images/pharmacy_module/ic_shipping_address.png differ diff --git a/assets/images/pharmacy_module/ic_shipping_mark.png b/assets/images/pharmacy_module/ic_shipping_mark.png new file mode 100644 index 00000000..cc4b272d Binary files /dev/null and b/assets/images/pharmacy_module/ic_shipping_mark.png differ diff --git a/assets/images/pharmacy_module/ic_shipping_truck.png b/assets/images/pharmacy_module/ic_shipping_truck.png new file mode 100644 index 00000000..274ae1da Binary files /dev/null and b/assets/images/pharmacy_module/ic_shipping_truck.png differ diff --git a/assets/images/pharmacy_module/lakum/Account_activation_icon.png b/assets/images/pharmacy_module/lakum/Account_activation_icon.png new file mode 100644 index 00000000..dc93366c Binary files /dev/null and b/assets/images/pharmacy_module/lakum/Account_activation_icon.png differ diff --git a/assets/images/pharmacy_module/lakum/Lakum_transfer_icon.png b/assets/images/pharmacy_module/lakum/Lakum_transfer_icon.png new file mode 100644 index 00000000..b7d33dd6 Binary files /dev/null and b/assets/images/pharmacy_module/lakum/Lakum_transfer_icon.png differ diff --git a/assets/images/pharmacy_module/lakum/expired_icon.png b/assets/images/pharmacy_module/lakum/expired_icon.png new file mode 100644 index 00000000..9a980984 Binary files /dev/null and b/assets/images/pharmacy_module/lakum/expired_icon.png differ diff --git a/assets/images/pharmacy_module/lakum/inactive_cross.png b/assets/images/pharmacy_module/lakum/inactive_cross.png new file mode 100644 index 00000000..5a592b7a Binary files /dev/null and b/assets/images/pharmacy_module/lakum/inactive_cross.png 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 new file mode 100644 index 00000000..73323a0e Binary files /dev/null and b/assets/images/pharmacy_module/lakum/lakum_card_front_bg.png differ diff --git a/assets/images/pharmacy_module/lakum/lakum_checkout.png b/assets/images/pharmacy_module/lakum/lakum_checkout.png new file mode 100644 index 00000000..e0230a00 Binary files /dev/null and b/assets/images/pharmacy_module/lakum/lakum_checkout.png differ diff --git a/assets/images/pharmacy_module/lakum/waiting_gained_icon.png b/assets/images/pharmacy_module/lakum/waiting_gained_icon.png new file mode 100644 index 00000000..37ff1ac9 Binary files /dev/null and b/assets/images/pharmacy_module/lakum/waiting_gained_icon.png 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 new file mode 100644 index 00000000..7f31f622 Binary files /dev/null and b/assets/images/pharmacy_module/lakum/will_be_expired_icon.png differ diff --git a/assets/images/pharmacy_module/payment/LogoParmacyGreen.png b/assets/images/pharmacy_module/payment/LogoParmacyGreen.png new file mode 100644 index 00000000..72862b33 Binary files /dev/null and b/assets/images/pharmacy_module/payment/LogoParmacyGreen.png differ diff --git a/assets/images/pharmacy_module/payment/aramex_shipping_logo.png b/assets/images/pharmacy_module/payment/aramex_shipping_logo.png new file mode 100644 index 00000000..e7b45d9c Binary files /dev/null and b/assets/images/pharmacy_module/payment/aramex_shipping_logo.png differ diff --git a/assets/images/pharmacy_module/payment/hmg_shipping_logo.png b/assets/images/pharmacy_module/payment/hmg_shipping_logo.png new file mode 100644 index 00000000..725b2e5e Binary files /dev/null and b/assets/images/pharmacy_module/payment/hmg_shipping_logo.png differ diff --git a/assets/images/pharmacy_module/payment/installment.png b/assets/images/pharmacy_module/payment/installment.png new file mode 100644 index 00000000..034497ef Binary files /dev/null and b/assets/images/pharmacy_module/payment/installment.png differ diff --git a/assets/images/pharmacy_module/payment/mada.png b/assets/images/pharmacy_module/payment/mada.png new file mode 100644 index 00000000..f65b970c Binary files /dev/null and b/assets/images/pharmacy_module/payment/mada.png differ diff --git a/assets/images/pharmacy_module/payment/mastercard.png b/assets/images/pharmacy_module/payment/mastercard.png new file mode 100644 index 00000000..1d48b854 Binary files /dev/null and b/assets/images/pharmacy_module/payment/mastercard.png differ diff --git a/assets/images/pharmacy_module/payment/sadad.png b/assets/images/pharmacy_module/payment/sadad.png new file mode 100644 index 00000000..35e0426c Binary files /dev/null and b/assets/images/pharmacy_module/payment/sadad.png differ diff --git a/assets/images/pharmacy_module/payment/visa.png b/assets/images/pharmacy_module/payment/visa.png new file mode 100644 index 00000000..8d29703c Binary files /dev/null and b/assets/images/pharmacy_module/payment/visa.png differ diff --git a/assets/images/pharmacy_module/payment_image.png b/assets/images/pharmacy_module/payment_image.png new file mode 100644 index 00000000..ebf7a929 Binary files /dev/null and b/assets/images/pharmacy_module/payment_image.png differ diff --git a/assets/images/powerd-by.jpg b/assets/images/powerd-by.jpg new file mode 100644 index 00000000..93bdbb18 Binary files /dev/null and b/assets/images/powerd-by.jpg differ diff --git a/assets/images/progress-loading-red.gif b/assets/images/progress-loading-red.gif new file mode 100644 index 00000000..517c3dab Binary files /dev/null and b/assets/images/progress-loading-red.gif differ diff --git a/help/test/widget_test.dart b/help/test/widget_test.dart index 0d8435b7..9ca1523f 100644 --- a/help/test/widget_test.dart +++ b/help/test/widget_test.dart @@ -8,7 +8,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:help/main.dart'; +import '../lib/main.dart'; + + void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index 4e1980a7..6ccef9d4 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1,5 @@ -e7c24319209ad9049a87d4c83aeeb7de \ No newline at end of file +<<<<<<< HEAD +e7c24319209ad9049a87d4c83aeeb7de +======= +59a6c452ee075b50114918f17f1ad8f5 +>>>>>>> development diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 668711ce..de6671fa 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -173,6 +173,10 @@ PODS: - Flutter - url_launcher_windows (0.0.1): - Flutter + - vibration (1.7.3): + - Flutter + - vibration_web (1.6.2): + - Flutter - video_player (0.0.1): - Flutter - video_player_web (0.0.1): @@ -233,6 +237,8 @@ DEPENDENCIES: - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) - url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`) + - vibration (from `.symlinks/plugins/vibration/ios`) + - vibration_web (from `.symlinks/plugins/vibration_web/ios`) - video_player (from `.symlinks/plugins/video_player/ios`) - video_player_web (from `.symlinks/plugins/video_player_web/ios`) - wakelock (from `.symlinks/plugins/wakelock/ios`) @@ -355,6 +361,10 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/url_launcher_web/ios" url_launcher_windows: :path: ".symlinks/plugins/url_launcher_windows/ios" + vibration: + :path: ".symlinks/plugins/vibration/ios" + vibration_web: + :path: ".symlinks/plugins/vibration_web/ios" video_player: :path: ".symlinks/plugins/video_player/ios" video_player_web: @@ -432,6 +442,8 @@ SPEC CHECKSUMS: url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5 + vibration: b5a33e764c3f609a975b9dca73dce20fdde627dc + vibration_web: 0ba303d92469ba34d71c612a228b315908d7fcd9 video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7 wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4 diff --git a/lib/Constants.dart b/lib/Constants.dart new file mode 100644 index 00000000..5b8fd9da --- /dev/null +++ b/lib/Constants.dart @@ -0,0 +1,3 @@ +import 'package:flutter/material.dart'; + +final Color secondaryColor = Colors.red[800]; \ No newline at end of file diff --git a/lib/config/config.dart b/lib/config/config.dart index 10ec0b73..795da85b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,38 +12,65 @@ const EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/exacartapi'; const PACKAGES_CATEGORIES = '/api/categories'; const PACKAGES_PRODUCTS = '/api/products'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; + +//const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/'; +const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; -const BASE_URL = 'https://hmgwebservices.com/'; + const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; ///Geofencing const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints'; const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo'; +//weather +const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; + +const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; + // Wifi Credentials const WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; ///Doctor -const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; +const GET_MY_DOCTOR = + 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; +const GET_DOCTOR_RATING_NOTES = + 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; +const GET_DOCTOR_RATING_DETAILS = + 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; ///Prescriptions const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const GET_PRESCRIPTIONS_ALL_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT = + 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = + 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = + 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; +const SEND_LAB_RESULT_EMAIL = + 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = + 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = + 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; +const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = + 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; + const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail'; @@ -82,13 +109,17 @@ const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; ///userInformation const GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New'; +///Update email +const UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail'; +const UPDATE_PATENT_INFO = 'Services/Community.svc/REST/UpdateUserInfo_New'; + ///addNewChild const GET_NEWCHILD_REQUEST = 'Services/Community.svc/REST/CreateNewBaby'; ///newUserId const GET_NEW_USER_REQUEST = 'Services/Community.svc/REST/CreateNewUser_New'; -///delteChild +///delete Child const DELETE_CHILD_REQUEST = 'Services/Community.svc/REST/DeleteBaby'; ///addNewTABLE @@ -103,6 +134,8 @@ const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_G ///Reports const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; +const SEND_MEDICAL_REPORT_EMAIL = + 'Services/Notifications.svc/REST/SendMedicalReportEmail'; ///Rate const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; @@ -208,17 +241,21 @@ const LANGUAGE = 2; const PATIENT_OUT_SA = 0; const SESSION_ID = 'TMRhVmkGhOsvamErw'; const IS_DENTAL_ALLOWED_BACKEND = false; -const PATIENT_TYPE = 2; -const PATIENT_TYPE_ID = 2; +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 = "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; +const GET_PATIENT_INSURANCE_DETAILS = + "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; +const UPLOAD_INSURANCE_CARD = + 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; @@ -282,12 +319,46 @@ 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_GET_COUNTRY = "epharmacy/api/countries"; +const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer"; const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners"; const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer"; const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts"; const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/"; const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/"; +const GET_ORDER = "orders?"; +const GET_ORDER_DETAILS = "epharmacy/api/orders/"; +const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress"; +const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress"; +const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress"; +const GET_ADDRESS = "Customers/"; +const GET_Cancel_ORDER = "cancelorder/"; +const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8"; +const GET_SHOPPING_CART = "epharmacy/api/shopping_cart_items/"; +const GET_SHIPPING_OPTIONS = "epharmacy/api/get_shipping_option/"; +const 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 = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; @@ -296,12 +367,62 @@ const PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_Updat const GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; const GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; -const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; -const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; +const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = + 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; +const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = + 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; +const GET_PATIENT_ALL_PRES_ORD = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const PATIENT_ER_INSERT_PRES_ORDER = + 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; +const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews'; + +//Pharmacy wishlist +const GET_WISHLIST = "shopping_cart_items/"; +const DELETE_WISHLIST = "delete_shopping_cart_item_by_product?customer_id="; +const GET_REVIEW = "customerreviews/"; +const GET_BRANDS = "manufacturer"; +const GET_TOP_BRANDS = "topmanufacturer?page=1&limit=8"; +const GET_PRODUCT_DETAIL = "products/"; +const GET_LOCATION = "Services/Patients.svc/REST/GetPharmcyListBySKU"; +const GET_SPECIFICATION = "productspecification/"; +const GET_BRAND_ITEMS = "products?ManufacturerId="; + +// External API +const ADD_ADDRESS_INFO = + "https://mdlaboratories.com/exacartapi/api/addcustomeraddress"; +const GET_CUSTOMER_ADDRESSES = + "https://mdlaboratories.com/exacartapi/api/Customers/"; +const GET_CUSTOMER_INFO = + "https://mdlaboratories.com/exacartapi/api/VerifyCustomer"; + +//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 3aa066e6..387dbcb1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -76,10 +76,18 @@ const Map localizedValues = { 'instruction': {'en': 'Instructions', 'ar': 'تعليمات'}, 'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'}, 'livecareAppo': {'en': 'LiveCare Appointment', 'ar': 'الموعد لايف كير'}, - 'cancelAppoMsg': {'en': 'Are you sure you want to cancel this appointment?', 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'}, + 'cancelAppoMsg': { + 'en': 'Are you sure you want to cancel this appointment?', + 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟' + }, 'upcoming-noAction': {'en': 'No Action Required', 'ar': 'لا يوجد إجراء مطلوب'}, 'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'}, + "book-success-confirm-more-24-1-2": { + "en": + "The online payment process will be available 24 hours before the appointment.", + "ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة." + }, 'upcoming-payment-pending': {'en': 'Online Payment will be Activated before 24 Hours of Appointment Time', 'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز'}, 'upcoming-payment-now': {'en': 'Pay Online now to avoid long waiting queue', 'ar': 'ادفع الآن لتفادي الانتظار'}, 'upcoming-QR': {'en': 'Use the QR Code to Check-In in hospital', 'ar': 'استخدم الرمز لتسجيل الحضور في المستشفى'}, @@ -101,27 +109,54 @@ const Map localizedValues = { 'loginregister': {'en': 'Login / Register', 'ar': 'تسجيل الدخول'}, 'poweredBy': {'en': 'Powered By', 'ar': 'مشغل بواسطة'}, "welcome": {"en": "Welcome", "ar": "مرحبا"}, - "welcome_text": {"en": "Dr. Sulaiman Al Habib Mobile Application", "ar": "الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك"}, - 'welcome_text2': {'en': 'Have you visited AlHabib Medical Group before? ', 'ar': 'هل قمت بزيارة مجموعة الحبيب الطبية من قبل؟'}, + "welcome_text": { + "en": "Dr. Sulaiman Al Habib Mobile Application", + "ar": "الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك" + }, + 'welcome_text2': { + 'en': 'Have you visited AlHabib Medical Group before? ', + 'ar': 'هل قمت بزيارة مجموعة الحبيب الطبية من قبل؟' + }, 'yes': {'en': 'Yes', 'ar': 'نعم'}, 'no': {'en': 'No', 'ar': 'لا'}, - "logintyperadio": {"en": "Choose from below options to login to your medical file.", "ar": "اختر من الخيارات أدناه لتسجيل الدخول إلى ملفك الطبي."}, + "logintyperadio": { + "en": "Choose from below options to login to your medical file.", + "ar": "اختر من الخيارات أدناه لتسجيل الدخول إلى ملفك الطبي." + }, "registernow": {"en": "Register Now", "ar": "تسجيل الان"}, - "nationalID": {"en": "Enter the Identification Number", "ar": "أدخل رقم الهوية الوطنية او الاقامة"}, + "nationalID": { + "en": "Enter the Identification Number", + "ar": "أدخل رقم الهوية الوطنية او الاقامة" + }, "national-id": {"en": "National ID", "ar": "رقم الهوية"}, "fileNo": {"en": "File Number", "ar": "رقم الملف"}, "fileno": {"en": "File No", "ar": "رقم الملف"}, "forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"}, - "forgotFileNoTitle": {"en": "Forgot medical file Number", "ar": "نسيت رقم الملف"}, + "forgotFileNoTitle": { + "en": "Forgot medical file Number", + "ar": "نسيت رقم الملف" + }, - "enter-national-id": {"en": "Please enter mobile number and identification number", "ar": "الرجاء إدخال رقم الجوال ورقم الهوية"}, - "profile-info": {"en": "Please enter profile information", "ar": "الرجاء إدخال معلومات الملف الشخصي"}, + "enter-national-id": { + "en": "Please enter mobile number and identification number", + "ar": "الرجاء إدخال رقم الجوال ورقم الهوية" + }, + "profile-info": { + "en": "Please enter profile information", + "ar": "الرجاء إدخال معلومات الملف الشخصي" + }, "submit": {"en": "Submit", "ar": "ارسال"}, - "forgot-desc": {"en": "Enter the mobile number to receive the Medical file Number via SMS", "ar": "أدخل رقم الجوال المسجل لاستلام رقم الملف عن طريق الرسائل النصية"}, + "forgot-desc": { + "en": "Enter the mobile number to receive the Medical file Number via SMS", + "ar": "أدخل رقم الجوال المسجل لاستلام رقم الملف عن طريق الرسائل النصية" + }, "dob": {"en": "Birth Date:", "ar": "تاريخ الميلاد"}, "hijri-date": {"en": "Hijri Date", "ar": "التاريخ الهجري"}, "gregorian-date": {"en": "Gregorian Date", "ar": "التاريخ الميلادي"}, - "verify-login-with": {"en": "Please choose one of the following options to verify", "ar": "الرجاء اختيار احدى الخيارات التالية للتحقق من البيانات"}, + "verify-login-with": { + "en": "Please choose one of the following options to verify", + "ar": "الرجاء اختيار احدى الخيارات التالية للتحقق من البيانات" + }, "register-user": {"en": "Register", "ar": "تسجيل"}, "verify-with-fingerprint": {"en": "Fingerprint", "ar": "بصمة"}, "verify-with-faceid": {"en": "Face ID", "ar": "معرف الوجه"}, @@ -130,18 +165,32 @@ const Map localizedValues = { "last-login": {"en": "LAST LOGIN AT:", "ar": "آخر تسجيل دخول"}, "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, "verify-fingerprint": { - "en": "To activate the fingerprint login service, please verify data by using one of the following options.", - "ar": "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات" + "en": + "To activate the fingerprint login service, please verify data by using one of the following options.", + "ar": + "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات" }, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'البحث عن الدواء'}, 'pharmaciesList': {'en': 'Pharmacies List', 'ar': 'قائمة الصيدلايات'}, - 'searchMedicineHere': {'en': 'Search Medicine Here', 'ar': 'ابحث عن الدواء هنا'}, + 'searchMedicineHere': { + 'en': 'Search Medicine Here', + 'ar': 'ابحث عن الدواء هنا' + }, 'description': {'en': 'Description', 'ar': 'الوصف'}, 'price': {'en': 'Price', 'ar': 'السعر'}, 'youCanFindItIn': {'en': 'You can find it in', 'ar': 'يمكنكة ان تجده في'}, - 'pleaseEnterMedicineName': {'en': 'Please Enter Medicine Name', 'ar': 'الرجائ ادخال اسم الدواء'}, - "verification_message": {"en": "Please enter verification code", "ar": "الرجاء إدخال رمز التحقق"}, - "validation_message": {"en": "The verification code expires in", "ar": "تنتهي صلاحية رمز التحقق خلال"}, + 'pleaseEnterMedicineName': { + 'en': 'Please Enter Medicine Name', + 'ar': 'الرجائ ادخال اسم الدواء' + }, + "verification_message": { + "en": "Please enter the Verification Code sent to", + "ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى" + }, + "validation_message": { + "en": "The verification code expires in", + "ar": "تنتهي صلاحية رمز التحقق خلال" + }, "arabic-change": {"en": "عربي", "ar": "English"}, "notification": {"en": "Notifications", "ar": "إشعارات"}, "app-settings": {"en": "App Settings", "ar": "إعدادات التطبيق"}, @@ -149,31 +198,80 @@ const Map localizedValues = { "before": {"en": "Before", "ar": "قبل"}, "minute": {"en": "Minutes", "ar": "دقيقة"}, "hour": {"en": "Hour", "ar": "ساعة"}, - "reminderSuccess": {"en": "The reminder has been added successfully", "ar": "يضاف التذكير بنجاح"}, - "patientShareToDo": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"}, + "reminderSuccess": { + "en": "The reminder has been added successfully", + "ar": "يضاف التذكير بنجاح" + }, + "patientShareToDo": { + "en": "Amount before tax: ", + "ar": "المبلغ قبل الضريبة:" + }, "patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"}, - "patientShareTotalToDo": {"en": "Total amount Due: ", "ar": "المبلغ الإجمالي المستحق:"}, + "patientShareTotalToDo": { + "en": "Total amount Due: ", + "ar": "المبلغ الإجمالي المستحق:" + }, 'paymentMethod': {'en': 'Payment Method', 'ar': 'طريقة الدفع او السداد'}, - 'noNeedToWaitInLine': {'en': 'No need to stand in line.', 'ar': 'لا داعي للوقوف في الطابور.'}, - 'useQRAppoAttend': {'en': 'Use the QR code to register the appointment attendance.', 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.'}, - 'passQRAppoAttend': {'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'}, - 'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'}, - 'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'}, - 'scanQRHospital': {'en': 'Scan above QR Code to Check-In on the Machine in Hospital', 'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى'}, + 'noNeedToWaitInLine': { + 'en': 'No need to stand in line.', + 'ar': 'لا داعي للوقوف في الطابور.' + }, + 'useQRAppoAttend': { + 'en': 'Use the QR code to register the appointment attendance.', + 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.' + }, + 'passQRAppoAttend': { + 'en': + 'Pass the QR code through the attendance devices available in the Hospital.', + 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.' + }, + 'sitWaitingQR': { + 'en': 'Sit in the waiting rooms until called by the nurse.', + 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.' + }, + 'attendRegisterCode': { + 'en': 'Attendance registration code', + 'ar': 'رمز تسجيل الحضور' + }, + 'scanQRHospital': { + 'en': 'Scan above QR Code to Check-In on the Machine in Hospital', + 'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى' + }, "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, - "EmailSentSuccessfully": {"en": "Email Sent Successfully", "ar": "تم إرسال البريد الإلكتروني بنجاح"}, + "EmailSentSuccessfully": { + "en": "Email Sent Successfully", + "ar": "تم إرسال البريد الإلكتروني بنجاح" + }, "close": {"en": "Close", "ar": "مغلق"}, "booked": {"en": "Booked", "ar": "محجوز"}, "confirmed": {"en": "Confirmed", "ar": "مؤكد"}, "arrived": {"en": "Arrived", "ar": "تم الحضور"}, - "payNowBookSuccess": {"en": "Pay now via Al Habib App", "ar": "ادفع الآن عبر تطبيق الحبيب"}, - "payNowBookSuccesstext1": {"en": "Pay Now using online payment service From secure payment gateways", "ar": "ادفع الآن باستخدام خدمة الدفع عبر الإنترنت من بوابات الدفع الآمنة"}, - "payNowBookSuccesstext2": {"en": "You can also Pay Later via online payment Or in Hospital", "ar": "يمكنك أيضًا الدفع لاحقًا عبر الدفع عبر الإنترنت أو في المستشفى"}, + "payNowBookSuccess": { + "en": "Pay now via Al Habib App", + "ar": "ادفع الآن عبر تطبيق الحبيب" + }, + "payNowBookSuccesstext1": { + "en": "Pay Now using online payment service From secure payment gateways", + "ar": "ادفع الآن باستخدام خدمة الدفع عبر الإنترنت من بوابات الدفع الآمنة" + }, + "payNowBookSuccesstext2": { + "en": "You can also Pay Later via online payment Or in Hospital", + "ar": "يمكنك أيضًا الدفع لاحقًا عبر الدفع عبر الإنترنت أو في المستشفى" + }, 'payLater': {'en': 'Pay Later', 'ar': 'ادفع لاحقا'}, - 'askDocNotAllowed': {'en': 'This service will be available for last 15 days doctor Visit only', 'ar': 'هذه الخدمة متاحة للزيارات خلال اخر 15 يوم فقط'}, - "more-verify": {"en": "More Verification Options", "ar": "المزيد من خيارات التحقق"}, + 'askDocNotAllowed': { + 'en': 'This service will be available for last 15 days doctor Visit only', + 'ar': 'هذه الخدمة متاحة للزيارات خلال اخر 15 يوم فقط' + }, + "more-verify": { + "en": "More Verification Options", + "ar": "المزيد من خيارات التحقق" + }, "welcome-back": {"en": "Welcome back!", "ar": "مرحبا بعودتك!"}, - "account-info": {"en": "Would you like to login with current username?", "ar": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟"}, + "account-info": { + "en": "Would you like to login with current username?", + "ar": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟" + }, "another-acc": {"en": "Use Another Account", "ar": "استخدم حسابا آخر"}, "next": {"en": "Next", "ar": 'التالى'}, "first-name": {"en": "First Name", "ar": "الاسم الأول"}, @@ -184,7 +282,10 @@ const Map localizedValues = { "preferred-language": {"en": "Preferred Language", "ar": "اللغة المفضلة"}, "english": {"en": "English", "ar": "الإنجليزية"}, "arabic": {"en": "Arabic", "ar": "العربية"}, - "locations-register": {"en": "Where do you want to create this file?", "ar": "أين تريد فتح هذا الملف؟"}, + "locations-register": { + "en": "Where do you want to create this file?", + "ar": "أين تريد فتح هذا الملف؟" + }, "ksa": {"en": "KSA", "ar": "السعودية"}, "dubai": {"en": "Dubai", "ar": "دبي"}, "enter-email": {"en": "Enter Email", "ar": "ادخل البريد الالكتروني"}, @@ -196,7 +297,7 @@ const Map localizedValues = { "recieved-requests": {"en": "Recieved Requests", "ar": "الطلبات المستلمة"}, "manage-files": {"en": "Manage Family Files", "ar": "إدارة ملفات العائلة"}, 'oxygenation': {'en': 'Oxygenation', 'ar': 'الأوكسجين'}, - 'bodyMeasurements': {'en': 'body Mass', 'ar': 'قياسات الجسم'}, + 'bodyMeasurements': {'en': 'body Mass Index', 'ar': 'مؤشر الكتلة'}, 'temperature': {'en': 'Temperature', 'ar': 'درجة الحرارة'}, 'pulse': {'en': 'Pulse', 'ar': 'النبض'}, 'respiration': {'en': 'Respiration', 'ar': 'التنفس'}, @@ -214,7 +315,7 @@ const Map localizedValues = { "reject-view": {"en": "Reject", "ar": "رفض"}, "delete-view": {"en": "Delete", "ar": "حذف"}, // "my-family": {"en": "MY FAMILY", "ar": "عائلتي"}, - "approvals": {"en": "Approvals", "ar": "موفقات التأمين"}, + "approvals": {"en": "Approvals", "ar": "موافقات التأمين"}, "approvalNo": {"en": "Approval No.: ", "ar": "رقم الموافقة: "}, "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, "receiptOn": {"en": "Receipt on: ", "ar": "تاريخ الفاتورة: "}, @@ -223,7 +324,10 @@ const Map localizedValues = { "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, "usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"}, "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, - "totalApproval": {"en": "Total approval unused", "ar": "اجمالي الموافقات الغير مستخدمة"}, + "totalApproval": { + "en": "Total approval unused", + "ar": "اجمالي الموافقات الغير مستخدمة" + }, "category": {"en": "Category: ", "ar": "الفئة"}, "expirationDate": {"en": "Expiration Date: ", "ar": "تاريخ الانتهاء"}, "patientCard": {"en": "Patient Card ID: ", "ar": "رقم الاشتراك"}, @@ -235,6 +339,7 @@ const Map localizedValues = { "remove-family-member": {"en": "Remove this member?", "ar": "إزالة ملف العضو؟"}, "MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'}, "myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك الطبية'}, + "viewMore": {"en": "View More", 'ar': 'عرض المزيد'}, "homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'}, "OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدليات الحبيب'}, @@ -281,9 +386,18 @@ const Map localizedValues = { "ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "}, "requestA": {"en": "Request:", "ar": "اسعاف"}, "MyAppointments": {"en": "Appointments", "ar": "مواعيدي"}, - "NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"}, - "NoConfirmedAppointments": {"en": "No Confirmed Appointments", "ar": "لا توجد مواعيد مؤكدة"}, - "noArrivedAppointments": {"en": "No Arrived Appointments", "ar": "لم تصل المواعيد"}, + "NoBookedAppointments": { + "en": "No Booked Appointments", + "ar": "لا توجد مواعيد محجوزة" + }, + "NoConfirmedAppointments": { + "en": "No Confirmed Appointments", + "ar": "لا توجد مواعيد مؤكدة" + }, + "noArrivedAppointments": { + "en": "No Arrived Appointments", + "ar": "لم تصل المواعيد" + }, "MyAppointmentsList": {"en": "List", "ar": "قائمة بمواعدي"}, "Radiology": {"en": "Radiology", "ar": "الأشعة"}, "RadiologySubtitle": {"en": "Result", "ar": "صور وتقارير"}, @@ -333,16 +447,25 @@ const Map localizedValues = { "LabOrders": {"en": "Lab Orders", "ar": "تحاليل المختبر"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "Prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, - "History": {"en": "History", "ar": "السجل"}, + "History": {"en": "History", "ar": "السجلات"}, "OrderNo": {"en": "Order No", "ar": "رقم الطلب"}, "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, "MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"}, "km": {"en": "KMs:", "ar": "كم"}, - "PatientHealthSummaryReport": {"en": "Patient Health Summary Report", "ar": " ملخص التقارير الشهرية"}, - "ToViewTheTermsAndConditions": {"en": "To View The Terms And Conditions Report", "ar": " عرض الشروط والأحكام "}, + "PatientHealthSummaryReport": { + "en": "Patient Health Summary Report", + "ar": " ملخص التقارير الشهرية" + }, + "ToViewTheTermsAndConditions": { + "en": "To View The Terms And Conditions Report", + "ar": " عرض الشروط والأحكام " + }, "ClickHere": {"en": "Click here", "ar": "أنقر هنا"}, - "IAgreeToTheTermsAndConditions": {"en": "I agree to the terms and conditions ", "ar": "أوافق على الشروط والاحكام "}, + "IAgreeToTheTermsAndConditions": { + "en": "I agree to the terms and conditions ", + "ar": "أوافق على الشروط والاحكام " + }, "IAgreeToTheTermsAndConditionsSubtitle": { "en": "I agree to the terms and conditions ", "ar": @@ -351,8 +474,14 @@ const Map localizedValues = { "Save": {"en": "Save", "ar": "حفظ "}, "UserAgreement": {"en": "User Agreement", "ar": "اتفاقية الخصوصية "}, "UpdateSuccessfully": {"en": "Update Successfully", "ar": "تم التحديث بنجاح"}, - "CHECK_VACCINE_AVAILABILITY": {"en": "CHECK VACCINE AVAILABILITY", "ar": "تحقق من توافر اللقاح"}, - "MyVaccinesAvailability": {"en": "MyVaccinesAvailability", "ar": "توفر لقاحي"}, + "CHECK_VACCINE_AVAILABILITY": { + "en": "CHECK VACCINE AVAILABILITY", + "ar": "تحقق من توافر اللقاح" + }, + "MyVaccinesAvailability": { + "en": "MyVaccinesAvailability", + "ar": "توفر لقاحي" + }, "PaymentService": {"en": "Payment Service", "ar": "خدمة المدفوعات"}, "PaymentOnline": {"en": "Service", "ar": "الالكتروني"}, "OnlineCheckIn": {"en": "Online Check-In", "ar": "مدفوعات معلقة"}, @@ -376,8 +505,14 @@ const Map localizedValues = { "DepositorName": {"en": "Depositor Name", "ar": "اسم المودع *"}, "MobileNumber": {"en": "Mobile Number", "ar": "رقم الجوال"}, "Ok": {"en": "Ok", "ar": "حسنا"}, - "TheVerificationCodeExpiresIn": {"en": "The Verification Code Expires In", "ar": "تنتهي صلاحية رمز التحقق في"}, - "PleaseEnterTheVerificationCode": {"en": "Please enter the verification code send to", "ar": "الرجاء إدخال رمز التحقق المرسل إلى"}, + "TheVerificationCodeExpiresIn": { + "en": "The Verification Code Expires In", + "ar": "تنتهي صلاحية رمز التحقق في" + }, + "PleaseEnterTheVerificationCode": { + "en": "Please enter the verification code send to", + "ar": "الرجاء إدخال رمز التحقق المرسل إلى" + }, "EyeMeasurements": {"en": "Eye Measurements", "ar": "قياسات النظر"}, "Measurements": {"en": "Measurements", "ar": "قياسات"}, "Classes": {"en": "Classes", "ar": "نظارات"}, @@ -400,8 +535,10 @@ const Map localizedValues = { "DailyQuantity": {"en": "Daily Quantity :", "ar": "جرعات يومية"}, "AddReminder": {"en": "Add Reminder", "ar": "إضافة تذكير"}, "reminderDes": { - "en": "Please select treatment start day and time to be notified when it\'s time to take the medicine", - "ar": " يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء" + "en": + "Please select treatment start day and time to be notified when it\'s time to take the medicine", + "ar": + " يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء" }, "StartDay": {"en": "Start Day", "ar": "يوم البداية"}, "EndDay": {"en": "End Day", "ar": "يوم الانتهاء"}, @@ -411,12 +548,24 @@ const Map localizedValues = { "DoctorResponses": {"en": "Doctor Responses", "ar": "ردود الأطباء"}, "New": {"en": "New", "ar": "جديد"}, "All": {"en": "All", "ar": "الكل"}, - "QuestionHere": {"en": "Enter the question here...", "ar": "اضف الاستفسار هنا"}, - "ViewDoctorResponses": {"en": "View Doctor Responses", "ar": "الاطلاع على ردود الأطباء"}, + "QuestionHere": { + "en": "Enter the question here...", + "ar": "اضف الاستفسار هنا" + }, + "ViewDoctorResponses": { + "en": "View Doctor Responses", + "ar": "الاطلاع على ردود الأطباء" + }, "ServiceInformationButton": {"en": "LOGIN / REGISTER", "ar": "دخول / تسجيل"}, - "ServiceInformationTitle": {"en": "Service Information", "ar": "معلومات الخدمة"}, + "ServiceInformationTitle": { + "en": "Service Information", + "ar": "معلومات الخدمة" + }, "ServiceInformation": {"en": "Service Information", "ar": "معلومات الخدمة"}, - "HomeHealthCare": {"en": "Home Health Care", "ar": " الرعاية الصحية المنزلية "}, + "HomeHealthCare": { + "en": "Home Health Care", + "ar": " الرعاية الصحية المنزلية " + }, "HomeHealthCareText": { "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.", @@ -426,26 +575,135 @@ const Map localizedValues = { "LoginRegister": {"en": "Login/Register", "ar": "دخول / تسجيل"}, "OrderLog": {"en": "Order Log", "ar": " سجل الطلبات"}, "info-lab": { - "en": "This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.", - "ar": "خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية." + "en": + "This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.", + "ar": + "خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية." }, "info-radiology": { - "en": "This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.", - "ar": "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل." + "en": + "This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.", + "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": " اكتب تقييمك"}, + "review": {"en": " reviews", "ar": " تقييمات"}, + "pendingOrder": {"en": " PENDING", "ar": " معلقة"}, + "deliveredOrder": {"en": " DELIVERED", "ar": " تم التوصيل"}, + "processingOrder": {"en": " PROCESSING", "ar": "قيد التنفيذ"}, + "cancelledOrder": {"en": " CANCELLED", "ar": "ملغي"}, + "compare": {"en": " Compare", "ar": "مقارنه"}, + "medicationsRefill": {"en": " Medication Refill", "ar": "طلب أعادة صرف"}, + "myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"}, + "quantity": {"en": " QTY ", "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 Details", "ar": " تفاصيل الطلب"}, + "orderSummary": {"en": "Order Summary", "ar": " تفاصيل المنتج"}, + "subtotal": {"en": "Subtotal", "ar": " المجموع الفرعي"}, + "shipping": {"en": "Shipping", "ar": " الشحن"}, + "shipBy": {"en": "SHIP BY:", "ar": "الشحن عن طريق:"}, + "lakumPoints": {"en": "Lakum Points", "ar": "نقاط لكم"}, + "use": {"en": "USE", "ar": "استخدم"}, + "proceedPay": {"en": "PROCEED TO PAY", "ar": "المتابعة للدفع"}, + "vat": {"en": "VAT (15%)", "ar": "(15%) القيمة المضافة"}, + "inclusiveVat": {"en": "(inclusive VAT)", "ar": "(شامل الضريبة)"}, + "items": {"en": "item(s)", "ar": "عنصر"}, + "checkOut": {"en": "CHECK OUT", "ar": "الدفع"}, + "sar": {"en": "SAR", "ar": " ر.س "}, + "payOnline": {"en": "PAY ONLINE", "ar": "اتمام عملية الدفع "}, + "cancelOrder": {"en": "CANCEL ORDER", "ar": "الغاء الطلب "}, + "confirmAddress": {"en": "CONFIRM ADDRESS ", "ar": " تأكيد العنوان "}, + "confirmLocation": {"en": "CONFIRM LOCATION ", "ar": " تأكيد الموقع "}, + "conditionsHMG": {"en": "Terms & Conditions ", "ar": "الشروط و الأحكام "}, + "conditions": {"en": "Terms & Conditions of Lakum", "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": {"en": "Before using the checkup, please read Terms of Service.", "ar": "قبل استخدام الفحص ، يرجى قراءة شروط الخدمة"}, - "accept": {"en": "I read and accept Terms of Service and Privacy Policy", "ar": "قرأت ووافقت على شروط الخدمة وسياسة الخصوصية"}, - "data-safe-info": {"en": "Information that you provide is anonymous and not shared with anyone.", "ar": "المعلومات التي تقدمها لا تتم مشاركتها مع أي شخص"}, + "Beforeusing": { + "en": "Before using the checkup, please read Terms of Service.", + "ar": "قبل استخدام الفحص ، يرجى قراءة شروط الخدمة" + }, + "accept": { + "en": "I read and accept Terms of Service and Privacy Policy", + "ar": "قرأت ووافقت على شروط الخدمة وسياسة الخصوصية" + }, + "data-safe-info": { + "en": + "Information that you provide is anonymous and not shared with anyone.", + "ar": "المعلومات التي تقدمها لا تتم مشاركتها مع أي شخص" + }, "data-safe": {"en": " Your data is safe.", "ar": "بياناتك آمنة"}, - "informational": {"en": "Checkup is for informational purposes and is not a qualified medical opinion", "ar": "الفحص هو لأغراض معلوماتية وليس رأي طبي مؤهل"}, - "not-use-in-emerbency": {"en": "Do not use in emergencies.", "ar": "لا تستخدم في حالات الطوارئ"}, - "not-use-in-emerbency-details": {"en": "In case of health emergency, ", "ar": "في حالة الطوارئ اتصل بأقرب رقم للطوارئ على الفور"}, - "not-use-in-emerbency-details-call": {"en": "call the nearest emergency number immediately", "ar": " اتصل بأقرب رقم للطوارئ على الفور"}, - "check-diagnosis": {"en": "Checkup is not a diagnosis.", "ar": "الفحص ليس تشخيص."}, + "informational": { + "en": + "Checkup is for informational purposes and is not a qualified medical opinion", + "ar": "الفحص هو لأغراض معلوماتية وليس رأي طبي مؤهل" + }, + "not-use-in-emerbency": { + "en": "Do not use in emergencies.", + "ar": "لا تستخدم في حالات الطوارئ" + }, + "not-use-in-emerbency-details": { + "en": "In case of health emergency, ", + "ar": "في حالة الطوارئ اتصل بأقرب رقم للطوارئ على الفور" + }, + "not-use-in-emerbency-details-call": { + "en": "call the nearest emergency number immediately", + "ar": " اتصل بأقرب رقم للطوارئ على الفور" + }, + "check-diagnosis": { + "en": "Checkup is not a diagnosis.", + "ar": "الفحص ليس تشخيص." + }, "remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"}, - "loginToUseService": {"en": "You need to login to use this service", "ar": "هذة الخدمة تتطلب تسجيل الدخول"}, + "loginToUseService": { + "en": "You need to login to use this service", + "ar": "هذة الخدمة تتطلب تسجيل الدخول" + }, // pharmacy module "medicationRefill": {"en": "MEDICATION REFILL", "ar": "إعادة تعبئة الدواء"}, @@ -456,12 +714,50 @@ 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": "حدد العمر"}, "i-am": {"en": "I am", "ar": "أنا"}, "years-old": {"en": "years old", "ar": "سنة"}, - "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, + "drag-point": { + "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.", + "ar": + "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة" + }, "email": {"en": "Email", "ar": "البريد الالكتروني"}, "Book": {"en": "Book", "ar": "احجز"}, "AppointmentLabel": {"en": "Appointment", "ar": "موعد"}, @@ -536,15 +832,19 @@ const Map localizedValues = { }, "info-allergies": { - "en": "This service allows you to view all types of allergies recorded during your visits to Al Habib Medical Group.", - "ar": "خدمة الحساسية: هذه الخدمة تمكنك من الاطلاع على جميع انواع الحساسية التي تم تسجيلها خلال زياراتك في مجموعة الحبيب الطبية." + "en": + "This service allows you to view all types of allergies recorded during your visits to Al Habib Medical Group.", + "ar": + "خدمة الحساسية: هذه الخدمة تمكنك من الاطلاع على جميع انواع الحساسية التي تم تسجيلها خلال زياراتك في مجموعة الحبيب الطبية." }, "sick-leaves": {"en": "Sick Leaves", "ar": "الاجازات المرضية"}, "info-sick-leaves": { - "en": "This service allows you to view all sick leaves that were taken in Al Habib Medical Group in addition to:", - "ar": "الاجازات المرضية: هذه الخدمة تمكنك من الاطلاع على جميع الاجازات المرضية والتي تم اصدارها في مجموعة الحبيب الطبية بالاضافة الى:" + "en": + "This service allows you to view all sick leaves that were taken in Al Habib Medical Group in addition to:", + "ar": + "الاجازات المرضية: هذه الخدمة تمكنك من الاطلاع على جميع الاجازات المرضية والتي تم اصدارها في مجموعة الحبيب الطبية بالاضافة الى:" }, "info-sick-leave-points": { "en": [ @@ -554,12 +854,20 @@ const Map localizedValues = { "Branch that patient take the vaccination form.", "Sending a report of vaccinations to the email. ", ], - "ar": ["اسم الطبيب", "تاريخ الاجازة.", "عدد ايام الاجازة.", "الفرع الذي تم اصدار الاجازة منه.", "ارسال نسخة مختومة من الاجازة الى البريد الالكتروني."] + "ar": [ + "اسم الطبيب", + "تاريخ الاجازة.", + "عدد ايام الاجازة.", + "الفرع الذي تم اصدار الاجازة منه.", + "ارسال نسخة مختومة من الاجازة الى البريد الالكتروني." + ] }, "info-approvals": { - "en": "This service allows you to view all approvals requests that have been sent to the insurance companies in addition to:", - "ar": "خدمة الموافقات: هذه الخدمة تمكنك من الاطلاع على جميع طلبات الموافقات والتي تم ارسالها الى شركات التامين بالاضافة الى:" + "en": + "This service allows you to view all approvals requests that have been sent to the insurance companies in addition to:", + "ar": + "خدمة الموافقات: هذه الخدمة تمكنك من الاطلاع على جميع طلبات الموافقات والتي تم ارسالها الى شركات التامين بالاضافة الى:" }, "info-approval-points": { @@ -577,18 +885,37 @@ const Map localizedValues = { "info-month-report": { "en": "Upon activation of this service, the system will send a monthly report automatically to the registered email which lists the vital signs and the results for the last visits made in AlHabib Medical Group.", - "ar": "خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية." + "ar": + "خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية." + }, + "language-setting": { + "en": "SMS and Confirmation Calls Language", + "ar": "لغة الرسائل القصيرة و الاتصال الآلي" }, - "language-setting": {"en": "SMS and Confirmation Calls Language", "ar": "لغة الرسائل القصيرة و الاتصال الآلي"}, "alert": {"en": "Alerts", "ar": "التنبيهات"}, - "email-alert": {"en": "Alert By Email", "ar": "استلام التنبيهات بالبريد الالكتروني"}, - "sms-alert": {"en": "Alert By SMS", "ar": "استلام التنبيهات بالرسائل القصيرة"}, + "email-alert": { + "en": "Alert By Email", + "ar": "استلام التنبيهات بالبريد الالكتروني" + }, + "sms-alert": { + "en": "Alert By SMS", + "ar": "استلام التنبيهات بالرسائل القصيرة" + }, "contact-info": {"en": "Contact Information", "ar": "معلومات التواصل"}, - "emrg-name": {"en": "Emergency Contact Name", "ar": "اسم للتواصل في حالة الطوارئ"}, - "emrg-no": {"en": "Emergency Contact Number", "ar": "رقم للتواصل في حالة الطوارئ"}, + "emrg-name": { + "en": "Emergency Contact Name", + "ar": "اسم للتواصل في حالة الطوارئ" + }, + "emrg-no": { + "en": "Emergency Contact Number", + "ar": "رقم للتواصل في حالة الطوارئ" + }, "modes": {"en": "Modes", "ar": "الاوضاع"}, "vibration": {"en": "Vibration Touch Feedback", "ar": "الاهتزاز عند اللمس"}, - "blind-modes": {"en": "Modes for Partially Blind", "ar": "تأثيرات لدعم ضعاف البصر"}, + "blind-modes": { + "en": "Modes for Partially Blind", + "ar": "تأثيرات لدعم ضعاف البصر" + }, "invert-theme": {"en": "Invert", "ar": "ألوان سلبية"}, "off-theme": {"en": "Off", "ar": "إيقاف"}, "dim-theme": {"en": "Dim", "ar": "ضوء خافت"}, @@ -605,8 +932,14 @@ const Map localizedValues = { "LiveChat": {"en": "Live Chat", "ar": "محادثة مباشرة"}, "Service": {"en": "Service", "ar": "خدمة"}, "HMGServiceLabel": {"en": "HMG Service", 'ar': 'خدمات الحبيب'}, - "HealthWeatherIndicators": {"en": "Health Weather Indicators", 'ar': ' مؤشرات الطقس الصحية '}, - "HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية على أساس الطقس الحالي '}, + "HealthWeatherIndicators": { + "en": "Health Weather Indicators", + 'ar': ' مؤشرات الطقس الصحية ' + }, + "HealthTipsBasedOnCurrentWeather": { + "en": "Health Tips Based On Current Weather", + 'ar': ' نصائح صحية على أساس الطقس الحالي ' + }, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, "ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"}, @@ -627,28 +960,41 @@ const Map localizedValues = { "send": {"en": "Send", "ar": "أرسل"}, "status": {"en": "Status", "ar": "الحالة"}, "like-to-hear": { - "en": "We would love to hear the feedback, concerns on healthcare services and eServices experience. Please use the below form", - "ar": "يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة" + "en": + "We would love to hear the feedback, concerns on healthcare services and eServices experience. Please use the below form", + "ar": + "يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة" }, "subject": {"en": "Subject", "ar": "الموضوع"}, "message": {"en": "Message", "ar": "رسالة"}, - "empty-subject": {"en": "Please enter the subject", "ar": "يرجى ادخال الموضوع"}, - "empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"}, + "empty-subject": { + "en": "Please enter the subject", + "ar": "يرجى ادخال الموضوع" + }, + "empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الرسالة"}, "select-attachment": {"en": "Select Attachment", "ar": "إختر المرفق"}, "complain-appo": {"en": "Complaint for appointment", "ar": "شكوى على موعد"}, - "complain-without-appo": {"en": "Complaint without appointment", "ar": "شكوى بدون موعد"}, + "complain-without-appo": { + "en": "Complaint without appointment", + "ar": "شكوى بدون موعد" + }, "question": {"en": "Question", "ar": "سؤال"}, "message-type": {"en": "Message Type", "ar": "نوع الرسالة"}, "compliment": {"en": "compliment", "ar": "ثناء"}, "suggestion": {"en": "Suggestion", "ar": "إقتراح"}, - "your-feedback": {"en": "Your feedback was sent", "ar": "إقتراح"}, - "select-part": {"en": "Please select the part that complain about", "ar": "يرجى تحديد الجزء الذي تشكو منه"}, + "your-feedback": {"en": "Your feedback was sent", "ar": "لقد تم ارسال اقراحك شكرا لك"}, + "select-part": { + "en": "Please select the part that complain about", + "ar": "يرجى تحديد الجزء الذي تشكو منه" + }, "number": {"en": "Number", "ar": "الرقم"}, "not-classified": {"en": "Not classified", "ar": "غير محدد"}, "selectClinic": {"en": "Select Clinic", "ar": " بحث بالعيادة"}, - "reviews": {"en": "Reviews", "ar": "تقييمات"}, - "searchItemError": {"en": "Item name should be more than 3 character ", "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف"}, - "YouCanFind": {"en": "YouCanFind", "ar": "باستطاعتك العثور على "}, + "searchItemError": { + "en": "Item name should be more than 3 character ", + "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف" + }, + "YouCanFind": {"en": "You Can Find ", "ar": "باستطاعتك العثور على "}, "ItemInSearch": {"en": " Item In Search", "ar": " عنصر في البحث "}, "wantConnectHmgNetwork": { "en": "Dear customer there is no internet access, Do you want to connect with HMG network to use our app, make sure you are in range of HMG network", @@ -656,4 +1002,451 @@ const Map localizedValues = { }, "failedToAccessHmgServices": {"en": "Connected with HMG Network,\n\nBut failed to access HMG services", "ar": "Connected with HMG Network,\n\nBut failed to access HMG services"}, "offerAndPackages": {"en": "Offers And Packages", "ar": "العروض والباقات"}, + "InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"}, + "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, + "GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"}, + "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, + + "value": {"en": "Value", "ar": "القيمة"}, + "range": {"en": "Range", "ar": "المدى"}, + "out-patient": {"en": "Out Patient", "ar": "عيادات خارجية"}, + "in-patient": {"en": "In Patient", "ar": "تنويم"}, + "report": {"en": "Radiology Report", "ar": "تقرير الاشعة"}, + "open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"}, + "send-copy": {"en": "Email the Report", "ar": "أرسل التقرير"}, + "appoSurvey": {"en": "Survey", "ar": "إستبيان"}, + "appoSurveySubtitle": {"en": "Survey", "ar": "إستبيان"}, + "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, + "doctorRating": {"en": "Doctor Rating", "ar": "تقييم الطبيب"}, + "good": {"en": "Good", "ar": "جيد"}, + "v-good": {"en": "Very Good", "ar": "جيد جدا"}, + "excellent": {"en": "Excellent", "ar": "ممتاز"}, + "average": {"en": "Average", "ar": "متوسط"}, + "below-average": {"en": "Below Average", "ar": "أقل من المتوسط"}, + "info-signs": { + "en": + "This service allows you to view all vital signs were performed in the Habib Medical Group, e.x (height, weight, body mass index, heart rate, etc.) as well shows some statistics charts.", + "ar": + "خدمة المؤشرات الحيوية: هذه الخدمة تمكنك من الاطلاع على جميع المؤشرات الحيوية على سبيل المثال (الطول، الوزن، مؤشر كتلة الجسم، معدل نبضات القلب الخ..) التي تمت في مجموعة الحبيب الطبية وكذلك رسوم بيانية على مستوى المؤشر." + }, + "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": "حدد طريقة النقل" + }, + "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": + "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." + }, + "update-succ": { + "en": "Successfully updated profile", + "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": "مكتمل"}, + + "request-medical-report": { + "en": "Request medical report", + "ar": "طلب تقرير طبي" + }, + "insur-cards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}, + 'labResult': {"en": "Lab results", "ar": "نتائج التحاليل المخبرية"}, + 'details': {'en': 'Details', 'ar': 'التفاصيل'}, + "age": {"en": "Age", "ar": "العمر"}, + "active-insurence": {"en": "Active", "ar": "نشطة"}, + "not-active": {"en": "Not Active", "ar": "غير نشط"}, + "card-detail": {"en": "Insurance Details", "ar": "منافعك التامينية"}, + "Dr": {"en": "Dr. ", "ar": "الدكتور."}, + "empty": {"en": "You do not have any records.", "ar": "ليس لديك أي سجلات"}, + "last-visit": { + "en": "How was your last visit with doctor?", + "ar": "كيف تقيم زيارتك الأخيرة للطبيب؟" + }, + "tap-title": {"en": "Please rate the doctor", "ar": "يرجى تقييم الطبيب"}, + "later": {"en": "Later", "ar": "لاحقاً"}, + "sendSuc": { + "en": "A copy has been sent to the email", + "ar": "تم إرسال نسخة إلى البريد الإلكتروني" + }, + "instructions": { + "en": + "You can now talk directly to the appointments department by chat or request a call back", + "ar": + "يمكنك الان التحدث مباشرة مع قسم المواعيد عن طريق خدمة المحادثة النصية أو طلب معاودة الاتصال" + }, + "instructions-pharmacies": { + "en": + "You can now talk directly to the pharmacist by chat or request a call back", + "ar": + "يمكنك الآن التحدث مباشرة إلى الصيدلي عن طريق الدردشة أو طلب معاودة الاتصال" + }, + "select-hospital": {"en": "Choose Hospital", "ar": "اختر المستشفى"}, + "start": {"en": "Start", "ar": "ابدأ"}, + "info-chat": { + "en": + "This service allows you to chat with customer service directly without the need to call.", + "ar": + "المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً." + }, + "last-appointment": { + "en": "How was your appointment?", + "ar": "كيف كان موعدك الطبي ؟" + }, + "rate-clinic": {"en": "Please rate the clinic", "ar": "يرجى تقييم العيادة"}, + "fetch-data": {"en": "Fetch Data", "ar": "تحديث الان"}, + "rate": {"en": "Rate", "ar": "تقييم"}, + "send-email": { + "en": "Send a copy of this report to the email", + "ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني" + }, + "update-email": {"en": "Update Email", "ar": "تحديث البريد الالكتروني"}, + "booked-success": { + "en": "The appointment has been successfully booked.", + "ar": "لقد تم حجز الموعد بنجاح" + }, + "appo-reminder-select-option-30": { + "en": "Before 30 Mins", + "ar": "قبل 30 دقيقة" + }, + "appo-reminder-select-option-60": { + "en": "Before 1 Hour", + "ar": "قبل ساعة واحدة" + }, + "appo-reminder-select-option-90": { + "en": "Before 1 Hour and 30 mins", + "ar": "قبل ساعة و 30 دقيقة" + }, + "appo-reminder-select-option-120": { + "en": "Before 2 Hours", + "ar": "قبل ساعتين" + }, + "noDataAvailable": { + "en": "No data available", + "ar": " لا يوجد بيانات متاحة " + }, + "thename": {"en": "The Name", "ar": "الاسم"}, + "noSearchResult": {"en": "No Search Result", "ar": "لا توجد نتيجة بحث"}, + "selectFileSouse": {"en": "Select file souse", "ar": "حدد الملف"}, + "gallery": {"en": "Gallery", "ar": "معرض الصور"}, + "camera": {"en": "Camera", "ar": "كاميرا"}, + "med-report": { + "en": "Medical Reports", + "ar": "التقارير الطبية" + }, + "new-med-report": { + "en": "Requests", + "ar": "الطلبات" + }, + "requestReport":{ + "en":"Request a report", + "ar":" طلب تقرير" + }, + "confirm-msg-report": { + "en": "Request for medical report?", + "ar": "طلب تقرير طبي؟" + }, + "successSendReport": { + "en": "The request has been submitted successfully", + "ar": "تم تنفيذ طلبك بنجاح" + }, + "pulseTitle": { + "en": "Heart rate", + "ar": "معدل النبض بالدقيقة" + }, + "systolic-lng": { + "en": "Systolic", + "ar": "الإنقباض" + }, + "diastolic-lng": { + "en": "Diastolic", + "ar": "الإنبساط" + }, + "policy-holder": { + "en": "Policy Holder", + "ar": "حامل بطاقة التأمين" + }, + "policy-no": { + "en": "Policy Number", + "ar": "رقم سياسات" + }, + "agree": { + "en": "I agree, this is the correct information", + "ar": "موافق، هذه المعلومات صحيحة" + }, + "disagree": { + "en": "No, this is not the correct information", + "ar": "غير موافق، هذه المعلومات غير الصحيحة" + }, + "expiry-date": { + "en": "Expiry Date", + "ar": "تاريخ انتهاء الصلاحية" + }, + "class": { + "en": "Class", + "ar": "فئة" + }, + "approval": { + "en": "Approval", + "ar": "موافقة" + }, + "no-data": { + "en": "No data found", + "ar": "لاتوجد بيانات" + }, + "insurance-details": { + "en": "Insurance Details", + "ar": "تفاصيل التأمين" + }, + "nearest-hospital": { + "en": "Nearest Hospital", + "ar": "أقرب مستشفى" + }, + "request-sent": { + "en": "Request sent successfully", + "ar": "تم إرسال الطلب بنجاح" + }, + "message-sent": { + "en": "Message sent successfully", + "ar": "تم إرسال الرسالة بنجاح" + }, + "sent-on": { + "en": "Sent on", + "ar": "أرسلت في" + }, + "attach-insurace-image": { + "en": "Attach insurance card image", + "ar": "إرفاق صورة بطاقة التأمين" + }, + "upload-without-image": { + "en": "You can still submit, if you don't have Insurance Image", + "ar": "لا يزال بإمكانك الإرسال ، إذا لم يكن لديك صورة تأمين" + }, + "info-insur-cards": { + "en": "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", + "ar": "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" + }, + "scan-now": { + "en": "If you have a card / Document Scan now", + "ar": "إذا كانت لديك بطاقة / مستند ارفقها الان" + }, + "liveCare": { + "en": "Live Care", + "ar": "لايف كير" + }, + "topBrands":{ + "en":"Top Brands", + "ar":"اعلى العلامات التجارية" + }, + + "notifyMe":{ + "en":"notify me", + "ar":"اعلمني" + }, + "specification":{ + "en":"Specification", + "ar":"تخصيص" + }, + + "availability":{ + "en":"Availability", + "ar":"التوفر" + }, + + "quantitySize":{ + "en":"Quantity", + "ar":"كميه" + }, + "addToCart":{ + "en":"add to cart", + "ar":"إضفة للسلة" + }, + "buyNow":{ + "en":"buy now", + "ar":"إشتري الان" + }, + "quantityShortcut":{ + "en":"QTY", + "ar":"كمية" + }, + + + "pharmacyServiceTermsCondition": { + "en": "I agree with the terms of service and I adhere to them unconditionally", + "ar": " أوافق على شروط الخدمة وألتزم بها دون قيد أو شرط" + }, + "Year": {"en": "YEAR", "ar": "السنة"}, + "Month": {"en": "MONTH", "ar": "الشهر"}, + "point": {"en": "POINT", "ar": "النقاط"}, + "riyal": {"en": "RIYAL", "ar": "الريال"}, + "termOfService": {"en": "Terms of service", "ar": "شروط الخدمة"}, + "shoppingCart": {"en": "Shopping Cart", "ar": "عربة التسوق"}, + + "referralStatus": {"en": "Referral Status", "ar": "حالة الإحالة"}, + "referralDate": {"en": "Referral Date", "ar": "تاريخ الإحالة"}, + "patientName": {"en": "Patient Name", "ar": "اسم المريض"}, + "referralNumber": {"en": "Referral Number", "ar": "رقم الإحالة"}, + "requestID": {"en": "Request ID", "ar": " رقم الطلب"}, + "OrderStatus": {"en": "Status", "ar": "الحاله"}, + "pickupDate": {"en": "Pickup Date", "ar": "التاريخ"}, + "serviceName": {"en": "Service Name", "ar": " اسم الخدمة"}, + "orderLocation": {"en": "Location", "ar": "الموقع"}, + "selectService": {"en": "Select Service", "ar": "حدد الخدمة"}, + "coveredService": {"en": "Covered Service : ", "ar": " الخدمات المغطاة : "}, + "selectedService": { + "en": "Selected Service : ", + "ar": " الخدمات المختارة : " + }, + "cancelOrderMsg": { + "en": "Are you sure!! want to cancel this order", + "ar": "هل أنت واثق!! تريد إلغاء هذا الطلب" + }, + "processDoneSuccessfully": { + "en": "Process Done Successfully", + "ar": "تمت العملية بنجاح" + }, + "selectHomeHealthCareServices": { + "en": "Select Home Health Care Services", + "ar": " حدد خدمات الرعاية الصحية المنزلية" + }, + "description-vaccination": {"en": "Description", "ar": "وصف"}, + "due-date": {"en": "Due date", "ar": "تاريخ الاستحقاق"}, + "valid-email": { + "en": "Please enter valid email", + "ar": "الرجاء إدخال عنوان بريد صحيح" + }, + "confirm-send": { + "en": "Send the child's schedule to the email?", + "ar": "ارسال جدول التطعيمات الى بريدك الالكتروني؟" + }, + "vaccination": {"en": "Vaccination", "ar": "جدول التطعيمات"}, + "welcomeBack": {"en": "Welcome back", "ar": "مرحبا مرة أخرى"}, + + "updated-email": { + "en": "Updated email successfully", + "ar": "تم تحديث البريد الالكتروني" + }, + + "view-list-children": { + "en": "View List of Children", + "ar": "عرض قائمة الأطفال" + }, }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 30d866de..458040bb 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -21,3 +21,8 @@ const THEME_VALUE = 'is_vibration'; const MAIN_USER = 'main-user'; const PHARMACY_LAST_VISITED_PRODUCTS = 'last-visited'; const HMG_GEOFENCES = 'hmg-geo-fences'; +const PHARMACY_CUSTOMER_ID = 'costumer-id'; +const WEATHER = 'weather'; +const BLOOD_TYPE = 'blood-type'; +const NOTIFICATION_COUNT = 'notification-count'; +const PHARMACY_SELECTED_ADDRESS = 'selected-address'; diff --git a/lib/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart new file mode 100644 index 00000000..438f1630 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart @@ -0,0 +1,76 @@ +class GetAllProjectsResponseModel { + String desciption; + Null desciptionN; + int iD; + String legalName; + String legalNameN; + String name; + Null nameN; + String phoneNumber; + String setupID; + int distanceInKilometers; + bool isActive; + String latitude; + String longitude; + int mainProjectID; + Null projectOutSA; + bool usingInDoctorApp; + + GetAllProjectsResponseModel( + {this.desciption, + this.desciptionN, + this.iD, + this.legalName, + this.legalNameN, + this.name, + this.nameN, + this.phoneNumber, + this.setupID, + this.distanceInKilometers, + this.isActive, + this.latitude, + this.longitude, + this.mainProjectID, + this.projectOutSA, + this.usingInDoctorApp}); + + GetAllProjectsResponseModel.fromJson(Map json) { + desciption = json['Desciption']; + desciptionN = json['DesciptionN']; + iD = json['ID']; + legalName = json['LegalName']; + legalNameN = json['LegalNameN']; + name = json['Name']; + nameN = json['NameN']; + phoneNumber = json['PhoneNumber']; + setupID = json['SetupID']; + distanceInKilometers = json['DistanceInKilometers']; + isActive = json['IsActive']; + latitude = json['Latitude']; + longitude = json['Longitude']; + mainProjectID = json['MainProjectID']; + projectOutSA = json['ProjectOutSA']; + usingInDoctorApp = json['UsingInDoctorApp']; + } + + Map toJson() { + final Map data = new Map(); + data['Desciption'] = this.desciption; + data['DesciptionN'] = this.desciptionN; + data['ID'] = this.iD; + data['LegalName'] = this.legalName; + data['LegalNameN'] = this.legalNameN; + data['Name'] = this.name; + data['NameN'] = this.nameN; + data['PhoneNumber'] = this.phoneNumber; + data['SetupID'] = this.setupID; + data['DistanceInKilometers'] = this.distanceInKilometers; + data['IsActive'] = this.isActive; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['MainProjectID'] = this.mainProjectID; + data['ProjectOutSA'] = this.projectOutSA; + data['UsingInDoctorApp'] = this.usingInDoctorApp; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/EReferral/get_ereferral_response_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_ereferral_response_model.dart new file mode 100644 index 00000000..e873261d --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/EReferral/get_ereferral_response_model.dart @@ -0,0 +1,128 @@ +class GetEReferralResponseModel { + dynamic acceptedBrachCode; + dynamic acceptedBranchName; + dynamic acceptedBranchNameAr; + Channel channel; + dynamic identityCardAttachment; + String identityNumber; + dynamic insuranceCardAttachment; + bool isInsuredPatient; + String otherRelationship; + String patientContactNo; + int patientId; + String patientName; + int preferredBranchCode; + String preferredBranchName; + String referralDate; + int referralNumber; + Channel relationshipType; + String requesterContactNo; + String requesterName; + String status; + String statusAr; + + GetEReferralResponseModel( + {this.acceptedBrachCode, + this.acceptedBranchName, + this.acceptedBranchNameAr, + this.channel, + this.identityCardAttachment, + this.identityNumber, + this.insuranceCardAttachment, + this.isInsuredPatient, + this.otherRelationship, + this.patientContactNo, + this.patientId, + this.patientName, + this.preferredBranchCode, + this.preferredBranchName, + this.referralDate, + this.referralNumber, + this.relationshipType, + this.requesterContactNo, + this.requesterName, + this.status, + this.statusAr}); + + GetEReferralResponseModel.fromJson(Map json) { + acceptedBrachCode = json['AcceptedBrachCode']; + acceptedBranchName = json['AcceptedBranchName']; + acceptedBranchNameAr = json['AcceptedBranchNameAr']; + channel = + json['Channel'] != null ? new Channel.fromJson(json['Channel']) : null; + identityCardAttachment = json['IdentityCardAttachment']; + identityNumber = json['IdentityNumber']; + insuranceCardAttachment = json['InsuranceCardAttachment']; + isInsuredPatient = json['IsInsuredPatient']; + otherRelationship = json['OtherRelationship']; + patientContactNo = json['PatientContactNo']; + patientId = json['PatientId']; + patientName = json['PatientName']; + preferredBranchCode = json['PreferredBranchCode']; + preferredBranchName = json['PreferredBranchName']; + referralDate = json['ReferralDate']; + referralNumber = json['ReferralNumber']; + relationshipType = json['RelationshipType'] != null + ? new Channel.fromJson(json['RelationshipType']) + : null; + requesterContactNo = json['RequesterContactNo']; + requesterName = json['RequesterName']; + status = json['Status']; + statusAr = json['StatusAr']; + } + + Map toJson() { + final Map data = new Map(); + data['AcceptedBrachCode'] = this.acceptedBrachCode; + data['AcceptedBranchName'] = this.acceptedBranchName; + data['AcceptedBranchNameAr'] = this.acceptedBranchNameAr; + if (this.channel != null) { + data['Channel'] = this.channel.toJson(); + } + data['IdentityCardAttachment'] = this.identityCardAttachment; + data['IdentityNumber'] = this.identityNumber; + data['InsuranceCardAttachment'] = this.insuranceCardAttachment; + data['IsInsuredPatient'] = this.isInsuredPatient; + data['OtherRelationship'] = this.otherRelationship; + data['PatientContactNo'] = this.patientContactNo; + data['PatientId'] = this.patientId; + data['PatientName'] = this.patientName; + data['PreferredBranchCode'] = this.preferredBranchCode; + data['PreferredBranchName'] = this.preferredBranchName; + data['ReferralDate'] = this.referralDate; + data['ReferralNumber'] = this.referralNumber; + if (this.relationshipType != null) { + data['RelationshipType'] = this.relationshipType.toJson(); + } + data['RequesterContactNo'] = this.requesterContactNo; + data['RequesterName'] = this.requesterName; + data['Status'] = this.status; + data['StatusAr'] = this.statusAr; + return data; + } +} + +class Channel { + int iD; + String text; + String textAr; + String textEn; + + Channel({this.iD, this.text, this.textAr, this.textEn}); + + Channel.fromJson(Map json) { + iD = json['ID']; + text = json['Text']; + textAr = json['Text_Ar']; + textEn = json['Text_En']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['Text'] = this.text; + data['Text_Ar'] = this.textAr; + data['Text_En'] = this.textEn; + return data; + } +} diff --git a/lib/core/model/ImagesInfo.dart b/lib/core/model/ImagesInfo.dart new file mode 100644 index 00000000..5ab48fb3 --- /dev/null +++ b/lib/core/model/ImagesInfo.dart @@ -0,0 +1,6 @@ +class ImagesInfo { + final String imageAr; + final String imageEn; + + ImagesInfo({this.imageAr, this.imageEn}); +} diff --git a/lib/core/model/insurance/Insurance_card_details.dart b/lib/core/model/insurance/Insurance_card_details.dart new file mode 100644 index 00000000..ddc33b2e --- /dev/null +++ b/lib/core/model/insurance/Insurance_card_details.dart @@ -0,0 +1,88 @@ +class InsuranceCardDetailsModel { + int approvalLimit; + int companyGroupID; + String companyName; + String companyRemarks; + String dOB; + int deductible; + String effectiveFrom; + String effectiveTo; + String eligabilityFailureReason; + bool isMemberEligible; + String memberID; + String memberName; + String memberStatus; + dynamic message; + String nationalId; + String policyNumber; + String responseMessage; + String room; + String subCategory; + + InsuranceCardDetailsModel( + {this.approvalLimit, + this.companyGroupID, + this.companyName, + this.companyRemarks, + this.dOB, + this.deductible, + this.effectiveFrom, + this.effectiveTo, + this.eligabilityFailureReason, + this.isMemberEligible, + this.memberID, + this.memberName, + this.memberStatus, + this.message, + this.nationalId, + this.policyNumber, + this.responseMessage, + this.room, + this.subCategory}); + + InsuranceCardDetailsModel.fromJson(Map json) { + approvalLimit = json['ApprovalLimit']; + companyGroupID = json['CompanyGroupID']; + companyName = json['CompanyName']; + companyRemarks = json['CompanyRemarks']; + dOB = json['DOB']; + deductible = json['Deductible']; + effectiveFrom = json['EffectiveFrom']; + effectiveTo = json['EffectiveTo']; + eligabilityFailureReason = json['EligabilityFailureReason']; + isMemberEligible = json['IsMemberEligible']; + memberID = json['MemberID']; + memberName = json['MemberName']; + memberStatus = json['MemberStatus']; + message = json['Message']; + nationalId = json['NationalId']; + policyNumber = json['PolicyNumber']; + responseMessage = json['ResponseMessage']; + room = json['Room']; + subCategory = json['SubCategory']; + } + + Map toJson() { + final Map data = new Map(); + data['ApprovalLimit'] = this.approvalLimit; + data['CompanyGroupID'] = this.companyGroupID; + data['CompanyName'] = this.companyName; + data['CompanyRemarks'] = this.companyRemarks; + data['DOB'] = this.dOB; + data['Deductible'] = this.deductible; + data['EffectiveFrom'] = this.effectiveFrom; + data['EffectiveTo'] = this.effectiveTo; + data['EligabilityFailureReason'] = this.eligabilityFailureReason; + data['IsMemberEligible'] = this.isMemberEligible; + data['MemberID'] = this.memberID; + data['MemberName'] = this.memberName; + data['MemberStatus'] = this.memberStatus; + data['Message'] = this.message; + data['NationalId'] = this.nationalId; + data['PolicyNumber'] = this.policyNumber; + data['ResponseMessage'] = this.responseMessage; + data['Room'] = this.room; + data['SubCategory'] = this.subCategory; + return data; + } +} diff --git a/lib/core/model/insurance/insurance_card_update.dart b/lib/core/model/insurance/insurance_card_update_model.dart similarity index 100% rename from lib/core/model/insurance/insurance_card_update.dart rename to lib/core/model/insurance/insurance_card_update_model.dart diff --git a/lib/core/model/labs/LabOrderResult.dart b/lib/core/model/labs/LabOrderResult.dart new file mode 100644 index 00000000..ecb4ae65 --- /dev/null +++ b/lib/core/model/labs/LabOrderResult.dart @@ -0,0 +1,88 @@ +class LabOrderResult { + String description; + dynamic femaleInterpretativeData; + int gender; + int lineItemNo; + dynamic maleInterpretativeData; + dynamic notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + dynamic superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + String verifiedOnDateTime; + + LabOrderResult( + {this.description, + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); + + LabOrderResult.fromJson(Map json) { + description = json['Description']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + gender = json['Gender']; + lineItemNo = json['LineItemNo']; + maleInterpretativeData = json['MaleInterpretativeData']; + notes = json['Notes']; + packageID = json['PackageID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + referanceRange = json['ReferanceRange']; + resultValue = json['ResultValue']; + sampleCollectedOn = json['SampleCollectedOn']; + sampleReceivedOn = json['SampleReceivedOn']; + setupID = json['SetupID']; + superVerifiedOn = json['SuperVerifiedOn']; + testCode = json['TestCode']; + uOM = json['UOM']; + verifiedOn = json['VerifiedOn']; + verifiedOnDateTime = json['VerifiedOnDateTime']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Gender'] = this.gender; + data['LineItemNo'] = this.lineItemNo; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['Notes'] = this.notes; + data['PackageID'] = this.packageID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ReferanceRange'] = this.referanceRange; + data['ResultValue'] = this.resultValue; + data['SampleCollectedOn'] = this.sampleCollectedOn; + data['SampleReceivedOn'] = this.sampleReceivedOn; + data['SetupID'] = this.setupID; + data['SuperVerifiedOn'] = this.superVerifiedOn; + data['TestCode'] = this.testCode; + data['UOM'] = this.uOM; + data['VerifiedOn'] = this.verifiedOn; + data['VerifiedOnDateTime'] = this.verifiedOnDateTime; + return data; + } +} diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index c9acd809..2deb13f3 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -1,9 +1,9 @@ class LabResult { String description; - Null femaleInterpretativeData; + dynamic femaleInterpretativeData; int gender; int lineItemNo; - Null maleInterpretativeData; + dynamic maleInterpretativeData; String notes; String packageID; int patientID; @@ -13,11 +13,11 @@ class LabResult { String sampleCollectedOn; String sampleReceivedOn; String setupID; - Null superVerifiedOn; + dynamic superVerifiedOn; String testCode; String uOM; String verifiedOn; - Null verifiedOnDateTime; + dynamic verifiedOnDateTime; LabResult( {this.description, @@ -92,8 +92,7 @@ class LabResultList { String filterName = ""; List patientLabResultList = List(); - LabResultList( - {this.filterName, LabResult lab}) { + LabResultList({this.filterName, LabResult lab}) { patientLabResultList.add(lab); } } diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index 26daaff0..3c49b80a 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -34,7 +34,7 @@ class PatientLabOrders { String qR; String setupID; List speciality; - + bool isLiveCareAppointment; PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -68,7 +68,7 @@ class PatientLabOrders { this.projectNameN, this.qR, this.setupID, - this.speciality}); + this.speciality,this.isLiveCareAppointment}); PatientLabOrders.fromJson(Map json) { actualDoctorRate = json['ActualDoctorRate']; @@ -103,6 +103,7 @@ class PatientLabOrders { projectNameN = json['ProjectNameN']; qR = json['QR']; setupID = json['SetupID']; + isLiveCareAppointment = json['IsLiveCareAppointment']; // speciality = json['Speciality'].cast(); } @@ -141,6 +142,7 @@ class PatientLabOrders { data['QR'] = this.qR; data['SetupID'] = this.setupID; data['Speciality'] = this.speciality; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; return data; } } diff --git a/lib/core/model/pharmacies/Addresses.dart b/lib/core/model/pharmacies/Addresses.dart index 74d5a591..b00b1a17 100644 --- a/lib/core/model/pharmacies/Addresses.dart +++ b/lib/core/model/pharmacies/Addresses.dart @@ -17,6 +17,7 @@ class Addresses { String createdOnUtc; String province; String latLong; + bool isChecked; Addresses( {this.id, @@ -36,7 +37,8 @@ class Addresses { this.customerAttributes, this.createdOnUtc, this.province, - this.latLong}); + this.latLong, + this.isChecked = false}); Addresses.fromJson(Map json) { id = json['id']; @@ -57,6 +59,7 @@ class Addresses { createdOnUtc = json['created_on_utc']; province = json['province']; latLong = json['lat_long']; + isChecked = json['isChecked']; } Map toJson() { @@ -79,6 +82,7 @@ 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 new file mode 100644 index 00000000..765ac54d --- /dev/null +++ b/lib/core/model/pharmacies/BillingAddress.dart @@ -0,0 +1,84 @@ +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/Country.dart b/lib/core/model/pharmacies/Country.dart new file mode 100644 index 00000000..77f519d3 --- /dev/null +++ b/lib/core/model/pharmacies/Country.dart @@ -0,0 +1,32 @@ +class CountryData { + int id; + String name; + String namen; + String twoLetterIsoCode; + String threeLetterIsoCode; + + CountryData( + {this.id, + this.name, + this.namen, + this.twoLetterIsoCode, + this.threeLetterIsoCode}); + + CountryData.fromJson(Map json) { + id = json['id']; + name = json['name']; + namen = json['namen']; + twoLetterIsoCode = json['two_letter_iso_code']; + threeLetterIsoCode = json['three_letter_iso_code']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['namen'] = this.namen; + data['two_letter_iso_code'] = this.twoLetterIsoCode; + data['three_letter_iso_code'] = this.threeLetterIsoCode; + return data; + } +} diff --git a/lib/core/model/pharmacies/Customer.dart b/lib/core/model/pharmacies/Customer.dart index a5311489..e3defbbe 100644 --- a/lib/core/model/pharmacies/Customer.dart +++ b/lib/core/model/pharmacies/Customer.dart @@ -1,4 +1,10 @@ +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; @@ -8,8 +14,6 @@ class Customer { String phone; String countryCode; String yahalaAccountno; - String billingAddress; - String shippingAddress; String id; String username; String email; @@ -17,50 +21,63 @@ class Customer { String lastName; String languageId; String adminComment; - String isTaxExempt; - String hasShoppingCartItems; - String active; - String deleted; - String isSystemAccount; + bool isTaxExempt; + bool hasShoppingCartItems; + bool active; + bool deleted; + bool isSystemAccount; String systemName; String lastIpAddress; String createdOnUtc; String lastLoginDateUtc; String lastActivityDateUtc; - String registeredInStoreId; + int registeredInStoreId; Customer( - {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}); + {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}); 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']; @@ -70,8 +87,6 @@ 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']; @@ -94,6 +109,15 @@ 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; @@ -103,8 +127,6 @@ 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; @@ -125,4 +147,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 new file mode 100644 index 00000000..4f1d0455 --- /dev/null +++ b/lib/core/model/pharmacies/LacumAccountInformation.dart @@ -0,0 +1,1926 @@ +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 new file mode 100644 index 00000000..c609fa0b --- /dev/null +++ b/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart @@ -0,0 +1,179 @@ +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; + dynamic waitingPoints; + dynamic loyalityAmount; + dynamic 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 new file mode 100644 index 00000000..4237e304 --- /dev/null +++ b/lib/core/model/pharmacies/ListUserAgreement.dart @@ -0,0 +1,28 @@ +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 new file mode 100644 index 00000000..db9c20ae --- /dev/null +++ b/lib/core/model/pharmacies/PharmacyAddressesModel.dart @@ -0,0 +1,170 @@ + +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 cd461ae5..c472cb4c 100644 --- a/lib/core/model/pharmacies/PharmacyProduct.dart +++ b/lib/core/model/pharmacies/PharmacyProduct.dart @@ -1,149 +1,538 @@ +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.images, + this.attributes, + this.specifications, + this.associatedProductIds, + this.tags, + this.vendorId, + this.seName}); PharmacyProduct.fromJson(Map json) { - 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); + 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)); + }); } + 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; - if (this.discountIds != String) { + 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) { data['discount_ids'] = this.discountIds.map((v) => v).toList(); } - if (this.reviews != String) { + if (this.storeIds != null) { + data['store_ids'] = this.storeIds.map((v) => v).toList(); + } + data['manufacturer_ids'] = this.manufacturerIds; + if (this.reviews != null) { data['reviews'] = this.reviews.map((v) => v.toJson()).toList(); } - if (this.images != String) { + if (this.images != null) { 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 new file mode 100644 index 00000000..71cf3498 --- /dev/null +++ b/lib/core/model/pharmacies/PointsAmountPerMonth.dart @@ -0,0 +1,42 @@ +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 new file mode 100644 index 00000000..eef74064 --- /dev/null +++ b/lib/core/model/pharmacies/PointsAmountPerYear.dart @@ -0,0 +1,38 @@ +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 new file mode 100644 index 00000000..e78e87b7 --- /dev/null +++ b/lib/core/model/pharmacies/PointsAmountPerday.dart @@ -0,0 +1,42 @@ +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 new file mode 100644 index 00000000..7b342af9 --- /dev/null +++ b/lib/core/model/pharmacies/PointsDetails.dart @@ -0,0 +1,57 @@ +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 new file mode 100644 index 00000000..1b589537 --- /dev/null +++ b/lib/core/model/pharmacies/ShippingOption.dart @@ -0,0 +1,97 @@ +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 new file mode 100644 index 00000000..f965203a --- /dev/null +++ b/lib/core/model/pharmacies/ShoppingCart.dart @@ -0,0 +1,115 @@ +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 new file mode 100644 index 00000000..96b751ae --- /dev/null +++ b/lib/core/model/pharmacies/ShoppingCartResponse.dart @@ -0,0 +1,55 @@ +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 new file mode 100644 index 00000000..f227de69 --- /dev/null +++ b/lib/core/model/pharmacies/Specifications.dart @@ -0,0 +1,36 @@ +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 new file mode 100644 index 00000000..027d1f81 --- /dev/null +++ b/lib/core/model/pharmacies/order_model.dart @@ -0,0 +1,1456 @@ + +import 'dart:convert'; + +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; + +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) => PharmacyImageObject.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, + }; +} + +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 new file mode 100644 index 00000000..dd9e0e54 --- /dev/null +++ b/lib/core/model/pharmacies/payment-checkout-data.dart @@ -0,0 +1,21 @@ +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 new file mode 100644 index 00000000..03cd689e --- /dev/null +++ b/lib/core/model/pharmacy/brands_model.dart @@ -0,0 +1,24 @@ +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 new file mode 100644 index 00000000..82c5b55f --- /dev/null +++ b/lib/core/model/pharmacy/categorise_parent_model.dart @@ -0,0 +1,75 @@ +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 new file mode 100644 index 00000000..52ab1d2d --- /dev/null +++ b/lib/core/model/pharmacy/final_products_model.dart @@ -0,0 +1,184 @@ +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 new file mode 100644 index 00000000..f41b731b --- /dev/null +++ b/lib/core/model/pharmacy/offer_products_model.dart @@ -0,0 +1,579 @@ +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 new file mode 100644 index 00000000..3add1d3d --- /dev/null +++ b/lib/core/model/pharmacy/offers_model.dart @@ -0,0 +1,175 @@ +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 new file mode 100644 index 00000000..55495416 --- /dev/null +++ b/lib/core/model/pharmacy/parent_products_model.dart @@ -0,0 +1,566 @@ +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 new file mode 100644 index 00000000..33ac26f1 --- /dev/null +++ b/lib/core/model/pharmacy/pharmacy_categorise.dart @@ -0,0 +1,103 @@ +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 new file mode 100644 index 00000000..71e25e8d --- /dev/null +++ b/lib/core/model/pharmacy/scan_qr_model.dart @@ -0,0 +1,584 @@ +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 new file mode 100644 index 00000000..916ec023 --- /dev/null +++ b/lib/core/model/pharmacy/sub_categories_model.dart @@ -0,0 +1,75 @@ +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 new file mode 100644 index 00000000..6e8964c9 --- /dev/null +++ b/lib/core/model/pharmacy/sub_products_model.dart @@ -0,0 +1,562 @@ +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/prescriptions/Prescriptions.dart b/lib/core/model/prescriptions/Prescriptions.dart index 1362f1c2..0169010f 100644 --- a/lib/core/model/prescriptions/Prescriptions.dart +++ b/lib/core/model/prescriptions/Prescriptions.dart @@ -27,6 +27,7 @@ class Prescriptions { bool isDoctorAllowVedioCall; bool isExecludeDoctor; bool isInOutPatient; + bool isLiveCareAppointment; String isInOutPatientDescription; String isInOutPatientDescriptionN; bool isInsurancePatient; @@ -68,7 +69,7 @@ class Prescriptions { this.nationalityFlagURL, this.noOfPatientsRate, this.qR, - this.speciality}); + this.speciality,this.isLiveCareAppointment}); Prescriptions.fromJson(Map json) { setupID = json['SetupID']; @@ -103,6 +104,7 @@ class Prescriptions { nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; qR = json['QR']; + isLiveCareAppointment = json['IsLiveCareAppointment']; // speciality = json['Speciality'].cast(); } @@ -141,6 +143,7 @@ class Prescriptions { data['NoOfPatientsRate'] = this.noOfPatientsRate; data['QR'] = this.qR; data['Speciality'] = this.speciality; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; return data; } } diff --git a/lib/core/model/privilege/PrivilegeModel.dart b/lib/core/model/privilege/PrivilegeModel.dart new file mode 100644 index 00000000..3b629fde --- /dev/null +++ b/lib/core/model/privilege/PrivilegeModel.dart @@ -0,0 +1,24 @@ +class PrivilegeModel { + int iD; + String serviceName; + bool privilege; + dynamic region; + + PrivilegeModel({this.iD, this.serviceName, this.privilege, this.region}); + + PrivilegeModel.fromJson(Map json) { + iD = json['ID']; + serviceName = json['ServiceName']; + privilege = json['Previlege']; + region = json['Region']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['ServiceName'] = this.serviceName; + data['Previlege'] = this.privilege; + data['Region'] = this.region; + return data; + } +} diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 2efe4481..ed47b51d 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -41,6 +41,7 @@ class FinalRadiology { List speciality; bool isCVI; bool isRadMedicalReport; + bool isLiveCareAppointment; FinalRadiology( {this.setupID, @@ -82,7 +83,7 @@ class FinalRadiology { this.reportDataTextString, this.speciality, this.isCVI, - this.isRadMedicalReport}); + this.isRadMedicalReport,this.isLiveCareAppointment}); FinalRadiology.fromJson(Map json) { try { @@ -121,11 +122,13 @@ class FinalRadiology { orderNo = json['OrderNo']; projectName = json['ProjectName']; qR = json['QR']; + isLiveCareAppointment = json['IsLiveCareAppointment']; reportDataHTML = json['ReportDataHTML']; reportDataTextString = json['ReportDataTextString']; // speciality = json['Speciality'].cast(); isCVI = json['isCVI']; isRadMedicalReport = json['isRadMedicalReport']; + } catch (e) { print(e); } diff --git a/lib/core/model/search_products_model.dart b/lib/core/model/search_products_model.dart new file mode 100644 index 00000000..d63fd4b0 --- /dev/null +++ b/lib/core/model/search_products_model.dart @@ -0,0 +1,185 @@ +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/model/sick_leave/sick_leave.dart b/lib/core/model/sick_leave/sick_leave.dart index ff73e1da..6811a552 100644 --- a/lib/core/model/sick_leave/sick_leave.dart +++ b/lib/core/model/sick_leave/sick_leave.dart @@ -32,6 +32,7 @@ class SickLeave { String projectName; String qR; List speciality; + bool isLiveCareAppointment; SickLeave( {this.setupID, @@ -64,7 +65,7 @@ class SickLeave { this.patientName, this.projectName, this.qR, - this.speciality}); + this.speciality,this.isLiveCareAppointment}); SickLeave.fromJson(Map json) { setupID = json['SetupID']; @@ -97,6 +98,7 @@ class SickLeave { patientName = json['PatientName']; projectName = json['ProjectName']; qR = json['QR']; + isLiveCareAppointment = json['IsLiveCareAppointment']; if(json['Speciality']!=null) speciality = json['Speciality'].cast(); } diff --git a/lib/core/model/weahter/weather_model.dart b/lib/core/model/weahter/weather_model.dart new file mode 100644 index 00000000..37ee5983 --- /dev/null +++ b/lib/core/model/weahter/weather_model.dart @@ -0,0 +1,267 @@ +class WeatherIndicatorModel { + Null date; + int languageID; + int serviceName; + Null time; + Null androidLink; + Null authenticationTokenID; + Null data; + bool dataw; + int dietType; + Null errorCode; + Null errorEndUserMessage; + Null errorEndUserMessageN; + Null errorMessage; + int errorType; + int foodCategory; + Null iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + Null patientBlodType; + Null successMsg; + Null successMsgN; + Null citiesList; + Null cityName; + Null get5DaysWeatherForecastList; + List getCityInfoList; + Null getTodayWeatherForecastList; + Null iniciesList; + + WeatherIndicatorModel( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.citiesList, + this.cityName, + this.get5DaysWeatherForecastList, + this.getCityInfoList, + this.getTodayWeatherForecastList, + this.iniciesList}); + + WeatherIndicatorModel.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + citiesList = json['CitiesList']; + cityName = json['CityName']; + get5DaysWeatherForecastList = json['Get5DaysWeatherForecastList']; + if (json['GetCityInfo_List'] != null) { + getCityInfoList = new List(); + json['GetCityInfo_List'].forEach((v) { + getCityInfoList.add(new GetCityInfoList.fromJson(v)); + }); + } + getTodayWeatherForecastList = json['GetTodayWeatherForecastList']; + iniciesList = json['IniciesList']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['CitiesList'] = this.citiesList; + data['CityName'] = this.cityName; + data['Get5DaysWeatherForecastList'] = this.get5DaysWeatherForecastList; + if (this.getCityInfoList != null) { + data['GetCityInfo_List'] = + this.getCityInfoList.map((v) => v.toJson()).toList(); + } + data['GetTodayWeatherForecastList'] = this.getTodayWeatherForecastList; + data['IniciesList'] = this.iniciesList; + return data; + } +} + +class GetCityInfoList { + CategoriesNames categoriesNames; + String category; + String categoryValue; + int cityID; + String cityName; + String cityNameN; + String colorName; + String createdOn; + String iD; + int iniceID; + bool isOrderEmpty; + bool isValuesReversed; + bool language; + double latitude; + double longitude; + String name; + int orderNum; + double temperature; + String value; + + GetCityInfoList( + {this.categoriesNames, + this.category, + this.categoryValue, + this.cityID, + this.cityName, + this.cityNameN, + this.colorName, + this.createdOn, + this.iD, + this.iniceID, + this.isOrderEmpty, + this.isValuesReversed, + this.language, + this.latitude, + this.longitude, + this.name, + this.orderNum, + this.temperature, + this.value}); + + GetCityInfoList.fromJson(Map json) { + categoriesNames = json['CategoriesNames'] != null + ? new CategoriesNames.fromJson(json['CategoriesNames']) + : null; + category = json['Category']; + categoryValue = json['CategoryValue']; + cityID = json['CityID']; + cityName = json['CityName']; + cityNameN = json['CityNameN']; + colorName = json['ColorName']; + createdOn = json['CreatedOn']; + iD = json['ID']; + iniceID = json['IniceID']; + isOrderEmpty = json['IsOrderEmpty']; + isValuesReversed = json['IsValuesReversed']; + language = json['Language']; + latitude = json['Latitude']; + longitude = json['Longitude']; + name = json['Name']; + orderNum = json['OrderNum']; + temperature = json['Temperature']; + value = json['Value']; + } + + Map toJson() { + final Map data = new Map(); + if (this.categoriesNames != null) { + data['CategoriesNames'] = this.categoriesNames.toJson(); + } + data['Category'] = this.category; + data['CategoryValue'] = this.categoryValue; + data['CityID'] = this.cityID; + data['CityName'] = this.cityName; + data['CityNameN'] = this.cityNameN; + data['ColorName'] = this.colorName; + data['CreatedOn'] = this.createdOn; + data['ID'] = this.iD; + data['IniceID'] = this.iniceID; + data['IsOrderEmpty'] = this.isOrderEmpty; + data['IsValuesReversed'] = this.isValuesReversed; + data['Language'] = this.language; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['Name'] = this.name; + data['OrderNum'] = this.orderNum; + data['Temperature'] = this.temperature; + data['Value'] = this.value; + return data; + } +} + +class CategoriesNames { + String category1; + String category2; + String category3; + String category4; + String category5; + + CategoriesNames( + {this.category1, + this.category2, + this.category3, + this.category4, + this.category5}); + + CategoriesNames.fromJson(Map json) { + category1 = json['Category1']; + category2 = json['Category2']; + category3 = json['Category3']; + category4 = json['Category4']; + category5 = json['Category5']; + } + + Map toJson() { + final Map data = new Map(); + data['Category1'] = this.category1; + data['Category2'] = this.category2; + data['Category3'] = this.category3; + data['Category4'] = this.category4; + data['Category5'] = this.category5; + return data; + } +} + diff --git a/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart b/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart new file mode 100644 index 00000000..da12b48b --- /dev/null +++ b/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart @@ -0,0 +1,202 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; +import 'package:intl/intl.dart'; + +import '../base_service.dart'; + +class CustomerAddressesService extends BaseService { + + List addressesList = List(); + CustomerInfo customerInfo; + + Future addAddressInfo({ AddNewAddressRequestModel + addNewAddressRequestModel }) async { + + addNewAddressRequestModel.customer.email = customerInfo.email; + addNewAddressRequestModel.customer.id = customerInfo.customerId; + addNewAddressRequestModel.customer.roleIds = [3]; + addNewAddressRequestModel.customer.addresses[0].email = customerInfo.email; + addNewAddressRequestModel.customer.addresses[0].phoneNumber = customerInfo.mobileNumber; + addNewAddressRequestModel.customer.addresses[0].firstName = user.firstName; + addNewAddressRequestModel.customer.addresses[0].lastName = user.lastName; + addNewAddressRequestModel.customer.addresses[0].countryId = 69; + + var f = DateFormat('E, d MMM yyyy HH:mm:ss'); + var date = f.format(DateTime.now().toUtc()) + " GMT"; + addNewAddressRequestModel.customer.addresses[0].createdOnUtc = date; + hasError = false; + await baseAppClient.post(ADD_ADDRESS_INFO, + onSuccess: (dynamic response, int statusCode) { + addressesList.clear(); + response["customers"][0]["addresses"].forEach((data) { + addressesList + .add(AddressInfo.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: addNewAddressRequestModel.toJson(), isExternal: true, isAllowAny: true); + } + + Future getCustomerAddresses() async { + Map queryParams = { + 'fields':'addresses' + }; + hasError = false; + await baseAppClient.get("$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}", + onSuccess: (dynamic response, int statusCode) { + addressesList.clear(); + response["customers"][0]["addresses"].forEach((data) { + addressesList + .add(AddressInfo.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, queryParams: queryParams, isExternal: true); + } + + + Future getCustomerInfo() async { + Map queryParams = { + 'FileNumber':'${user.patientID}' + }; + + hasError = false; + await baseAppClient.get(GET_CUSTOMER_INFO, + onSuccess: (dynamic response, int statusCode) { + customerInfo= CustomerInfo.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, queryParams: queryParams, isExternal: true); + } +} + + +class CustomerInfo { + bool isRegistered; + String userName; + Null password; + String email; + Null errorMessage; + String mobileNumber; + int customerId; + + CustomerInfo( + {this.isRegistered, + this.userName, + this.password, + this.email, + this.errorMessage, + this.mobileNumber, + this.customerId}); + + CustomerInfo.fromJson(Map json) { + isRegistered = json['IsRegistered']; + userName = json['UserName']; + password = json['Password']; + email = json['Email']; + errorMessage = json['ErrorMessage']; + mobileNumber = json['MobileNumber']; + customerId = json['CustomerId']; + } + + Map toJson() { + final Map data = new Map(); + data['IsRegistered'] = this.isRegistered; + data['UserName'] = this.userName; + data['Password'] = this.password; + data['Email'] = this.email; + data['ErrorMessage'] = this.errorMessage; + data['MobileNumber'] = this.mobileNumber; + data['CustomerId'] = this.customerId; + return data; + } +} + + +class AddressInfo { + String id; + String firstName; + String lastName; + String email; + Null company; + int countryId; + String country; + Null stateProvinceId; + String city; + String address1; + String address2; + String zipPostalCode; + String phoneNumber; + Null faxNumber; + String customerAttributes; + String createdOnUtc; + Null province; + String latLong; + + AddressInfo( + {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}); + + AddressInfo.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/service/AuthenticatedUserObject.dart b/lib/core/service/AuthenticatedUserObject.dart index 5f992478..8dd2583d 100644 --- a/lib/core/service/AuthenticatedUserObject.dart +++ b/lib/core/service/AuthenticatedUserObject.dart @@ -11,14 +11,14 @@ class AuthenticatedUserObject { getUser(); } - getUser() async { - if (user == null) { + getUser({bool getUser = false}) async { + if (getUser) { + var userData = await sharedPref.getObject(USER_PROFILE); + if (userData != null) user = AuthenticatedUser.fromJson(userData); + } else if (user == null) { var userData = await sharedPref.getObject(USER_PROFILE); if (userData != null) user = AuthenticatedUser.fromJson(userData); } - - // var isLogin = await sharedPref.getString(LOGIN_TOKEN_ID); - this.isLogin = user != null; } logout() async { diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 54be167f..04f599f1 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -2,10 +2,14 @@ import 'dart:convert'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; import 'package:provider/provider.dart'; @@ -21,74 +25,92 @@ AppSharedPreferences sharedPref = new AppSharedPreferences(); /// onFailure: (String error, int statusCode) {}, /// body: Map(); /// -AuthenticatedUserObject authenticatedUserObject = locator(); +AuthenticatedUserObject authenticatedUserObject = + locator(); +VitalSignService _vitalSignService = locator(); class BaseAppClient { - post(String endPoint, {Map body, Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, bool isAllowAny = false}) async { - String url = BASE_URL + endPoint; + post(String endPoint, + {Map body, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + bool isAllowAny = false, + bool isExternal = false}) async { + String url; + if (isExternal) { + url = endPoint; + } else { + url = BASE_URL + endPoint; + } try { //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - String token = await sharedPref.getString(TOKEN); - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - var user = await sharedPref.getObject(USER_PROFILE); - if (body.containsKey('SetupID')) { - body['SetupID'] = body.containsKey('SetupID') - ? body['SetupID'] != null - ? body['SetupID'] - : SETUP_ID - : SETUP_ID; - } - body['VersionID'] = VERSION_ID; - body['Channel'] = CHANNEL; - body['LanguageID'] = body.containsKey('LanguageID') - ? body['LanguageID'] != null - ? body['LanguageID'] - : languageID == 'ar' - ? 1 - : 2 - : languageID == 'ar' - ? 1 - : 2; - - body['IPAdress'] = IP_ADDRESS; - body['generalid'] = GENERAL_ID; - body['PatientOutSA'] = body.containsKey('PatientOutSA') - ? body['PatientOutSA'] != null - ? body['PatientOutSA'] - : PATIENT_OUT_SA - : PATIENT_OUT_SA; - - if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; - } + if (!isExternal) { + String token = await sharedPref.getString(TOKEN); + var languageID = await sharedPref.getString(APP_LANGUAGE); + var user = await sharedPref.getObject(USER_PROFILE); + if (body.containsKey('SetupID')) { + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null + ? body['SetupID'] + : SETUP_ID + : SETUP_ID; + } + + body['VersionID'] = VERSION_ID; + body['Channel'] = CHANNEL; + body['LanguageID'] = body.containsKey('LanguageID') + ? body['LanguageID'] != null + ? body['LanguageID'] + : languageID == 'ar' + ? 1 + : 2 + : languageID == 'en' + ? 2 + : 1; - body['DeviceTypeID'] = DeviceTypeID; - - if (!body.containsKey('IsPublicRequest')) { - body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null - ? body['PatientType'] - : user['PatientType'] != null - ? user['PatientType'] - : PATIENT_TYPE - : PATIENT_TYPE; - - body['PatientTypeID'] = body.containsKey('PatientTypeID') - ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : user['PatientTypeID'] != null - ? user['PatientTypeID'] - : PATIENT_TYPE_ID - : PATIENT_TYPE_ID; - if (user != null) { - body['TokenID'] = token; - body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID']; - body['PatientOutSA'] = user['OutSA']; - body['SessionID'] = SESSION_ID; //getSessionId(token); + body['IPAdress'] = IP_ADDRESS; + body['generalid'] = GENERAL_ID; + body['PatientOutSA'] = body.containsKey('PatientOutSA') + ? body['PatientOutSA'] != null + ? body['PatientOutSA'] + : PATIENT_OUT_SA + : PATIENT_OUT_SA; + + if (body.containsKey('isDentalAllowedBackend')) { + body['isDentalAllowedBackend'] = + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; + } + + body['DeviceTypeID'] = DeviceTypeID; + + if (!body.containsKey('IsPublicRequest')) { + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null + ? body['PatientType'] + : user['PatientType'] != null + ? user['PatientType'] + : PATIENT_TYPE + : PATIENT_TYPE; + + body['PatientTypeID'] = body.containsKey('PatientTypeID') + ? body['PatientTypeID'] != null + ? body['PatientTypeID'] + : user['PatientType'] != null + ? user['PatientType'] + : PATIENT_TYPE_ID + : PATIENT_TYPE_ID; + if (user != null) { + body['TokenID'] = token; + body['PatientID'] = body['PatientID'] != null + ? body['PatientID'] + : user['PatientID']; + body['PatientOutSA'] = user['OutSA']; + body['SessionID'] = SESSION_ID; //getSessionId(token); + } } } @@ -97,7 +119,12 @@ class BaseAppClient { var ss = json.encode(body); if (await Utils.checkConnection()) { - final response = await http.post(url.trim(), body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}); + final response = await http.post(url.trim(), + body: json.encode(body), + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }); final int statusCode = response.statusCode; print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { @@ -107,6 +134,10 @@ class BaseAppClient { if (parsed['Response_Message'] != null) { onSuccess(parsed, statusCode); } else { + if (parsed['ErrorType'] == 4) { + navigateToAppUpdate( + AppGlobal.context, parsed['ErrorEndUserMessage']); + } if (isAllowAny) { onSuccess(parsed, statusCode); } else if (parsed['IsAuthenticated'] == null) { @@ -117,19 +148,39 @@ class BaseAppClient { } else if (parsed['Result'] == 'OK') { onSuccess(parsed, statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + if (parsed != null) { + onSuccess(parsed, statusCode); + } else { + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logout(); + } } - } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); - } else if (!parsed['IsAuthenticated']) { - await logout(); + } + else if(parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']){ + onFailure( + parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + } + else if (!parsed['IsAuthenticated']) { + await logout(); //helpers.showErrorToast('Your session expired Please login agian'); } else { if (parsed['SameClinicApptList'] != null) { onSuccess(parsed, statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + if (parsed['message'] != null) { + onFailure(parsed['message'] ?? parsed['message'], statusCode); + } else { + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + } } } } @@ -142,9 +193,24 @@ class BaseAppClient { onFailure(e.toString(), -1); } } + Future navigateToAppUpdate(context, String text) async { + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (context) => AppUpdatePage(appUpdateText: text))); + } - get(String endPoint, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map queryParams}) async { - String url = BASE_URL + endPoint; + get(String endPoint, + {Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + Map queryParams, + bool isExternal = false}) async { + String url; + if (isExternal) { + url = endPoint; + } else { + url = BASE_URL + endPoint; + } if (queryParams != null) { String queryString = Uri(queryParameters: queryParams).query; url += '?' + queryString; @@ -155,7 +221,10 @@ class BaseAppClient { if (await Utils.checkConnection()) { final response = await http.get( url.trim(), - headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}, + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }, ); final int statusCode = response.statusCode; print("statusCode :$statusCode"); @@ -171,6 +240,38 @@ 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); + } + } + simpleGet(String fullUrl, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map queryParams}) async { String url = fullUrl; var haveParams = (queryParams != null); @@ -201,14 +302,20 @@ class BaseAppClient { 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; + Provider.of(AppGlobal.context, listen: false).isLogin = + false; + var model = Provider.of(AppGlobal.context,listen: false); + _vitalSignService.weightKg = ""; + _vitalSignService.heightCm = ""; + model.setState(0, false); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); } String getSessionId(String id) { ///return id.replaceAll(RegExp('/[^\w\s]/'), ''); - // return id.replaceAll(RegExp('/[^a-zA-Z ]'), ''); + return id.replaceAll(RegExp('/[^a-zA-Z ]'), ''); } static defaultHttpParameters() async { @@ -231,4 +338,4 @@ class BaseAppClient { return params; } -} +} \ No newline at end of file diff --git a/lib/core/service/contactus/livechat_service.dart b/lib/core/service/contactus/livechat_service.dart index b806d56b..025073ca 100644 --- a/lib/core/service/contactus/livechat_service.dart +++ b/lib/core/service/contactus/livechat_service.dart @@ -8,6 +8,7 @@ class LiveChatService extends BaseService { List LivechatModelList = List(); Map body = Map(); + // body['body'] Future getAllLiveChatOrders() async { hasError = false; diff --git a/lib/core/service/hospital_service.dart b/lib/core/service/hospital_service.dart index 194b8256..312d7fd7 100644 --- a/lib/core/service/hospital_service.dart +++ b/lib/core/service/hospital_service.dart @@ -13,14 +13,13 @@ class HospitalService extends BaseService { double _longitude; _getCurrentLocation() async { - await getLastKnownPosition().then((value) { + await Geolocator.getLastKnownPosition().then((value) { _latitude = value.latitude; _longitude = value.longitude; }).catchError((e) { _longitude = 0; _latitude = 0; }); - // currentLocation = LatLng(position.latitude, position.longitude); } Future getHospitals() async { @@ -28,6 +27,8 @@ class HospitalService extends BaseService { Map body = Map(); body['Latitude'] = _latitude; body['Longitude'] = _longitude; + body['IsOnlineCheckIn'] = true; + body['PatientOutSA'] = 0; await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index 790003e9..0b626342 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -1,8 +1,9 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; -import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; @@ -20,6 +21,10 @@ class InsuranceCardService extends BaseService { List get insuranceApproval => _insuranceApproval; + InsuranceCardDetailsModel insuranceCardDetails; + List insuranceCardDetailsList = List(); + bool isHaveInsuranceCard = false; + GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse(); @@ -136,4 +141,42 @@ class InsuranceCardService extends BaseService { }, body:{'CompanyID': data.companyID,'SubCategoryID':data.subCategoryID },); return Future.value(localRes); } + + Future getPatientInsuranceDetails({String setupID, int projectID, String patientIdentificationID,int patientID}) async{ + error = ""; + hasError = false; + insuranceCardDetails = null; + isHaveInsuranceCard = false; + await baseAppClient.post(GET_PATIENT_INSURANCE_DETAILS, + onSuccess: (dynamic response, int statusCode) { + insuranceCardDetailsList.clear(); + isHaveInsuranceCard = true; + response['List_PatientInsuranceDetails'].forEach((item) { + insuranceCardDetailsList.add(InsuranceCardDetailsModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body:{'SetupID': setupID,'ProjectID':projectID,'PatientIdentificationID':patientIdentificationID ,'isDentalAllowedBackend':false,'PatientID':patientID},); + + } + + Future uploadInsuranceCard({ String patientIdentificationID,int patientID,String image=""}) async{ + error = ""; + Map body = Map(); + body['PatientID']=patientID; + body['PatientType']=user.patientType; + body['MobileNo']=user.mobileNumber; + body['PatientIdentificationID']=patientIdentificationID; + body['InsuranceCardImage']= image; + + await baseAppClient.post(UPLOAD_INSURANCE_CARD, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body:body,); + + } } diff --git a/lib/core/service/medical/PatientSickLeaveService.dart b/lib/core/service/medical/PatientSickLeaveService.dart index b2bb16ef..bb60ee3b 100644 --- a/lib/core/service/medical/PatientSickLeaveService.dart +++ b/lib/core/service/medical/PatientSickLeaveService.dart @@ -21,7 +21,11 @@ class PatientSickLeaveService extends BaseService { } sendSickLeaveEmail( - {int requestNo, String projectName, String doctorName, int projectID,String setupID}) async { + {int requestNo, + String projectName, + String doctorName, + int projectID, + String setupID}) async { hasError = false; super.error = ""; Map body = Map(); @@ -33,8 +37,8 @@ class PatientSickLeaveService extends BaseService { body['PatientName'] = user.firstName + " " + user.firstName; body['ProjectName'] = projectName; body['DoctorName'] = doctorName; - body['ProjectID'] = 12; - body['SetupID'] = 12; + body['ProjectID'] = projectID; + body['SetupID'] = setupID; await baseAppClient .post(SendSickLeaveEmail, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index b9b9a16c..11592956 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; @@ -32,6 +33,7 @@ class LabsService extends BaseService { List patientLabSpecialResult = List(); List labResultList = List(); + List labOrdersResultsList = List(); Future getLaboratoryResult( {String projectID, @@ -68,6 +70,7 @@ class LabsService extends BaseService { await baseAppClient.post(GET_Patient_LAB_RESULT, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); + labResultList.clear(); response['ListPLR'].forEach((lab) { labResultList.add(LabResult.fromJson(lab)); }); @@ -77,6 +80,28 @@ class LabsService extends BaseService { }, body: body); } + Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder,String procedure}) async { + hasError = false; + Map body = Map(); + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['isDentalAllowedBackend'] = false; + body['SetupID'] = patientLabOrder.setupID; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID; + body['Procedure'] = procedure; + await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, + onSuccess: (dynamic response, int statusCode) { + labOrdersResultsList.clear(); + response['ListPLR'].forEach((lab) { + labOrdersResultsList.add(LabOrderResult.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); @@ -85,19 +110,19 @@ class LabsService extends BaseService { _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; - _requestSendLabReportEmail.patientName = user.firstName + user.lastName; + _requestSendLabReportEmail.patientName = user.firstName +" "+ user.lastName; _requestSendLabReportEmail.patientIditificationNum = user.patientIdentificationNo; _requestSendLabReportEmail.dateofBirth = user.dateofBirth; _requestSendLabReportEmail.to = user.emailAddress; - _requestSendLabReportEmail.orderDate = - '${patientLabOrder.orderDate.year}-${patientLabOrder.orderDate.month}-${patientLabOrder.orderDate.day}'; + _requestSendLabReportEmail.orderDate = '${patientLabOrder.orderDate.year}-${patientLabOrder.orderDate.month}-${patientLabOrder.orderDate.day}'; _requestSendLabReportEmail.patientMobileNumber = user.mobileNumber; _requestSendLabReportEmail.projectName = patientLabOrder.projectName; + _requestSendLabReportEmail.setupID = user.setupID; - await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT, + await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) { - AppToast.showSuccessToast(message: 'A copy has been sent to the email'); + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/medical/my_balance_service.dart b/lib/core/service/medical/my_balance_service.dart index c456b38c..86e925b8 100644 --- a/lib/core/service/medical/my_balance_service.dart +++ b/lib/core/service/medical/my_balance_service.dart @@ -24,7 +24,12 @@ class MyBalanceService extends BaseService { String logInTokenID; String verificationCode; - AuthenticatedUserObject authenticatedUserObject = locator(); + AuthenticatedUserObject authenticatedUserObject = + locator(); + + MyBalanceService(){ + getFamilyFiles(); + } getPatientAdvanceBalanceAmount() async { hasError = false; @@ -61,13 +66,14 @@ class MyBalanceService extends BaseService { }, body: body); } - getPatientInfoByPatientIDAndMobileNumber() async { + getPatientInfoByPatientIDAndMobileNumber(AdvanceModel advanceModel) async { hasError = false; super.error = ""; Map body = Map(); body['isDentalAllowedBackend'] = false; - body['MobileNo'] = authenticatedUserObject.user.mobileNumber; - body['ProjectID'] = authenticatedUserObject.user.projectID; + body['MobileNo'] = advanceModel.mobileNumber; + body['ProjectID'] = advanceModel.hospitalsModel.iD; + body['PatientID'] = advanceModel.fileNumber; await baseAppClient.post(GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER, onSuccess: (response, statusCode) async { @@ -81,7 +87,7 @@ class MyBalanceService extends BaseService { }, body: body); } - sendActivationCodeForAdvancePayment({int patientID,int projectID}) async { + sendActivationCodeForAdvancePayment({int patientID, int projectID}) async { hasError = false; super.error = ""; Map body = Map(); @@ -111,9 +117,8 @@ class MyBalanceService extends BaseService { body['LogInTokenID'] = logInTokenID; await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT, - onSuccess: (response, statusCode) async { - - }, onFailure: (String error, int statusCode) { + onSuccess: (response, statusCode) async {}, + onFailure: (String error, int statusCode) { hasError = true; super.error = error; super.error = error; diff --git a/lib/core/service/medical/prescriptions_service.dart b/lib/core/service/medical/prescriptions_service.dart index b920499c..e9741a7f 100644 --- a/lib/core/service/medical/prescriptions_service.dart +++ b/lib/core/service/medical/prescriptions_service.dart @@ -57,20 +57,31 @@ class PrescriptionsService extends BaseService { List prescriptionReportList = List(); Future getPrescriptionReport( - {int dischargeNo, int projectId, int clinicID, String setupID,int episodeID}) async { + {Prescriptions prescriptions}) async { hasError = false; - _requestPrescriptionReport.dischargeNo = dischargeNo; - _requestPrescriptionReport.projectID = projectId; - _requestPrescriptionReport.clinicID = clinicID; - _requestPrescriptionReport.setupID = setupID; - _requestPrescriptionReport.episodeID = episodeID; - - await baseAppClient.post(GET_PRESCRIPTION_REPORT, + _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; + _requestPrescriptionReport.projectID = prescriptions.projectID; + _requestPrescriptionReport.clinicID = prescriptions.clinicID; + _requestPrescriptionReport.setupID = prescriptions.setupID; + _requestPrescriptionReport.episodeID = prescriptions.episodeID; + _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; + + await baseAppClient.post(prescriptions.isInOutPatient? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT, onSuccess: (dynamic response, int statusCode) { prescriptionReportList.clear(); - response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { - prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); - }); + prescriptionReportEnhList.clear(); + if(prescriptions.isInOutPatient){ + response['ListPRM'].forEach((prescriptions) { + prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); + prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); + }); + }else{ + response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { + prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); + }); + } + + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index b3cb737b..965fa752 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -67,7 +67,7 @@ class RadiologyService extends BaseService { _requestSendRadReportEmail.patientName = user.firstName + " " + user.lastName; _requestSendRadReportEmail.patientIditificationNum = user.patientIdentificationNo; _requestSendRadReportEmail.projectName = finalRadiology.projectName; - _requestSendRadReportEmail.radResult = 'asd'; //finalRadiology.reportData; + _requestSendRadReportEmail.radResult = finalRadiology.reportData; _requestSendRadReportEmail.to = user.emailAddress; _requestSendRadReportEmail.dateofBirth = user.dateofBirth; diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index 19f86e2e..b2f90e61 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -9,11 +9,11 @@ class ReportsService extends BaseService { List appointHistoryList = List(); String userAgreementContent = ""; RequestReports _requestReports = RequestReports( - isReport: true, - encounterType: 1, - requestType: 1, - patientOutSA: 0, - ); + isReport: true, + encounterType: 1, + requestType: 1, + patientOutSA: 0, + ); Future getReports() async { hasError = false; @@ -56,22 +56,18 @@ class ReportsService extends BaseService { }, body: Map()); } - Future updatePatientHealthSummaryReport({bool isSummary}) async { Map body = Map(); body['RSummaryReport'] = isSummary; hasError = false; await baseAppClient.post(UPDATE_HEALTH_TERMS, - onSuccess: (dynamic response, int statusCode) { - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } - - Future insertRequestForMedicalReport( AppointmentHistory appointmentHistory) async { Map body = new Map(); @@ -96,4 +92,44 @@ class ReportsService extends BaseService { super.error = error; }, body: body); } + + Future sendEmailForMedicalReport( + String projectName, + String clinicName, + String doctorName, + String requestDate, + String invoiceNo, + int projectID, + String stamp, + String setupID) async { + Map body = new Map(); + body['SetupID'] = setupID; + body['PrintDate'] = requestDate; + body['ProcedureID'] = "05005009"; + body['Reporttype'] = "MEDICAL REPORT"; + body['stamp'] = stamp; + body['To'] = user.emailAddress; + body['DateofBirth'] = user.dateofBirth; + body['PatientIditificationNum'] = user.patientIdentificationNo; + body['PatientMobileNumber'] = user.mobileNumber; + body['PatientName'] = user.firstName + " " + user.lastName; + body['ProjectName'] = projectName; + body['ClinicName'] = clinicName; + body['ProjectID'] = projectID; + body['InvoiceNo'] = invoiceNo; + body['PrintedByName'] = user.firstName + " " + user.lastName; + + dynamic response; + + hasError = false; + await baseAppClient.post(SEND_MEDICAL_REPORT_EMAIL, + onSuccess: (dynamic res, int statusCode) { + response = res; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + return response; + } } diff --git a/lib/core/service/medical/vital_sign_service.dart b/lib/core/service/medical/vital_sign_service.dart index 16909fd9..d1fbbf1c 100644 --- a/lib/core/service/medical/vital_sign_service.dart +++ b/lib/core/service/medical/vital_sign_service.dart @@ -5,14 +5,14 @@ import '../base_service.dart'; class VitalSignService extends BaseService { List vitalSignResModelList = List(); - Map body = Map(); + String weightKg = ""; String heightCm = ""; String bloadType = ""; Future getPatientRadOrders({int appointmentNo, int projectID}) async { hasError = false; - + Map body = Map(); if (appointmentNo != null && projectID != null) { body['TransNo'] = appointmentNo; body['ProjectID'] = projectID; @@ -24,9 +24,17 @@ class VitalSignService extends BaseService { response['List_DoctorPatientVitalSign'].forEach((vital) { vitalSignResModelList.add(VitalSignResModel.fromJson(vital)); }); + bool isHaveWeight = false; + bool isHaveHeight = false; vitalSignResModelList.forEach((element) { - weightKg = '${element.weightKg}'; - heightCm = '${element.heightCm}'; + if (element.weightKg != 0 && !isHaveWeight) { + weightKg = '${element.weightKg}'; + isHaveWeight = true; + } + if (element.heightCm != 0 && !isHaveHeight) { + heightCm = '${element.heightCm}'; + isHaveHeight = true; + } }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/offers_service.dart b/lib/core/service/offers_service.dart new file mode 100644 index 00000000..2247c833 --- /dev/null +++ b/lib/core/service/offers_service.dart @@ -0,0 +1,56 @@ +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 new file mode 100644 index 00000000..b3e64e69 --- /dev/null +++ b/lib/core/service/parmacyModule/lacum-registration-service.dart @@ -0,0 +1,50 @@ +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 new file mode 100644 index 00000000..c7117303 --- /dev/null +++ b/lib/core/service/parmacyModule/lacum-service.dart @@ -0,0 +1,133 @@ +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 new file mode 100644 index 00000000..b15696f9 --- /dev/null +++ b/lib/core/service/parmacyModule/lacum-transfer-service.dart @@ -0,0 +1,57 @@ +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 1f3f9ddd..5648ff6d 100644 --- a/lib/core/service/parmacyModule/order-preview-service.dart +++ b/lib/core/service/parmacyModule/order-preview-service.dart @@ -1,29 +1,248 @@ 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 getBannerListList() async { + Future getAddresses() async { + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + Map queryParams = {'fields': 'addresses'}; hasError = false; try { - await baseAppClient.get(GET_CUSTOMERS_ADDRESSES, + await baseAppClient.get("$GET_CUSTOMERS_ADDRESSES$customerId", onSuccess: (dynamic response, int statusCode) { - addresses.clear(); - response['customers'][0]['addresses'].forEach((item) { - addresses.add(Addresses.fromJson(item)); - }); + 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]; }, 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 8584e140..c3bce324 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -4,8 +4,10 @@ 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 = ''; @@ -15,6 +17,55 @@ 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 { @@ -40,7 +91,10 @@ class PharmacyModuleService extends BaseService { onSuccess: (dynamic response, int statusCode) { manufacturerList.clear(); response['manufacturer'].forEach((item) { - manufacturerList.add(Manufacturer.fromJson(item)); + Manufacturer manufacturer = Manufacturer.fromJson(item); + if(manufacturer.image != null){ + manufacturerList.add(Manufacturer.fromJson(item)); + } }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -81,14 +135,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 new file mode 100644 index 00000000..68fac632 --- /dev/null +++ b/lib/core/service/parmacyModule/terms-condition-service.dart @@ -0,0 +1,33 @@ +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/pharmacies_service.dart b/lib/core/service/pharmacies_service.dart index f89fb425..dbd4fae1 100644 --- a/lib/core/service/pharmacies_service.dart +++ b/lib/core/service/pharmacies_service.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_list_model.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; +import 'package:geolocator/geolocator.dart'; class PharmacyService extends BaseService { List _medicineItem = List(); @@ -59,10 +60,30 @@ class PharmacyService extends BaseService { projectID: 15, ); + double _latitude=0; + double _longitude=0; + + _getCurrentLocation() async { + await Geolocator.getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } + Future getMedicineList({String drugName}) async { hasError = false; - _requestGetPharmaciesModel.pHRItemName = drugName; - try { + await _getCurrentLocation(); + Map body = Map(); + body['PHR_itemName'] = drugName.trim(); + body['isLoginForDoctorApp'] = true; + body['isDentalAllowedBackend'] = true; + body['PageSize'] = 25; + body['Latitude'] = _latitude; + body['Longitude'] = _longitude; + await baseAppClient.post(GET_PHARMCY_ITEMS, onSuccess: (dynamic response, int statusCode) { _medicineItem.clear(); @@ -72,15 +93,18 @@ class PharmacyService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _requestGetPharmaciesModel.toJson()); - } catch (error) { - throw error; - } + }, body: body); + } Future getPharmaciesList({int itemID}) async { - _pharmaciesListModel.itemID = itemID; - try { + + await _getCurrentLocation(); + Map body = Map(); + body['ItemID'] = itemID; + body['Latitude'] = _latitude; + body['Longitude'] = _longitude; + await baseAppClient.post(GET_PHARMACY_LIST, onSuccess: (dynamic response, int statusCode) { _pharmaciesList.clear(); @@ -91,9 +115,7 @@ class PharmacyService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _pharmaciesListModel.toJson()); - } catch (error) { - throw error; - } + }, body:body); + } } diff --git a/lib/core/service/pharmacy_categorise_service.dart b/lib/core/service/pharmacy_categorise_service.dart new file mode 100644 index 00000000..b55a755d --- /dev/null +++ b/lib/core/service/pharmacy_categorise_service.dart @@ -0,0 +1,225 @@ +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/service/privilege_service.dart b/lib/core/service/privilege_service.dart new file mode 100644 index 00000000..5beef992 --- /dev/null +++ b/lib/core/service/privilege_service.dart @@ -0,0 +1,22 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class PrivilegeService extends BaseService { + + List privilegeModelList = List(); + + Future getPrivilege() async { + Map body = Map(); + body['PatientType'] = 4; + await baseAppClient.post(GET_PRIVILEGE, + onSuccess: (dynamic response, int statusCode) { + response['ServicePrivilegeList'].forEach((item) { + privilegeModelList.add(PrivilegeModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/weather_service.dart b/lib/core/service/weather_service.dart new file mode 100644 index 00000000..10ab1adf --- /dev/null +++ b/lib/core/service/weather_service.dart @@ -0,0 +1,36 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class WeatherService extends BaseService { + List weatherIndicatorData = List(); + + Map body = Map(); + String Latitude = ""; + String Longitude = ""; + String PhoneNumber = ""; + + Future getWeatherData() async { + hasError = false; + + var lat = await sharedPref.getDouble(USER_LAT); + var long = await sharedPref.getDouble(USER_LONG); + body['Latitude'] = lat ?? 0; + body['Longitude'] = long ?? 0; + + await baseAppClient.post(WEATHER_INDICATOR, + onSuccess: (dynamic response, int statusCode) { + weatherIndicatorData = []; + response['GetCityInfo_List'].forEach((data) { + weatherIndicatorData.add(GetCityInfoList.fromJson(data)); + }); + print(weatherIndicatorData); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + await this.sharedPref.setObject(WEATHER, weatherIndicatorData[0]); + return Future.value(weatherIndicatorData[0]); + } +} diff --git a/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart b/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart new file mode 100644 index 00000000..5bde5a5f --- /dev/null +++ b/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart @@ -0,0 +1,136 @@ +class AddNewAddressRequestModel { + Customer customer; + + AddNewAddressRequestModel({this.customer}); + + AddNewAddressRequestModel.fromJson(Map json) { + customer = json['customer'] != null + ? new Customer.fromJson(json['customer']) + : null; + } + + Map toJson() { + final Map data = new Map(); + if (this.customer != null) { + data['customer'] = this.customer.toJson(); + } + return data; + } +} + +class Customer { + List addresses; + int id; + String email; + List roleIds; + + Customer({this.addresses, this.id, this.email, this.roleIds}); + + Customer.fromJson(Map json) { + if (json['addresses'] != null) { + addresses = new List(); + json['addresses'].forEach((v) { + addresses.add(new Addresses.fromJson(v)); + }); + } + id = json['id']; + email = json['email']; + roleIds = json['role_ids'].cast(); + } + + Map toJson() { + final Map data = new Map(); + if (this.addresses != null) { + data['addresses'] = this.addresses.map((v) => v.toJson()).toList(); + } + data['id'] = this.id; + data['email'] = this.email; + data['role_ids'] = this.roleIds; + return data; + } +} + +class Addresses { + int id; + String firstName; + String lastName; + String email; + Null company; + int countryId; + String country; + Null stateProvinceId; + String city; + String address1; + String address2; + String zipPostalCode; + String phoneNumber; + Null faxNumber; + String customerAttributes; + String createdOnUtc; + Null province; + String latLong; + + Addresses( + {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}); + + Addresses.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/viewModels/AlHabibMedicalService/cmc_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart index bf3404a9..f2c81956 100644 --- a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart @@ -9,14 +9,19 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/cmc_service.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import '../../../locator.dart'; +import 'add_new_address_Request_Model.dart'; class CMCViewModel extends BaseViewModel { CMCService _cMCService = locator(); - + CustomerAddressesService _customerAddressesService = + locator(); + List get addressesList => + _customerAddressesService.addressesList; List get cmcAllServicesList => _cMCService.cmcAllServicesList; @@ -107,4 +112,44 @@ class CMCViewModel extends BaseViewModel { getCmcAllPresOrders(); } } + + Future getCustomerAddresses() async { + setState(ViewState.Busy); + await _customerAddressesService.getCustomerAddresses( + ); + if (_customerAddressesService.hasError) { + error = _customerAddressesService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future getCustomerInfo() async { + setState(ViewState.Busy); + await _customerAddressesService.getCustomerInfo( + ); + if (_customerAddressesService.hasError) { + error = _customerAddressesService.error; + setState(ViewState.ErrorLocal); + } else { + await getCustomerAddresses(); + } + } + + Future addAddressInfo( + {AddNewAddressRequestModel addNewAddressRequestModel}) async { + + + setState(ViewState.Busy); + await _customerAddressesService.addAddressInfo( + addNewAddressRequestModel: addNewAddressRequestModel + ); + if (_customerAddressesService.hasError) { + error = _customerAddressesService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } \ No newline at end of file diff --git a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart index 031d0a0c..20a19b23 100644 --- a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -8,18 +8,28 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/home_health_care_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:intl/intl.dart'; import '../../../locator.dart'; +import 'add_new_address_Request_Model.dart'; class HomeHealthCareViewModel extends BaseViewModel { HomeHealthCareService _homeHealthCareService = locator(); + CustomerAddressesService _customerAddressesService = + locator(); + List get hhcAllServicesList => _homeHealthCareService.hhcAllServicesList; + + List get addressesList => + _customerAddressesService.addressesList; + List get hhcAllPresOrders => _homeHealthCareService.hhcAllPresOrdersList; @@ -93,5 +103,44 @@ class HomeHealthCareViewModel extends BaseViewModel { } + Future getCustomerAddresses() async { + setState(ViewState.Busy); + await _customerAddressesService.getCustomerAddresses( + ); + if (_customerAddressesService.hasError) { + error = _customerAddressesService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future getCustomerInfo() async { + setState(ViewState.Busy); + await _customerAddressesService.getCustomerInfo( + ); + if (_customerAddressesService.hasError) { + error = _customerAddressesService.error; + setState(ViewState.ErrorLocal); + } else { + await getCustomerAddresses(); + } + } + + Future addAddressInfo( + {AddNewAddressRequestModel addNewAddressRequestModel}) async { + + setState(ViewState.Busy); + await _customerAddressesService.addAddressInfo( + addNewAddressRequestModel: addNewAddressRequestModel + ); + if (_customerAddressesService.hasError) { + error = _customerAddressesService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + } \ No newline at end of file diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart index d8ea5196..aab267e9 100644 --- a/lib/core/viewModels/base_view_model.dart +++ b/lib/core/viewModels/base_view_model.dart @@ -29,11 +29,16 @@ class BaseViewModel extends ChangeNotifier { if (hasListeners) notifyListeners(); } + setUser(AuthenticatedUser user){ + this.user = user; + notifyListeners(); + } + BaseViewModel() { //authenticatedUserObject.getUser(); user = authenticatedUserObject.user; this.isLogin = authenticatedUserObject.isLogin; - _getUser(); + } _getUser() async { diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index 4cf22b23..e085e476 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -1,13 +1,21 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; 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 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import '../../locator.dart'; class DashboardViewModel extends BaseViewModel { VitalSignService _vitalSignService = locator(); - String get weightKg => _vitalSignService.weightKg; - String get heightCm => _vitalSignService.heightCm; - String bloadType = ""; + + String get weightKg => _vitalSignService.weightKg; + + String get heightCm => _vitalSignService.heightCm; + String booldType = "-"; + + // ToDoCountProviderModel toDoProvider = + // Provider.of(AppGlobal.context); getPatientRadOrders() async { if (isLogin && _vitalSignService.weightKg.isEmpty) { @@ -15,9 +23,24 @@ class DashboardViewModel extends BaseViewModel { await _vitalSignService.getPatientRadOrders(); if (_vitalSignService.hasError) { error = _vitalSignService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); + setState(ViewState.ErrorLocal); + } else { + booldType = await sharedPref.getString(BLOOD_TYPE) ?? "-"; + setState(ViewState.Idle); + } } } + +// 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/feedback/feedback_view_model.dart b/lib/core/viewModels/feedback/feedback_view_model.dart index 4956024d..6793c786 100644 --- a/lib/core/viewModels/feedback/feedback_view_model.dart +++ b/lib/core/viewModels/feedback/feedback_view_model.dart @@ -21,59 +21,8 @@ class FeedbackViewModel extends BaseViewModel { FeedbackService _feedbackService = locator(); List get cOCItemList => _feedbackService.cOCItemList; - MessageType messageType = MessageType.NON; - MessageType messageTypeDialog = MessageType.NON; - - String getSelected(BuildContext context) { - switch (messageType) { - case MessageType.ComplaintOnAnAppointment: - return TranslationBase.of(context).complainAppo; - break; - case MessageType.ComplaintWithoutAppointment: - return TranslationBase.of(context).complainWithoutAppo; - break; - case MessageType.Question: - return TranslationBase.of(context).question; - break; - case MessageType.Compliment: - return TranslationBase.of(context).compliment; - break; - case MessageType.Suggestion: - return TranslationBase.of(context).suggestion; - break; - case MessageType.NON: - return TranslationBase.of(context).notClassified; - break; - } - return TranslationBase.of(context).notClassified; - } - - setMessageDialogType(MessageType messageType) { - messageTypeDialog = messageType; - notifyListeners(); - } - - setMessageType(MessageType messageType) { - this.messageType = messageType; - switch (messageType) { - case MessageType.ComplaintOnAnAppointment: - break; - case MessageType.ComplaintWithoutAppointment: - break; - case MessageType.Question: - break; - case MessageType.Compliment: - break; - case MessageType.Suggestion: - break; - case MessageType.NON: - break; - } - notifyListeners(); - } - List get appointHistoryList => _feedbackService.appointHistoryList; @@ -93,11 +42,9 @@ class FeedbackViewModel extends BaseViewModel { if (_feedbackService.hasError) { error = _feedbackService.error; setState(ViewState.ErrorLocal); - setMessageType(MessageType.NON); return false; } else { setState(ViewState.Idle); - setMessageType(MessageType.NON); return true; } } diff --git a/lib/core/viewModels/insurance_card_View_model.dart b/lib/core/viewModels/insurance_card_View_model.dart index 7029f082..234db5d4 100644 --- a/lib/core/viewModels/insurance_card_View_model.dart +++ b/lib/core/viewModels/insurance_card_View_model.dart @@ -1,7 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; -import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; @@ -72,5 +72,14 @@ class InsuranceViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + Future uploadInsuranceCard({String patientIdentificationID, int patientID,String image =""}) async { + setState(ViewState.BusyLocal); + await _insuranceCardService.uploadInsuranceCard(patientIdentificationID: patientIdentificationID,patientID: patientID,image: image); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } } diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 582ee745..9e3f09e5 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -1,9 +1,11 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; @@ -12,6 +14,9 @@ class LabsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; LabsService _labsService = locator(); + List get labOrdersResultsList => _labsService.labOrdersResultsList; + + List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); @@ -105,43 +110,54 @@ class LabsViewModel extends BaseViewModel { getPatientLabResult({PatientLabOrders patientLabOrder}) async { setState(ViewState.Busy); - await _labsService.getPatientLabResult( - patientLabOrder: patientLabOrder - ); + await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); } else { _labsService.labResultList.forEach((element) { - List patientLabOrdersClinic = - labResultLists - .where((elementClinic) => - elementClinic.filterName == element.testCode) - .toList(); + List patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList(); if (patientLabOrdersClinic.length != 0) { - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList - .add(element); + + var value= labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList + .where((e) => e.sampleCollectedOn== element.sampleCollectedOn && e.resultValue ==element.resultValue ).toList(); + if(value.isEmpty) + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element); } else { - labResultLists.add(LabResultList( - filterName: element.testCode, - lab: element)); + labResultLists.add(LabResultList(filterName: element.testCode, lab: element)); } - }); setState(ViewState.Idle); } } - sendLabReportEmail({PatientLabOrders patientLabOrder}) async { + + getPatientLabOrdersResults({PatientLabOrders patientLabOrder,String procedure}) async { setState(ViewState.Busy); - await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); + await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder,procedure: procedure); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); } else { + bool isShouldClear = false; + if(_labsService.labOrdersResultsList.length==1) + { + labOrdersResultsList.forEach((element) { + if(element.resultValue.contains('/') ||element.resultValue.contains('*' )|| element.resultValue.isEmpty ) + isShouldClear = true; + });} + if(isShouldClear) + _labsService.labOrdersResultsList.clear(); setState(ViewState.Idle); } } + + sendLabReportEmail({PatientLabOrders patientLabOrder,String mes}) async { + await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); + if (_labsService.hasError) { + error = _labsService.error; + }else + AppToast.showSuccessToast(message: mes); + } } diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index af4e126e..f9554d94 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -74,11 +74,10 @@ class MyBalanceViewModel extends BaseViewModel { setState(ViewState.Idle); } - //============== + Future getCities() async { setState(ViewState.Busy); await _bloodDonationService.getAllCitiesOrders(); - // getHospitals(); if (_bloodDonationService.hasError) { error = _bloodDonationService.error; setState(ViewState.Error); @@ -89,8 +88,6 @@ class MyBalanceViewModel extends BaseViewModel { Future getBlood() async { setState(ViewState.Busy); await _bloodDetailsService.getAllBloodOrders(); - ; - if (_bloodDetailsService.hasError) { error = _bloodDetailsService.error; setState(ViewState.Error); @@ -98,7 +95,6 @@ class MyBalanceViewModel extends BaseViewModel { setState(ViewState.Idle); } - //=============== Future getPatientInfoByPatientID({String id}) async { setState(ViewState.Busy); @@ -112,10 +108,10 @@ class MyBalanceViewModel extends BaseViewModel { } } - Future getPatientInfoByPatientIDAndMobileNumber() async { + Future getPatientInfoByPatientIDAndMobileNumber(AdvanceModel advanceModel) async { setState(ViewState.Busy); await _myBalanceService - .getPatientInfoByPatientIDAndMobileNumber(); + .getPatientInfoByPatientIDAndMobileNumber(advanceModel); if (_myBalanceService.hasError) { error = _myBalanceService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart index 054dc4ef..2c32a081 100644 --- a/lib/core/viewModels/medical/prescriptions_view_model.dart +++ b/lib/core/viewModels/medical/prescriptions_view_model.dart @@ -103,9 +103,9 @@ class PrescriptionsViewModel extends BaseViewModel { notifyListeners(); } - getPrescriptionReport({int dischargeNo,int projectId,int clinicID,String setupID,int episodeID}) async { + getPrescriptionReport({Prescriptions prescriptions}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport(dischargeNo: dischargeNo,projectId: projectId,clinicID: clinicID,setupID: setupID,episodeID: episodeID); + await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions); if (_prescriptionsService.hasError) { error = _prescriptionsService.error; setState(ViewState.ErrorLocal); @@ -119,6 +119,7 @@ class PrescriptionsViewModel extends BaseViewModel { int patientID, String clinicName, String doctorName, + String mes, int projectID}) async { setState(ViewState.BusyLocal); await _prescriptionsService.sendPrescriptionEmail( @@ -128,7 +129,7 @@ class PrescriptionsViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); AppToast.showErrorToast(message: error); } else { - AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail'); + AppToast.showSuccessToast(message: mes); setState(ViewState.Idle); } } diff --git a/lib/core/viewModels/medical/radiology_view_model.dart b/lib/core/viewModels/medical/radiology_view_model.dart index 26d40361..076707dc 100644 --- a/lib/core/viewModels/medical/radiology_view_model.dart +++ b/lib/core/viewModels/medical/radiology_view_model.dart @@ -80,7 +80,7 @@ class RadiologyViewModel extends BaseViewModel { } sendRadReportEmail( - {FinalRadiology finalRadiology}) async { + {FinalRadiology finalRadiology,String mes}) async { setState(ViewState.BusyLocal); await _radiologyService.sendRadReportEmail( finalRadiology: finalRadiology @@ -89,7 +89,7 @@ class RadiologyViewModel extends BaseViewModel { error = _radiologyService.error; AppToast.showErrorToast(message: error); } else { - AppToast.showSuccessToast(message: 'A copy has been sent to the email'); + AppToast.showSuccessToast(message: mes); } setState(ViewState.Idle); } diff --git a/lib/core/viewModels/medical/reports_view_model.dart b/lib/core/viewModels/medical/reports_view_model.dart index e0fdfaa3..271b5463 100644 --- a/lib/core/viewModels/medical/reports_view_model.dart +++ b/lib/core/viewModels/medical/reports_view_model.dart @@ -69,7 +69,7 @@ class ReportsViewModel extends BaseViewModel { } - insertRequestForMedicalReport(AppointmentHistory appointmentHistory)async{ + insertRequestForMedicalReport(AppointmentHistory appointmentHistory,String mes)async{ setState(ViewState.Busy); await _reportsService.insertRequestForMedicalReport(appointmentHistory); if (_reportsService.hasError) { @@ -77,7 +77,7 @@ class ReportsViewModel extends BaseViewModel { AppToast.showErrorToast(message: error); setState(ViewState.ErrorLocal); } else { - AppToast.showSuccessToast(message: 'The order was send '); + AppToast.showSuccessToast(message: mes); setState(ViewState.Idle); } } diff --git a/lib/core/viewModels/medical/vital_sign_view_model.dart b/lib/core/viewModels/medical/vital_sign_view_model.dart index f534140f..b2110187 100644 --- a/lib/core/viewModels/medical/vital_sign_view_model.dart +++ b/lib/core/viewModels/medical/vital_sign_view_model.dart @@ -11,7 +11,15 @@ class VitalSignViewModel extends BaseViewModel { List get vitalSignResModelList => _vitalSignService.vitalSignResModelList; - getPatientRadOrders({int appointmentNo, int projectID}) async { + String heightCm = "0"; + String weightKg = "0"; + String bodyMax = "0"; + String temperatureCelcius = "0"; + String hartRat = "0"; + String respirationBeatPerMinute = "0"; + String bloodPressure = "0 / 0"; + + getPatientVitalSign({int appointmentNo, int projectID}) async { setState(ViewState.Busy); if (appointmentNo != null && projectID != null) { @@ -23,7 +31,41 @@ class VitalSignViewModel extends BaseViewModel { if (_vitalSignService.hasError) { error = _vitalSignService.error; setState(ViewState.Error); - } else + } else { + _vitalSignService.vitalSignResModelList.forEach((element) { + if (heightCm == "0" || heightCm == null || heightCm == 'null') { + heightCm = element.heightCm.toString(); + } + if (weightKg == "0" || weightKg == null || weightKg == 'null') { + weightKg = element.weightKg.toString(); + } + if (bodyMax == "0" || + bodyMax == null || + bodyMax == 'null') { + bodyMax = element.bodyMassIndex.toString(); + } + if (temperatureCelcius == "0" || + temperatureCelcius == null || + temperatureCelcius == 'null') { + temperatureCelcius = element.temperatureCelcius.toString(); + } + if (hartRat == "0" || hartRat == null || hartRat == 'null') { + hartRat = element.pulseBeatPerMinute.toString(); + } + if (respirationBeatPerMinute == "0" || + respirationBeatPerMinute == null || + respirationBeatPerMinute == 'null') { + respirationBeatPerMinute = + element.respirationBeatPerMinute.toString(); + } + if (bloodPressure == "0 / 0" || + bloodPressure == null || + bloodPressure == 'null') { + bloodPressure = element.bloodPressure.toString(); + } + }); + setState(ViewState.Idle); + } } } diff --git a/lib/core/viewModels/offers_Categorise_view_model.dart b/lib/core/viewModels/offers_Categorise_view_model.dart new file mode 100644 index 00000000..b63dd553 --- /dev/null +++ b/lib/core/viewModels/offers_Categorise_view_model.dart @@ -0,0 +1,48 @@ +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/pharmacies_view_model.dart b/lib/core/viewModels/pharmacies_view_model.dart index 01ad4e72..b9e162fc 100644 --- a/lib/core/viewModels/pharmacies_view_model.dart +++ b/lib/core/viewModels/pharmacies_view_model.dart @@ -23,9 +23,11 @@ class PharmacyViewModel extends BaseViewModel { setState(ViewState.Error); } else setState(ViewState.Idle); - //_pharmacyService.clearPharmaciesList(); } + clearMedicineSearch(){ + _pharmacyService.clearMedicineList(); + } Future getMedicine({String name}) async { hasError = false; _pharmacyService.clearMedicineList(); diff --git a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart index 00f4819b..06295188 100644 --- a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart @@ -1,3 +1,11 @@ +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'; @@ -5,4 +13,183 @@ 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 new file mode 100644 index 00000000..485c92fb --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -0,0 +1,117 @@ +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/Country.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyAddressesModel.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class PharmacyAddressesViewModel extends BaseViewModel { + PharmacyAddressService _pharmacyAddressService = + locator(); + + List get addresses => _pharmacyAddressService.addresses; + + int get selectedAddressIndex => _pharmacyAddressService.selectedAddressIndex; + + CountryData get country => _pharmacyAddressService.country; + + setSelectedAddressIndex(int index) { + _pharmacyAddressService.selectedAddressIndex = index; + } + + Future getAddressesList() async { + setState(ViewState.Busy); + await _pharmacyAddressService.getAddresses(); + if (_pharmacyAddressService.hasError) { + error = _pharmacyAddressService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + +/* Future getCountries(String countryName) async { + setState(ViewState.Busy); + await _pharmacyAddressService.getCountries(countryName); + if (_pharmacyAddressService.hasError) { + error = _pharmacyAddressService.error; + // setState(ViewState.Error); + } else { + // setState(ViewState.Idle); + } + }*/ + + Future addEditAddress(PickResult value, Addresses editedAddress) async { + setState(ViewState.Busy); + + Addresses sendingAddress; + + if (editedAddress == null) { + sendingAddress = Addresses(); + sendingAddress.id = "0"; + sendingAddress.firstName = user.firstName; + sendingAddress.lastName = user.lastName; + sendingAddress.email = user.emailAddress; + sendingAddress.company = null; + } else { + sendingAddress = editedAddress; + } + value.addressComponents.forEach((element) { + if (element.types.contains("country")) { + sendingAddress.country = element.longName; + } + if (element.types.contains("administrative_area_level_1")) { + sendingAddress.city = element.longName; + } + if (element.types.contains("postal_code")) { + sendingAddress.zipPostalCode = element.longName; + } + if (element.types.contains("administrative_area_level_2")) { + sendingAddress.province = element.longName; + } + }); + sendingAddress.latLong = value.geometry.location.toString(); + + await _pharmacyAddressService.getCountries(sendingAddress.country); + sendingAddress.countryId = country.id; + sendingAddress.stateProvinceId = null; + sendingAddress.address1 = value.formattedAddress; + sendingAddress.address2 = ""; + sendingAddress.phoneNumber = user.mobileNumber; + sendingAddress.faxNumber = user.faxNumber; + sendingAddress.customerAttributes = ""; + sendingAddress.createdOnUtc = DateTime.now().toString(); + + if (editedAddress == null) { + await _pharmacyAddressService.addCustomerAddress(sendingAddress); + } else { + await _pharmacyAddressService.editCustomerAddress(sendingAddress); + } + + if (_pharmacyAddressService.hasError) { + error = _pharmacyAddressService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future deleteAddresses(Addresses sendingAddress) async { + setState(ViewState.Busy); + await _pharmacyAddressService.deleteCustomerAddress(sendingAddress); + if (_pharmacyAddressService.hasError) { + error = _pharmacyAddressService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future saveSelectedAddressLocally(Addresses selectedAddress) async { + await sharedPref.setObject(PHARMACY_SELECTED_ADDRESS, selectedAddress); + } +} diff --git a/lib/core/viewModels/pharmacyModule/brand_view_model.dart b/lib/core/viewModels/pharmacyModule/brand_view_model.dart new file mode 100644 index 00000000..c981b2b3 --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/brand_view_model.dart @@ -0,0 +1,57 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/brands_service.dart'; + + +import '../../../locator.dart'; + +class BrandsViewModel extends BaseViewModel{ + BrandsService _brandsService = locator(); + List get brandsListList => _brandsService.brandsList; + + BrandsService _topBrandsService = locator(); + List get topBrandsListList => _topBrandsService.topBrandsList; + + List get searchList => + _brandsService.searchList; + + bool hasError = false; + + + Future getBrandsData() async { + hasError = false; + setState(ViewState.Busy); + await _brandsService.getBrands(); + if (_brandsService.hasError) { + error = _brandsService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getTopBrandsData() async { + hasError = false; + setState(ViewState.Busy); + await _topBrandsService.getTopBrands(); + if (_topBrandsService.hasError) { + error = _topBrandsService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + + Future searchProducts({String productName}) async { + hasError = false; + _brandsService.clearSearchList(); + setState(ViewState.Busy); + await _brandsService.searchProducts(productName: productName); + if (_brandsService.hasError) { + error = _brandsService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} \ 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 new file mode 100644 index 00000000..f8f5ea05 --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart @@ -0,0 +1,55 @@ +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 new file mode 100644 index 00000000..cd19a40f --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/lacum-trasnfer-viewModel.dart @@ -0,0 +1,42 @@ +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 new file mode 100644 index 00000000..ba8d70d9 --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart @@ -0,0 +1,111 @@ +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 new file mode 100644 index 00000000..b7ddb528 --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart @@ -0,0 +1,127 @@ +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/ShoppingCartResponse.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart'; +import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_service.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 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:flutter/material.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; + + CancelOrderService _cancelOrderService = locator(); + + List get cancelOrder => _cancelOrderService.cancelOrderList; + + + OrderPreviewService _orderServices = locator(); + List get addresses => _orderServices.addresses; + LacumAccountInformation get lacumInformation => + _orderServices.lacumInformation; + ShoppingCartResponse cartResponse = ShoppingCartResponse(); + PaymentCheckoutData paymentCheckoutData = PaymentCheckoutData(); + double totalAdditionalShippingCharge = 0; + + + + Future getOrder(customerId, pageID) async { + print("this is customer id" + customerId); + setState(ViewState.Busy); + await _orderService.getOrder(customerId, pageID); + if (_orderService.hasError) { + error = _orderService.error; + setState(ViewState.Error); + } else { + //order = _orderService.orderList; + setState(ViewState.Idle); + } + } + + Future getOrderDetails(orderId) async { + setState(ViewState.Busy); + await _orderDetailsService.getOrderDetails(orderId); + if (_orderDetailsService.hasError) { + error = _orderDetailsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getProductReview() async { + setState(ViewState.Busy); + // await _orderService.getProductReview(); + if (_orderService.hasError) { + error = _orderService.error; + setState(ViewState.Error); + } else { + //order = _orderService.orderList; + setState(ViewState.Idle); + } + } + + Future getCanceledOrder(order, context) async { + print("this is order id" + order); + setState(ViewState.Busy); + dynamic res; + await _cancelOrderService.getCanceledOrder(order).then((value) { + res = value['success']['SuccessEndUserMsg']; + print(value['success']['SuccessEndUserMsg']); + AppToast.showSuccessToast(message: "Request Sent Successfully"); +// Navigator.pop(context); + }); + if (_cancelOrderService.hasError) { + error = _cancelOrderService.error; + setState(ViewState.Error); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); +// AppToast.showSuccessToast(message: "Request Sent Successfully"); +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => OrderPage())); + + } + + return res; + } + + Future makeReview(Product product, double rating, String reviewText) async { + setState(ViewState.Busy); + await _orderDetailsService.makeReview(product, rating, reviewText); + if (_orderDetailsService.hasError) { + error = _orderDetailsService.error; + setState(ViewState.Error); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + AppToast.showSuccessToast( + message: "Your review has been Submitted successfully"); + } + } + Future makeOrder() async { + setState(ViewState.Busy); + await _orderServices.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts); + if (_orderServices.hasError) { + error = _orderServices.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + +} diff --git a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart index f8c574f7..4dfc6a26 100644 --- a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart @@ -1,3 +1,4 @@ +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'; @@ -21,6 +22,25 @@ 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) { @@ -47,6 +67,7 @@ class PharmacyModuleViewModel extends BaseViewModel { error = _pharmacyService.error; setState(ViewState.Error); } else { + setState(ViewState.Idle); _getBestSellerProducts(); } } @@ -70,4 +91,18 @@ 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/product_detail_view_model.dart b/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart new file mode 100644 index 00000000..47a3bb11 --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart @@ -0,0 +1,110 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/product_detail_service.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/specification.dart'; + + +import '../../../locator.dart'; + +class ProductDetailViewModel extends BaseViewModel{ + ProductDetailService _productDetailService = locator(); + ProductDetailService _productLocationService = locator(); + ProductDetailService _productWishlistService = locator(); + ProductDetailService _productSpecification = locator(); + + List get productDetailService => _productDetailService.productDetailList; + + List get productLocationService => _productLocationService.productLocationList; + + List get wishListItems => _productWishlistService.wishListProducts; + + List get productSpecification => _productSpecification.productSpecification; + + bool hasError = false; + + + Future getProductReviewsData(productID) async { + print('ENAD REview'); + hasError = false; + setState(ViewState.Busy); + await _productDetailService.getProductReviews(productID); + if (_productDetailService.hasError) { + error = _productDetailService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getProductLocationData() async { + print('ENAD in model view'); + hasError = false; + setState(ViewState.Busy); + await _productLocationService.getProductAvailabiltyDetail(); + if (_productLocationService.hasError) { + error = _productLocationService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future addToCartData(quantity, itemID) async { + hasError = false; + setState(ViewState.Busy); + await _productLocationService.addToCart(quantity, itemID); + if (_productLocationService.hasError) { + error = _productLocationService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future addToWishlistData(itemID) async { + hasError = false; + setState(ViewState.Busy); + await _productLocationService.addToWishlist(itemID); + if (_productLocationService.hasError) { + error = _productLocationService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future checkWishlistData() async { + hasError = false; + setState(ViewState.Busy); + await _productWishlistService.getWishlistItems(); + if (_productWishlistService.hasError) { + error = _productWishlistService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + + Future deletWishlistData(itemID) async { + hasError = false; + setState(ViewState.Busy); + await _productWishlistService.delteItemFromWishlist(itemID); + if (_productWishlistService.hasError) { + error = _productWishlistService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + + Future productSpecificationData(itemID) async { + hasError = false; + setState(ViewState.Busy); + await _productWishlistService.productSpecificationData(itemID); + if (_productWishlistService.hasError) { + error = _productWishlistService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + +} \ No newline at end of file diff --git a/lib/core/viewModels/pharmacyModule/review_view_model.dart b/lib/core/viewModels/pharmacyModule/review_view_model.dart new file mode 100644 index 00000000..3661820b --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/review_view_model.dart @@ -0,0 +1,26 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/reviewModel.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/review_service.dart'; + +import '../../../locator.dart'; + +class ReviewViewModel extends BaseViewModel{ + ReviewService _reviewService = locator(); + + List get reviewListList => _reviewService.reviewList; + + bool hasError = false; + + + Future getReviewData() async { + hasError = false; + setState(ViewState.Busy); + await _reviewService.getReview(); + if (_reviewService.hasError) { + error = _reviewService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} \ No newline at end of file diff --git a/lib/core/viewModels/pharmacyModule/tems-condition-viewmodel.dart b/lib/core/viewModels/pharmacyModule/tems-condition-viewmodel.dart new file mode 100644 index 00000000..6a5bd476 --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/tems-condition-viewmodel.dart @@ -0,0 +1,24 @@ +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/pharmacyModule/wishlist_view_model.dart b/lib/core/viewModels/pharmacyModule/wishlist_view_model.dart new file mode 100644 index 00000000..788b7f3c --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/wishlist_view_model.dart @@ -0,0 +1,36 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/wishList_service.dart'; + +import '../../../locator.dart'; + +class WishListViewModel extends BaseViewModel{ + WishListService _wishlistService = locator(); + + List get wishListList => _wishlistService.wishListProducts; + bool hasError = false; + + +// Future getWishlistData() async { +// setState(ViewState.Busy); +// await _wishlistService.getWishlist(); +// if (_wishlistService.hasError) { +// error = _wishlistService.error; +// setState(ViewState.Error); +// } else { +// setState(ViewState.Idle); +// } +// } + + Future getWishlistData() async { + hasError = false; + setState(ViewState.Busy); + await _wishlistService.getWishlist(); + if (_wishlistService.hasError) { + error = _wishlistService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} \ No newline at end of file diff --git a/lib/core/viewModels/pharmacy_categorise_view_model.dart b/lib/core/viewModels/pharmacy_categorise_view_model.dart new file mode 100644 index 00000000..5e1f4f9f --- /dev/null +++ b/lib/core/viewModels/pharmacy_categorise_view_model.dart @@ -0,0 +1,158 @@ +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/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index e65a70f7..baaf6b5b 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -2,6 +2,8 @@ import 'dart:async'; import 'package:connectivity/connectivity.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; +import 'package:diplomaticquarterapp/core/service/privilege_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; @@ -34,14 +36,21 @@ class ProjectViewModel extends BaseViewModel { bool get isArabic => _isArabic; - // BaseViewModel baseViewModel = locator() + + bool isLoginChild = false; + List privilegeRootUser = List(); + List privilegeChildUser = List(); + + List get privileges => + isLoginChild ? privilegeChildUser : privilegeChildUser; + StreamSubscription subscription; ProjectViewModel() { - // PlatformBridge.init(context); // Moved to 'main.dart' due to context availability loadSharedPrefLanguage(); - - subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { + subscription = Connectivity() + .onConnectivityChanged + .listen((ConnectivityResult result) { switch (result) { case ConnectivityResult.wifi: isInternetConnection = true; @@ -57,7 +66,7 @@ class ProjectViewModel extends BaseViewModel { }); } - void loadSharedPrefLanguage() async { + Future loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); _appLocale = Locale(currentLanguage); _isArabic = currentLanguage == 'ar'; @@ -80,6 +89,49 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } + setPrivilegeModelList( + {List privilege}) { + this.isLoginChild = isLoginChild; + privilegeRootUser = privilege; + + notifyListeners(); + } + + setPrivilege({privilegeList, bool isLoginChild = false}) { + List privilege = List(); + + privilegeList['List'][0]['ListPrivilege'].forEach((item) { + privilege.add(PrivilegeModel.fromJson(item)); + }); + + this.isLoginChild = isLoginChild; + if (isLoginChild) + privilegeChildUser = privilege; + else + privilegeRootUser = privilege; + + notifyListeners(); + } + + setIsLoginChild({@required bool isLoginChild}){ + this.isLoginChild = isLoginChild; + notifyListeners(); + } + + bool havePrivilege(int id) { + bool isHavePrivilege = false; + if(isLoginChild) + privilegeChildUser.forEach((element) { + if (element.iD == id) isHavePrivilege = element.privilege; + }); + else{ + privilegeRootUser.forEach((element) { + if (element.iD == id) isHavePrivilege = element.privilege; + }); + } + return isHavePrivilege; + } + @override void dispose() { if (subscription != null) subscription.cancel(); diff --git a/lib/core/viewModels/weather/weather_view_model.dart b/lib/core/viewModels/weather/weather_view_model.dart new file mode 100644 index 00000000..bb201843 --- /dev/null +++ b/lib/core/viewModels/weather/weather_view_model.dart @@ -0,0 +1,31 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; +import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart'; + +import 'package:diplomaticquarterapp/core/service/er/er_service.dart'; +import 'package:diplomaticquarterapp/core/service/weather_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; + +import '../../../locator.dart'; + +class WeatherViewModel extends BaseViewModel { + WeatherService _weatherService = locator(); + List get weatherIndicatorData => + _weatherService.weatherIndicatorData; + getWeatherData() async { + setState(ViewState.Busy); + + // if (id != null && projectID != null) { + // await _erService.getProjectAvgERWaitingTimeOrders( + // id: id, projectID: projectID); + // } else { + await _weatherService.getWeatherData(); + // } + if (_weatherService.hasError) { + error = _weatherService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index f00cc1f6..cfdad053 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -4,11 +4,18 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_v import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/review_service.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/wishList_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/cancelOrder_service.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:get_it/get_it.dart'; import 'core/service/AlHabibMedicalService/cmc_service.dart'; +import 'core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'core/service/AlHabibMedicalService/e_referral_service.dart'; import 'core/service/AlHabibMedicalService/home_health_care_service.dart'; import 'core/service/AuthenticatedUserObject.dart'; @@ -45,11 +52,19 @@ 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/packages_offers/PackagesOffersServices.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/service/privilege_service.dart'; +import 'core/service/weather_service.dart'; import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'core/service/parmacyModule/parmacy_module_service.dart'; +import 'core/service/offers_service.dart'; +import 'core/service/pharmacy_categorise_service.dart'; import 'core/viewModels/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'; @@ -82,16 +97,35 @@ 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/packages_offers/PackagesOffersViewModel.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/brand_view_model.dart'; +import 'core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; +import 'core/viewModels/pharmacyModule/product_detail_view_model.dart'; +import 'core/viewModels/pharmacyModule/review_view_model.dart'; +import 'core/viewModels/pharmacyModule/wishlist_view_model.dart'; +import 'core/viewModels/qr_view_model.dart'; +import 'core/viewModels/vaccine_view_model.dart'; +import 'core/service/vaccine_service.dart'; +import 'core/viewModels/weather/weather_view_model.dart'; +import 'services/pharmacy_services/brands_service.dart'; +import 'services/pharmacy_services/product_detail_service.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; @@ -124,6 +158,7 @@ void setupLocator() { locator.registerLazySingleton(() => EReferralService()); locator.registerLazySingleton(() => HomeHealthCareService()); locator.registerLazySingleton(() => CMCService()); + locator.registerLazySingleton(() => PatientSickLeaveService()); locator.registerLazySingleton(() => MyBalanceService()); locator.registerLazySingleton(() => BloodSugarService()); @@ -136,6 +171,7 @@ void setupLocator() { locator.registerLazySingleton(() => FindusService()); locator.registerLazySingleton(() => LiveChatService()); locator.registerLazySingleton(() => H2OService()); + locator.registerLazySingleton(() => BloodDonationService()); locator.registerLazySingleton(() => BloodDetailsService()); locator.registerLazySingleton(() => ChildVaccinesService()); @@ -144,10 +180,30 @@ void setupLocator() { locator.registerLazySingleton(() => DeleteBabyService()); locator.registerLazySingleton(() => VaccinationTableService()); - locator.registerLazySingleton(() => NotificationService()); + //pharmacy + locator.registerLazySingleton(() => PharmacyCategoriseService()); + locator.registerLazySingleton(() => OffersCategoriseService()); + + locator.registerLazySingleton(() => NotificationService()); locator.registerLazySingleton(() => PharmacyModuleService()); + locator.registerLazySingleton(() => WishListService()); + locator.registerLazySingleton(() => ReviewService()); + locator.registerLazySingleton(() => BrandsService()); + locator.registerLazySingleton(() => ProductDetailService()); + 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(() => CancelOrderService()); + locator.registerLazySingleton(() => PrivilegeService()); + locator.registerLazySingleton(() => WeatherService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -178,6 +234,10 @@ 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()); @@ -193,7 +253,21 @@ void setupLocator() { locator.registerFactory(() => NotificationViewModel()); locator.registerFactory(() => PharmacyModuleViewModel()); + locator.registerFactory(() => WishListViewModel()); + locator.registerFactory(() => ReviewViewModel()); + locator.registerFactory(() => BrandsViewModel()); + locator.registerFactory(() => ProductDetailViewModel()); + locator.registerFactory(() => WeatherViewModel()); + + locator.registerFactory(() => OrderPreviewViewModel()); + locator.registerFactory(() => LacumViewModel()); + locator.registerFactory(() => LacumTranferViewModel()); + locator.registerFactory(() => LacumRegistrationViewModel()); + + //pharmacy + locator.registerFactory(() => PharmacyCategoriseViewModel()); + locator.registerFactory(() => OffersCategoriseViewModel()); // Offer And Packages //---------------------- diff --git a/lib/main.dart b/lib/main.dart index 19304516..fe129e01 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -13,11 +13,13 @@ import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import 'Constants.dart'; import 'config/size_config.dart'; import 'core/model/geofencing/requests/GeoZonesRequestModel.dart'; import 'core/service/geofencing/GeofencingServices.dart'; import 'core/viewModels/project_view_model.dart'; import 'locator.dart'; +import 'pages/pharmacies/compare-list.dart'; void main() async { setupLocator(); @@ -32,6 +34,8 @@ class MyApp extends StatelessWidget { LocalNotification.getInstance().showNow(title: "Payload", subtitle: payload, payload: payload); }); + final themeNotifier = Provider.of(context); + precacheImage(AssetImage('assets/images/powerd-by.jpg'), context); return LayoutBuilder( builder: (context, constraints) { return OrientationBuilder( @@ -50,10 +54,13 @@ class MyApp extends StatelessWidget { StreamProvider.value( value: RobotProvider().intStream(), initialData: RobotProvider().setValue({}), - ) + ), + ChangeNotifierProvider( + create: (context) => CompareList()), ], child: Consumer( builder: (context, projectProvider, child) => MaterialApp( + showSemanticsDebugger: false, title: 'Diplomatic Quarter App', locale: projectProvider.appLocal, @@ -79,6 +86,11 @@ class MyApp extends StatelessWidget { }, ), hintColor: Colors.grey[400], + textTheme: TextTheme( + headline1: TextStyle( + color: Color(0xffB8382C), + ), + ), disabledColor: Colors.grey[300], errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor: Color(0xffE9E9E9), // Colors.grey[100], @@ -89,6 +101,8 @@ class MyApp extends StatelessWidget { highlightColor: Colors.grey[100].withOpacity(0.4), splashColor: Colors.transparent, primaryColor: Colors.grey, + toggleableActiveColor: secondaryColor, + indicatorColor: secondaryColor, bottomSheetTheme: BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')), cursorColor: Colors.grey, iconTheme: IconThemeData(), diff --git a/lib/models/Appointments/AppoimentAllHistoryResultList.dart b/lib/models/Appointments/AppoimentAllHistoryResultList.dart index 20eace25..045f759e 100644 --- a/lib/models/Appointments/AppoimentAllHistoryResultList.dart +++ b/lib/models/Appointments/AppoimentAllHistoryResultList.dart @@ -50,6 +50,7 @@ class AppoitmentAllHistoryResultList { bool isExecludeDoctor; int isFollowup; bool isLiveCareAppointment; + bool isInOutPatient; bool isMedicalReportRequested; bool isOnlineCheckedIN; String latitude; @@ -188,6 +189,7 @@ class AppoitmentAllHistoryResultList { isExecludeDoctor = json['IsExecludeDoctor']; isFollowup = json['IsFollowup']; isLiveCareAppointment = json['IsLiveCareAppointment']; + isInOutPatient = json['IsInOutPatient']; isMedicalReportRequested = json['IsMedicalReportRequested']; isOnlineCheckedIN = json['IsOnlineCheckedIN']; latitude = json['Latitude']; @@ -259,6 +261,7 @@ class AppoitmentAllHistoryResultList { data['IsExecludeDoctor'] = this.isExecludeDoctor; data['IsFollowup'] = this.isFollowup; data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['IsInOutPatient'] = this.isInOutPatient; data['IsMedicalReportRequested'] = this.isMedicalReportRequested; data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN; data['Latitude'] = this.latitude; 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/Appointments/toDoCountProviderModel.dart b/lib/models/Appointments/toDoCountProviderModel.dart index 0fd83491..e44a0ebb 100644 --- a/lib/models/Appointments/toDoCountProviderModel.dart +++ b/lib/models/Appointments/toDoCountProviderModel.dart @@ -2,11 +2,15 @@ import 'package:flutter/cupertino.dart'; class ToDoCountProviderModel with ChangeNotifier { int _count; + bool _isShowBadge = false; int get count => _count == null ? 0 : _count; - void setState(int count) { + bool get isShowBadge => _isShowBadge; + + void setState(int count, bool isShowBadge) { _count = count; + _isShowBadge = isShowBadge; notifyListeners(); } } diff --git a/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart index b21d940f..750cf0be 100644 --- a/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart +++ b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart @@ -25,7 +25,7 @@ class GetAllSharedRecordsByStatusResponse { dynamic successMsgN; dynamic doctorInformationList; List getAllPendingRecordsList; - List getAllSharedRecordsByStatusList; + List getAllSharedRecordsByStatusList = List(); List getResponseFileList; bool isHMGPatient; bool isLoginSuccessfully; @@ -92,7 +92,7 @@ class GetAllSharedRecordsByStatusResponse { this.successMsgN, this.doctorInformationList, this.getAllPendingRecordsList, - this.getAllSharedRecordsByStatusList, + this.getAllSharedRecordsByStatusList , this.getResponseFileList, this.isHMGPatient, this.isLoginSuccessfully, diff --git a/lib/models/id-name-pair.dart b/lib/models/id-name-pair.dart new file mode 100644 index 00000000..00336572 --- /dev/null +++ b/lib/models/id-name-pair.dart @@ -0,0 +1,12 @@ +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/models/pharmacy/Wishlist.dart b/lib/models/pharmacy/Wishlist.dart new file mode 100644 index 00000000..41704ede --- /dev/null +++ b/lib/models/pharmacy/Wishlist.dart @@ -0,0 +1,881 @@ +// To parse this JSON data, do +// +// final wishlist = wishlistFromJson(jsonString); + +import 'dart:convert'; + +List wishlistFromJson(String str) => List.from(json.decode(str).map((x) => Wishlist.fromJson(x))); + +String wishlistToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class Wishlist { + Wishlist({ + 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, + }); + + dynamic languageId; + dynamic id; + List productAttributes; + dynamic customerEnteredPrice; + dynamic quantity; + dynamic discountAmountInclTax; + dynamic subtotal; + dynamic subtotalWithVat; + dynamic subtotalVatAmount; + dynamic subtotalVatRate; + dynamic currency; + dynamic currencyn; + dynamic rentalStartDateUtc; + dynamic rentalEndDateUtc; + dynamic createdOnUtc; + dynamic updatedOnUtc; + dynamic shoppingCartType; + dynamic productId; + dynamic product; + dynamic customerId; + Customer customer; + + factory Wishlist.fromJson(Map json) => Wishlist( + languageId: json["language_id"], + id: json["id"], + productAttributes: List.from(json["product_attributes"].map((x) => x)), + 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: DateTime.parse(json["created_on_utc"]), + updatedOnUtc: DateTime.parse(json["updated_on_utc"]), + shoppingCartType: json["shopping_cart_type"], + productId: json["product_id"], + product: Product.fromJson(json["product"]), + customerId: json["customer_id"], + customer: Customer.fromJson(json["customer"]), + ); + + Map toJson() => { + "language_id": languageId, + "id": id, + "product_attributes": List.from(productAttributes.map((x) => x)), + "customer_entered_price": customerEnteredPrice, + "quantity": quantity, + "discount_amount_incl_tax": discountAmountInclTax, + "subtotal": subtotal, + "subtotal_with_vat": subtotalWithVat, + "subtotal_vat_amount": subtotalVatAmount, + "subtotal_vat_rate": subtotalVatRate, + "currency": currency, + "currencyn": currencyn, + "rental_start_date_utc": rentalStartDateUtc, + "rental_end_date_utc": rentalEndDateUtc, + "created_on_utc": createdOnUtc.toIso8601String(), + "updated_on_utc": updatedOnUtc.toIso8601String(), + "shopping_cart_type": shoppingCartType, + "product_id": productId, + "product": product.toJson(), + "customer_id": customerId, + "customer": customer.toJson(), + }; +} + +class Customer { + Customer({ + 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, + }); + + Address billingAddress; + Address shippingAddress; + List
addresses; + String id; + String username; + String email; + dynamic firstName; + dynamic lastName; + dynamic languageId; + dynamic adminComment; + bool isTaxExempt; + bool hasShoppingCartItems; + bool active; + bool deleted; + bool isSystemAccount; + dynamic systemName; + String lastIpAddress; + DateTime createdOnUtc; + DateTime lastLoginDateUtc; + DateTime lastActivityDateUtc; + dynamic registeredInStoreId; + List roleIds; + + factory Customer.fromJson(Map json) => Customer( + billingAddress: Address.fromJson(json["billing_address"]), + shippingAddress: Address.fromJson(json["shipping_address"]), + addresses: List
.from(json["addresses"].map((x) => Address.fromJson(x))), + id: json["id"], + username: json["username"], + email: 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: 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() => { + "billing_address": billingAddress.toJson(), + "shipping_address": shippingAddress.toJson(), + "addresses": List.from(addresses.map((x) => x.toJson())), + "id": id, + "username": username, + "email": 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.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)), + }; +} + +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; + dynamic 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 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; + 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; + 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; + String currency; + String currencyn; + double weight; + dynamic length; + dynamic width; + dynamic height; + dynamic availableStartDateTimeUtc; + dynamic availableEndDateTimeUtc; + dynamic displayOrder; + bool published; + bool deleted; + DateTime createdOnUtc; + DateTime 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; + + factory Product.fromJson(Map json) => Product( + id: json["id"], + visibleIndividually: json["visible_individually"], + name: json["name"], + namen: json["namen"], + localizedNames: List.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))), + 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"].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: json["product_type"], + parentGroupedProductId: json["parent_grouped_product_id"], + roleIds: List.from(json["role_ids"].map((x) => x)), + discountIds: List.from(json["discount_ids"].map((x) => x)), + storeIds: List.from(json["store_ids"].map((x) => x)), + manufacturerIds: List.from(json["manufacturer_ids"].map((x) => x)), + reviews: List.from(json["reviews"].map((x) => x)), + images: List.from(json["images"].map((x) => Image.fromJson(x))), + attributes: List.from(json["attributes"].map((x) => x)), + specifications: List.from(json["specifications"].map((x) => Specification.fromJson(x))), + associatedProductIds: List.from(json["associated_product_ids"].map((x) => x)), + 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": List.from(localizedNames.map((x) => x.toJson())), + "short_description": shortDescription, + "short_descriptionn": shortDescriptionn, + "full_description": fullDescription, + "full_descriptionn": fullDescriptionn, + "markas_new": markasNew, + "show_on_home_page": showOnHomePage, + "meta_keywords": metaKeywords, + "meta_description": metaDescription, + "meta_title": 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": productType, + "parent_grouped_product_id": parentGroupedProductId, + "role_ids": List.from(roleIds.map((x) => x)), + "discount_ids": List.from(discountIds.map((x) => x)), + "store_ids": List.from(storeIds.map((x) => x)), + "manufacturer_ids": List.from(manufacturerIds.map((x) => x)), + "reviews": List.from(reviews.map((x) => x)), + "images": List.from(images.map((x) => x.toJson())), + "attributes": List.from(attributes.map((x) => x)), + "specifications": List.from(specifications.map((x) => x.toJson())), + "associated_product_ids": List.from(associatedProductIds.map((x) => x)), + "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, + }; +} + +class LocalizedName { + LocalizedName({ + this.languageId, + this.localizedName, + }); + + dynamic languageId; + String localizedName; + + factory LocalizedName.fromJson(Map json) => LocalizedName( + languageId: json["language_id"], + localizedName: json["localized_name"], + ); + + Map toJson() => { + "language_id": languageId, + "localized_name": localizedName, + }; +} + +class Specification { + Specification({ + this.id, + this.displayOrder, + this.defaultValue, + this.defaultValuen, + this.name, + this.nameN, + }); + + dynamic id; + dynamic displayOrder; + String defaultValue; + String defaultValuen; + String name; + String nameN; + + factory Specification.fromJson(Map json) => Specification( + id: json["id"], + displayOrder: json["display_order"], + defaultValue: json["default_value"], + defaultValuen: json["default_valuen"], + name: json["name"], + nameN: json["nameN"], + ); + + Map toJson() => { + "id": id, + "display_order": displayOrder, + "default_value": defaultValue, + "default_valuen": defaultValuen, + "name": name, + "nameN": nameN, + }; +} + +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/models/pharmacy/addToCartModel.dart b/lib/models/pharmacy/addToCartModel.dart new file mode 100644 index 00000000..3253e6f7 --- /dev/null +++ b/lib/models/pharmacy/addToCartModel.dart @@ -0,0 +1,924 @@ +// To parse this JSON data, do +// +// final shoppingCart = shoppingCartFromJson(jsonString); + +import 'dart:convert'; + +ShoppingCart shoppingCartFromJson(String str) => ShoppingCart.fromJson(json.decode(str)); + +String shoppingCartToJson(ShoppingCart data) => json.encode(data.toJson()); + +class ShoppingCart { + ShoppingCart({ + this.itemCount, + this.quantityCount, + this.subtotal, + this.subtotalWithVat, + this.subtotalVatAmount, + this.subtotalVatRate, + this.shoppingCarts, + }); + + int itemCount; + int quantityCount; + double subtotal; + double subtotalWithVat; + double subtotalVatAmount; + int subtotalVatRate; + List shoppingCarts; + + factory ShoppingCart.fromJson(Map json) => ShoppingCart( + itemCount: json["item_count"], + quantityCount: json["quantity_count"], + subtotal: json["subtotal"].toDouble(), + subtotalWithVat: json["subtotal_with_vat"].toDouble(), + subtotalVatAmount: json["subtotal_vat_amount"].toDouble(), + subtotalVatRate: json["subtotal_vat_rate"], + shoppingCarts: List.from(json["shopping_carts"].map((x) => ShoppingCartElement.fromJson(x))), + ); + + Map toJson() => { + "item_count": itemCount, + "quantity_count": quantityCount, + "subtotal": subtotal, + "subtotal_with_vat": subtotalWithVat, + "subtotal_vat_amount": subtotalVatAmount, + "subtotal_vat_rate": subtotalVatRate, + "shopping_carts": List.from(shoppingCarts.map((x) => x.toJson())), + }; +} + +class ShoppingCartElement { + ShoppingCartElement({ + 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, + }); + + int languageId; + String id; + List productAttributes; + int customerEnteredPrice; + int quantity; + dynamic discountAmountInclTax; + String subtotal; + String subtotalWithVat; + String subtotalVatAmount; + String subtotalVatRate; + String currency; + String currencyn; + dynamic rentalStartDateUtc; + dynamic rentalEndDateUtc; + DateTime createdOnUtc; + DateTime updatedOnUtc; + String shoppingCartType; + int productId; + Product product; + int customerId; + Customer customer; + + factory ShoppingCartElement.fromJson(Map json) => ShoppingCartElement( + languageId: json["language_id"], + id: json["id"], + productAttributes: List.from(json["product_attributes"].map((x) => x)), + 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: DateTime.parse(json["created_on_utc"]), + updatedOnUtc: DateTime.parse(json["updated_on_utc"]), + shoppingCartType: json["shopping_cart_type"], + productId: json["product_id"], + product: Product.fromJson(json["product"]), + customerId: json["customer_id"], + customer: Customer.fromJson(json["customer"]), + ); + + Map toJson() => { + "language_id": languageId, + "id": id, + "product_attributes": List.from(productAttributes.map((x) => x)), + "customer_entered_price": customerEnteredPrice, + "quantity": quantity, + "discount_amount_incl_tax": discountAmountInclTax, + "subtotal": subtotal, + "subtotal_with_vat": subtotalWithVat, + "subtotal_vat_amount": subtotalVatAmount, + "subtotal_vat_rate": subtotalVatRate, + "currency": currency, + "currencyn": currencyn, + "rental_start_date_utc": rentalStartDateUtc, + "rental_end_date_utc": rentalEndDateUtc, + "created_on_utc": createdOnUtc.toIso8601String(), + "updated_on_utc": updatedOnUtc.toIso8601String(), + "shopping_cart_type": shoppingCartType, + "product_id": productId, + "product": product.toJson(), + "customer_id": customerId, + "customer": customer.toJson(), + }; +} + +class Customer { + Customer({ + 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, + }); + + Address billingAddress; + Address shippingAddress; + List
addresses; + String id; + String username; + String email; + dynamic firstName; + dynamic lastName; + dynamic languageId; + dynamic adminComment; + bool isTaxExempt; + bool hasShoppingCartItems; + bool active; + bool deleted; + bool isSystemAccount; + dynamic systemName; + String lastIpAddress; + DateTime createdOnUtc; + DateTime lastLoginDateUtc; + DateTime lastActivityDateUtc; + int registeredInStoreId; + List roleIds; + + factory Customer.fromJson(Map json) => Customer( + billingAddress: Address.fromJson(json["billing_address"]), + shippingAddress: Address.fromJson(json["shipping_address"]), + addresses: List
.from(json["addresses"].map((x) => Address.fromJson(x))), + id: json["id"], + username: json["username"], + email: 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: 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() => { + "billing_address": billingAddress.toJson(), + "shipping_address": shippingAddress.toJson(), + "addresses": List.from(addresses.map((x) => x.toJson())), + "id": id, + "username": username, + "email": 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.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)), + }; +} + +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 { CALIFORNIA, RIYADH, AL_OYUN } + +final cityValues = EnumValues({ + "Al Oyun": City.AL_OYUN, + "California": City.CALIFORNIA, + "Riyadh": City.RIYADH +}); + +enum Country { UNITED_STATES, SAUDI_ARABIA } + +final countryValues = EnumValues({ + "Saudi Arabia": Country.SAUDI_ARABIA, + "United States": Country.UNITED_STATES +}); + +enum Email { TAMER_FANASHEH_GMAIL_COM, TAMER_DASDASDAS_GMAIL_COM, TAMER_F_CLOUDSOLUTION_SA_COM } + +final emailValues = EnumValues({ + "Tamer.dasdasdas@gmail.com": Email.TAMER_DASDASDAS_GMAIL_COM, + "Tamer.fanasheh@gmail.com": Email.TAMER_FANASHEH_GMAIL_COM, + "Tamer.F@cloudsolution-sa.com": Email.TAMER_F_CLOUDSOLUTION_SA_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 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; + List localizedNames; + 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; + dynamic rxMessage; + dynamic rxMessagen; + dynamic manufacturerPartNumber; + dynamic gtin; + bool isGiftCard; + bool requireOtherProducts; + bool automaticallyAddRequiredProducts; + bool isDownload; + bool unlimitedDownloads; + int maxNumberOfDownloads; + dynamic downloadExpirationDays; + bool hasSampleDownload; + bool hasUserAgreement; + bool isRecurring; + int recurringCycleLength; + int recurringTotalCycles; + bool isRental; + int rentalPriceLength; + bool isShipEnabled; + bool isFreeShipping; + bool shipSeparately; + int 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; + dynamic allowedQuantities; + bool allowAddingOnlyExistingAttributeCombinations; + bool disableBuyButton; + bool disableWishlistButton; + bool availableForPreOrder; + dynamic preOrderAvailabilityStartDateTimeUtc; + bool callForPrice; + double price; + int oldPrice; + double productCost; + dynamic specialPrice; + dynamic specialPriceStartDateTimeUtc; + dynamic specialPriceEndDateTimeUtc; + bool customerEntersPrice; + int minimumCustomerEnteredPrice; + int maximumCustomerEnteredPrice; + bool basepriceEnabled; + int basepriceAmount; + int basepriceBaseAmount; + bool hasTierPrices; + bool hasDiscountsApplied; + dynamic discountName; + dynamic discountNamen; + dynamic discountDescription; + dynamic discountDescriptionn; + dynamic discountPercentage; + String currency; + String currencyn; + double weight; + int length; + int width; + int height; + dynamic availableStartDateTimeUtc; + dynamic availableEndDateTimeUtc; + int displayOrder; + bool published; + bool deleted; + DateTime createdOnUtc; + DateTime 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; + + factory Product.fromJson(Map json) => Product( + id: json["id"], + visibleIndividually: json["visible_individually"], + name: json["name"], + namen: json["namen"], + localizedNames: List.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))), + 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"] == 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: json["product_type"], + parentGroupedProductId: json["parent_grouped_product_id"], + roleIds: List.from(json["role_ids"].map((x) => x)), + discountIds: List.from(json["discount_ids"].map((x) => x)), + storeIds: List.from(json["store_ids"].map((x) => x)), + manufacturerIds: List.from(json["manufacturer_ids"].map((x) => x)), + reviews: List.from(json["reviews"].map((x) => x)), + images: List.from(json["images"].map((x) => Image.fromJson(x))), + attributes: List.from(json["attributes"].map((x) => x)), + specifications: List.from(json["specifications"].map((x) => Specification.fromJson(x))), + associatedProductIds: List.from(json["associated_product_ids"].map((x) => x)), + 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": List.from(localizedNames.map((x) => x.toJson())), + "short_description": shortDescription, + "short_descriptionn": 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": productType, + "parent_grouped_product_id": parentGroupedProductId, + "role_ids": List.from(roleIds.map((x) => x)), + "discount_ids": List.from(discountIds.map((x) => x)), + "store_ids": List.from(storeIds.map((x) => x)), + "manufacturer_ids": List.from(manufacturerIds.map((x) => x)), + "reviews": List.from(reviews.map((x) => x)), + "images": List.from(images.map((x) => x.toJson())), + "attributes": List.from(attributes.map((x) => x)), + "specifications": List.from(specifications.map((x) => x.toJson())), + "associated_product_ids": List.from(associatedProductIds.map((x) => x)), + "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, + }); + + int id; + int 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, + }; +} + +class LocalizedName { + LocalizedName({ + this.languageId, + this.localizedName, + }); + + int languageId; + String localizedName; + + factory LocalizedName.fromJson(Map json) => LocalizedName( + languageId: json["language_id"], + localizedName: json["localized_name"], + ); + + Map toJson() => { + "language_id": languageId, + "localized_name": localizedName, + }; +} + +class Specification { + Specification({ + this.id, + this.displayOrder, + this.defaultValue, + this.defaultValuen, + this.name, + this.nameN, + }); + + int id; + int displayOrder; + String defaultValue; + String defaultValuen; + String name; + String nameN; + + factory Specification.fromJson(Map json) => Specification( + id: json["id"], + displayOrder: json["display_order"], + defaultValue: json["default_value"], + defaultValuen: json["default_valuen"], + name: json["name"], + nameN: json["nameN"], + ); + + Map toJson() => { + "id": id, + "display_order": displayOrder, + "default_value": defaultValue, + "default_valuen": defaultValuen, + "name": name, + "nameN": nameN, + }; +} + +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/models/pharmacy/brandModel.dart b/lib/models/pharmacy/brandModel.dart new file mode 100644 index 00000000..2855d492 --- /dev/null +++ b/lib/models/pharmacy/brandModel.dart @@ -0,0 +1,137 @@ +// To parse this JSON data, do +// +// final brand = brandFromJson(jsonString); + +import 'dart:convert'; + +List brandFromJson(String str) => List.from(json.decode(str).map((x) => Brand.fromJson(x))); + +String brandToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class Brand { + Brand({ + this.id, + this.name, + this.namen, + this.localizedNames, + this.description, + this.manufacturerTemplateId, + this.metaKeywords, + this.metaDescription, + this.metaTitle, + this.pageSize, + this.pageSizeOptions, + this.priceRanges, + this.published, + this.deleted, + this.displayOrder, + this.createdOnUtc, + this.updatedOnUtc, + this.image, + }); + + String id; + String name; + String namen; + List localizedNames; + String description; + int manufacturerTemplateId; + String metaKeywords; + dynamic metaDescription; + dynamic metaTitle; + int pageSize; + String pageSizeOptions; + dynamic priceRanges; + bool published; + bool deleted; + int displayOrder; + DateTime createdOnUtc; + DateTime updatedOnUtc; + Image image; + + factory Brand.fromJson(Map json) => Brand( + id: json["id"], + name: json["name"], + namen: json["namen"], + localizedNames: List.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))), + description: json["description"] == null ? null : json["description"], + manufacturerTemplateId: json["manufacturer_template_id"], + metaKeywords: json["meta_keywords"], + metaDescription: json["meta_description"], + metaTitle: json["meta_title"], + pageSize: json["page_size"], + pageSizeOptions: json["page_size_options"], + priceRanges: json["price_ranges"], + published: json["published"], + deleted: json["deleted"], + displayOrder: json["display_order"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + updatedOnUtc: DateTime.parse(json["updated_on_utc"]), + image: json["image"] == null ? null : Image.fromJson(json["image"]), + ); + + Map toJson() => { + "id": id, + "name": name, + "namen": namen, + "localized_names": List.from(localizedNames.map((x) => x.toJson())), + "description": description == null ? null : description, + "manufacturer_template_id": manufacturerTemplateId, + "meta_keywords": metaKeywords, + "meta_description": metaDescription, + "meta_title": metaTitle, + "page_size": pageSize, + "page_size_options": pageSizeOptions, + "price_ranges": priceRanges, + "published": published, + "deleted": deleted, + "display_order": displayOrder, + "created_on_utc": createdOnUtc.toIso8601String(), + "updated_on_utc": updatedOnUtc.toIso8601String(), + "image": image == null ? null : image.toJson(), + }; +} + +class Image { + Image({ + this.src, + this.thumb, + this.attachment, + }); + + String src; + dynamic thumb; + dynamic attachment; + + factory Image.fromJson(Map json) => Image( + src: json["src"], + thumb: json["thumb"], + attachment: json["attachment"], + ); + + Map toJson() => { + "src": src, + "thumb": thumb, + "attachment": attachment, + }; +} + +class LocalizedName { + LocalizedName({ + this.languageId, + this.localizedName, + }); + + int languageId; + String localizedName; + + factory LocalizedName.fromJson(Map json) => LocalizedName( + languageId: json["language_id"], + localizedName: json["localized_name"], + ); + + Map toJson() => { + "language_id": languageId, + "localized_name": localizedName, + }; +} diff --git a/lib/models/pharmacy/locationModel.dart b/lib/models/pharmacy/locationModel.dart new file mode 100644 index 00000000..36ee7350 --- /dev/null +++ b/lib/models/pharmacy/locationModel.dart @@ -0,0 +1,159 @@ +// To parse this JSON data, do +// +// final locationModel = locationModelFromJson(jsonString); + +import 'dart:convert'; + +List locationModelFromJson(String str) => List.from(json.decode(str).map((x) => LocationModel.fromJson(x))); + +String locationModelToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class LocationModel { + LocationModel({ + this.expiryDate, + this.sellingPrice, + this.quantity, + this.itemId, + this.locationId, + this.projectId, + this.setupId, + this.locationDescription, + this.locationDescriptionN, + this.itemDescription, + this.itemDescriptionN, + this.alias, + this.locationTypeId, + this.barcode, + this.companybarcode, + this.cityId, + this.cityName, + this.distanceInKilometers, + this.latitude, + this.locationType, + this.longitude, + this.phoneNumber, + this.projectImageUrl, + this.sortOrder, + }); + + ExpiryDate expiryDate; + double sellingPrice; + int quantity; + int itemId; + int locationId; + int projectId; + String setupId; + String locationDescription; + dynamic locationDescriptionN; + ItemDescription itemDescription; + dynamic itemDescriptionN; + Alias alias; + int locationTypeId; + int barcode; + dynamic companybarcode; + int cityId; + CityName cityName; + int distanceInKilometers; + String latitude; + int locationType; + String longitude; + String phoneNumber; + String projectImageUrl; + int sortOrder; + + factory LocationModel.fromJson(Map json) => LocationModel( + expiryDate: expiryDateValues.map[json["ExpiryDate"]], + sellingPrice: json["SellingPrice"].toDouble(), + quantity: json["Quantity"], + itemId: json["ItemID"], + locationId: json["LocationID"], + projectId: json["ProjectID"], + setupId: json["SetupID"], + locationDescription: json["LocationDescription"], + locationDescriptionN: json["LocationDescriptionN"], + itemDescription: itemDescriptionValues.map[json["ItemDescription"]], + itemDescriptionN: json["ItemDescriptionN"], + alias: aliasValues.map[json["Alias"]], + locationTypeId: json["LocationTypeID"], + barcode: json["Barcode"], + companybarcode: json["Companybarcode"], + cityId: json["CityID"], + cityName: cityNameValues.map[json["CityName"]], + distanceInKilometers: json["DistanceInKilometers"], + latitude: json["Latitude"], + locationType: json["LocationType"], + longitude: json["Longitude"], + phoneNumber: json["PhoneNumber"], + projectImageUrl: json["ProjectImageURL"], + sortOrder: json["SortOrder"], + ); + + Map toJson() => { + "ExpiryDate": expiryDateValues.reverse[expiryDate], + "SellingPrice": sellingPrice, + "Quantity": quantity, + "ItemID": itemId, + "LocationID": locationId, + "ProjectID": projectId, + "SetupID": setupId, + "LocationDescription": locationDescription, + "LocationDescriptionN": locationDescriptionN, + "ItemDescription": itemDescriptionValues.reverse[itemDescription], + "ItemDescriptionN": itemDescriptionN, + "Alias": aliasValues.reverse[alias], + "LocationTypeID": locationTypeId, + "Barcode": barcode, + "Companybarcode": companybarcode, + "CityID": cityId, + "CityName": cityNameValues.reverse[cityName], + "DistanceInKilometers": distanceInKilometers, + "Latitude": latitude, + "LocationType": locationType, + "Longitude": longitude, + "PhoneNumber": phoneNumber, + "ProjectImageURL": projectImageUrl, + "SortOrder": sortOrder, + }; +} + +enum Alias { CAPSULE } + +final aliasValues = EnumValues({ + "CAPSULE": Alias.CAPSULE +}); + +enum CityName { RIYADH, KHOBAR, QASSIM } + +final cityNameValues = EnumValues({ + "Khobar": CityName.KHOBAR, + "Qassim": CityName.QASSIM, + "Riyadh": CityName.RIYADH +}); + +enum ExpiryDate { DATE_16223220000000300, DATE_16250004000000300, DATE_16538580000000300 } + +final expiryDateValues = EnumValues({ + "/Date(1622322000000+0300)/": ExpiryDate.DATE_16223220000000300, + "/Date(1625000400000+0300)/": ExpiryDate.DATE_16250004000000300, + "/Date(1653858000000+0300)/": ExpiryDate.DATE_16538580000000300 +}); + +enum ItemDescription { XERACTAN_20_MG_CAP_30_S } + +final itemDescriptionValues = EnumValues({ + "XERACTAN 20 MG CAP 30'S": ItemDescription.XERACTAN_20_MG_CAP_30_S +}); + +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/models/pharmacy/productDetailModel.dart b/lib/models/pharmacy/productDetailModel.dart new file mode 100644 index 00000000..d2e8f010 --- /dev/null +++ b/lib/models/pharmacy/productDetailModel.dart @@ -0,0 +1,249 @@ +// To parse this JSON data, do +// +// final productDetail = productDetailFromJson(jsonString); + +import 'dart:convert'; + +List productDetailFromJson(String str) => List.from(json.decode(str).map((x) => ProductDetail.fromJson(x))); + +String productDetailToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class ProductDetail { + ProductDetail({ + this.reviews, + }); + + List reviews; + + factory ProductDetail.fromJson(Map json) => ProductDetail( + reviews: List.from(json["reviews"].map((x) => Review.fromJson(x))), + ); + + Map toJson() => { + "reviews": List.from(reviews.map((x) => x.toJson())), + }; +} + +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, + }); + + int id; + int position; + int reviewId; + int customerId; + int productId; + int storeId; + bool isApproved; + String title; + String reviewText; + dynamic replyText; + int rating; + int helpfulYesTotal; + int helpfulNoTotal; + DateTime createdOnUtc; + Customer 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: json["title"], + reviewText: 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: Customer.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": title, + "review_text": 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 Customer { + Customer({ + 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, + }); + + dynamic fileNumber; + dynamic iqamaNumber; + int isOutSa; + int patientType; + dynamic gender; + DateTime birthDate; + dynamic phone; + dynamic countryCode; + dynamic yahalaAccountno; + dynamic billingAddress; + dynamic shippingAddress; + String id; + Email username; + Email 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; + + factory Customer.fromJson(Map json) => Customer( + 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"], + id: json["id"], + username: emailValues.map[json["username"]], + email: emailValues.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"], + ); + + 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, + "id": id, + "username": emailValues.reverse[username], + "email": emailValues.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, + }; +} + +enum Email { STEVE_GATES_NOP_COMMERCE_COM } + +final emailValues = EnumValues({ + "steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM +}); + +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/models/pharmacy/products.dart b/lib/models/pharmacy/products.dart new file mode 100644 index 00000000..b4833c64 --- /dev/null +++ b/lib/models/pharmacy/products.dart @@ -0,0 +1,835 @@ +// To parse this JSON data, do +// +// final products = productsFromJson(jsonString); + +import 'dart:convert'; + +Products productsFromJson(String str) => Products.fromJson(json.decode(str)); + +String productsToJson(Products data) => json.encode(data.toJson()); + +class Products { + Products({ + this.messageStatus, + this.products, + }); + + dynamic messageStatus; + List products; + + factory Products.fromJson(Map json) => Products( + messageStatus: json["MessageStatus"], + products: List.from(json["products"].map((x) => Product.fromJson(x))), + ); + + Map toJson() => { + "MessageStatus": messageStatus, + "products": List.from(products.map((x) => x.toJson())), + }; +} + +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; + List localizedNames; + 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; + dynamic manufacturerPartNumber; + dynamic gtin; + bool isGiftCard; + bool requireOtherProducts; + bool automaticallyAddRequiredProducts; + bool isDownload; + bool unlimitedDownloads; + int maxNumberOfDownloads; + dynamic downloadExpirationDays; + bool hasSampleDownload; + bool hasUserAgreement; + bool isRecurring; + int recurringCycleLength; + int recurringTotalCycles; + bool isRental; + int rentalPriceLength; + bool isShipEnabled; + bool isFreeShipping; + bool shipSeparately; + int 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; + dynamic allowedQuantities; + bool allowAddingOnlyExistingAttributeCombinations; + bool disableBuyButton; + bool disableWishlistButton; + bool availableForPreOrder; + dynamic preOrderAvailabilityStartDateTimeUtc; + bool callForPrice; + double price; + int oldPrice; + double productCost; + dynamic specialPrice; + dynamic specialPriceStartDateTimeUtc; + dynamic specialPriceEndDateTimeUtc; + bool customerEntersPrice; + int minimumCustomerEnteredPrice; + int maximumCustomerEnteredPrice; + bool basepriceEnabled; + int basepriceAmount; + int basepriceBaseAmount; + bool hasTierPrices; + bool hasDiscountsApplied; + String discountName; + String discountNamen; + String discountDescription; + String discountDescriptionn; + String discountPercentage; + String currency; + String currencyn; + double weight; + int length; + int width; + int height; + dynamic availableStartDateTimeUtc; + dynamic availableEndDateTimeUtc; + int displayOrder; + bool published; + bool deleted; + DateTime createdOnUtc; + DateTime 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; + + factory Product.fromJson(Map json) => Product( + id: json["id"], + visibleIndividually: json["visible_individually"], + name: json["name"], + namen: json["namen"], + localizedNames: List.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))), + 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"] == null ? null : json["rx_message"], + rxMessagen: json["rx_messagen"] == null ? null : 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"] == null ? null : json["discount_name"], + discountNamen: json["discount_namen"] == null ? null : json["discount_namen"], + discountDescription: json["discount_description"] == null ? null : json["discount_description"], + discountDescriptionn: json["discount_Descriptionn"] == null ? null : json["discount_Descriptionn"], + discountPercentage: json["discount_percentage"] == null ? null : 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: json["product_type"], + parentGroupedProductId: json["parent_grouped_product_id"], + roleIds: List.from(json["role_ids"].map((x) => x)), + discountIds: List.from(json["discount_ids"].map((x) => x)), + storeIds: List.from(json["store_ids"].map((x) => x)), + manufacturerIds: List.from(json["manufacturer_ids"].map((x) => x)), + reviews: List.from(json["reviews"].map((x) => Review.fromJson(x))), + images: List.from(json["images"].map((x) => Image.fromJson(x))), + attributes: List.from(json["attributes"].map((x) => x)), + specifications: List.from(json["specifications"].map((x) => Specification.fromJson(x))), + associatedProductIds: List.from(json["associated_product_ids"].map((x) => x)), + 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": List.from(localizedNames.map((x) => x.toJson())), + "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 == null ? null : rxMessage, + "rx_messagen": rxMessagen == null ? null : 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 == null ? null : discountName, + "discount_namen": discountNamen == null ? null : discountNamen, + "discount_description": discountDescription == null ? null : discountDescription, + "discount_Descriptionn": discountDescriptionn == null ? null : discountDescriptionn, + "discount_percentage": discountPercentage == null ? null : 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": productType, + "parent_grouped_product_id": parentGroupedProductId, + "role_ids": List.from(roleIds.map((x) => x)), + "discount_ids": List.from(discountIds.map((x) => x)), + "store_ids": List.from(storeIds.map((x) => x)), + "manufacturer_ids": List.from(manufacturerIds.map((x) => x)), + "reviews": List.from(reviews.map((x) => x.toJson())), + "images": List.from(images.map((x) => x.toJson())), + "attributes": List.from(attributes.map((x) => x)), + "specifications": List.from(specifications.map((x) => x.toJson())), + "associated_product_ids": List.from(associatedProductIds.map((x) => x)), + "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, + }); + + int id; + int 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, + }; +} + +class LocalizedName { + LocalizedName({ + this.languageId, + this.localizedName, + }); + + int languageId; + String localizedName; + + factory LocalizedName.fromJson(Map json) => LocalizedName( + languageId: json["language_id"], + localizedName: json["localized_name"], + ); + + Map toJson() => { + "language_id": languageId, + "localized_name": localizedName, + }; +} + +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, + }); + + int id; + int position; + int reviewId; + int customerId; + int productId; + int storeId; + bool isApproved; + String title; + String reviewText; + dynamic replyText; + int rating; + int helpfulYesTotal; + int helpfulNoTotal; + DateTime createdOnUtc; + Customer 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: json["title"], + reviewText: 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: Customer.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": title, + "review_text": 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 Customer { + Customer({ + 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; + int isOutSa; + int patientType; + dynamic gender; + DateTime birthDate; + dynamic phone; + dynamic countryCode; + dynamic yahalaAccountno; + dynamic billingAddress; + dynamic shippingAddress; + List addresses; + String id; + Username username; + Email 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 Customer.fromJson(Map json) => Customer( + 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: usernameValues.map[json["username"]], + email: emailValues.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": usernameValues.reverse[username], + "email": emailValues.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 Email { MEMO17299_GMAIL_COM, STEVE_GATES_NOP_COMMERCE_COM } + +final emailValues = EnumValues({ + "Memo17299@gmail.com": Email.MEMO17299_GMAIL_COM, + "steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM +}); + +enum Username { AMAL_26, STEVE_GATES_NOP_COMMERCE_COM } + +final usernameValues = EnumValues({ + "amal_26": Username.AMAL_26, + "steve_gates@nopCommerce.com": Username.STEVE_GATES_NOP_COMMERCE_COM +}); + +class Specification { + Specification({ + this.id, + this.displayOrder, + this.defaultValue, + this.defaultValuen, + this.name, + this.nameN, + }); + + int id; + int displayOrder; + String defaultValue; + String defaultValuen; + Name name; + NameN nameN; + + factory Specification.fromJson(Map json) => Specification( + id: json["id"], + displayOrder: json["display_order"], + defaultValue: json["default_value"], + defaultValuen: json["default_valuen"], + name: nameValues.map[json["name"]], + nameN: nameNValues.map[json["nameN"]], + ); + + Map toJson() => { + "id": id, + "display_order": displayOrder, + "default_value": defaultValue, + "default_valuen": defaultValuen, + "name": nameValues.reverse[name], + "nameN": nameNValues.reverse[nameN], + }; +} + +enum Name { PRIMARY_UNIT_OF_MEASURE, BRAND, MANUFACTURER_COUNTRY_NAME, STORAGE, COMPOSITION, SPF } + +final nameValues = EnumValues({ + "BRAND": Name.BRAND, + "COMPOSITION": Name.COMPOSITION, + "MANUFACTURER COUNTRY NAME": Name.MANUFACTURER_COUNTRY_NAME, + "Primary Unit Of Measure": Name.PRIMARY_UNIT_OF_MEASURE, + "SPF": Name.SPF, + "STORAGE": Name.STORAGE +}); + +enum NameN { EMPTY, NAME_N, PURPLE, FLUFFY, TENTACLED, SPF } + +final nameNValues = EnumValues({ + "وحدة القياس الأولية": NameN.EMPTY, + "تخزين": NameN.FLUFFY, + "علامة تجارية": NameN.NAME_N, + "اسم البلد المصنع": NameN.PURPLE, + "SPF": NameN.SPF, + "المكونات": NameN.TENTACLED +}); + +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/models/pharmacy/reviewModel.dart b/lib/models/pharmacy/reviewModel.dart new file mode 100644 index 00000000..da30212c --- /dev/null +++ b/lib/models/pharmacy/reviewModel.dart @@ -0,0 +1,803 @@ +// To parse this JSON data, do +// +// final review = reviewFromJson(jsonString); + +import 'dart:convert'; + +List reviewFromJson(String str) => List.from(json.decode(str).map((x) => Review.fromJson(x))); + +String reviewToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +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; + List 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; + 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; + DateTime createdOnUtc; + DateTime 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; + + factory Product.fromJson(Map json) => Product( + id: json["id"], + visibleIndividually: json["visible_individually"], + name: json["name"], + namen: json["namen"], + localizedNames: List.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))), + 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"].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: json["product_type"], + parentGroupedProductId: json["parent_grouped_product_id"], + roleIds: List.from(json["role_ids"].map((x) => x)), + discountIds: List.from(json["discount_ids"].map((x) => x)), + storeIds: List.from(json["store_ids"].map((x) => x)), + manufacturerIds: List.from(json["manufacturer_ids"].map((x) => x)), + reviews: List.from(json["reviews"].map((x) => Review.fromJson(x))), + images: List.from(json["images"].map((x) => Image.fromJson(x))), + attributes: List.from(json["attributes"].map((x) => x)), + specifications: List.from(json["specifications"].map((x) => Specification.fromJson(x))), + associatedProductIds: List.from(json["associated_product_ids"].map((x) => x)), + 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": List.from(localizedNames.map((x) => x.toJson())), + "short_description": shortDescription, + "short_descriptionn": shortDescriptionn, + "full_description": fullDescription, + "full_descriptionn": fullDescriptionn, + "markas_new": markasNew, + "show_on_home_page": showOnHomePage, + "meta_keywords": metaKeywords, + "meta_description": metaDescription, + "meta_title": 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": productType, + "parent_grouped_product_id": parentGroupedProductId, + "role_ids": List.from(roleIds.map((x) => x)), + "discount_ids": List.from(discountIds.map((x) => x)), + "store_ids": List.from(storeIds.map((x) => x)), + "manufacturer_ids": List.from(manufacturerIds.map((x) => x)), + "reviews": List.from(reviews.map((x) => x.toJson())), + "images": List.from(images.map((x) => x.toJson())), + "attributes": List.from(attributes.map((x) => x)), + "specifications": List.from(specifications.map((x) => x.toJson())), + "associated_product_ids": List.from(associatedProductIds.map((x) => x)), + "tags": List.from(tags.map((x) => x)), + "vendor_id": vendorId, + "se_name": seName, + }; +} + +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; + String title; + ReviewText reviewText; + dynamic replyText; + dynamic rating; + dynamic helpfulYesTotal; + dynamic helpfulNoTotal; + DateTime createdOnUtc; + Customer customer; + Product 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: 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: Customer.fromJson(json["customer"]), + product: json["product"] == null ? null : Product.fromJson(json["product"]), + ); + + Map toJson() => { + "id": id, + "position": position, + "review_id": reviewId, + "customer_id": customerId, + "product_id": productId, + "store_id": storeId, + "is_approved": isApproved, + "title": title, + "review_text": reviewText, + "reply_text": replyText, + "rating": rating, + "helpful_yes_total": helpfulYesTotal, + "helpful_no_total": helpfulNoTotal, + "created_on_utc": createdOnUtc.toIso8601String(), + "customer": customer.toJson(), + "product": product == null ? null : product.toJson(), + }; +} + +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, + }; +} + +class LocalizedName { + LocalizedName({ + this.languageId, + this.localizedName, + }); + + dynamic languageId; + String localizedName; + + factory LocalizedName.fromJson(Map json) => LocalizedName( + languageId: json["language_id"], + localizedName: json["localized_name"], + ); + + Map toJson() => { + "language_id": languageId, + "localized_name": localizedName, + }; +} + +class Specification { + Specification({ + this.id, + this.displayOrder, + this.defaultValue, + this.defaultValuen, + this.name, + this.nameN, + }); + + dynamic id; + dynamic displayOrder; + String defaultValue; + String defaultValuen; + String name; + String nameN; + + factory Specification.fromJson(Map json) => Specification( + id: json["id"], + displayOrder: json["display_order"], + defaultValue: json["default_value"], + defaultValuen: json["default_valuen"], + name: json["name"], + nameN: json["nameN"], + ); + + Map toJson() => { + "id": id, + "display_order": displayOrder, + "default_value": defaultValue, + "default_valuen": defaultValuen, + "name": name, + "nameN": nameN, + }; +} + +class Customer { + Customer({ + 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; + Username username; + Email 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 Customer.fromJson(Map json) => Customer( + 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: usernameValues.map[json["username"]], + email: emailValues.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": usernameValues.reverse[username], + "email": emailValues.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 Email { TAMER_FANASHEH_DRSULAIMANALHABIB_COM, STEVE_GATES_NOP_COMMERCE_COM } + +final emailValues = EnumValues({ + "steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM, + "tamer.fanasheh@drsulaimanalhabib.com": Email.TAMER_FANASHEH_DRSULAIMANALHABIB_COM +}); + +enum Username { TAMERF, STEVE_GATES_NOP_COMMERCE_COM } + +final usernameValues = EnumValues({ + "steve_gates@nopCommerce.com": Username.STEVE_GATES_NOP_COMMERCE_COM, + "tamerf": Username.TAMERF +}); + +enum ReviewText { ENADDD, ENAD_TEST_0001, GOOD, ENAD_TEST_REVIEW_001, ENAD } + +final reviewTextValues = EnumValues({ + "ENAD ": ReviewText.ENAD, + "enaddd": ReviewText.ENADDD, + "ENAD TEST 0001": ReviewText.ENAD_TEST_0001, + "Enad Test Review 001": ReviewText.ENAD_TEST_REVIEW_001, + "good": ReviewText.GOOD +}); + +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/models/pharmacy/specification.dart b/lib/models/pharmacy/specification.dart new file mode 100644 index 00000000..6ef69191 --- /dev/null +++ b/lib/models/pharmacy/specification.dart @@ -0,0 +1,61 @@ +// To parse this JSON data, do +// +// final specificationModel = specificationModelFromJson(jsonString); + +import 'dart:convert'; + +SpecificationModel specificationModelFromJson(String str) => SpecificationModel.fromJson(json.decode(str)); + +String specificationModelToJson(SpecificationModel data) => json.encode(data.toJson()); + +class SpecificationModel { + SpecificationModel({ + this.specification, + }); + + List specification; + + factory SpecificationModel.fromJson(Map json) => SpecificationModel( + specification: List.from(json["specification"].map((x) => Specification.fromJson(x))), + ); + + Map toJson() => { + "specification": List.from(specification.map((x) => x.toJson())), + }; +} + +class Specification { + Specification({ + this.id, + this.displayOrder, + this.defaultValue, + this.defaultValuen, + this.name, + this.nameN, + }); + + int id; + int displayOrder; + String defaultValue; + String defaultValuen; + String name; + String nameN; + + factory Specification.fromJson(Map json) => Specification( + id: json["id"], + displayOrder: json["display_order"], + defaultValue: json["default_value"], + defaultValuen: json["default_valuen"], + name: json["name"], + nameN: json["nameN"], + ); + + Map toJson() => { + "id": id, + "display_order": displayOrder, + "default_value": defaultValue, + "default_valuen": defaultValuen, + "name": name, + "nameN": nameN, + }; +} diff --git a/lib/models/pharmacy/topBrandsModel.dart b/lib/models/pharmacy/topBrandsModel.dart new file mode 100644 index 00000000..0cd833b7 --- /dev/null +++ b/lib/models/pharmacy/topBrandsModel.dart @@ -0,0 +1,137 @@ +// To parse this JSON data, do +// +// final topBrand = topBrandFromJson(jsonString); + +import 'dart:convert'; + +List topBrandFromJson(String str) => List.from(json.decode(str).map((x) => TopBrand.fromJson(x))); + +String topBrandToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class TopBrand { + TopBrand({ + this.id, + this.name, + this.namen, + this.localizedNames, + this.description, + this.manufacturerTemplateId, + this.metaKeywords, + this.metaDescription, + this.metaTitle, + this.pageSize, + this.pageSizeOptions, + this.priceRanges, + this.published, + this.deleted, + this.displayOrder, + this.createdOnUtc, + this.updatedOnUtc, + this.image, + }); + + String id; + String name; + String namen; + List localizedNames; + String description; + int manufacturerTemplateId; + String metaKeywords; + dynamic metaDescription; + dynamic metaTitle; + int pageSize; + String pageSizeOptions; + dynamic priceRanges; + bool published; + bool deleted; + int displayOrder; + DateTime createdOnUtc; + DateTime updatedOnUtc; + Image image; + + factory TopBrand.fromJson(Map json) => TopBrand( + id: json["id"], + name: json["name"], + namen: json["namen"], + localizedNames: List.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))), + description: json["description"] == null ? null : json["description"], + manufacturerTemplateId: json["manufacturer_template_id"], + metaKeywords: json["meta_keywords"], + metaDescription: json["meta_description"], + metaTitle: json["meta_title"], + pageSize: json["page_size"], + pageSizeOptions: json["page_size_options"], + priceRanges: json["price_ranges"], + published: json["published"], + deleted: json["deleted"], + displayOrder: json["display_order"], + createdOnUtc: DateTime.parse(json["created_on_utc"]), + updatedOnUtc: DateTime.parse(json["updated_on_utc"]), + image: json["image"] == null ? null : Image.fromJson(json["image"]), + ); + + Map toJson() => { + "id": id, + "name": name, + "namen": namen, + "localized_names": List.from(localizedNames.map((x) => x.toJson())), + "description": description == null ? null : description, + "manufacturer_template_id": manufacturerTemplateId, + "meta_keywords": metaKeywords, + "meta_description": metaDescription, + "meta_title": metaTitle, + "page_size": pageSize, + "page_size_options": pageSizeOptions, + "price_ranges": priceRanges, + "published": published, + "deleted": deleted, + "display_order": displayOrder, + "created_on_utc": createdOnUtc.toIso8601String(), + "updated_on_utc": updatedOnUtc.toIso8601String(), + "image": image == null ? null : image.toJson(), + }; +} + +class Image { + Image({ + this.src, + this.thumb, + this.attachment, + }); + + String src; + dynamic thumb; + dynamic attachment; + + factory Image.fromJson(Map json) => Image( + src: json["src"], + thumb: json["thumb"], + attachment: json["attachment"], + ); + + Map toJson() => { + "src": src, + "thumb": thumb, + "attachment": attachment, + }; +} + +class LocalizedName { + LocalizedName({ + this.languageId, + this.localizedName, + }); + + int languageId; + String localizedName; + + factory LocalizedName.fromJson(Map json) => LocalizedName( + languageId: json["language_id"], + localizedName: json["localized_name"], + ); + + Map toJson() => { + "language_id": languageId, + "localized_name": localizedName, + }; +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index d84b9d61..a823c154 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -15,7 +15,7 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import '../dialogs/select_city_dialog.dart'; - +import 'dart:io'; class NewEReferralStepThreePage extends StatefulWidget { final CreateEReferralRequestModel createEReferralRequestModel; final Function changePageViewIndex; @@ -101,12 +101,17 @@ class _NewEReferralStepThreePageState extends State { InkWell( onTap: () { ImageOptions.showImageOptions(context, - (String image) { + (String image,File file) { setState(() { - EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image ); - medicalReportImages.add(eReferralAttachment); + EReferralAttachment eReferralAttachment = + new EReferralAttachment( + fileName: + 'image ${medicalReportImages.length + 1}.png', + base64String: image); + medicalReportImages + .add(eReferralAttachment); }); - }); + }, ); }, child: Container( margin: EdgeInsets.only( @@ -158,15 +163,17 @@ class _NewEReferralStepThreePageState extends State { width: 8, ), Texts( - medicalReportImages[index].fileName, + medicalReportImages[index] + .fileName, ), ], ), InkWell( onTap: () { setState(() { - medicalReportImages - .remove(medicalReportImages[index]); + medicalReportImages.remove( + medicalReportImages[ + index]); }); }, child: Icon( @@ -262,12 +269,12 @@ class _NewEReferralStepThreePageState extends State { ], ), ), - if(isPatientInsured) - SizedBox( - height: 12, - ), + if (isPatientInsured) + SizedBox( + height: 12, + ), Opacity( - opacity: isPatientInsured?1:0, + opacity: isPatientInsured ? 1 : 0, child: Container( padding: EdgeInsets.only(top: 10), decoration: BoxDecoration( @@ -276,16 +283,21 @@ class _NewEReferralStepThreePageState extends State { ), child: Column( children: [ - InkWell( onTap: () { ImageOptions.showImageOptions(context, - (String image) { + (String image,File file) { setState(() { + EReferralAttachment + eReferralAttachment = + new EReferralAttachment( + fileName: + 'image ${medicalReportImages.length + 1}.png', + base64String: image); - EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image ); - - insuredPatientImages=[eReferralAttachment]; + insuredPatientImages = [ + eReferralAttachment + ]; }); }); }, @@ -333,8 +345,8 @@ class _NewEReferralStepThreePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - FontAwesomeIcons.paperclip), + Icon(FontAwesomeIcons + .paperclip), SizedBox( width: 8, ), @@ -346,8 +358,9 @@ class _NewEReferralStepThreePageState extends State { InkWell( onTap: () { setState(() { - insuredPatientImages - .remove(insuredPatientImages[index]); + insuredPatientImages.remove( + insuredPatientImages[ + index]); }); }, child: Icon( @@ -378,25 +391,37 @@ class _NewEReferralStepThreePageState extends State { textColor: Colors.white, label: "Submit", onTap: () async { - this.widget.createEReferralRequestModel.medicalReportAttachment = medicalReportImages; - this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length !=0?insuredPatientImages[0]:null; - this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured; + this + .widget + .createEReferralRequestModel + .medicalReportAttachment = medicalReportImages; + this + .widget + .createEReferralRequestModel + .insuranceCardAttachment = + insuredPatientImages.length != 0 + ? insuredPatientImages[0] + : null; + this.widget.createEReferralRequestModel.isInsuredPatient = + isPatientInsured; // ToDo make the preferred Branch info dynamic - this.widget.createEReferralRequestModel.preferredBranchCode = 15; - this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital"; - - + this.widget.createEReferralRequestModel.preferredBranchCode = + 15; + this.widget.createEReferralRequestModel.preferredBranchName = + "Arryan Hospital"; // this.widget.createEReferralRequestModel.fullName= ""; - this.widget.createEReferralRequestModel.otherRelationship= ""; + this.widget.createEReferralRequestModel.otherRelationship = + ""; // this.widget.createEReferralRequestModel.; // this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital"; // this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital"; - await model.createEReferral(this.widget.createEReferralRequestModel); + await model + .createEReferral(this.widget.createEReferralRequestModel); }, loading: model.state == ViewState.BusyLocal, - disabled: medicalReportImages.length == 0 , + disabled: medicalReportImages.length == 0, ), ))); } @@ -416,12 +441,10 @@ class _NewEReferralStepThreePageState extends State { ); } - String getRelationName() { if (_selectedCity != null) return _selectedCity.description; else return "Select Relationship" /*TranslationBase.of(context).selectHospital*/; } - } diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 7e3d4181..1359ab8d 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,9 +1,12 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/weather_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_index_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/my_web_view.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; @@ -21,13 +24,17 @@ import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class AllHabibMedicalService extends StatefulWidget { @@ -43,17 +50,25 @@ class AllHabibMedicalService extends StatefulWidget { class _AllHabibMedicalServiceState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser = new AuthenticatedUser(); - + LocationUtils locationUtils; + var weather = '--'; + WeatherService _weatherService = WeatherService(); @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - getAuthUser(); + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance.addPostFrameCallback((_) => { + Geolocator.getLastKnownPosition() + .then((value) => setLocation(value)) + }); }); super.initState(); } @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).alhabiServices, @@ -98,17 +113,41 @@ class _AllHabibMedicalServiceState extends State { ], ), Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Image.asset('assets/images/Weather_ico.png',width: 80,height: 80,), - Texts( - TranslationBase.of(context).moreDetails, - color: Colors.white, - decoration: TextDecoration.underline, - ), - ], - ), + flex: 2, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: HealthWeatherIndicator(), + ), + ); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/Weather_ico.png', + width: 60, + height: 60, + ), + Directionality( + textDirection: TextDirection.ltr, + child: AppText(weather, + fontSize: 22, + color: Colors.white)) + ], + ), + Texts( + TranslationBase.of(context).moreDetails, + color: Colors.white, + decoration: TextDecoration.underline, + ), + ], + )), ) ], ), @@ -123,7 +162,16 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/new-design/my_file_bottom_bar.png', title: TranslationBase.of(context).myMedicalFile, ), - + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: LiveCareHome(), + ), + ), + imageLocation: 'assets/images/new-design/liveCare_ar_bg.png', + title: TranslationBase.of(context).livecare, + ), ServicesContainer( onTap: () => Navigator.push( context, @@ -148,7 +196,15 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).onlinePaymentService, ), - + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(), + ), + imageLocation: + 'assets/images/al-habib_online_payment_service_icon.png', + title: 'Covid-19- Drive-Thru Test', + ), ServicesContainer( onTap: () { Navigator.push( @@ -163,7 +219,37 @@ class _AllHabibMedicalServiceState extends State { imageLocation: 'assets/images/emergency_service_image.png', title: TranslationBase.of(context).emergencyService, ), - + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: ParkingPage(), + ), + ), + imageLocation: 'assets/images/pharmacy_logo.png', + title: 'Pharmacy'), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: InsuranceUpdate(), + ), + ), + imageLocation: + 'assets/images/medical/insurance_card_icon.png', + title: TranslationBase.of(context).updateInsurance, + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: authUser.patientID == null + ? EReferralIndexPage() + : EReferralPage()), + ), + imageLocation: 'assets/images/ereferral_service_icon.png', + title: 'E-Referral', + ), ServicesContainer( onTap: () => Navigator.push( context, @@ -175,19 +261,86 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/new-design/family_menu_icon_red.png', title: 'My Family', ), - + if(projectViewModel.havePrivilege(35)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(page: ChildVaccinesPage()), + ), + imageLocation: + 'assets/images/new-design/children_vaccines_icon.png', + title: 'Child Vaccines', + ), ServicesContainer( onTap: () => Navigator.push( context, FadePage( - page: ToDo(), + page: ToDo(isShowAppBar: true), ), ), imageLocation: 'assets/images/new-design/upcoming_icon_bottom_bar.png', title: TranslationBase.of(context).todoList, ), - + if(projectViewModel.havePrivilege(42)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(page: SymptomInfo()), + ), + imageLocation: 'assets/images/new-design/body_icon.png', + title: 'Symptom Checker'), + if(projectViewModel.havePrivilege(36)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(page: BloodDonationPage()), + ), + imageLocation: 'assets/images/new-design/blood_icon.png', + title: 'Blood Donation', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: (HealthCalculators()), + ), + ), + imageLocation: + 'assets/images/new-design/health_calculator_icon.png', + title: 'Health Calculators', + ), + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: HealthConverter(), + ), + ), + imageLocation: + 'assets/images/new-design/health_convertor_icon.png', + title: 'Health Converter', + ), + if(projectViewModel.havePrivilege(38)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage( + page: H2OPageIndexPage(), + ), + ), + imageLocation: 'assets/images/new-design/water_icon.png', + title: 'H2O', + ), + if(projectViewModel.havePrivilege(41)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(), + ), + imageLocation: 'assets/images/new-design/smartwatch_icon.png', + title: TranslationBase.of(context).smartWatches, + ), ServicesContainer( onTap: () => Navigator.push( context, @@ -204,7 +357,7 @@ 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: () { @@ -227,7 +380,7 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: 'assets/images/new-design/find_us_icon.png', - title: 'Find Us', + title: TranslationBase.of(context).findUs, ), ], ), @@ -244,7 +397,25 @@ class _AllHabibMedicalServiceState extends State { setState(() { authUser = data; }); - print(authUser.patientID); } + var data = await this.sharedPref.getObject(WEATHER); + if (data == null) { + var d = await _weatherService.getWeatherData(); + print(d); + setState(() { + weather = d != null ? d.temperature.toString() + '\u2103' : '--'; + }); + } else { + setState(() { + weather = + data != null ? data['Temperature'].toString() + '\u2103' : '--'; + }); + } + } + + void setLocation(Position position) { + this.sharedPref.setDouble(USER_LAT, position.latitude ?? 0.0); + this.sharedPref.setDouble(USER_LONG, position.longitude ?? 0.0); + getAuthUser(); } } diff --git a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart new file mode 100644 index 00000000..dbb46eee --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart @@ -0,0 +1,140 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/weather_slider/weather_slider.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; + +class HealthWeatherIndicator extends StatefulWidget { + @override + _HospitalsPageState createState() => _HospitalsPageState(); +} + +class _HospitalsPageState extends State { + var data; + LocationUtils locationUtils; + AppSharedPreferences sharedPref = AppSharedPreferences(); + var weather = '--'; + @override + void initState() { + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance + .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + getWeather(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getWeatherData(), + allowAny: true, + builder: (_, mode, widget) => AppScaffold( + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).healthWeatherIndicators, + isShowAppBar: true, + body: mode.weatherIndicatorData.length > 0 + ? SingleChildScrollView( + child: Column(children: [ + Container( + margin: EdgeInsets.all(8), + width: double.infinity, + height: 150, + decoration: BoxDecoration( + image: DecorationImage( + image: + ExactAssetImage('assets/images/Weather_img.png'), + fit: BoxFit.cover, + ), + borderRadius: BorderRadius.circular(8.0)), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.0), + child: Row( + children: [ + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .healthWeatherIndicators, + color: Colors.white, + fontWeight: FontWeight.w600, + ), + AppText( + TranslationBase.of(context) + .healthTipsBasedOnCurrentWeather, + color: Colors.white, + fontSize: 14, + ), + ], + )), + Expanded( + flex: 2, + child: InkWell( + onTap: () {}, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/Weather_ico.png', + width: 60, + height: 60, + ), + Directionality( + textDirection: TextDirection.ltr, + child: AppText(weather, + fontSize: 22, + color: Colors.white)) + ], + ), + ], + )), + ) + ], + ), + ), + ), + Padding( + padding: EdgeInsets.all(15), + child: AppText( + projectViewModel.isArabic + ? mode.weatherIndicatorData[0].cityNameN + : mode.weatherIndicatorData[0].cityName, + fontSize: 24, + fontWeight: FontWeight.bold, + )), + Padding( + padding: EdgeInsets.all(15), + child: Column( + children: mode.weatherIndicatorData.map((data) { + return WeatherSlider(data); + }).toList())) + ])) + : Center(child: AppCircularProgressIndicator())), + ); + } + + getWeather() async { + var data = await this.sharedPref.getObject(WEATHER); + setState(() { + weather = data['Temperature'].toString() + '\u2103' ?? '--'; + }); + } +} diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index 3d9fccb2..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)); + }); }, ), ), @@ -213,6 +214,9 @@ class ConfirmPaymentPage extends StatelessWidget { appo.projectID.toString(), authenticatedUser.emailAddress, paymentMethod, + authenticatedUser.patientType, + authenticatedUser.firstName, + authenticatedUser.patientID, authenticatedUser, browser); } @@ -245,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']; @@ -260,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(), @@ -279,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/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index fa69d913..d7e08a66 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, @@ -236,7 +241,7 @@ class _BookConfirmState extends State { ), ), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0), + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: Text( TranslationBase.of(context).date + ": " + @@ -320,7 +325,7 @@ class _BookConfirmState extends State { Container( margin: EdgeInsets.only(top: 5.0), child: Text( - "Gender: " + + TranslationBase.of(context).gender + ": " + widget.authUser.genderDescription, style: TextStyle( fontSize: 12.0, @@ -330,7 +335,7 @@ class _BookConfirmState extends State { Container( margin: EdgeInsets.only(top: 5.0, bottom: 3.0), child: Text( - "Age: " + widget.authUser.age.toString(), + TranslationBase.of(context).age + ": " + widget.authUser.age.toString(), style: TextStyle( fontSize: 12.0, color: Colors.grey[600], @@ -418,12 +423,13 @@ class _BookConfirmState extends State { context) .then((res) { if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: "Appointment Booked Successfully"); + AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); 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, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } 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 39e290a1..f513c434 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'; @@ -166,6 +165,173 @@ class _BookSuccessState extends State { ], ), ), + bottomNavigationBar: getBottomContainer(), + ); + } + + Widget getBottomContainer() { + switch (widget.patientShareResponse.nextAction) { + case 0: + return Container(); + break; + case 10: + return _getConfirmAppoButtons(); + break; + case 15: + return _getPaymentPendingAppo(); + break; + case 20: + return _getPayNowButtons(); + break; + case 30: + return _getQRButtons(); + break; + case 50: + return _getConfirmAppoButtons(); + break; + } + } + + Widget _getQRButtons() { + return Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.18, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { +// navigateToQR(context); + getAppoQR(context); + }, + child: Text(TranslationBase.of(context).viewQR.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ); + } + + Widget _getPayNowButtons() { + return Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.2, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + startPaymentProcess(); + }, + child: Text(TranslationBase.of(context).payNow.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF40ACC9), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text(TranslationBase.of(context).payLater.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ); + } + + Widget _getConfirmAppoButtons() { + return Container( + alignment: Alignment.bottomCenter, + margin: EdgeInsets.only(bottom: 5.0), + height: MediaQuery.of(context).size.height * 0.15, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + AppoitmentAllHistoryResultList appo = + new AppoitmentAllHistoryResultList(); + appo.clinicID = widget.docObject.clinicID; + appo.projectID = widget.docObject.projectID; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; + appo.serviceID = widget.patientShareResponse.serviceID; + appo.isLiveCareAppointment = + widget.patientShareResponse.isLiveCareAppointment; + appo.doctorID = widget.patientShareResponse.doctorID; + confirmAppointment(appo); + }, + child: Text( + widget.patientShareResponse.isLiveCareAppointment + ? TranslationBase.of(context) + .confirmLiveCare + .toUpperCase() + : TranslationBase.of(context).confirm.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF40ACC9), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text( + TranslationBase.of(context).confirmLater.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), ); } @@ -239,8 +405,7 @@ class _BookSuccessState extends State { _getBulletPoint("1"), Container( width: MediaQuery.of(context).size.width * 0.8, - child: Text( - "Please confirm the appointment to avoid the cancellation", + child: Text(TranslationBase.of(context).upcomingConfirm, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)), ), @@ -264,7 +429,7 @@ class _BookSuccessState extends State { Container( width: MediaQuery.of(context).size.width * 0.8, child: Text( - "The online payment process will be available 24 hours before the appointment.", + TranslationBase.of(context).upcomingConfirmMore, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)), ), @@ -278,67 +443,6 @@ class _BookSuccessState extends State { margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), child: Image.asset("assets/images/new-design/payment-method.png"), ), - Container( - alignment: Alignment.bottomCenter, - height: MediaQuery.of(context).size.height * 0.32, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - AppoitmentAllHistoryResultList appo = - new AppoitmentAllHistoryResultList(); - appo.clinicID = widget.docObject.clinicID; - appo.projectID = widget.docObject.projectID; - appo.appointmentNo = - widget.patientShareResponse.appointmentNo; - appo.serviceID = widget.patientShareResponse.serviceID; - appo.isLiveCareAppointment = - widget.patientShareResponse.isLiveCareAppointment; - appo.doctorID = widget.patientShareResponse.doctorID; - confirmAppointment(appo); - }, - child: Text( - widget.patientShareResponse.isLiveCareAppointment - ? TranslationBase.of(context) - .confirmLiveCare - .toUpperCase() - : TranslationBase.of(context).confirm.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF40ACC9), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - navigateToHome(context); - }, - child: Text( - TranslationBase.of(context).confirmLater.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ], - ), - ), ], ); } @@ -349,36 +453,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 +491,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() { @@ -462,52 +568,6 @@ class _BookSuccessState extends State { ), ], ), - Container( - alignment: Alignment.bottomCenter, - height: MediaQuery.of(context).size.height * 0.2, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - startPaymentProcess(); - }, - child: Text(TranslationBase.of(context).payNow.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF40ACC9), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - navigateToHome(context); - }, - child: Text( - TranslationBase.of(context).payLater.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ], - ), - ), ], ); } @@ -554,7 +614,7 @@ class _BookSuccessState extends State { AppoitmentAllHistoryResultList appo) async { if (paymentMethod == "ApplePay") { await widget.chromeBrowser.open( - url: "https://flutter.dev/", + url: "https://applepay-datatrans-sample.herokuapp.com/", options: ChromeSafariBrowserClassOptions( android: AndroidChromeCustomTabsOptions( addDefaultShareMenuItem: false), @@ -573,6 +633,9 @@ class _BookSuccessState extends State { appo.projectID.toString(), authenticatedUser.emailAddress, paymentMethod, + authenticatedUser.patientType, + authenticatedUser.firstName, + authenticatedUser.patientID, authenticatedUser, widget.browser); } @@ -630,6 +693,7 @@ class _BookSuccessState extends State { } getApplePayAPQ(AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service .checkPaymentStatus( @@ -637,6 +701,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']; @@ -646,9 +711,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) { @@ -763,34 +829,34 @@ class _BookSuccessState extends State { ), ], ), - Container( - alignment: Alignment.bottomCenter, - height: MediaQuery.of(context).size.height * 0.18, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { -// navigateToQR(context); - getAppoQR(context); - }, - child: Text(TranslationBase.of(context).viewQR.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ], - ), - ), +// Container( +// alignment: Alignment.bottomCenter, +// height: MediaQuery.of(context).size.height * 0.18, +// child: Column( +// mainAxisAlignment: MainAxisAlignment.end, +// children: [ +// ButtonTheme( +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(10.0), +// ), +// minWidth: MediaQuery.of(context).size.width * 0.7, +// height: 45.0, +// child: RaisedButton( +// color: new Color(0xFF60686b), +// textColor: Colors.white, +// disabledTextColor: Colors.white, +// disabledColor: new Color(0xFFbcc2c4), +// onPressed: () { +// // navigateToQR(context); +// getAppoQR(context); +// }, +// child: Text(TranslationBase.of(context).viewQR.toUpperCase(), +// style: TextStyle(fontSize: 18.0)), +// ), +// ), +// ], +// ), +// ), ], ); } diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 6864e6b1..392eb24c 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,23 +45,14 @@ class _DoctorProfileState extends State AppSharedPreferences sharedPref = AppSharedPreferences(); + List doctorDetailsList = List(); + @override void initState() { _tabController = new TabController( length: 2, vsync: this, initialIndex: widget.isOpenAppt == true ? 1 : 0); - - // event.controller.stream.listen((p) { - // if (p['clinic_id'] != null && - // p['doctor_id'] != null && - // p['project_id'] != null) { - // setState(() { - // // need to take the data from here - // // dropdownValue = p['clinic_id']; - // }); - // } - // }); _tabController = new TabController(length: 2, vsync: this); widget.authUser = new AuthenticatedUser(); widget.doctor.speciality = widget.docProfileList.specialty; @@ -150,19 +144,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.docProfileList.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 +214,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.docProfileList.noOfPatientsRate) * 100; + return width; + } + getPatientData() async { if (await sharedPref.getObject(USER_PROFILE) != null) { var data = diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 095d72a6..94308c1c 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -6,9 +6,12 @@ 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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; +import 'components/SearchByClinic.dart'; + class Search extends StatefulWidget { final int type; final List clnicIds; @@ -31,34 +34,40 @@ class _SearchState extends State with TickerProviderStateMixin { @override Widget build(BuildContext context) { AppGlobal.context = context; - return Scaffold( - appBar: AppBar( - bottom: TabBar( - tabs: [ - Tab(text: TranslationBase.of(context).clinicName), - Tab( - text: TranslationBase.of(context).doctorName, - ) - ], - controller: _tabController, - ), - title: Text(TranslationBase.of(context).bookAppo, - style: TextStyle(color: Colors.white)), - leading: Builder( - builder: (BuildContext context) { - return ArrowBack(); - }, - ), - ), - body: TabBarView( - physics: NeverScrollableScrollPhysics(), - children: [ - SearchByClinic( - clnicIds: widget.clnicIds, - ), - SearchByDoctor() - ], - controller: _tabController), - ); + return AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).bookAppo, + body: Container( + child: Column( + children: [ + TabBar( + tabs: [ + Tab(text: TranslationBase.of(context).clinicName), + Tab( + text: TranslationBase.of(context).doctorName, + ) + ], + controller: _tabController, + ), + Divider( + color: Colors.grey[600], + thickness: 0.5, + ), + Expanded( + child: new TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + SearchByClinic( + clnicIds: widget.clnicIds, + ), + SearchByDoctor() + ], + controller: _tabController, + ), + ) + ], + ), + )); } } diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 055b0c41..0c65a789 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -36,7 +36,7 @@ class _SearchResultsState extends State { ...List.generate( widget.patientDoctorAppointmentListHospital.length, (index) => AppExpandableNotifier( - isExpand: index == 1 ? true : false, + // isExpand: index == 0 ? true : false, title: widget.patientDoctorAppointmentListHospital[index] .filterName + " - " + diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 70b6aaa0..7caf1977 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -178,7 +178,8 @@ class _DocAvailableAppointmentsState extends State holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), ), daysOfWeekStyle: DaysOfWeekStyle( - weekendStyle: TextStyle().copyWith(color: Colors.blue[600]), + weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 14.0), + weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 14.0), ), headerStyle: HeaderStyle( centerHeaderTitle: true, @@ -190,7 +191,7 @@ class _DocAvailableAppointmentsState extends State opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController), child: Container( margin: const EdgeInsets.all(4.0), - padding: const EdgeInsets.only(top: 5.0, left: 6.0), + padding: const EdgeInsets.only(top: 5.0, left: 5.0), color: Colors.transparent, width: 0, height: 0, @@ -380,6 +381,7 @@ class _DocAvailableAppointmentsState extends State AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); }); } diff --git a/lib/pages/BookAppointment/components/DocInfo.dart b/lib/pages/BookAppointment/components/DocInfo.dart index aa6e3b9f..89b9e4d0 100644 --- a/lib/pages/BookAppointment/components/DocInfo.dart +++ b/lib/pages/BookAppointment/components/DocInfo.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -13,31 +14,29 @@ class DoctorInformation extends StatelessWidget { return Container( margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), child: Column( + mainAxisSize: MainAxisSize.min, children: [ - Card( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), + AppExpandableNotifier( + isExpand: true, + headerWidget: Container( + margin: EdgeInsets.all(10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SvgPicture.asset( + "assets/images/DQ/doctor_information_icon.svg"), + Container( + margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0), + child: Text(TranslationBase.of(context).docInfo, + style: TextStyle(fontSize: 16.0, letterSpacing: 0.8)), + ), + ], + ), ), - child: Column( + bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ - Container( - margin: EdgeInsets.all(15.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SvgPicture.asset( - "assets/images/DQ/doctor_information_icon.svg"), - Container( - margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0), - child: Text(TranslationBase.of(context).docInfo, - style: - TextStyle(fontSize: 16.0, letterSpacing: 0.8)), - ), - ], - ), - ), Container( padding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0), child: Table( @@ -78,34 +77,32 @@ class DoctorInformation extends StatelessWidget { ], ), ), - Card( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), + // ), + AppExpandableNotifier( + isExpand: true, + headerWidget: Container( + margin: EdgeInsets.all(10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SvgPicture.asset( + "assets/images/DQ/doctor_qualification_icon.svg"), + Container( + margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0), + child: Text(TranslationBase.of(context).docQualifications, + style: TextStyle(fontSize: 16.0, letterSpacing: 0.8)), + ), + ], + ), ), - child: Column( + bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ - Container( - margin: EdgeInsets.all(15.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SvgPicture.asset( - "assets/images/DQ/doctor_qualification_icon.svg"), - Container( - margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0), - child: Text( - TranslationBase.of(context).docQualifications, - style: - TextStyle(fontSize: 16.0, letterSpacing: 0.8)), - ), - ], - ), - ), Container( margin: EdgeInsets.fromLTRB(20.0, 0.0, 10.0, 5.0), child: Column( + mainAxisSize: MainAxisSize.min, children: [ _getNormalText(docProfileList.doctorProfileInfo) ], @@ -123,7 +120,6 @@ class DoctorInformation extends StatelessWidget { return Text(text, style: TextStyle( fontSize: 13, - fontFamily: 'Open-Sans', fontWeight: FontWeight.bold, letterSpacing: 0.5, color: Colors.grey[800])); @@ -133,11 +129,9 @@ class DoctorInformation extends StatelessWidget { return Container( margin: EdgeInsets.only(top: 5.0), child: Text(text, + maxLines: 16, style: TextStyle( - fontSize: 13, - fontFamily: 'Open-Sans', - letterSpacing: 0.5, - color: Colors.grey[700])), + fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])), ); } @@ -150,10 +144,7 @@ class DoctorInformation extends StatelessWidget { children: [ Text(text.trim(), style: TextStyle( - fontSize: 13, - fontFamily: 'Open-Sans', - letterSpacing: 0.5, - color: Colors.grey[700])), + fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])), Container( margin: EdgeInsets.only(left: 5.0, right: 5.0), child: Image.network(icon, width: 18.0, height: 18.0), diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 7943e423..01c9ee92 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.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'; @@ -34,6 +34,7 @@ class _SearchByClinicState extends State { List projectsList = []; bool isMobileAppDentalAllow = false; bool isLoaded = false; + bool isProjectLoaded = false; @override void initState() { @@ -56,6 +57,11 @@ class _SearchByClinicState extends State { onChanged: (bool value) { setState(() { nearestAppo = value; + print(nearestAppo); + if (nearestAppo) + getProjectsList(); + else + isProjectLoaded = false; }); }, ), @@ -121,7 +127,8 @@ class _SearchByClinicState extends State { }, ), )), - isDentalSelectedAndSupported() == true || nearestAppo + isDentalSelectedAndSupported() == true || + (nearestAppo && isProjectLoaded) ? Container( height: 60.0, decoration: BoxDecoration( @@ -177,24 +184,30 @@ class _SearchByClinicState extends State { }); }); getProjectsList(); + GifLoaderDialogUtils.hideDialog(context); } else {} }).catchError((err) { print(err); + GifLoaderDialogUtils.hideDialog(context); }); } getProjectsList() { ClinicListService service = new ClinicListService(); + List projectsListLocal = []; service.getProjectsList(context).then((res) { if (res['MessageStatus'] == 1) { setState(() { res['ListProject'].forEach((v) { - projectsList.add(new HospitalsModel.fromJson(v)); + projectsListLocal.add(new HospitalsModel.fromJson(v)); }); + projectsList = projectsListLocal; }); - GifLoaderDialogUtils.hideDialog(context); filterClinic(); - } else {} + isProjectLoaded = true; + } else { + isProjectLoaded = false; + } }).catchError((err) { print(err); }); @@ -216,6 +229,9 @@ class _SearchByClinicState extends State { List arrDistance = []; List result; int numAll; + List _patientDoctorAppointmentListHospital = + List(); + DoctorsListService service = new DoctorsListService(); service .getDoctorsList( @@ -228,15 +244,34 @@ class _SearchByClinicState extends State { if (res['MessageStatus'] == 1) { setState(() { if (res['DoctorList'].length != 0) { - print(res['DoctorList']); + // print(res['DoctorList']); doctorsList.clear(); res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); + }); + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); - arr.add(new DoctorList.fromJson(v).projectName); - arrDistance.add(new DoctorList.fromJson(v) - .projectDistanceInKiloMeters - .toString()); + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + distanceInKMs: + element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } }); } else {} }); @@ -244,7 +279,7 @@ class _SearchByClinicState extends State { result = LinkedHashSet.from(arr).toList(); numAll = result.length; navigateToSearchResults( - context, doctorsList, result, numAll, arrDistance); + context, doctorsList, _patientDoctorAppointmentListHospital); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -267,24 +302,26 @@ class _SearchByClinicState extends State { } Future navigateToSearchResults( - context, docList, result, numAll, resultDistance) async { - Navigator.push( context, - MaterialPageRoute( - builder: (context) => BranchView( - doctorsList: docList, - result: result, - num: numAll, - resultDistance: resultDistance), - ), - ).then((value) { + List docList, + List + patientDoctorAppointmentListHospital) async { + isProjectLoaded = false; + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => SearchResults( + isLiveCareAppointment: false, + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))).then((value) { getProjectsList(); }); } filterClinic() { setState(() { - if (widget.clnicIds.length > 0) { + if (widget.clnicIds != null && widget.clnicIds.length > 0) { clinicsList = clinicsList .where((i) => widget.clnicIds.indexOf(i.clinicID) > -1) .toList(); diff --git a/lib/pages/BookAppointment/widgets/CardCommon.dart b/lib/pages/BookAppointment/widgets/CardCommon.dart index e56ba965..b03e9b24 100644 --- a/lib/pages/BookAppointment/widgets/CardCommon.dart +++ b/lib/pages/BookAppointment/widgets/CardCommon.dart @@ -1,6 +1,8 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:flutter/material.dart'; +import '../../../Constants.dart'; + class CardCommon extends StatelessWidget { final image; final text; @@ -31,7 +33,7 @@ class CardCommon extends StatelessWidget { child: Text(this.text, overflow: TextOverflow.clip, style: TextStyle( - color: new Color(0xFF40ACC9), + color: secondaryColor, letterSpacing: 1.0, fontSize: 20.0)), ), diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index 5bffe17c..d85971bb 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -1,11 +1,15 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.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/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -27,13 +31,14 @@ class _HospitalsLiveChatPageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getLiveChatRequestOrders(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, + isShowDecPage: false, body: SingleChildScrollView( child: Container( - margin: EdgeInsets.only(left: 15, right: 15), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -43,11 +48,11 @@ class _HospitalsLiveChatPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 20, + height: 70, ), Container( width: double.infinity, - height: 200, + height: 230, decoration: BoxDecoration( image: DecorationImage( image: ExactAssetImage( @@ -56,10 +61,29 @@ class _HospitalsLiveChatPageState extends State { ), child: Padding( padding: const EdgeInsets.all(8.0), - child: Texts( - 'You can now talk directly to the appointments department by chat or request a call back\n \nChoose Hospital :', - color: Colors.white, - textAlign: TextAlign.start, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: projectViewModel.isArabic? 10:20, + ), + Texts( + TranslationBase.of(context).instructions, + color: Colors.white, + textAlign: TextAlign.start, + ), + SizedBox( + height:projectViewModel.isArabic? 8:25, + ), + Texts( + TranslationBase.of(context) + .selectHospitalDec + + " :", + color: Colors.white, + fontWeight: FontWeight.w700, + textAlign: TextAlign.start, + ), + ], ), ), ), @@ -91,7 +115,7 @@ class _HospitalsLiveChatPageState extends State { borderRadius: BorderRadius.all( Radius.circular(5)), color: tappedIndex == index - ? Colors.red + ? Theme.of(context).primaryColor : Colors.white, ), child: Padding( @@ -104,8 +128,7 @@ class _HospitalsLiveChatPageState extends State { onTap: () { setState(() { tappedIndex = index; - chat = - "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=en&WorkGroup=${model.LiveChatModelList[index].value}"; + chat = "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.currentLanguage}&WorkGroup=${model.LiveChatModelList[index].value}"; }); }, child: Row( @@ -135,7 +158,8 @@ class _HospitalsLiveChatPageState extends State { .black, textAlign: TextAlign .center, - ))), //model.cOCItemList[index].cOCTitl + ))), + //model.cOCItemList[index].cOCTitl IconButton( icon: Icon( Icons.arrow_forward_ios, @@ -171,18 +195,19 @@ class _HospitalsLiveChatPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.13, + height: MediaQuery.of(context).size.height * 0.10, width: double.infinity, padding: EdgeInsets.all(8.0), child: Center( child: Container( - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery.of(context).size.height * 0.07, width: MediaQuery.of(context).size.width * 0.8, - child: Button( - label: 'ٍStart', + child: SecondaryButton( + label: TranslationBase.of(context).start, loading: model.state == ViewState.BusyLocal, + textColor: Colors.white, + disabled: chat.isEmpty, onTap: () { - print("chat=" + chat); launch(chat); }, ), diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart index b870234a..a747db3d 100644 --- a/lib/pages/ContactUs/LiveChat/livechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -1,6 +1,8 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/pharmaciesLivechat_page.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'; @@ -16,9 +18,15 @@ class LiveChatPage extends StatefulWidget { class _LiveChatPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; + List imagesInfo = List(); + @override void initState() { super.initState(); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/1.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/2.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/2.png')); + _tabController = TabController(length: 2, vsync: this); } @@ -33,7 +41,10 @@ class _LiveChatPageState extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: 'Locations', + imagesInfo: imagesInfo, + title: TranslationBase.of(context).liveChat, + description: TranslationBase.of(context).infoChat, + appBarTitle: TranslationBase.of(context).service, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -71,25 +82,22 @@ class _LiveChatPageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - //indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab, - - indicatorColor: Colors.red[800], + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ 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/ContactUs/LiveChat/pharmaciesLivechat_page.dart b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart index cbda0828..c5300b5d 100644 --- a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart @@ -1,12 +1,15 @@ import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.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/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -28,10 +31,11 @@ class _PhamaciesLiveChatPageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getLiveChatRequestOrders(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, + isShowDecPage: false, body: SingleChildScrollView( child: Container( margin: EdgeInsets.only(left: 15, right: 15), @@ -43,12 +47,9 @@ class _PhamaciesLiveChatPageState extends State { Container( width: double.infinity, height: 200, - decoration: BoxDecoration( - image: DecorationImage( - image: ExactAssetImage(''), fit: BoxFit.cover), - ), + child: Texts( - 'You can now talk directly to the pharmacist by chat or request a call back', + TranslationBase.of(context).instructionsPharmacies, color: Colors.black, textAlign: TextAlign.center, ), @@ -63,20 +64,20 @@ class _PhamaciesLiveChatPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.13, + height: MediaQuery.of(context).size.height * 0.10, width: double.infinity, padding: EdgeInsets.all(8.0), child: Center( child: Container( - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery.of(context).size.height * 0.87, width: MediaQuery.of(context).size.width * 0.8, child: Button( - label: 'ٍStart', + label: TranslationBase.of(context).start, loading: model.state == ViewState.BusyLocal, onTap: () { print("chat=" + chat); chat = - "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=1"; + "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.isArabic? 1:2}"; launch(chat); }, ), diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index 807ac1c7..5cf59e21 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -81,7 +81,7 @@ class _FindUsPageState extends State //indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Colors.red[800], + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 7aa968a5..308dbeca 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -116,9 +116,9 @@ class _HospitalsPageState extends State { CrossAxisAlignment.center, children: [ IconButton( - // icon: Icon(Icons.location_on,color: Colors.red,), - icon: new Image.asset( - 'assets/images/new-design/navigate.png'), + icon: Icon(Icons.location_on,color: Theme.of(context).primaryColor,size: 35,), + // icon: new Image.asset( + // 'assets/images/new-design/navigate.png'), tooltip: '', onPressed: () { setState(() { @@ -139,9 +139,9 @@ class _HospitalsPageState extends State { }, ), IconButton( - // icon: Icon(Icons.phone,color: Colors.red,), - icon: new Image.asset( - 'assets/images/new-design/call.png'), + icon: Icon(Icons.phone,color: Theme.of(context).primaryColor,size: 35,), + // icon: new Image.asset( + // 'assets/images/new-design/call.png'), tooltip: '', onPressed: () { setState(() { diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart index cab201e3..6cf94728 100644 --- a/lib/pages/ContactUs/findus/pharmacies_page.dart +++ b/lib/pages/ContactUs/findus/pharmacies_page.dart @@ -140,13 +140,7 @@ class _PharmaciesPageState extends State { child: Row( children: [ IconButton( - // icon: Icon( - // Icons - // .location_on, - // color: Colors.red, - // ), - icon: new Image.asset( - 'assets/images/new-design/navigate.png'), + icon: Icon(Icons.location_on,color: Theme.of(context).primaryColor,size: 35,), tooltip: '', onPressed: () { setState(() { @@ -163,21 +157,15 @@ class _PharmaciesPageState extends State { .findusPharmaciesModelList[ index] .locationName); - // _volume += 10; }); }, ), IconButton( - // icon: Icon( - // Icons.phone, - // color: Colors.red, - // ), - icon: new Image.asset( - 'assets/images/new-design/call.png'), + icon: Icon(Icons.phone,color: Theme.of(context).primaryColor,size: 35,), tooltip: 'I', onPressed: () { setState(() { - // _volume += 10; + launch("tel://" + widget .findusPharmaciesModelList[ diff --git a/lib/pages/ContactUs/widgets/card_common_contat.dart b/lib/pages/ContactUs/widgets/card_common_contat.dart index 67580dbf..cfb9108b 100644 --- a/lib/pages/ContactUs/widgets/card_common_contat.dart +++ b/lib/pages/ContactUs/widgets/card_common_contat.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -34,19 +35,16 @@ class CardCommonContact extends StatelessWidget { children: [ Container( margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), - child: Text(this.text, - overflow: TextOverflow.clip, - style: TextStyle( - color: new Color(0xFFc5272d), - letterSpacing: 1.0, - fontSize: 20.0)), + child: Texts(this.text, + // overflow: TextOverflow.clip, + color:Theme.of(context).primaryColor, + fontWeight: FontWeight.w700, + fontSize: 20.0), ), Container( margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), - child: Text(this.subText, - overflow: TextOverflow.clip, - style: TextStyle( - color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), + child: Texts(this.subText, + color: Colors.black, fontSize: 15.0), ), Align( alignment: projectViewModel.isArabic? Alignment.bottomLeft:Alignment.bottomRight, diff --git a/lib/pages/DrawerPages/family/add-family_type.dart b/lib/pages/DrawerPages/family/add-family_type.dart index 96e055b3..33e39397 100644 --- a/lib/pages/DrawerPages/family/add-family_type.dart +++ b/lib/pages/DrawerPages/family/add-family_type.dart @@ -27,7 +27,7 @@ class AddFamilyMemberType extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( - 'assets/images/habib-logo.png', + 'assets/images/DQ/dq_logo_icon.png', height: 80, width: 80, ), diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index d3de1b62..2d7e4270 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -1,9 +1,23 @@ +import 'dart:ui'; + import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' + as list; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -13,69 +27,159 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.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:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/routes.dart'; +import 'package:provider/provider.dart'; class MyFamily extends StatefulWidget { final bool isAppbarVisible; - MyFamily({this.isAppbarVisible =true}); + + MyFamily({this.isAppbarVisible = true}); + @override _MyFamily createState() => _MyFamily(); } class _MyFamily extends State with TickerProviderStateMixin { + List imagesInfo = List(); final familyFileProvider = FamilyFilesProvider(); AppSharedPreferences sharedPref = new AppSharedPreferences(); var userID; TabController _tabController; - + int _tabIndex = 0; + AuthenticatedUserObject authenticatedUserObject = + locator(); + AppointmentRateViewModel appointmentRateViewModel = + locator(); + ProjectViewModel projectViewModel; + AuthenticatedUser user; + VitalSignService _vitalSignService = locator(); + var isVaiable = false; @override void initState() { _tabController = new TabController(length: 2, vsync: this, initialIndex: 0); - + checkUserData(); super.initState(); } bool expandFlag = false; + Widget build(BuildContext context) { - // return Scaffold( - // appBar: AppBar( - // bottom: TabBar( - // indicatorColor: Colors.red, - // tabs: [ - // Padding( - // padding: EdgeInsets.all(6), - // child: AppText( - // TranslationBase.of(context).family, - // color: Colors.white, - // )), - // Padding( - // padding: EdgeInsets.all(6), - // child: AppText( - // TranslationBase.of(context).request, - // color: Colors.white, - // )), - // ], - // controller: _tabController, - // ), - // - // ), - // body: TabBarView( - // // physics: NeverScrollableScrollPhysics(), - // children: [myFamilyDetails(context), myFamilyRequest(context)], - // controller: _tabController), - // ); - // //bottomNavigationBar: BottomBarSearch()); + imagesInfo.add( + ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), + ); + + imagesInfo.add( + ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), + ); + projectViewModel = Provider.of(context); + return AppScaffold( + appBarTitle: TranslationBase.of(context).myFamilyFiles, + isShowAppBar: widget.isAppbarVisible, + imagesInfo: imagesInfo, + description: TranslationBase.of(context).familyInfo, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.92, + // 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + //indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText(TranslationBase.of(context).family), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText(TranslationBase.of(context).request), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: (user != null && projectViewModel.isLogin) + ? TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + myFamilyDetails(context), + myFamilyRequest(context) + ], + ) + : Container(child: AppText('Loading..')), + ) + ], + ), + ), + ); return AppScaffold( appBarTitle: TranslationBase.of(context).myFamilyFiles, isShowAppBar: widget.isAppbarVisible, body: SingleChildScrollView( child: Container( - height: SizeConfig.screenHeight, + height: SizeConfig.screenHeight * .9, width: SizeConfig.realScreenWidth, padding: EdgeInsets.all(20), child: Stack( @@ -84,12 +188,13 @@ class _MyFamily extends State with TickerProviderStateMixin { controller: _tabController, indicatorColor: Colors.red, tabs: [ - Padding( - padding: EdgeInsets.all(6), - child: Text(TranslationBase.of(context).family)), - Padding( - padding: EdgeInsets.all(6), - child: Text(TranslationBase.of(context).request)), + Tab( + // padding: EdgeInsets.all(6), + child: AppText(TranslationBase.of(context).family)), + Tab( + // padding: EdgeInsets.all(6), + child: + AppText(TranslationBase.of(context).request)), ], ), TabBarView( @@ -106,7 +211,7 @@ class _MyFamily extends State with TickerProviderStateMixin { Widget myFamilyDetails(context) { return Container( height: MediaQuery.of(context).size.height, - margin: EdgeInsets.fromLTRB(20.0, 0, 20.0, 0.0), + margin: EdgeInsets.fromLTRB(20.0, 25.0, 20.0, 0.0), child: Column( children: [ Expanded( @@ -125,7 +230,8 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text("No data found")); + child: Text( + TranslationBase.of(context).noDataAvailable)); else return Padding( padding: EdgeInsets.only(top: 50), @@ -223,13 +329,13 @@ class _MyFamily extends State with TickerProviderStateMixin { Widget myFamilyRequest(context) { return //Padding( - // padding: const EdgeInsets.symmetric(horizontal: 10.0), - // child: - SingleChildScrollView( - child: Container( + // padding: const EdgeInsets.symmetric(horizontal: 10.0), + // child: + SingleChildScrollView( + child: Container( height: MediaQuery.of(context).size.height, - margin: EdgeInsets.only(top:50), - child: Column( + margin: EdgeInsets.only(top: 65), + child: Column( children: [ RoundedContainer( child: ExpansionTile( @@ -251,40 +357,60 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text('No data found')); + child: Text(TranslationBase.of(context) + .noDataAvailable)); else return Column( children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 3, - child: Text(TranslationBase.of(context) - .request)), - Expanded( - flex: 2, - child: Text( - TranslationBase.of(context) - .switchUser, - )), - Expanded( - flex: 1, - child: Text( - TranslationBase.of(context) - .deleteView, - )), - ], - ), + // Padding(padding: EdgeInsets.only(left:10, right:10), + // child: + // Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Expanded( + // flex: 3, + // child: Text(TranslationBase.of(context) + // .request)), + // Expanded( + // flex: 2, + // child: Text( + // TranslationBase.of(context) + // .switchUser, + // )), + // Expanded( + // flex: 1, + // child: Text( + // TranslationBase.of(context) + // .deleteView, + // )), + // ], + // )), Column(children: [ - Row(children: [ - Expanded(flex: 3, child: AppText('Name')), - Expanded(flex: 1, child: AppText('Allow')), - Expanded(flex: 1, child: AppText('Reject')), - ]), + Padding( + padding: EdgeInsets.only( + left: 10, right: 10), + child: Row(children: [ + Expanded( + flex: 3, + child: AppText( + TranslationBase.of(context) + .theName)), + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context) + .allowView)), + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context) + .rejectView)), + ])), Column( - children:familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList + children: familyFileProvider + .allSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList .map((result) { return Padding( padding: EdgeInsets.all(10), @@ -302,8 +428,10 @@ class _MyFamily extends State with TickerProviderStateMixin { color: Colors.black, ), onPressed: () { - acceptRequest( - result, context); + acceptRemoveRequest( + result.iD, + 3, + context); }, )), Expanded( @@ -314,8 +442,10 @@ class _MyFamily extends State with TickerProviderStateMixin { color: Colors.black, ), onPressed: () { - deleteRequest( - result, context); + acceptRemoveRequest( + result.iD, + 4, + context); }, )) ], @@ -350,12 +480,25 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text('No data found')); + child: Text(TranslationBase.of(context) + .noDataAvailable)); else - return SingleChildScrollView( - child: Container( - height: SizeConfig.screenHeight * .3, - child: ListView( + return Container( + height: SizeConfig.screenHeight * .3, + child: SingleChildScrollView( + child: Column( + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, right: 10), + child: Row(children: [ + Expanded( + flex: 3, + child: AppText( + TranslationBase.of(context) + .theName)) + ])), + Column( children: snapshot .data.getAllSharedRecordsByStatusList .map((result) { @@ -365,18 +508,25 @@ class _MyFamily extends State with TickerProviderStateMixin { children: [ Expanded( flex: 3, - child: - Text(result.patientName)), + child: Text( + result.patientName)), Expanded( flex: 2, child: AppText( result.statusDescription, - color: Colors.red, + color: result.status == 3 + ? Colors.green + : result.status == 2 + ? Colors + .yellow[800] + : Colors.red, )), ], )); }).toList(), - ))); + ) + ], + ))); } }) ], @@ -390,8 +540,8 @@ class _MyFamily extends State with TickerProviderStateMixin { children: [ FutureBuilder( future: getUserViewRequest(), // async work - builder: - (BuildContext context, AsyncSnapshot snapshot) { + builder: (BuildContext context, + AsyncSnapshot snapshot) { switch (snapshot.connectionState) { case ConnectionState.waiting: return Padding( @@ -401,59 +551,59 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text('No data found')); + child: Text(TranslationBase.of(context) + .noDataAvailable)); else return Column( children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 3, - child: Text( - TranslationBase.of(context).request)), - Expanded( - flex: 2, - child: Text( - TranslationBase.of(context).switchUser, - )), - Expanded( - flex: 1, - child: Text( - TranslationBase.of(context).deleteView, - )), - ], - ), Column(children: [ - Row(children: [ - Expanded(flex: 3, child: AppText('Name')), - Expanded(flex: 1, child: AppText('Delete')), - ]), + Padding( + padding: + EdgeInsets.only(left: 10, right: 10), + child: Row(children: [ + Expanded( + flex: 3, + child: AppText( + TranslationBase.of(context) + .theName)), + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context) + .deleteView)), + ])), Column( - children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList + children: familyFileProvider + .allSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList .map((result) { - return Padding( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - flex: 3, - child: Text(result.patientName)), - Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.delete, - color: Colors.black, - ), - onPressed: () { - deleteRequest( - result, context); - }, - )), - ], - )); + return result.status == 3 + ? Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: AppText( + result.patientName)), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.delete, + color: Colors.black, + ), + onPressed: () { + deactivateRequest( + result.iD, + 5, + context); + }, + )), + ], + )) + : Container( + child: AppText(isAvailable())); }).toList()) ]) ], @@ -468,13 +618,24 @@ class _MyFamily extends State with TickerProviderStateMixin { ); } - Future getFamilyFiles() async { - if (await sharedPref.getObject(FAMILY_FILE) != null) { - // print(await sharedPref.getObject(FAMILY_FILE)); - return Future.value(GetAllSharedRecordsByStatusResponse.fromJson( - await sharedPref.getObject(FAMILY_FILE))); + String isAvailable() { + if (isVaiable == false) { + this.isVaiable = true; + return TranslationBase.of(context).noDataAvailable; } else { - return familyFileProvider.getSharedRecordByStatus(); + return ""; + } + } + + Future getFamilyFiles() async { + if (user != null) { + if (await sharedPref.getObject(FAMILY_FILE) != null) { + // print(await sharedPref.getObject(FAMILY_FILE)); + return Future.value(GetAllSharedRecordsByStatusResponse.fromJson( + await sharedPref.getObject(FAMILY_FILE))); + } else { + return familyFileProvider.getSharedRecordByStatus(); + } } } @@ -514,33 +675,119 @@ class _MyFamily extends State with TickerProviderStateMixin { } refreshFamily(context) { - sharedPref.remove(FAMILY_FILE); - (context as Element).reassemble(); + //sharedPref.remove(FAMILY_FILE); + setState(() { + sharedPref.remove(FAMILY_FILE); + }); } switchUser(user, context) { GifLoaderDialogUtils.showMyDialog(context); + // this + // .familyFileProvider + // .silentLoggin(user) + // .then((value) => loginAfter(value, context)); + + // Utils.showProgressDialog(context); this .familyFileProvider - .silentLoggin(user) - .then((value) => loginAfter(value, context)); + .silentLoggin(user is AuthenticatedUser ? null : user, + mainUser: user is AuthenticatedUser) + .then((value) { + _vitalSignService.heightCm = ""; + _vitalSignService.weightKg = ""; + loginAfter(value, context); + }).catchError((err) { + print(err); + AppToast.showErrorToast(message: err); + Navigator.of(context).pop(); + }); } - loginAfter(result, context) async{ - GifLoaderDialogUtils.hideDialog(context); + loginAfter(result, context) async { + //GifLoaderDialogUtils.hideDialog(context); + Provider.of(context, listen: false).setPrivilege(privilegeList: result,isLoginChild: true); + var currentLang = await sharedPref.getString(APP_LANGUAGE); + result = list.CheckActivationCode.fromJson(result); var familyFile = await sharedPref.getObject(FAMILY_FILE); - result = CheckActivationCode.fromJson(result); + var mainUser = await sharedPref.getObject(MAIN_USER); + var bloodType = await sharedPref.getString(BLOOD_TYPE); this.sharedPref.clear(); - this.sharedPref.setObject(FAMILY_FILE, familyFile); + if (mainUser["PatientID"] != result.list.patientID) { + result.list.isFamily = true; + } + this.sharedPref.setString(APP_LANGUAGE, currentLang); + this.sharedPref.setObject(MAIN_USER, mainUser); + this.sharedPref.setString(BLOOD_TYPE, bloodType); this.sharedPref.setObject(USER_PROFILE, result.list); + this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID); - //this.checkIfUserAgreedBefore(result), - Navigator.of(context).pushNamed( - HOME, - ); + await authenticatedUserObject.getUser(getUser: true); + Provider.of(context, listen: false).user = + authenticatedUserObject.user; + Provider.of(context, listen: false) + .setUser(authenticatedUserObject.user); + appointmentRateViewModel + .getIsLastAppointmentRatedList() + .then((value) => { + //getToDoCount(), + // Utils.hideProgressDialog(), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false) + } + }) + .catchError((err) { + print(err); + // Utils.hideProgressDialog(); + // GifLoaderDialogUtils.hideDialog(context); + }); + } + + deactivateRequest(ID, status, context) { + GifLoaderDialogUtils.showMyDialog(context); + Map request = {}; + request["ID"] = ID; + request["Status"] = status; + this.familyFileProvider.deactivateFamily(request).then((value) => + {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)}); + } + + acceptRemoveRequest(ID, status, context) { + GifLoaderDialogUtils.showMyDialog(context); + Map request = {}; + request["ID"] = ID; + request["Status"] = status; + this.familyFileProvider.acceptRejectFamily(request).then((value) => + {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)}); } - deleteRequest(result, context) {} - acceptRequest(result, context) {} + checkUserData() async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + + var data2 = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(MAIN_USER)); + print(data2); + setState(() { + this.user = data; + }); + } + } } diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 413d80e6..1690254a 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -24,6 +25,7 @@ class AmbulanceReq extends StatefulWidget { class _AmbulanceReqState extends State with SingleTickerProviderStateMixin { TabController _tabController; + List imagesInfo = List(); @override void initState() { @@ -39,11 +41,19 @@ class _AmbulanceReqState extends State @override Widget build(BuildContext context) { + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/Ambulance/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/Ambulance/ar/0.png')); + return BaseView( onModelReady: (model) => model.getAmRequestOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: "Ambulance Request", + appBarTitle: TranslationBase.of(context).transportationService, + description: TranslationBase.of(context).infoAmbulance, + imagesInfo: imagesInfo, baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, @@ -92,8 +102,7 @@ class _AmbulanceReqState extends State Container( width: MediaQuery.of(context).size.width * 0.40, child: Center( - child: Texts( - "Ambulance Request"), //TranslationBase.of(context).prescriptions + child: Texts(TranslationBase.of(context).transportationService), ), ), Container( @@ -118,8 +127,8 @@ class _AmbulanceReqState extends State controller: _tabController, children: [ AmbulanceRequestIndexPage( - amRequestViewModel: model, - ), + amRequestViewModel: model, + ), OrderLogPage( amRequestViewModel: model, ) diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index db2b0643..17b6d57b 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -1,11 +1,17 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; import 'widgets/AppointmentActions.dart'; @@ -26,46 +32,51 @@ class _AppointmentDetailsState extends State with SingleTickerProviderStateMixin { static TabController _tabController; + List doctorDetailsList = List(); + @override void initState() { _tabController = new TabController(length: 2, vsync: this); + AppointmentDetails.showFooterButton = false; super.initState(); } + @override void dispose() { - // TODO: implement dispose super.dispose(); _tabController.dispose(); + AppointmentDetails.showFooterButton = false; } @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: widget.appo.doctorNameObj, isShowAppBar: true, bottomSheet: AppointmentDetails.showFooterButton ? Container( - width: MediaQuery.of(context).size.width, - height: 50.0, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: goToBookConfirm, - child: Text(TranslationBase.of(context).bookNow, - style: TextStyle(fontSize: 18.0)), - ), - ), - ) + width: MediaQuery.of(context).size.width, + height: 50.0, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: goToBookConfirm, + child: Text(TranslationBase.of(context).bookNow, + style: TextStyle(fontSize: 18.0)), + ), + ), + ) : null, body: Container( color: new Color(0xFFf6f6f6), @@ -88,7 +99,8 @@ class _AppointmentDetailsState extends State ), ), Container( - margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), + margin: + EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), alignment: Alignment.center, child: Text( widget.appo.doctorTitle + @@ -103,7 +115,7 @@ class _AppointmentDetailsState extends State Container( margin: EdgeInsets.only(top: 10.0), alignment: Alignment.center, - child: Text(widget.appo.clinicName, + child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), style: TextStyle( fontSize: 12.0, color: Colors.grey[900], @@ -123,19 +135,37 @@ class _AppointmentDetailsState extends State emptyIcon: Icons.star, ), ), + InkWell( + onTap: () { + getDoctorRatingsDetails(); + }, + child: Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: Text( + "(" + + widget.appo.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: 5.0), alignment: Alignment.center, - child: Text( - "(" + - widget.appo.noOfPatientsRate.toString() + - " Reviews)", - style: TextStyle( - fontSize: 14.0, - color: Colors.blue[800], - letterSpacing: 1.0, - decoration: TextDecoration.underline, - )), + child: Text(DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + widget.appo.appointmentDate), + projectViewModel.isArabic ? "ar" : "en")), + ), + Container( + alignment: Alignment.center, + child: Text(widget.appo.startTime.substring(0, 5)), ), Container( margin: EdgeInsets.only(top: 10.0), @@ -171,8 +201,14 @@ class _AppointmentDetailsState extends State child: TabBarView( physics: NeverScrollableScrollPhysics(), children: [ - AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton), - DocAvailableAppointments(doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment) + AppointmentActions( + appo: widget.appo, + tabController: _tabController, + enableFooterButton: enableFooterButton), + DocAvailableAppointments( + doctor: getDoctorObject(), + isLiveCareAppointment: + widget.appo.isLiveCareAppointment) ], controller: _tabController, ), @@ -207,7 +243,292 @@ class _AppointmentDetailsState extends State selectedTime: DocAvailableAppointments.selectedTime))); } + getDoctorRatingsDetails() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.getDoctorsRatingDetails(widget.appo.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 + .appo + .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.appo.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.appo.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.appo.noOfPatientsRate) * 100; + return width; + } + + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString(); + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + " "; + }); + return docSpeciality; + } DoctorList getDoctorObject() { DoctorList docObj = new DoctorList(); diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 95485da5..a49149b5 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -1,4 +1,6 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/enum/filter_type.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'; @@ -27,6 +29,10 @@ class MyAppointments extends StatefulWidget { List(); List _patientArrivedAppointmentListHospital = List(); + List _patientBookedAppointmentListClinic = List(); + List _patientConfirmedAppointmentListClinic = List(); + List _patientArrivedAppointmentListClinic = List(); + @override _MyAppointmentsState createState() => _MyAppointmentsState(); } @@ -40,12 +46,28 @@ class _MyAppointmentsState extends State AuthenticatedUserObject authenticatedUserObject = locator(); + List imagesInfo = List(); + + FilterType filterType; + @override void initState() { _tabController = new TabController(length: 3, vsync: this); + filterType = FilterType.Clinic; 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 +76,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( @@ -68,17 +92,55 @@ class _MyAppointmentsState extends State color: Colors.grey[600], thickness: 0.5, ), - Expanded( - child: new TabBarView( - physics: NeverScrollableScrollPhysics(), - children: [ - isDataLoaded ? getBookedAppointments() : Container(), - isDataLoaded ? getConfirmedAppointments() : Container(), - isDataLoaded ? getArrivedAppointments() : Container() - ], - controller: _tabController, - ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => setFilterType(FilterType.Clinic), + child: ListTile( + title: Text(TranslationBase.of(context).clinic), + leading: Radio( + value: FilterType.Clinic, + groupValue: filterType, + activeColor: Theme.of(context).primaryColor, + onChanged: (FilterType value) { + setFilterType(value); + }, + ), + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => setFilterType(FilterType.Hospital), + child: ListTile( + title: Text(TranslationBase.of(context).hospital), + leading: Radio( + value: FilterType.Hospital, + groupValue: filterType, + activeColor: Theme.of(context).primaryColor, + onChanged: (FilterType value) => setFilterType(value), + ), + ), + ), + ) + ], ), + isDataLoaded + ? Expanded( + child: new TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + getBookedAppointments(), + getConfirmedAppointments(), + getArrivedAppointments() + ], + controller: _tabController, + ), + ) + : Container(), ]), ), ); @@ -96,24 +158,30 @@ class _MyAppointmentsState extends State widget._patientConfirmedAppointmentListHospital.clear(); widget._patientArrivedAppointmentListHospital.clear(); + widget._patientBookedAppointmentListClinic.clear(); + widget._patientConfirmedAppointmentListClinic.clear(); + widget._patientArrivedAppointmentListClinic.clear(); + service.getPatientAppointmentHistory(false, context).then((res) { print(res['AppoimentAllHistoryResultList'].length); - if (res['MessageStatus'] == 1) { - GifLoaderDialogUtils.hideDialog(context); - setState(() { + GifLoaderDialogUtils.hideDialog(context); + setState(() { + if (res['MessageStatus'] == 1) { + // setState(() { if (res['AppoimentAllHistoryResultList'].length != 0) { + // isDataLoaded = true; res['AppoimentAllHistoryResultList'].forEach((v) { widget.appoList .add(new AppoitmentAllHistoryResultList.fromJson(v)); }); sortAppointmentList(); - openAppointmentsTab(); - isDataLoaded = true; } else {} - }); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } + // }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + isDataLoaded = true; + }); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); @@ -150,11 +218,31 @@ class _MyAppointmentsState extends State }); widget.bookedAppoList.forEach((element) { + List doctorByClinic = + widget._patientBookedAppointmentListClinic + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByClinic.length != 0) { + widget + ._patientBookedAppointmentListClinic[widget + ._patientBookedAppointmentListClinic + .indexOf(doctorByClinic[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientBookedAppointmentListClinic.add(PatientAppointmentList( + filterName: element.clinicName, patientDoctorAppointment: element)); + } + List doctorByHospital = widget._patientBookedAppointmentListHospital .where( (elementClinic) => - elementClinic.filterName == element.clinicName, + elementClinic.filterName == element.projectName, ) .toList(); @@ -167,16 +255,39 @@ class _MyAppointmentsState extends State .add(element); } else { widget._patientBookedAppointmentListHospital.add(PatientAppointmentList( - filterName: element.clinicName, patientDoctorAppointment: element)); + filterName: element.projectName, + patientDoctorAppointment: element)); } }); widget.confirmedAppoList.forEach((element) { + List doctorByClinic = + widget._patientConfirmedAppointmentListClinic + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByClinic.length != 0) { + widget + ._patientConfirmedAppointmentListClinic[widget + ._patientConfirmedAppointmentListClinic + .indexOf(doctorByClinic[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientConfirmedAppointmentListClinic.add( + PatientAppointmentList( + filterName: element.clinicName, + patientDoctorAppointment: element)); + } + List doctorByHospital = widget._patientConfirmedAppointmentListHospital .where( (elementClinic) => - elementClinic.filterName == element.clinicName, + elementClinic.filterName == element.projectName, ) .toList(); @@ -190,17 +301,37 @@ class _MyAppointmentsState extends State } else { widget._patientConfirmedAppointmentListHospital.add( PatientAppointmentList( - filterName: element.clinicName, + filterName: element.projectName, patientDoctorAppointment: element)); } }); widget.arrivedAppoList.forEach((element) { + List doctorByClinic = + widget._patientArrivedAppointmentListClinic + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByClinic.length != 0) { + widget + ._patientArrivedAppointmentListClinic[widget + ._patientArrivedAppointmentListClinic + .indexOf(doctorByClinic[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientArrivedAppointmentListClinic.add(PatientAppointmentList( + filterName: element.clinicName, patientDoctorAppointment: element)); + } + List doctorByHospital = widget._patientArrivedAppointmentListHospital .where( (elementClinic) => - elementClinic.filterName == element.clinicName, + elementClinic.filterName == element.projectName, ) .toList(); @@ -214,9 +345,11 @@ class _MyAppointmentsState extends State } else { widget._patientArrivedAppointmentListHospital.add( PatientAppointmentList( - filterName: element.clinicName, + filterName: element.projectName, patientDoctorAppointment: element)); } + + openAppointmentsTab(); }); } @@ -230,11 +363,11 @@ class _MyAppointmentsState extends State } else if (flag == 3) { _tabController.index = 2; } else { - if (widget._patientBookedAppointmentListHospital.length != 0) { + if (widget._patientBookedAppointmentListClinic.length != 0) { _tabController.index = 0; - } else if (widget._patientConfirmedAppointmentListHospital.length != 0) { + } else if (widget._patientConfirmedAppointmentListClinic.length != 0) { _tabController.index = 1; - } else if (widget._patientArrivedAppointmentListHospital.length != 0) { + } else if (widget._patientArrivedAppointmentListClinic.length != 0) { _tabController.index = 2; return; } @@ -250,24 +383,42 @@ class _MyAppointmentsState extends State child: Column( children: [ ...List.generate( - widget._patientBookedAppointmentListHospital.length, + filterType == FilterType.Clinic + ? widget._patientBookedAppointmentListClinic.length + : widget._patientBookedAppointmentListHospital.length, (index) => AppExpandableNotifier( - title: widget - ._patientBookedAppointmentListHospital[index] - .filterName, + title: filterType == FilterType.Clinic + ? widget + ._patientBookedAppointmentListClinic[index] + .filterName + : widget + ._patientBookedAppointmentListHospital[index] + .filterName, bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: widget - ._patientBookedAppointmentListHospital[index] - .patientDoctorAppointmentList - .map((doctor) { - return AppointmentCard( - appo: doctor, - onReloadAppointmentHistory: - getPatientAppointmentHistory, - ); - }).toList(), + children: filterType == FilterType.Clinic + ? widget + ._patientBookedAppointmentListClinic[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList() + : widget + ._patientBookedAppointmentListHospital[ + index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), )), ) ], @@ -283,7 +434,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, )), @@ -305,24 +456,43 @@ class _MyAppointmentsState extends State child: Column( children: [ ...List.generate( - widget._patientConfirmedAppointmentListHospital.length, + filterType == FilterType.Clinic + ? widget._patientConfirmedAppointmentListClinic.length + : widget + ._patientConfirmedAppointmentListHospital.length, (index) => AppExpandableNotifier( - title: widget - ._patientConfirmedAppointmentListHospital[index] - .filterName, + title: filterType == FilterType.Clinic + ? widget + ._patientConfirmedAppointmentListClinic[index] + .filterName + : widget + ._patientConfirmedAppointmentListHospital[index] + .filterName, bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: widget - ._patientConfirmedAppointmentListHospital[index] - .patientDoctorAppointmentList - .map((doctor) { - return AppointmentCard( - appo: doctor, - onReloadAppointmentHistory: - getPatientAppointmentHistory, - ); - }).toList(), + children: filterType == FilterType.Clinic + ? widget + ._patientConfirmedAppointmentListClinic[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList() + : widget + ._patientConfirmedAppointmentListHospital[ + index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), )), ) ], @@ -338,8 +508,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, )), @@ -359,24 +528,38 @@ class _MyAppointmentsState extends State child: Column( children: [ ...List.generate( - widget._patientArrivedAppointmentListHospital.length, + filterType == FilterType.Clinic + ? widget._patientArrivedAppointmentListClinic.length + : widget._patientArrivedAppointmentListHospital.length, (index) => AppExpandableNotifier( - title: widget - ._patientArrivedAppointmentListHospital[index] - .filterName, + title: filterType == FilterType.Clinic + ? widget._patientArrivedAppointmentListClinic[index] + .filterName + : widget._patientArrivedAppointmentListHospital[index] + .filterName, bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: widget - ._patientArrivedAppointmentListHospital[index] - .patientDoctorAppointmentList - .map((doctor) { - return AppointmentCard( - appo: doctor, - onReloadAppointmentHistory: - getPatientAppointmentHistory, - ); - }).toList(), + children: filterType == FilterType.Clinic + ? widget._patientArrivedAppointmentListClinic[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList() + : widget + ._patientArrivedAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), ), ), ) @@ -393,15 +576,20 @@ 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, + )), ), ], ), ), ); } + + setFilterType(FilterType filterType) { + setState(() { + this.filterType = filterType; + }); + } } diff --git a/lib/pages/MyAppointments/VisitTicket.dart b/lib/pages/MyAppointments/VisitTicket.dart index 54dcf13f..6f1dbdf8 100644 --- a/lib/pages/MyAppointments/VisitTicket.dart +++ b/lib/pages/MyAppointments/VisitTicket.dart @@ -2,11 +2,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class VisitTicket extends StatefulWidget { List appoList = []; @@ -48,9 +48,10 @@ class _VisitTicketState extends State { } getPatientAppointmentCurfewHistory(BuildContext context) { - loading(true); DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service.getPatientAppointmentHistory(true, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res['AppoimentAllHistoryResultList']); if (res['MessageStatus'] == 1) { setState(() { @@ -61,20 +62,13 @@ class _VisitTicketState extends State { }); } else {} }); - loading(false); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - loading(false); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - loading(false); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); - } - - loading(bool flag) { - setState(() { - isLoading = flag; }); } } diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index a89253c6..136bd30f 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -2,34 +2,28 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class ArrivedButtons { - static var buttons = [ + var buttons = [ { - "title": "Arrived", - "subtitle": "Status", - "icon": "assets/images/new-design/waiting-room.png", - "caller": "openReschedule" - }, - { - "title": "Medicines", - "subtitle": "Prescriptions", + "title": TranslationBase.of(AppGlobal.context).medicines, + "subtitle": TranslationBase.of(AppGlobal.context).medicinesSubtitle, "icon": "assets/images/new-design/medicine_prescriptions_icon.png", "caller": "prescriptions" }, { - "title": "Radiology", - "subtitle": "Services", + "title": TranslationBase.of(AppGlobal.context).radiology, + "subtitle": TranslationBase.of(AppGlobal.context).radiologySubtitle, "icon": "assets/images/new-design/radiology_service_icon.png", "caller": "radiology" }, { - "title": "Lab", - "subtitle": "Result", + "title": TranslationBase.of(AppGlobal.context).lab, + "subtitle": TranslationBase.of(AppGlobal.context).labSubtitle, "icon": "assets/images/new-design/lab_result_icon.png", "caller": "labResult" }, { - "title": "Vital Signs", - "subtitle": "Values", + "title": TranslationBase.of(AppGlobal.context).vitalSigns, + "subtitle": TranslationBase.of(AppGlobal.context).vitalSignsSubtitle, "icon": "assets/images/new-design/vital_signs.png", "caller": "VitalSigns" }, @@ -40,22 +34,22 @@ class ArrivedButtons { "caller": "insertComplaint" }, { - "title": "Insurance", - "subtitle": "Approvals", + "title": TranslationBase.of(AppGlobal.context).insuranceApproval, + "subtitle": TranslationBase.of(AppGlobal.context).insuranceSubtitle, "icon": "assets/images/new-design/insurance_approvals_icon.png", "caller": "Insurance" }, { - "title": "Ask Your", - "subtitle": "Doctor", + "title": TranslationBase.of(AppGlobal.context).askDoctor, + "subtitle": TranslationBase.of(AppGlobal.context).askYourSubtitle, "icon": "assets/images/new-design/ask_doctor_icon.png", "caller": "askDoc" }, { - "title": "Survey", - "subtitle": "Service", + "title": TranslationBase.of(AppGlobal.context).appoSurvey, + "subtitle": TranslationBase.of(AppGlobal.context).service, "icon": "assets/images/new-design/survey.png", "caller": "Survey" } ]; -} +} \ No newline at end of file diff --git a/lib/pages/MyAppointments/models/BookedButtons.dart b/lib/pages/MyAppointments/models/BookedButtons.dart index 1a76be63..709b3b1f 100644 --- a/lib/pages/MyAppointments/models/BookedButtons.dart +++ b/lib/pages/MyAppointments/models/BookedButtons.dart @@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class BookedButtons { - static var buttons = [ + var buttons = [ { "title": TranslationBase.of(AppGlobal.context).confirm, "subtitle": TranslationBase.of(AppGlobal.context).appointment, diff --git a/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart b/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart index 374ebf45..9548b7c8 100644 --- a/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart +++ b/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart @@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class BookedButtonsAllowCheckIn { - static var buttons = [ + var buttons = [ { "title": TranslationBase.of(AppGlobal.context).confirm, "subtitle": TranslationBase.of(AppGlobal.context).appointment, diff --git a/lib/pages/MyAppointments/models/ConfirmedButtons.dart b/lib/pages/MyAppointments/models/ConfirmedButtons.dart index d5b7836e..b02021c7 100644 --- a/lib/pages/MyAppointments/models/ConfirmedButtons.dart +++ b/lib/pages/MyAppointments/models/ConfirmedButtons.dart @@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class ConfirmedButtons { - static var buttons = [ + var buttons = [ { "title": TranslationBase.of(AppGlobal.context).reschedule, "subtitle": TranslationBase.of(AppGlobal.context).appointment, diff --git a/lib/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart b/lib/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart index 1368e3f3..07ba333e 100644 --- a/lib/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart +++ b/lib/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart @@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class ConfirmedButtonsAllowCheckIn { - static var buttons = [ + var buttons = [ { "title": TranslationBase.of(AppGlobal.context).reschedule, "subtitle": TranslationBase.of(AppGlobal.context).appointment, diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 7bb45bad..60035ee1 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -1,7 +1,10 @@ +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; 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'; @@ -14,9 +17,11 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.d import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; +import 'package:diplomaticquarterapp/pages/medical/labs/laboratory_result_page.dart'; 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 +29,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 +50,8 @@ class AppointmentActions extends StatefulWidget { class _AppointmentActionsState extends State { List appoButtonsList = []; + ToDoCountProviderModel toDoProvider; + @override void initState() { _getAppointmentActionButtons(); @@ -52,8 +60,12 @@ class _AppointmentActionsState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + toDoProvider = Provider.of(context); var size = MediaQuery.of(context).size; - final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2; + final double itemHeight = projectViewModel.isArabic + ? ((size.height - kToolbarHeight - 24) * 0.5) / 2 + : ((size.height - kToolbarHeight - 24) * 0.45) / 2; final double itemWidth = size.width / 2; return Container( @@ -72,51 +84,62 @@ class _AppointmentActionsState extends State { onTap: () { _handleButtonClicks(e); }, - child: Container( - height: 100.0, - margin: EdgeInsets.all(9.0), - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey[400], - blurRadius: 2.0, - spreadRadius: 0.0) - ], - borderRadius: BorderRadius.circular(10), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Container( - margin: - EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), - child: Text(e.title, - overflow: TextOverflow.clip, - style: TextStyle( - color: new Color(0xFF40ACC9), - letterSpacing: 1.0, - fontSize: 20.0)), - ), - Container( - margin: - EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), - child: Text(e.subtitle, - overflow: TextOverflow.clip, - style: TextStyle( - color: Colors.black, - letterSpacing: 1.0, - fontSize: 15.0)), - ), - Container( - alignment: Alignment.bottomRight, - margin: - EdgeInsets.fromLTRB(0.0, 10.0, 10.0, 7.0), - child: Image.asset(e.icon, - width: 45.0, height: 45.0), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + // height: 100.0, + margin: EdgeInsets.all(7.0), + padding: EdgeInsets.only(bottom: 4.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.max, + 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(), @@ -175,6 +198,10 @@ class _AppointmentActionsState extends State { openAppointmentRadiology(); break; + case "labResult": + openAppointmentLabResults(); + break; + case "prescriptions": openPrescriptionReport(); break; @@ -249,14 +276,15 @@ class _AppointmentActionsState extends State { Future> _getBookedAppoActionsList() async { print("_getBookedAppoActionsList"); - print(BookedButtons.buttons); + BookedButtons bookedButtons = new BookedButtons(); + print(bookedButtons.buttons); List buttonsList = []; - for (var i = 0; i < BookedButtons.buttons.length; i++) { + for (var i = 0; i < bookedButtons.buttons.length; i++) { buttonsList.add(AppoDetailsButton( - title: BookedButtons.buttons[i]['title'], - subtitle: BookedButtons.buttons[i]['subtitle'], - icon: BookedButtons.buttons[i]['icon'], - caller: BookedButtons.buttons[i]['caller'], + title: bookedButtons.buttons[i]['title'], + subtitle: bookedButtons.buttons[i]['subtitle'], + icon: bookedButtons.buttons[i]['icon'], + caller: bookedButtons.buttons[i]['caller'], )); } setState(() { @@ -266,14 +294,16 @@ class _AppointmentActionsState extends State { Future> _getBookedCheckInAppoActionsList() async { print("_getBookedCheckInAppoActionsList"); - print(BookedButtonsAllowCheckIn.buttons); + BookedButtonsAllowCheckIn bookedButtonsAllowCheckIn = + new BookedButtonsAllowCheckIn(); + print(bookedButtonsAllowCheckIn.buttons); List buttonsList = []; - for (var i = 0; i < BookedButtonsAllowCheckIn.buttons.length; i++) { + for (var i = 0; i < bookedButtonsAllowCheckIn.buttons.length; i++) { buttonsList.add(AppoDetailsButton( - title: BookedButtonsAllowCheckIn.buttons[i]['title'], - subtitle: BookedButtonsAllowCheckIn.buttons[i]['subtitle'], - icon: BookedButtonsAllowCheckIn.buttons[i]['icon'], - caller: BookedButtonsAllowCheckIn.buttons[i]['caller'], + title: bookedButtonsAllowCheckIn.buttons[i]['title'], + subtitle: bookedButtonsAllowCheckIn.buttons[i]['subtitle'], + icon: bookedButtonsAllowCheckIn.buttons[i]['icon'], + caller: bookedButtonsAllowCheckIn.buttons[i]['caller'], )); } setState(() { @@ -283,14 +313,15 @@ class _AppointmentActionsState extends State { Future> _getConfirmedAppoActionsList() async { print("_getConfirmedAppoActionsList"); - print(ConfirmedButtons.buttons); + ConfirmedButtons confirmedButtons = new ConfirmedButtons(); + print(confirmedButtons.buttons); List buttonsList = []; - for (var i = 0; i < ConfirmedButtons.buttons.length; i++) { + for (var i = 0; i < confirmedButtons.buttons.length; i++) { buttonsList.add(AppoDetailsButton( - title: ConfirmedButtons.buttons[i]['title'], - subtitle: ConfirmedButtons.buttons[i]['subtitle'], - icon: ConfirmedButtons.buttons[i]['icon'], - caller: ConfirmedButtons.buttons[i]['caller'], + title: confirmedButtons.buttons[i]['title'], + subtitle: confirmedButtons.buttons[i]['subtitle'], + icon: confirmedButtons.buttons[i]['icon'], + caller: confirmedButtons.buttons[i]['caller'], )); } setState(() { @@ -300,14 +331,16 @@ class _AppointmentActionsState extends State { Future> _getConfirmedCheckInAppoActionsList() async { print("_getConfirmedAllowCheckInAppoActionsList"); - print(ConfirmedButtonsAllowCheckIn.buttons); + ConfirmedButtonsAllowCheckIn confirmedButtonsAllowCheckIn = + new ConfirmedButtonsAllowCheckIn(); + print(confirmedButtonsAllowCheckIn.buttons); List buttonsList = []; - for (var i = 0; i < ConfirmedButtonsAllowCheckIn.buttons.length; i++) { + for (var i = 0; i < confirmedButtonsAllowCheckIn.buttons.length; i++) { buttonsList.add(AppoDetailsButton( - title: ConfirmedButtonsAllowCheckIn.buttons[i]['title'], - subtitle: ConfirmedButtonsAllowCheckIn.buttons[i]['subtitle'], - icon: ConfirmedButtonsAllowCheckIn.buttons[i]['icon'], - caller: ConfirmedButtonsAllowCheckIn.buttons[i]['caller'], + title: confirmedButtonsAllowCheckIn.buttons[i]['title'], + subtitle: confirmedButtonsAllowCheckIn.buttons[i]['subtitle'], + icon: confirmedButtonsAllowCheckIn.buttons[i]['icon'], + caller: confirmedButtonsAllowCheckIn.buttons[i]['caller'], )); } setState(() { @@ -317,14 +350,15 @@ class _AppointmentActionsState extends State { Future> _getArrivedAppoActionsList() async { print("_getArrivedAppoActionsList"); - print(ArrivedButtons.buttons); + ArrivedButtons arrivedButtons = new ArrivedButtons(); + print(arrivedButtons.buttons); List buttonsList = []; - for (var i = 0; i < ArrivedButtons.buttons.length; i++) { + for (var i = 0; i < arrivedButtons.buttons.length; i++) { buttonsList.add(AppoDetailsButton( - title: ArrivedButtons.buttons[i]['title'], - subtitle: ArrivedButtons.buttons[i]['subtitle'], - icon: ArrivedButtons.buttons[i]['icon'], - caller: ArrivedButtons.buttons[i]['caller'], + title: arrivedButtons.buttons[i]['title'], + subtitle: arrivedButtons.buttons[i]['subtitle'], + icon: arrivedButtons.buttons[i]['icon'], + caller: arrivedButtons.buttons[i]['caller'], )); } setState(() { @@ -334,14 +368,14 @@ class _AppointmentActionsState extends State { Future> _getArrivedInvoiceAppoActionsList() async { print("_getArrivedInvoiceAppoActionsList"); - print(ArrivedButtons.buttons); + ArrivedButtons arrivedButtons = new ArrivedButtons(); List buttonsList = []; - for (var i = 0; i < ArrivedButtons.buttons.length; i++) { + for (var i = 0; i < arrivedButtons.buttons.length; i++) { buttonsList.add(AppoDetailsButton( - title: ArrivedButtons.buttons[i]['title'], - subtitle: ArrivedButtons.buttons[i]['subtitle'], - icon: ArrivedButtons.buttons[i]['icon'], - caller: ArrivedButtons.buttons[i]['caller'], + title: arrivedButtons.buttons[i]['title'], + subtitle: arrivedButtons.buttons[i]['subtitle'], + icon: arrivedButtons.buttons[i]['icon'], + caller: arrivedButtons.buttons[i]['caller'], )); } setState(() { @@ -357,6 +391,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 +403,49 @@ class _AppointmentActionsState extends State { }); } + getToDoCount() { + toDoProvider.setState(0, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } else {} + }).catchError((err) { + print(err); + }); + } + + openAppointmentLabResults() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + PatientLabOrders patientLabOrders = new PatientLabOrders(); + service + .getPatientLabOrdersByAppoNo(widget.appo.appointmentNo, + widget.appo.projectID, widget.appo.clinicID, context) + .then((res) { + print(res['ListLabResultsByAppNo']); + GifLoaderDialogUtils.hideDialog(context); + if (res['ListLabResultsByAppNo'] != null) { + patientLabOrders.orderNo = + res['ListLabResultsByAppNo'][0]['OrderNo'].toString(); + patientLabOrders.invoiceNo = + res['ListLabResultsByAppNo'][0]['InvoiceNo'].toString(); + patientLabOrders.clinicID = widget.appo.clinicID; + patientLabOrders.projectID = widget.appo.projectID.toString(); + print(patientLabOrders.invoiceNo); + print(patientLabOrders.orderNo); + navigateToLabResults(patientLabOrders); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + } + openAppointmentRadiology() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); @@ -376,11 +454,15 @@ class _AppointmentActionsState extends State { .getPatientRadOrders(widget.appo.appointmentNo.toString(), context) .then((res) { GifLoaderDialogUtils.hideDialog(context); - print(res['FinalRadiologyList']); - finalRadiology = - new FinalRadiology.fromJson(res['FinalRadiologyList'][0]); - print(finalRadiology.reportData); - navigateToRadiologyDetails(finalRadiology); + if (res['FinalRadiologyList'] != null) { + print(res['FinalRadiologyList']); + finalRadiology = + new FinalRadiology.fromJson(res['FinalRadiologyList'][0]); + print(finalRadiology.reportData); + navigateToRadiologyDetails(finalRadiology); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); @@ -394,19 +476,19 @@ class _AppointmentActionsState extends State { DoctorsListService service = new DoctorsListService(); service.getPatientPrescriptionReports(widget.appo, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - res['ListPRM'].forEach((report) { - prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report)); - }); - print(prescriptionReportEnhList.length); - if (prescriptionReportEnhList.length != 0) { + if (res['ListPRM'].length != 0) { + res['ListPRM'].forEach((report) { + prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report)); + }); + print(prescriptionReportEnhList.length); navigateToMedicinePrescriptionReport( prescriptionReportEnhList, res['ListPRM']); } else { - AppToast.showErrorToast(message: "Sorry there is no data"); + AppToast.showErrorToast(message: TranslationBase.of(context).noRecords); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); print(err); + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); }); } @@ -423,6 +505,15 @@ class _AppointmentActionsState extends State { appo: widget.appo))); } + Future navigateToLabResults(PatientLabOrders patientLabOrders) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + LaboratoryResultPage(patientLabOrders: patientLabOrders))) + .then((value) {}); + } + Future navigateToRadiologyDetails(FinalRadiology finalRadiology) async { Navigator.push( context, @@ -577,7 +668,7 @@ class _AppointmentActionsState extends State { context, FadePage( page: VitalSignDetailsScreen( - appointmentNo: appoNo, projectID: projectID))); + appointmentNo: appoNo, projectID: projectID,isNotOneAppointment: false,))); } navigateToInsertComplaint() { diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index 71bde484..c4299e33 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -1,6 +1,13 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; 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/countdown_timer_controller.dart'; +import 'package:flutter_countdown_timer/current_remaining_time.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; import '../AppointmentDetails.dart'; @@ -17,8 +24,20 @@ class AppointmentCard extends StatefulWidget { } class _ApointmentCardState extends State { + CountdownTimerController controller; + + @override + void initState() { + super.initState(); + int endTime = DateTime.now().millisecondsSinceEpoch + 1000 * 30; + controller = CountdownTimerController( + endTime: endTime, + ); + } + @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return InkWell( onTap: () { navigateToAppointmentDetails(context, widget.appo); @@ -36,75 +55,157 @@ class _ApointmentCardState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ + Container( + width: projectViewModel.isArabic ? 27 : 20, + height: projectViewModel.isArabic ? 165 : 140, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: widget.appo.isLiveCareAppointment + ? Color(0xff404545) + : !widget.appo.isInOutPatient + ? Colors.red[900] + : Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic + ? Radius.circular(0) + : Radius.circular(8), + bottomLeft: projectViewModel.isArabic + ? Radius.circular(0) + : Radius.circular(8), + topRight: projectViewModel.isArabic + ? Radius.circular(8) + : Radius.circular(0), + bottomRight: projectViewModel.isArabic + ? Radius.circular(8) + : Radius.circular(0), + ), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + widget.appo.isLiveCareAppointment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !widget.appo.isInOutPatient + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + SizedBox(width: 8,), ClipRRect( borderRadius: BorderRadius.circular(100.0), child: Image.network(widget.appo.doctorImageURL, fit: BoxFit.fill, height: 60.0, width: 60.0), ), - Container( - width: MediaQuery.of(context).size.width * 0.57, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.appo.doctorTitle + - " " + - widget.appo.doctorNameObj, - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700], - letterSpacing: 1.0)), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text(widget.appo.clinicName, - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text(widget.appo.projectName, - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 3.0, bottom: 3.0), - child: Text(getDate(widget.appo.appointmentDate).trim(), + Expanded( + child: Container( + width: MediaQuery.of(context).size.width * 0.61, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.appo.doctorTitle + + " " + + widget.appo.doctorNameObj, style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], + fontSize: 14.0, + color: Colors.grey[700], letterSpacing: 1.0)), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar.readOnly( - initialRating: - widget.appo.actualDoctorRate.toDouble(), - size: 20.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - Container( - transform: - Matrix4.translationValues(15.0, -40.0, 0.0), - child: Image.asset( - "assets/images/new-design/arrow.png", - width: 25.0, - height: 25.0), - ), - ], - ), - ], + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(widget.appo.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(widget.appo.projectName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text( + DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + widget.appo.appointmentDate), + projectViewModel.isArabic ? "ar" : "en") + .trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: + widget.appo.actualDoctorRate.toDouble(), + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + Container( + transform: + Matrix4.translationValues(15.0, -40.0, 0.0), + child: projectViewModel.isArabic + ? Image.asset( + "assets/images/new-design/arrow_menu_black-ar.png", + width: 25.0, + height: 25.0) + : Image.asset( + "assets/images/new-design/arrow_menu_black-en.png", + width: 25.0, + height: 25.0), + ), + ], + ), + (widget.appo.patientStatusType == AppointmentType.BOOKED || + widget.appo.patientStatusType == + AppointmentType.CONFIRMED) + ? Container( + child: CountdownTimer( + controller: new CountdownTimerController( + endTime: + DateTime.now().millisecondsSinceEpoch + + (widget.appo.remaniningHoursTocanPay * + 1000) * + 60), + widgetBuilder: (_, CurrentRemainingTime time) { + return time != null + ? Text( + '${time.days}:${time.hours}:${time.min}:${time.sec} ' + + TranslationBase.of(context) + .upcomingTimeLeft, + style: TextStyle( + fontSize: 12.0, + color: Color(0xff40ACC9))) + : Container(); + }, + ), + ) + : 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/MyAppointments/widgets/custom_radio.dart b/lib/pages/MyAppointments/widgets/custom_radio.dart index 2ea9a39c..b21e34ec 100644 --- a/lib/pages/MyAppointments/widgets/custom_radio.dart +++ b/lib/pages/MyAppointments/widgets/custom_radio.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; class CustomRadio extends StatefulWidget { @@ -21,17 +22,23 @@ class CustomRadioState extends State { void initState() { super.initState(); - if (widget.requestData != null) { - widget.requestData.forEach((element) { - sampleData.add( - new RadioModel(false, element.description, element.parameterCode)); - }); - } else { - sampleData.add(new RadioModel(false, "Before 30 Mins", 30)); - sampleData.add(new RadioModel(false, 'Before 1 Hour', 60)); - sampleData.add(new RadioModel(false, 'Before 2 Hours', 120)); - sampleData.add(new RadioModel(false, 'Before 4 Hours', 240)); - } + WidgetsBinding.instance.addPostFrameCallback((_) { + if (widget.requestData != null) { + widget.requestData.forEach((element) { + sampleData.add(new RadioModel( + false, element.description, element.parameterCode)); + }); + } else { + sampleData.add(new RadioModel( + false, TranslationBase.of(context).appoReminder30, 30)); + sampleData.add(new RadioModel( + false, TranslationBase.of(context).appoReminder60, 60)); + sampleData.add(new RadioModel( + false, TranslationBase.of(context).appoReminder90, 90)); + sampleData.add(new RadioModel( + false, TranslationBase.of(context).appoReminder120, 120)); + } + }); } @override @@ -96,7 +103,7 @@ class RadioItem extends StatelessWidget { ), ), new Container( - margin: new EdgeInsets.only(left: 15.0), + margin: new EdgeInsets.only(left: 15.0, right: 15.0), child: new Text(_item.text, style: TextStyle(fontSize: 16.0)), ), ], diff --git a/lib/pages/MyAppointments/widgets/reminder_dialog.dart b/lib/pages/MyAppointments/widgets/reminder_dialog.dart index 13955e5b..b8803469 100644 --- a/lib/pages/MyAppointments/widgets/reminder_dialog.dart +++ b/lib/pages/MyAppointments/widgets/reminder_dialog.dart @@ -27,19 +27,18 @@ class _ReminderDialogState extends State { shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), child: Container( - height: MediaQuery.of(context).size.height * 0.57, + // height: MediaQuery.of(context).size.height * 0.57, width: 450.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, + mainAxisSize: MainAxisSize.min, children: [ Container( margin: EdgeInsets.all(20.0), child: Text(TranslationBase.of(context).setReminder, style: TextStyle( fontSize: 20.0, - fontWeight: FontWeight.bold, - fontFamily: "Open-Sans-Bold")), + fontWeight: FontWeight.bold)), ), Container( transform: Matrix4.translationValues(0.0, -30.0, 0.0), @@ -61,13 +60,12 @@ class _ReminderDialogState extends State { child: Text(TranslationBase.of(context).confirm, style: TextStyle( color: Colors.white, - fontWeight: FontWeight.bold, - fontFamily: 'Open-Sans-Bold')), + fontWeight: FontWeight.bold)), ), ), Container( width: MediaQuery.of(context).size.width, - margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0), + margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0, bottom: 20.0), child: OutlineButton( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0)), @@ -81,8 +79,7 @@ class _ReminderDialogState extends State { child: Text(TranslationBase.of(context).cancel_nocaps, style: TextStyle( color: Colors.red, - fontWeight: FontWeight.bold, - fontFamily: 'Open-Sans-Bold')), + fontWeight: FontWeight.bold)), ), ), ]), diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index b0315d28..1066ca15 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1,14 +1,19 @@ 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'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.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/pages/BookAppointment/QRCode.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart'; +import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -18,7 +23,11 @@ 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/countdown_timer_controller.dart'; +import 'package:flutter_countdown_timer/current_remaining_time.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; class ToDo extends StatefulWidget { @@ -27,6 +36,10 @@ class ToDo extends StatefulWidget { var languageID; MyInAppBrowser browser; + bool isShowAppBar = true; + + ToDo({@required this.isShowAppBar}); + @override _ToDoState createState() => _ToDoState(); } @@ -38,19 +51,37 @@ class _ToDoState extends State { AuthenticatedUserObject authenticatedUserObject = locator(); + List imagesInfo = List(); + + ToDoCountProviderModel toDoProvider; + CountdownTimerController controller; + @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')); + int endTime = DateTime.now().millisecondsSinceEpoch + 1000 * 30; + controller = CountdownTimerController(endTime: endTime); } @override Widget build(BuildContext context) { + toDoProvider = Provider.of(context); + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, + imagesInfo: imagesInfo, + isShowAppBar: widget.isShowAppBar, + isShowDecPage: true, + description: TranslationBase.of(context).infoTodo, body: SingleChildScrollView( child: Column( children: [ @@ -85,11 +116,19 @@ class _ToDoState extends State { height: 20.0), Container( margin: - EdgeInsets.only(left: 5.0, right: 20.0), + EdgeInsets.only(left: 10.0, right: 10.0), child: Text( - getDate(widget - .appoList[index].appointmentDate), - style: TextStyle(fontSize: 11.0)), + DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + widget.appoList[index] + .appointmentDate), + projectViewModel.isArabic + ? "ar" + : "en") + + " " + + widget.appoList[index].startTime + .substring(0, 5), + style: TextStyle(fontSize: 10.0)), ), widget.appoList[index].isLiveCareAppointment ? SvgPicture.asset( @@ -117,7 +156,7 @@ class _ToDoState extends State { : "-", overflow: TextOverflow.clip, maxLines: 2, - style: TextStyle(fontSize: 11.0)), + style: TextStyle(fontSize: 10.0)), ), ], ), @@ -197,6 +236,31 @@ class _ToDoState extends State { ), ], ), + Container( + child: CountdownTimer( + controller: new CountdownTimerController( + endTime: DateTime.now() + .millisecondsSinceEpoch + + (widget.appoList[index] + .remaniningHoursTocanPay * + 1000) * + 60), + widgetBuilder: + (_, CurrentRemainingTime time) { + return time != null + ? Text( + '${time.days}:${time.hours}:${time.min}:${time.sec} ' + + TranslationBase.of( + context) + .upcomingTimeLeft, + style: TextStyle( + fontSize: 12.0, + color: Color( + 0xff40ACC9))) + : Container(); + }, + ), + ), ], ), ), @@ -426,7 +490,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; }); @@ -477,6 +542,7 @@ class _ToDoState extends State { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service.getPatientAppointmentHistory(true, context).then((res) { + widget.appoList.clear(); GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { @@ -486,11 +552,9 @@ class _ToDoState extends State { widget.appoList .add(new AppoitmentAllHistoryResultList.fromJson(v)); }); - } else {} - }); - widget.appoList.forEach((element) { - print(element.isLiveCareAppointment); - print(element.nextAction); + } else { + Navigator.of(context).popAndPushNamed(HOME); + } }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); @@ -498,7 +562,7 @@ class _ToDoState extends State { }).catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); + err != null ?? AppToast.showErrorToast(message: err); }); } @@ -606,6 +670,9 @@ class _ToDoState extends State { appo.projectID.toString(), authenticatedUser.emailAddress, paymentMethod, + authenticatedUser.patientType, + authenticatedUser.firstName, + authenticatedUser.patientID, authenticatedUser, widget.browser); } @@ -663,8 +730,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']); @@ -696,6 +763,19 @@ class _ToDoState extends State { }); } + getPatientData() async { + AppSharedPreferences sharedPref = AppSharedPreferences(); + if (await sharedPref.getObject(USER_PROFILE) != null) { + var data = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + setState(() { + print(data); + authUser = data; + }); + getPatientAppointmentHistory(); + } + } + Future navigateToPaymentMethod( context, PatientShareResponse patientShareResponse, diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index a189128a..3a0734dc 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -218,7 +218,7 @@ class _PaymentMethodState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: MediaQuery.of(context).size.width * 0.7, + minWidth: MediaQuery.of(context).size.height * 0.1, height: 45.0, child: RaisedButton( color: new Color(0xFF60686b), diff --git a/lib/pages/appUpdatePage/app_update_page.dart b/lib/pages/appUpdatePage/app_update_page.dart new file mode 100644 index 00000000..7bcf2388 --- /dev/null +++ b/lib/pages/appUpdatePage/app_update_page.dart @@ -0,0 +1,109 @@ +import 'dart:io'; + +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class AppUpdatePage extends StatefulWidget { + String appUpdateText; + + AppUpdatePage({@required this.appUpdateText}); + + @override + _AppUpdatePageState createState() => _AppUpdatePageState(); +} + +class _AppUpdatePageState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "App Update", + backgroundColor: Colors.white, + isShowAppBar: false, + isShowDecPage: false, + body: SingleChildScrollView( + child: Container( + child: Column( + children: [ + Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + SvgPicture.asset( + "assets/images/new-design/update_rocket_image.svg", + fit: BoxFit.fill), + ]), + Container( + margin: EdgeInsets.only(top: 40.0), + width: MediaQuery.of(context).size.width, + child: Text(TranslationBase.of(context).appUpdate, + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xff2d6c90).withOpacity(1.0), + fontSize: 22.0, + fontWeight: FontWeight.bold))), + ], + ), + Container( + margin: EdgeInsets.only(top: 5.0, bottom: 5.0), + child: SvgPicture.asset("assets/images/new-design/HMG_logo.svg", + fit: BoxFit.fill), + ), + Container( + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), + width: MediaQuery.of(context).size.width, + child: Text(widget.appUpdateText, + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.grey[600], + fontSize: 16.0, + height: 1.5, + fontWeight: FontWeight.bold))), + Container( + margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: Colors.red[800], + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + openAppUpdateLink(); + }, + child: Text(TranslationBase.of(context).appUpdate, + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ], + ), + ), + ), + ); + } + + openAppUpdateLink() { + if (Platform.isAndroid) { + _launchURL("https://play.google.com/store/apps/details?id=com.ejada.hmg"); + } + if (Platform.isIOS) { + _launchURL("https://itunes.apple.com/app/id733503978"); + } + } + + _launchURL(String url) async { + if (await canLaunch(url)) { + await launch(url); + } else { + throw 'Could not launch $url'; + } + } +} diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 27d2f353..4d511452 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_mode import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; @@ -14,7 +15,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; - +import 'dart:convert'; +import 'dart:io'; import 'appointment_history.dart'; class SendFeedbackPage extends StatefulWidget { @@ -31,6 +33,41 @@ class _SendFeedbackPageState extends State { bool isShowListAppointHistory = true; String message; final formKey = GlobalKey(); + MessageType messageType = MessageType.NON; + + + String getSelected(BuildContext context) { + switch (messageType) { + case MessageType.ComplaintOnAnAppointment: + return TranslationBase.of(context).complainAppo; + break; + case MessageType.ComplaintWithoutAppointment: + return TranslationBase.of(context).complainWithoutAppo; + break; + case MessageType.Question: + return TranslationBase.of(context).question; + break; + case MessageType.Compliment: + return TranslationBase.of(context).compliment; + break; + case MessageType.Suggestion: + return TranslationBase.of(context).suggestion; + break; + case MessageType.NON: + return TranslationBase.of(context).notClassified; + break; + } + return TranslationBase.of(context).notClassified; + } + + + + setMessageType(MessageType messageType) { + setState(() { + this.messageType = messageType; + }); + + } @override Widget build(BuildContext context) { @@ -55,7 +92,6 @@ class _SendFeedbackPageState extends State { child: Texts( TranslationBase.of(context).likeToHear, textAlign: TextAlign.center, - variant: 'body2Link', ), ), InkWell( @@ -75,9 +111,8 @@ class _SendFeedbackPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - child: Texts( - model.getSelected(context), + getSelected(context), variant: 'bodyText', ), margin: EdgeInsets.only(left: 10,right: 10), @@ -91,7 +126,7 @@ class _SendFeedbackPageState extends State { ), ), ), - if (appointHistory != null && model.messageType == + if (appointHistory != null && messageType == MessageType.ComplaintOnAnAppointment) InkWell( onTap: () { @@ -167,12 +202,10 @@ class _SendFeedbackPageState extends State { ), ), ), - if (model.messageType == - MessageType.ComplaintOnAnAppointment && - model.appointHistoryList.length != 0 && + if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 && isShowListAppointHistory) Container( - height: MediaQuery.of(context).size.height * 0.4, + height: model.appointHistoryList.length>2?MediaQuery.of(context).size.height * 0.25:MediaQuery.of(context).size.height * 0.15, child: ListView.builder( itemCount: model.appointHistoryList.length, itemBuilder: (context, index) => InkWell( @@ -285,7 +318,7 @@ class _SendFeedbackPageState extends State { hintColor: Colors.black, fontWeight: FontWeight.w600, validator: (value) { - if (value == null) + if (value.isEmpty) return TranslationBase.of(context).emptySubject; else return null; @@ -303,7 +336,7 @@ class _SendFeedbackPageState extends State { minLines: 13, controller: messageController, validator: (value) { - if (value == null) + if (value.isEmpty) return TranslationBase.of(context).emptyMessage; else return null; @@ -311,11 +344,11 @@ class _SendFeedbackPageState extends State { ), InkWell( onTap: () { - ImageOptions.showImageOptions(context, (String image) { + ImageOptions.showImageOptions(context, (String image,File file) { setState(() { images.add(image); }); - }); + } ); }, child: Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), @@ -376,7 +409,7 @@ class _SendFeedbackPageState extends State { ), )), SizedBox( - height: 30, + height: 45, ), ], ), @@ -396,14 +429,14 @@ class _SendFeedbackPageState extends State { loading: model.state == ViewState.BusyLocal, onTap: () { final form = formKey.currentState; - if (form.validate()) if (model.messageType != MessageType.NON) + if (form.validate()) if (messageType != MessageType.NON) model .sendCOCItem( title: titleController.text, attachment: images.length > 0 ? images[0] : "", details: messageController.text, - cOCTypeName: getCOCName(model), - appointHistory: model.messageType == + cOCTypeName: getCOCName(), + appointHistory:messageType == MessageType.ComplaintOnAnAppointment ? appointHistory : null) @@ -414,7 +447,7 @@ class _SendFeedbackPageState extends State { messageController.text = ""; images = []; }); - model.setMessageType(MessageType.NON); + setMessageType(MessageType.NON); AppToast.showSuccessToast( message: TranslationBase.of(context).yourFeedback); } else { @@ -433,8 +466,8 @@ class _SendFeedbackPageState extends State { ); } - String getCOCName(FeedbackViewModel model) { - switch (model.messageType) { + String getCOCName() { + switch (messageType) { case MessageType.ComplaintOnAnAppointment: return "1"; break; @@ -462,15 +495,18 @@ class _SendFeedbackPageState extends State { showDialog( context: context, child: FeedbackTypeDialog( + messageTypeDialog: messageType, onValueSelected: (MessageType value) { if (value == MessageType.ComplaintOnAnAppointment) { + GifLoaderDialogUtils.showMyDialog(context); model.getPatentAppointmentHistory().then((value) { + GifLoaderDialogUtils.hideDialog(context); setState(() { appointHistory = null; }); }); } - model.setMessageType(value); + setMessageType(value); }, )); } @@ -478,14 +514,30 @@ class _SendFeedbackPageState extends State { class FeedbackTypeDialog extends StatefulWidget { final Function(MessageType) onValueSelected; + final MessageType messageTypeDialog; - const FeedbackTypeDialog({Key key, this.onValueSelected}) : super(key: key); + const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog=MessageType.NON}) : super(key: key); @override State createState() => new FeedbackTypeDialogState(); } class FeedbackTypeDialogState extends State { + + + MessageType messageTypeDialog = MessageType.NON; + + setMessageDialogType(MessageType messageType) { + setState(() { + messageTypeDialog = messageType; + }); + } + @override + void initState() { + messageTypeDialog = widget.messageTypeDialog; + super.initState(); + } + Widget build(BuildContext context) { return BaseView( builder: (_, model, widge) => SimpleDialog( @@ -507,16 +559,16 @@ class FeedbackTypeDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () => model.setMessageDialogType( + onTap: () => setMessageDialogType( MessageType.ComplaintOnAnAppointment), child: ListTile( title: Texts(TranslationBase.of(context).complainAppo), leading: Radio( value: MessageType.ComplaintOnAnAppointment, - groupValue: model.messageTypeDialog, - activeColor: Colors.red[800], + groupValue: messageTypeDialog, + activeColor: Theme.of(context).primaryColor, onChanged: (MessageType value) => - model.setMessageDialogType(value), + setMessageDialogType(value), ), ), ), @@ -531,16 +583,16 @@ class FeedbackTypeDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () => model.setMessageDialogType( + onTap: () => setMessageDialogType( MessageType.ComplaintWithoutAppointment), child: ListTile( title: Texts(TranslationBase.of(context).complainWithoutAppo), leading: Radio( value: MessageType.ComplaintWithoutAppointment, - groupValue: model.messageTypeDialog, - activeColor: Colors.red[800], + groupValue: messageTypeDialog, + activeColor: Theme.of(context).primaryColor, onChanged: (MessageType value) => - model.setMessageDialogType(value), + setMessageDialogType(value), ), ), ), @@ -556,15 +608,15 @@ class FeedbackTypeDialogState extends State { flex: 1, child: InkWell( onTap: () => - model.setMessageDialogType(MessageType.Question), + setMessageDialogType(MessageType.Question), child: ListTile( title: Texts(TranslationBase.of(context).question), leading: Radio( value: MessageType.Question, - groupValue: model.messageTypeDialog, - activeColor: Colors.red[800], + groupValue: messageTypeDialog, + activeColor: Theme.of(context).primaryColor, onChanged: (MessageType value) => - model.setMessageDialogType(value), + setMessageDialogType(value), ), ), ), @@ -580,15 +632,15 @@ class FeedbackTypeDialogState extends State { flex: 1, child: InkWell( onTap: () => - model.setMessageDialogType(MessageType.Compliment), + setMessageDialogType(MessageType.Compliment), child: ListTile( title: Texts(TranslationBase.of(context).compliment), leading: Radio( value: MessageType.Compliment, - groupValue: model.messageTypeDialog, - activeColor: Colors.red[800], + groupValue: messageTypeDialog, + activeColor: Theme.of(context).primaryColor, onChanged: (MessageType value) => - model.setMessageDialogType(value), + setMessageDialogType(value), ), ), ), @@ -604,15 +656,14 @@ class FeedbackTypeDialogState extends State { flex: 1, child: InkWell( onTap: () => - model.setMessageDialogType(MessageType.Suggestion), + setMessageDialogType(MessageType.Suggestion), child: ListTile( title: Texts(TranslationBase.of(context).suggestion), leading: Radio( value: MessageType.Suggestion, - groupValue: model.messageTypeDialog, - activeColor: Colors.red[800], - onChanged: (MessageType value) => - model.setMessageDialogType(value), + groupValue: messageTypeDialog, + activeColor: Theme.of(context).primaryColor, + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), @@ -644,7 +695,7 @@ class FeedbackTypeDialogState extends State { child: Center( child: Texts( TranslationBase.of(context).cancel, - color: Colors.red, + color: Theme.of(context).primaryColor, ), ), ), @@ -660,7 +711,7 @@ class FeedbackTypeDialogState extends State { flex: 1, child: InkWell( onTap: () { - widget.onValueSelected(model.messageTypeDialog); + widget.onValueSelected(messageTypeDialog); Navigator.pop(context); }, child: Padding( diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 457ded60..59d68fa2 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -14,73 +14,92 @@ class StatusFeedbackPage extends StatefulWidget { } class _StatusFeedbackPageState extends State { - @override Widget build(BuildContext context) { return BaseView( - allowAny: true, onModelReady: (model) => model.getCOC(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, isShowDecPage: false, - body: Container( - margin: EdgeInsets.only(top: 8.0,left: 8.0,right: 8.0 ), - padding: EdgeInsets.all(15.0), - child: ListView.builder( - itemCount: model.cOCItemList.length, - itemBuilder: (context, index) => Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - margin: EdgeInsets.all(4), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 8,), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts('${model.cOCItemList[index].cOCTitle}'), - Texts( - TranslationBase.of(context).number + ' : ${model.cOCItemList[index].itemID}', - variant: 'overline', - ), - ], - ), + body: model.cOCItemList.isNotEmpty + ? Container( + margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0), + padding: EdgeInsets.all(15.0), + child: ListView.builder( + itemCount: model.cOCItemList.length, + itemBuilder: (context, index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, ), - Expanded( + margin: EdgeInsets.all(4), + child: Padding( + padding: const EdgeInsets.all(8.0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('${model.cOCItemList[index].status}'), - Texts( - '${model.cOCItemList[index].date}', - variant: 'overline', + SizedBox( + height: 8, ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + '${model.cOCItemList[index].cOCTitle}'), + Texts( + TranslationBase.of(context).number + + ' : ${model.cOCItemList[index].itemID}', + variant: 'overline', + ), + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + '${model.cOCItemList[index].status}'), + Texts( + '${model.cOCItemList[index].date}', + variant: 'overline', + ), + ], + ), + ), + ], + ), + Texts('${model.cOCItemList[index].formType}'), + Divider( + height: 4.5, + color: Colors.grey[500], + ) ], ), ), - ], - ), - Texts('${model.cOCItemList[index].formType}'), - Divider(height: 4.5,color: Colors.grey[500],) + )), + ) + : Container( + child: Center( + child: Column( + children: [ + SizedBox(height: MediaQuery.of(context).size.height*0.4,), + Image.asset('assets/images/comments.png',width: 80,height: 80,), + SizedBox(height: 15,), + Texts(TranslationBase.of(context).noSearchResult), ], ), ), - )), - ), + ), ), ); } diff --git a/lib/pages/final_products_page.dart b/lib/pages/final_products_page.dart new file mode 100644 index 00000000..03adee97 --- /dev/null +++ b/lib/pages/final_products_page.dart @@ -0,0 +1,480 @@ +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/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart new file mode 100644 index 00000000..20e17593 --- /dev/null +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -0,0 +1,147 @@ +import 'dart:io'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class AttachInsuranceCardImageDialog extends StatefulWidget { + final String name; + final String fileNo; + final Function(File file, String image) image; + + const AttachInsuranceCardImageDialog( + {Key key, this.name, this.fileNo, this.image}) + : super(key: key); + + @override + _AttachInsuranceCardImageDialogState createState() => + _AttachInsuranceCardImageDialogState(); +} + +class _AttachInsuranceCardImageDialogState + extends State { + @override + void initState() { + super.initState(); + } + + String image; + File file; + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Texts(TranslationBase.of(context).attachInsuraceImage), + Divider(), + Texts(widget.name), + SizedBox( + height: 3, + ), + Texts(TranslationBase.of(context).fileNo + " " + widget.fileNo), + SizedBox( + height: 5.0, + ), + InkWell( + onTap: () { + ImageOptions.showImageOptions(context, (String image,File file) { + setState(() { + this.image = image; + this.file = file; + }); + }); + }, + child: image == null + ? Padding( + padding: const EdgeInsets.all(18.0), + child: Container( + width: double.maxFinite, + height: 250, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + border: Border.all(color: Colors.grey, width: 1.5)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment., + children: [ + SizedBox(height: 25,), + Icon( + Icons.camera_enhance_rounded, + size: 85, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(Icons.attach_file), + Texts(TranslationBase.of(context).selectAttachment.toUpperCase()) + ], + ), + ], + ), + ), + ) + : Image.file( + file, + fit: BoxFit.fill, + height: 250, + ), + ), + SizedBox( + height: 25.0, + ), + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + widget.image(file, image); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index 3b19e670..d81e704e 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( @@ -48,27 +63,24 @@ class _InsuranceApprovalState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - Text( + Texts( TranslationBase.of(context).totalApproval, - style: TextStyle( color: Color(0xff60688B), fontSize: 19.0, fontWeight: FontWeight.w600, - ), ), if (model.insuranceApproval.length > 0) Container( - width: SizeConfig.widthMultiplier * 18.0, - height: SizeConfig.heightMultiplier * 2.8, + width: 60, + height: 40, decoration: BoxDecoration( - color: Color(0xffC5272D), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(19.0)), child: Center( - child: Text( + child: Texts( model.insuranceApproval[0].unUsedCount .toString(), - style: TextStyle( - color: Colors.white, fontSize: 19.0), + color: Colors.white, fontSize: 17.0, ), )) ], @@ -87,29 +99,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,41 +122,31 @@ 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( padding: EdgeInsets.symmetric( vertical: 10.0), - child: Text( + child: Texts( model.insuranceApproval[index] .clinicName, - style: TextStyle( - fontSize: 20.0, - color: Color(0xff60686B), - fontWeight: FontWeight.w600, - ), + fontSize: 20.0, + color: Color(0xff60686B), + fontWeight: FontWeight.w600, ), ), - Text( + Texts( model.insuranceApproval[index] .doctorName, - style: TextStyle( - fontSize: 17.0, - fontStyle: FontStyle.italic), + fontSize: 17.0, ), ], ), @@ -165,45 +159,53 @@ class _InsuranceApprovalState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase.of(context) - .approvalNo + - model.insuranceApproval[index] - .approvalNo - .toString(), - style: TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.w600, - ), + Row( + children: [ + Texts( + TranslationBase.of(context).approvalNo, + fontSize: 18.0, + ), + Texts(model.insuranceApproval[index].approvalNo.toString(), + fontSize: 18.0, + fontWeight: FontWeight.w600,), + ], ), Divider( color: Colors.black, height: 25.0, thickness: 1.0, ), - Text( - TranslationBase.of(context) - .procedureStatus + - model.insuranceApproval[index] - .approvalStatusDescption, - style: TextStyle( + Row( + children: [ + Texts( + TranslationBase.of(context).procedureStatus , + fontSize: 17.5, + ), + SizedBox(width: 12,), + Texts( + model.insuranceApproval[index].approvalStatusDescption, fontWeight: FontWeight.w600, - fontSize: 17.5), + fontSize: 17.5, + ), + ], ), Divider( color: Colors.black, height: 25.0, thickness: 1.0, ), - Text( - TranslationBase.of(context) - .unusedCount + - model.insuranceApproval[index] - .unUsedCount - .toString(), - style: TextStyle( + Row( + children: [ + Texts( + TranslationBase.of(context).unusedCount, fontSize: 17.5, - fontWeight: FontWeight.w600), + ), + Texts( + model.insuranceApproval[index].unUsedCount.toString(), + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + ], ), Divider( color: Colors.black, @@ -222,13 +224,10 @@ class _InsuranceApprovalState extends State { // fontSize: 17.5, // fontWeight: FontWeight.w600), // ), - Text( - TranslationBase.of(context) - .companyName, - style: TextStyle( + Texts( + TranslationBase.of(context).companyName, fontWeight: FontWeight.w600, fontSize: 17.5, - ), ), Divider( @@ -236,32 +235,42 @@ class _InsuranceApprovalState extends State { height: 25.0, thickness: 1.0, ), - Text( - TranslationBase.of(context) - .receiptOn + - convertDateFormat(model - .insuranceApproval[index] - .rceiptOn), - style: TextStyle( - fontSize: 17.5, - fontWeight: FontWeight.w600, - ), + Row( + children: [ + Texts( + TranslationBase.of(context).receiptOn , + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + Texts( + convertDateFormat(model.insuranceApproval[index].rceiptOn), + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + ], ), Divider( color: Colors.black, height: 25.0, thickness: 1.0, ), - Text( - TranslationBase.of(context) - .expiryDate + - convertDateFormat(model - .insuranceApproval[index] - .expiryDate), - style: TextStyle( - fontSize: 17.5, - fontWeight: FontWeight.w600, - ), + Row( + children: [ + Texts( + TranslationBase.of(context).expiryDate, + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + Texts( + convertDateFormat(model.insuranceApproval[index].expiryDate), + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + ], ), Divider( color: Colors.black, diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index d5fac63f..42efc179 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'; @@ -24,21 +25,29 @@ class InsuranceCard extends StatefulWidget { @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) => AppScaffold( isShowAppBar: true, baseViewModel: model, - image: 'assets/images/medical/insurance_card_icon.png', 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, @@ -74,16 +83,16 @@ class _InsuranceCardState extends State { padding: EdgeInsets.all(14), width: double.infinity, decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.grey,width: 0.2), - borderRadius: BorderRadius.all(Radius.circular(2)), - boxShadow: [ - BoxShadow( - color: Colors.white70, - ), - - ] - ), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.grey, width: 0.2), + borderRadius: + BorderRadius.all(Radius.circular(2)), + boxShadow: [ + BoxShadow( + color: Colors.white70, + ), + ]), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -91,6 +100,7 @@ class _InsuranceCardState extends State { TranslationBase.of(context).companyName + model.insurance[index].companyName, fontSize: 20.0, + fontWeight: FontWeight.w700, ), Divider( color: Colors.black, @@ -98,45 +108,59 @@ class _InsuranceCardState extends State { thickness: 0.5, ), Column( - crossAxisAlignment: CrossAxisAlignment.stretch, + crossAxisAlignment: + CrossAxisAlignment.stretch, children: [ - Text( - TranslationBase.of(context).category + - model.insurance[index].subCategoryDesc, - style: TextStyle(fontSize: 18.5), + Texts( + TranslationBase.of(context).category +": "+ + model.insurance[index] + .subCategoryDesc, + fontSize: 18.5, ), - Text( - TranslationBase.of(context).expirationDate + - convertDateFormat( - model.insurance[index].cardValidTo), - style: TextStyle(fontSize: 18.5), + Row( + children: [ + Texts( + TranslationBase.of(context) + .expirationDate +": "+ + convertDateFormat(model + .insurance[index].cardValidTo), + fontSize: 18.5, + ), + Expanded( + child: Column( + children: [ + model.insurance[index].isActive == true + ? Texts( + TranslationBase.of(context) + .activeInsurence, + color: Colors.green, + fontWeight: FontWeight.w900, + fontSize: 17.9) + : Texts( + TranslationBase.of(context) + .notActive, + color: Colors.red, + fontWeight: FontWeight.w900, + fontSize: 17.9) + ], + ), + ), + ], ), - Text( - TranslationBase.of(context).patientCard + - model.insurance[index].patientCardID, - style: TextStyle(fontSize: 18.5), - ), - Text( - TranslationBase.of(context).policyNumber + + Texts( + TranslationBase.of(context) + .patientCard +": "+ model - .insurance[index].insurancePolicyNumber, - style: TextStyle(fontSize: 18.5), + .insurance[index].patientCardID, + fontSize: 18.5, + ), + Texts( + TranslationBase.of(context) + .policyNumber +" "+ + model.insurance[index] + .insurancePolicyNumber, + fontSize: 18.5, ), - ], - ), - Column( - children: [ - model.insurance[index].isActive == true - ? Text('Active', - style: TextStyle( - color: Colors.green, - fontWeight: FontWeight.w900, - fontSize: 17.9)) - : Text('Not Active', - style: TextStyle( - color: Colors.red, - fontWeight: FontWeight.w900, - fontSize: 17.9)) ], ), SizedBox( @@ -146,8 +170,11 @@ class _InsuranceCardState extends State { Container( color: Colors.transparent, child: SecondaryButton( - onTap:()=>{ getDetails(model.insurance[index])}, - label: TranslationBase.of(context).seeDetails, + onTap: () => { + getDetails(model.insurance[index]) + }, + label: TranslationBase.of(context) + .seeDetails, textColor: Colors.white, ), width: double.infinity, @@ -155,8 +182,6 @@ class _InsuranceCardState extends State { ], ), ), - - ], ), ], @@ -186,13 +211,13 @@ class _InsuranceCardState extends State { return newDate.toString(); } - getDetails(data){ + + getDetails(data) { GifLoaderDialogUtils.showMyDialog(context); _insuranceCardService.getInsuranceDetails(data).then((value) => { - GifLoaderDialogUtils.hideDialog(context), - Navigator.push(context, - FadePage(page: InsuranceCardDetails(data:value[0]['CheckList']))) - - }); + GifLoaderDialogUtils.hideDialog(context), + Navigator.push(context, + FadePage(page: InsuranceCardDetails(data: value[0]['CheckList']))) + }); } } diff --git a/lib/pages/insurance/insurance_card_update_details.dart b/lib/pages/insurance/insurance_card_update_details.dart new file mode 100644 index 00000000..5e9db38a --- /dev/null +++ b/lib/pages/insurance/insurance_card_update_details.dart @@ -0,0 +1,346 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart'; +import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.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/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'AttachInsuranceCardImageDialog.dart'; + +class InsuranceCardUpdateDetails extends StatelessWidget { + final List insuranceCardDetailsModel; + final String patientIdentificationID; + final int patientID; + final String name; + + const InsuranceCardUpdateDetails( + {Key key, + this.insuranceCardDetailsModel, + this.patientIdentificationID, + this.patientID, + this.name}) + : super(key: key); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + builder: (context, model, w) => AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).cardDetail, + body: SingleChildScrollView( + child: Column( + children: [ + ...List.generate( + insuranceCardDetailsModel.length, + (index) => Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: double.maxFinite, + margin: EdgeInsets.only(left: 8, right: 8, top: 8), + height: projectViewModel.isArabic ? 320 : 240, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + color: Color(0xff515B5D), + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + insuranceCardDetailsModel[index].memberID, + textScaleFactor: 2.1, + style: TextStyle( + color: Colors.white, + letterSpacing: 8.0, + fontWeight: FontWeight.w400, + fontSize: 15), + ), + SizedBox( + height: 5, + ), + Texts( + insuranceCardDetailsModel[index].companyName, + fontSize: 14, + color: Colors.white, + ), + SizedBox( + height: 25, + ), + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).policyHolder, + color: Colors.white, + fontSize: 14, + ), + Texts( + insuranceCardDetailsModel[index] + .memberName, + color: Colors.white, + fontSize: 14, + ), + ], + ), + ), + Expanded( + child: Column( + children: [ + Texts(TranslationBase.of(context).policyNo, + color: Colors.white), + Texts( + insuranceCardDetailsModel[index] + .policyNumber, + color: Colors.white), + ], + ), + ), + ], + ), + SizedBox( + height: 25, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context) + .expiryDateTitle, + color: Colors.white, + fontSize: 12, + ), + Texts( + insuranceCardDetailsModel[index].dOB, + color: Colors.white, + fontSize: 12, + ), + ], + ), + ), + Expanded( + child: Column( + children: [ + Texts( + TranslationBase.of(context).classTitle, + color: Colors.white, + fontSize: 12, + ), + Texts( + insuranceCardDetailsModel[index] + .subCategory, + color: Colors.white, + fontSize: 12, + ), + ], + ), + ), + Expanded( + child: Column( + children: [ + Texts( + TranslationBase.of(context).approval, + color: Colors.white, + fontSize: 12, + ), + Texts( + insuranceCardDetailsModel[index] + .approvalLimit + .toString(), + color: Colors.white, + fontSize: 12, + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ), + ), + if(insuranceCardDetailsModel.isEmpty) + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB( + 8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Texts( + name, + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of( + context) + .fileno + + ": " +patientID.toString(), + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ) + ], + ), + ), + ), + ], + ), + ), + ), + ), + SizedBox(height: 150,), + Image.asset('assets/images/no-data-found.png',width: 80,height: 80,), + SizedBox(height: 8,), + Texts(TranslationBase.of(context).noDataAvailable) + ], + ) + ], + ), + ), + bottomSheet: Container( + width: double.infinity, + height:insuranceCardDetailsModel.isEmpty? MediaQuery.of(context).size.height * 0.14:MediaQuery.of(context).size.height * 0.21, + child: Container( + margin: EdgeInsets.only(left: 8, right: 8), + child: Column( + children: [ + SizedBox( + height: 8, + ), + if(insuranceCardDetailsModel.isEmpty) + SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).scanNow.toUpperCase(), + color: Theme.of(context).primaryColor, + onTap: () async { + confirmAttachInsuranceCardImageDialogDialog( + context: context, + name: name, + fileNo: patientID.toString(), + model: model); + }, + ), + if(insuranceCardDetailsModel.isNotEmpty) + SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).agree.toUpperCase(), + color: Theme.of(context).primaryColor, + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.uploadInsuranceCard( + patientIdentificationID: patientIdentificationID, + patientID: patientID); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + AppToast.showErrorToast(message: model.error); + } else { + AppToast.showSuccessToast( + message: TranslationBase.of(context).requestSent); + } + }, + ),if(insuranceCardDetailsModel.isNotEmpty) + SizedBox( + height: 12, + ),if(insuranceCardDetailsModel.isNotEmpty) + SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).disagree.toUpperCase(), + color: Colors.grey[800], + onTap: () async { + confirmAttachInsuranceCardImageDialogDialog( + context: context, + name: name, + fileNo: patientID.toString(), + model: model); + }, + ) + ], + ), + ), + ), + ), + ); + } + + void confirmAttachInsuranceCardImageDialogDialog( + {BuildContext context, + String name, + String fileNo, + InsuranceViewModel model}) { + showDialog( + context: context, + child: AttachInsuranceCardImageDialog( + fileNo: fileNo, + name: name, + image: (file, image) async { + GifLoaderDialogUtils.showMyDialog(context); + await model.uploadInsuranceCard( + patientIdentificationID: patientIdentificationID, + patientID: patientID, + image: image); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal || + model.state == ViewState.Error) { + AppToast.showErrorToast(message: model.error); + } else { + AppToast.showSuccessToast( + message: TranslationBase.of(context).requestSent); + } + Navigator.pop(context); + }, + ), + ); + } +} diff --git a/lib/pages/insurance/insurance_details.dart b/lib/pages/insurance/insurance_details.dart index d0a829be..16745e9e 100644 --- a/lib/pages/insurance/insurance_details.dart +++ b/lib/pages/insurance/insurance_details.dart @@ -1,35 +1,29 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:html/dom.dart' as dom; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class InsuranceCardDetails extends StatefulWidget { +class InsuranceCardDetails extends StatelessWidget { final String data; InsuranceCardDetails({this.data}); - @override - _InsuranceCardInsuranceCardDetailsState createState() => _InsuranceCardInsuranceCardDetailsState(); -} -//TODO fix it -class _InsuranceCardInsuranceCardDetailsState extends State { @override Widget build(BuildContext context) { - return - AppScaffold( - isShowAppBar: true, - - body: Center( - child: SingleChildScrollView( + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).cardDetail, + body: Center( + child: SingleChildScrollView( child: Html( - data:widget.data, - ) - ) + data: data, + ), + ), ), ); } - } diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart new file mode 100644 index 00000000..f938d9e5 --- /dev/null +++ b/lib/pages/insurance/insurance_page.dart @@ -0,0 +1,261 @@ +import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.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/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../../locator.dart'; +import 'insurance_card_update_details.dart'; + +class InsurancePage extends StatelessWidget { + final InsuranceViewModel model; + InsuranceCardService _insuranceCardService = locator(); + + InsurancePage({Key key, this.model}) : super(key: key); + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Column( + children: [ + SizedBox( + height: 65, + ), + Container( + margin: EdgeInsets.all(10.0), + color: Colors.white, + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + if (model.user != null) + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + model.user.firstName ?? '' + " " + model.user.lastName ?? '', + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model.user.patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ) + ], + ), + ), + ), + Expanded( + flex: 2, + child: Container( + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase.of( + context) + .fetchData, + small: true, + textColor: Colors.white, + onTap: () { + getDetails( + setupID: '010266', + projectID: 15, + patientIdentificationID: + model.user + .patientIdentificationNo, + patientID: model + .user.patientID, + name: model.user + .firstName + + " " + + model + .user.lastName,context: context); + }, + ), + ), + ], + ), + ), + ) + ], + ), + ), + if(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false) + ...List.generate(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, (index) => + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 + ? Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB( + 8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Texts( + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientName, + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of( + context) + .fileno + + ": " + + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ) + ], + ), + ), + ), + Expanded( + flex: 2, + child: Container( + margin: + EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase + .of(context) + .fetchData, + small: true, + textColor: + Colors.white, + onTap: () { + getDetails( + projectID: 15, + patientIdentificationID: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientIdenficationNumber, + setupID: + '010266', + patientID: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .responseID, + name: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index].patientName,context: context); + }, + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + ) + : Container() + ), + + ], + ), + ); + } + + getDetails( + {String setupID, + int projectID, + String patientIdentificationID, + int patientID, + String name,BuildContext context}) { + GifLoaderDialogUtils.showMyDialog(context); + _insuranceCardService + .getPatientInsuranceDetails( + setupID: setupID, + projectID: projectID, + patientID: patientID, + patientIdentificationID: patientIdentificationID) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { + Navigator.push( + context, + FadePage( + page: InsuranceCardUpdateDetails( + insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList, + patientID: patientID, + patientIdentificationID: patientIdentificationID, + name: name, + ))); + } else { + AppToast.showErrorToast(message: _insuranceCardService.error); + } + }); + } +} diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 1e616108..36b424a8 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,14 +1,22 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_details.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'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; import '../base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; -import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; -import 'package:rating_bar/rating_bar.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; + +import 'insurance_card_update_details.dart'; +import 'insurance_page.dart'; class InsuranceUpdate extends StatefulWidget { @override @@ -18,11 +26,13 @@ class InsuranceUpdate extends StatefulWidget { class _InsuranceUpdateState 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/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); } void dispose() { @@ -35,8 +45,12 @@ class _InsuranceUpdateState extends State onModelReady: (model) => model.getInsuranceUpdated(), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( - appBarTitle: 'Insurance Cards', + appBarTitle: TranslationBase.of(context).insurCards, + description: TranslationBase.of(context).infoInsurCards, + infoList: TranslationBase.of(context).infoPrescriptionsPoints, + imagesInfo: imagesInfo, isShowAppBar: true, + isShowDecPage: true, baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, @@ -63,7 +77,7 @@ class _InsuranceUpdateState extends State controller: _tabController, isScrollable: true, indicatorWeight: 4.0, - indicatorColor: Colors.red, + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.symmetric( horizontal: 13.0, vertical: 2.0), @@ -72,13 +86,14 @@ class _InsuranceUpdateState extends State Container( width: MediaQuery.of(context).size.width * 0.35, child: Center( - child: Texts('Card'), + child: Texts(TranslationBase.of(context) + .updateInsuranceSubtitle), ), ), Container( width: MediaQuery.of(context).size.width * 0.35, child: Center( - child: Texts('History'), + child: Texts(TranslationBase.of(context).history), ), ), ], @@ -96,85 +111,7 @@ class _InsuranceUpdateState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - Container( - child: ListView.builder( - itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, - itemBuilder: (BuildContext context, int index) { - return Container( - margin: EdgeInsets.all(10.0), - child: Card( - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - child: Container( - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, left: 10.0, right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index].patientName, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: FontWeight.w500, - letterSpacing: 1.0)), - Text( - 'File No.' + - model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index].patientID.toString(), - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: FontWeight.w500, - letterSpacing: 1.0)), - ], - ), - ), - ), - Expanded( - flex: 2, - child: Container( - // height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: 'Update', - small: true, - textColor: Colors.white, - // color: Colors.grey, - ), - //height: 45, - // width:90 - ), - ], - ), - ), - ) - ], - ), - ), - ), - ); - }), - ), + InsurancePage(model:model), Container( child: ListView.builder( itemCount: model.insuranceUpdate == null @@ -210,35 +147,40 @@ class _InsuranceUpdateState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("TAMER FANASHEH ", - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - 'File No.' + - model - .insuranceUpdate[ - index] - .patientID - .toString(), - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - model.insuranceUpdate[index] - .createdOn, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), + Texts( + model.user.firstName + + " " + + model.user.lastName, + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.black, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model + .insuranceUpdate[ + index] + .patientID + .toString(), + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.black, + ), + SizedBox( + height: 8, + ), + Texts( + model.insuranceUpdate[index] + .createdOn, + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.black, + ), ], ), ), @@ -246,7 +188,6 @@ class _InsuranceUpdateState extends State Expanded( flex: 1, child: Container( -// height: MediaQuery.of(context).size.height * 0.12, margin: EdgeInsets.only(top: 20.0), child: Column( children: [ @@ -257,15 +198,13 @@ class _InsuranceUpdateState extends State Container( margin: EdgeInsets.only( top: 13.5, left: 2.0), - child: Text( - model - .insuranceUpdate[ - index] - .statusDescription, - textAlign: - TextAlign.center, - style: TextStyle( - fontSize: 12.0)), + child: Texts( + model.insuranceUpdate[index] + .statusDescription, + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.black, + ), ), ], ), @@ -288,4 +227,6 @@ class _InsuranceUpdateState extends State ), ); } + + } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index b5a5c5d9..cd8a8a2d 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -1,10 +1,6 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart'; -import 'package:diplomaticquarterapp/core/model/geofencing/requests/LogGeoZoneRequestModel.dart'; -import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; @@ -15,12 +11,9 @@ 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/uitl/HMG_Geofence.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/offers_packages/offers_packages.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -29,6 +22,8 @@ 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; @@ -42,7 +37,6 @@ class _HomePageState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, wi) => AppScaffold( @@ -61,7 +55,10 @@ class _HomePageState extends State { width: double.infinity, height: 210, decoration: BoxDecoration( - image: DecorationImage(image: ExactAssetImage('assets/images/dashboard_top_bg.png'), fit: BoxFit.cover), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/dashboard_top_bg.png'), + fit: BoxFit.cover), ), child: Stack( children: [ @@ -70,7 +67,8 @@ class _HomePageState extends State { left: 5, right: 5, child: Container( - width: MediaQuery.of(context).size.width * 0.8, + width: + MediaQuery.of(context).size.width * 0.8, child: Row( children: [ Expanded( @@ -80,42 +78,81 @@ class _HomePageState extends State { margin: EdgeInsets.all(5), decoration: BoxDecoration( image: DecorationImage( - image: AssetImage("assets/images/new-design/covid_bg_transparent.png"), + image: AssetImage( + "assets/images/new-design/covid_bg_transparent.png"), fit: BoxFit.fill, ), - color: Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all(Radius.circular(5))), + color: + Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5))), child: Container( margin: EdgeInsets.only(top: 10.0), child: Column( children: [ - Text("COVID-19 TEST", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 18.0)), + Text("COVID-19 TEST", + style: TextStyle( + color: Colors.white, + fontWeight: + FontWeight.bold, + fontSize: 18.0)), Row( children: [ Container( - margin: EdgeInsets.only(top: 15.0, left: 3.5, right: 3.5), - child: SvgPicture.asset('assets/images/new-design/covid-19-car.svg', width: 45.0, height: 45.0), + margin: EdgeInsets.only( + top: 15.0, left: 3.5, right: 3.5), + child: SvgPicture.asset( + 'assets/images/new-design/covid-19-car.svg', + width: 45.0, + height: 45.0), ), Container( - margin: EdgeInsets.only(left: 10.0, top: 10.0), + margin: EdgeInsets.only( + left: 10.0, + top: 10.0), child: Column( children: [ - Text("Drive-Thru", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 16.0)), + Text("Drive-Thru", + style: TextStyle( + color: Colors + .white, + fontWeight: + FontWeight + .bold, + fontSize: + 16.0)), ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5.0), + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .circular( + 5.0), ), - minWidth: MediaQuery.of(context).size.width * 0.15, + minWidth: MediaQuery.of( + context) + .size + .width * + 0.15, height: 25.0, child: RaisedButton( - color: Colors.red[800], - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), + color: Colors + .red[800], + textColor: + Colors.white, + disabledTextColor: + Colors.white, + disabledColor: + new Color( + 0xFFbcc2c4), onPressed: () { navigateToCovidDriveThru(); }, - child: Text("BOOK NOW", style: TextStyle(fontSize: 12.0)), + child: Text( + "BOOK NOW", + style: TextStyle( + fontSize: + 12.0)), ), ), ], @@ -130,14 +167,21 @@ class _HomePageState extends State { ), Expanded( child: InkWell( - onTap: () => Navigator.push(context, FadePage(page: LiveCareHome())), + onTap: () => Navigator.push(context, + FadePage(page: LiveCareHome())), child: Container( height: 120, padding: EdgeInsets.all(15), margin: EdgeInsets.all(5), - decoration: BoxDecoration(color: Colors.white.withOpacity(0.3), borderRadius: BorderRadius.all(Radius.circular(5))), + decoration: BoxDecoration( + color: Colors.white + .withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5))), child: SvgPicture.asset( - projectViewModel.isArabic ? 'assets/images/new-design/livecare_arabic_logo.svg' : 'assets/images/new-design/liveCare_white_logo.svg', + projectViewModel.isArabic + ? 'assets/images/new-design/livecare_arabic_logo.svg' + : 'assets/images/new-design/liveCare_white_logo.svg', ), ), ), @@ -154,332 +198,368 @@ class _HomePageState extends State { ), Positioned( top: 155, - left: MediaQuery.of(context).size.width * (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03), - right: MediaQuery.of(context).size.width * (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03), + left: MediaQuery.of(context).size.width * + (MediaQuery.of(context).orientation == + Orientation.landscape + ? 0.02 + : 0.03), + right: MediaQuery.of(context).size.width * + (MediaQuery.of(context).orientation == + Orientation.landscape + ? 0.02 + : 0.03), child: (!model.isLogin && projectViewModel.user == null) ? Container( - width: double.infinity, - height: 125, - decoration: BoxDecoration( - color: HexColor('#A59E9E'), - shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(9)), - image: DecorationImage(image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)), - child: Container( - margin: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 8, - ), - Texts( - TranslationBase.of(context).myMedicalFile, - color: Colors.black87, - bold: true, - fontSize: 23, - ), - SizedBox( - height: 5, + width: double.infinity, + height: 125, + decoration: BoxDecoration( + color: HexColor('#A59E9E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover)), + child: Container( + margin: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of(context).myMedicalFile, + color: Colors.black87, + bold: true, + fontSize: 23, + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context) + .myMedicalFileSubTitle, + color: Colors.black, + fontSize: 16, + ), + Align( + alignment: projectViewModel.isArabic + ? Alignment.bottomRight + : Alignment.bottomLeft, + child: InkWell( + onTap: () { + widget.goToMyProfile(); + }, + child: Container( + margin: EdgeInsets.all(2), + width: 90, + height: 30, + decoration: BoxDecoration( + color: HexColor('#D81A2E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(9)), ), - Texts( - TranslationBase.of(context).myMedicalFileSubTitle, - color: Colors.black, - fontSize: 16, + child: Center( + child: Texts( + TranslationBase.of(context) + .viewMore, + color: Colors.white, + fontSize: 12, + ), ), - Align( - alignment: projectViewModel.isArabic ? Alignment.bottomRight : Alignment.bottomLeft, - child: InkWell( - onTap: () { - widget.goToMyProfile(); - }, - child: Container( - margin: EdgeInsets.all(2), - width: 90, - height: 30, - decoration: BoxDecoration( - color: HexColor('#D81A2E'), - shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(9)), + ), + ), + ) + ], + ), + ), + ) + : Container( + width: double.infinity, + height: 130, + decoration: BoxDecoration( + color: HexColor('#A59E9E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover), + ), + child: Container( + margin: EdgeInsets.all(5), + child: Column( + children: [ + Row( + children: [ + if (model.user != null) + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, ), - child: Center( - child: Texts( - TranslationBase.of(context).viewMore, - color: Colors.white, - fontSize: 12, - ), + Texts( + model.user.firstName + + " " + + model.user.lastName, + color: Colors.grey[100], + bold: true, + fontSize: 15, + ), + Texts( + '${model.user.patientID}', + color: Colors.white, + fontSize: 14, + ), + SizedBox( + height: 5, + ), + Texts( + '${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}', + color: Colors.grey[100], + fontWeight: FontWeight.normal, + fontSize: 14, ), + ], + ), + ), + InkWell( + onTap: () { + widget.goToMyProfile(); + }, + child: Container( + margin: EdgeInsets.all(2), + width: 90, + height: 30, + decoration: BoxDecoration( + color: HexColor('#D81A2E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(5), ), ), - ) - ], - ), - ), - ) - : Container( - width: double.infinity, - height: 130, - decoration: BoxDecoration( - color: HexColor('#A59E9E'), - shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(9)), - image: DecorationImage(image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover), + child: Center( + child: Texts( + TranslationBase.of(context) + .viewMore, + color: Colors.white, + fontSize: 12, + ), + ), + ), + ) + ], ), - child: Container( - margin: EdgeInsets.all(5), - child: Column( - children: [ - Row( + Row( + //crossAxisAlignment: CrossAxisAlignment.center, + //mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - if (model.user != null) - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 8, - ), - Texts( - model.user.firstName + " " + model.user.lastName, - color: Colors.grey[100], - bold: true, - fontSize: 15, - ), - Texts( - '${model.user.patientID}', - color: Colors.white, - fontSize: 14, - ), - SizedBox( - height: 5, - ), - Texts( - '${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}', - color: Colors.grey[100], - fontWeight: FontWeight.normal, - fontSize: 14, - ), - ], - ), - ), - InkWell( - onTap: () { - widget.goToMyProfile(); - }, - child: Container( - margin: EdgeInsets.all(2), - width: 90, - height: 30, - decoration: BoxDecoration( - color: HexColor('#D81A2E'), - shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all( - Radius.circular(5), - ), - ), - child: Center( - child: Texts( - TranslationBase.of(context).viewMore, - color: Colors.white, - fontSize: 12, - ), - ), - ), + Image.asset( + 'assets/images/height_icon.png', + width: 35, + height: 40, + ), + Texts( + "${model.heightCm}", + color: Colors.white, ) ], ), - Row( - //crossAxisAlignment: CrossAxisAlignment.center, - //mainAxisAlignment: MainAxisAlignment.spaceAround, + ), + SizedBox( + width: 3, + ), + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Image.asset( - 'assets/images/height_icon.png', - width: 35, - height: 40, - ), - Texts( - "${model.heightCm}", - color: Colors.white, - ) - ], - ), - ), - SizedBox( - width: 3, - ), - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Image.asset( - 'assets/images/weight_icon.png', - width: 25, - height: 40, - ), - Texts( - '${model.weightKg}', - color: Colors.white, - ) - ], - ), + Image.asset( + 'assets/images/weight_icon.png', + width: 25, + height: 40, ), - SizedBox( - width: 3, - ), - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Image.asset( - 'assets/images/blood_icon.png', - width: 35, - height: 40, - ), - Texts( - '${model.bloadType}', - color: Colors.white, - ) - ], - ), + Texts( + '${model.weightKg}', + color: Colors.white, + ) + ], + ), + ), + SizedBox( + width: 3, + ), + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + 'assets/images/blood_icon.png', + width: 35, + height: 40, ), + Texts( + '${model.booldType}', + color: Colors.white, + ) ], - ) - ], - ), - ), - ), + ), + ), + ], + ) + ], + ), + ), + ), ), ], ), - - /* Zohiab Kambrani | Commented below because its in progress - OffersAndPackagesWidget(OfferPackagesItemModel.dummy()), - */ - - Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - DashboardItem( - onTap: () { - Navigator.push( - context, - FadePage( - page: HomeHealthCareIndexPage(), - ), - ); - }, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/home_health_care_icon.png', - width: 50, - height: 50, + if(projectViewModel.havePrivilege(64)||projectViewModel.havePrivilege(65)||projectViewModel.havePrivilege(67)) + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if(projectViewModel.havePrivilege(64)) + DashboardItem( + onTap: () { + Navigator.push( + context, + FadePage( + page: HomeHealthCareIndexPage(), ), - SizedBox( - height: 3, + ); + }, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/home_health_care_icon.png', + width: 50, + height: 50, + ), + SizedBox( + height: 3, + ), + Texts( + TranslationBase.of(context) + .homeHealthCareService, + textAlign: TextAlign.center, + color: Colors.white, + bold: true, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], ), - Texts( - TranslationBase.of(context).homeHealthCareService, - textAlign: TextAlign.center, - color: Colors.white, - bold: true, - fontSize: SizeConfig.textMultiplier * 1.7, - ) - ], + ), ), + height: MediaQuery.of(context).size.width * 0.4, + imageName: 'home_healthcare_service_bg.png', + opacity: 0.5, ), - ), - height: MediaQuery.of(context).size.width * 0.4, - imageName: 'home_healthcare_service_bg.png', - opacity: 0.5, - ), - DashboardItem( - onTap: () => Navigator.push(context, FadePage(page: PharmacyPage())), - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/pharmacy_logo.png', - width: 40, - height: 40, - ), - SizedBox( - height: 20, + if(projectViewModel.havePrivilege(65)) + DashboardItem( + onTap: () => Navigator.push(context, FadePage(page: LandingPagePharmacy())), + + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/pharmacy_logo.png', + width: 40, + height: 40, + ), + SizedBox( + height: 20, + ), + Texts( + TranslationBase.of(context).onlinePharmacy, + textAlign: TextAlign.center, + color: Colors.white, + bold: true, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], ), - Texts( - TranslationBase.of(context).onlinePharmacy, - textAlign: TextAlign.center, - color: Colors.white, - bold: true, - fontSize: SizeConfig.textMultiplier * 1.7, - ) - ], + ), ), + height: MediaQuery.of(context).size.width * 0.4, + imageName: 'al-habib_onlne_pharmacy_bg.png', ), - ), - height: MediaQuery.of(context).size.width * 0.4, - imageName: 'al-habib_onlne_pharmacy_bg.png', - ), - DashboardItem( - onTap: () { - Navigator.push( - context, - FadePage( - page: CMCIndexPage(), - ), - ); - }, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/comprehensive_medical_checkup_logo.png', - width: 50, - height: 50, + if(projectViewModel.havePrivilege(67)) + DashboardItem( + onTap: (){ + Navigator.push( + context, + FadePage( + page: CMCIndexPage(), ), - SizedBox( - height: 3, + ); + }, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/comprehensive_medical_checkup_logo.png', + width: 50, + height: 50, + ), + SizedBox( + height: 3, + ), + Texts( + TranslationBase.of(context).emergencyService, + textAlign: TextAlign.center, + color: Colors.white, + bold: true, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], ), - Texts( - TranslationBase.of(context).emergencyService, - textAlign: TextAlign.center, - color: Colors.white, - bold: true, - fontSize: SizeConfig.textMultiplier * 1.7, - ) - ], + ), ), + height: MediaQuery.of(context).size.width * 0.4, + color: HexColor("#747C80"), + imageName: 'emergency_service_image.png', ), - ), - height: MediaQuery.of(context).size.width * 0.4, - color: HexColor("#747C80"), - imageName: 'emergency_service_image.png', - ), - ], + ], + ), ), - ), SizedBox( height: 8, ), InkWell( - onTap: () => Navigator.push(context, FadePage(page: PaymentService())), + onTap: () => + Navigator.push(context, FadePage(page: PaymentService())), child: Container( margin: EdgeInsets.only(left: 15, right: 15), child: Row( @@ -500,7 +580,8 @@ class _HomePageState extends State { height: 5, ), Texts( - TranslationBase.of(context).onlinePaymentService, + TranslationBase.of(context) + .onlinePaymentService, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -531,7 +612,8 @@ class _HomePageState extends State { height: 10, ), Texts( - TranslationBase.of(context).offersAndPackages, + TranslationBase.of(context) + .offersAndPackages, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -547,46 +629,48 @@ class _HomePageState extends State { borderRadius: BorderRadius.circular(6.0), color: Colors.white, )), - Container( - width: MediaQuery.of(context).size.width * 0.29, - child: InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: ErOptions( - isAppbar: true, - ))), - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/Dr_Schedule_report.png', - width: 50, - height: 50, - ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context).emergencyServices, - textAlign: TextAlign.center, - color: Colors.black87, - bold: false, - fontSize: SizeConfig.textMultiplier * 1.7, - ) - ], + if(projectViewModel.havePrivilege(60)) + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: ErOptions( + isAppbar: true, + ))), + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/Dr_Schedule_report.png', + width: 50, + height: 50, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context) + .emergencyServices, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], + ), ), ), ), + height: MediaQuery.of(context).size.width * 0.4, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), ), - height: MediaQuery.of(context).size.width * 0.4, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Colors.white, - ), - ), ], ), ), @@ -612,7 +696,8 @@ class _HomePageState extends State { fontWeight: FontWeight.normal, ), Texts( - TranslationBase.of(context).viewAllHabibMedicalService, + TranslationBase.of(context) + .viewAllHabibMedicalService, color: Colors.white, fontWeight: FontWeight.normal, fontSize: 10, @@ -633,13 +718,15 @@ class _HomePageState extends State { opacity: 0.5, color: Colors.grey[700], width: MediaQuery.of(context).size.width * 0.45, - onTap: () => Navigator.push(context, FadePage(page: AllHabibMedicalService())), + onTap: () => Navigator.push( + context, FadePage(page: AllHabibMedicalService())), ), DashboardItem( onTap: () { // Navigator.push( // context, FadePage(page: FeedbackHomePage())); - Navigator.push(context, FadePage(page: ContactUsPage())); + Navigator.push( + context, FadePage(page: ContactUsPage())); }, child: Container( width: double.infinity, @@ -690,12 +777,23 @@ class _HomePageState extends State { } navigateToCovidDriveThru() { - Navigator.push(context, MaterialPageRoute(builder: (context) => CovidDrivethruLocation())); + Navigator.push(context, + MaterialPageRoute(builder: (context) => CovidDrivethruLocation())); } } class DashboardItem extends StatelessWidget { - const DashboardItem({this.hasBorder = false, this.imageName, @required this.child, this.onTap, Key key, this.width, this.height, this.color, this.opacity = 0.4, this.hasColorFilter = true}) + const DashboardItem( + {this.hasBorder = false, + this.imageName, + @required this.child, + this.onTap, + Key key, + this.width, + this.height, + this.color, + this.opacity = 0.4, + this.hasColorFilter = true}) : super(key: key); final bool hasBorder; final String imageName; @@ -716,22 +814,25 @@ class DashboardItem extends StatelessWidget { height: height != null ? height : MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.19 - : MediaQuery.of(context).size.height * 0.35, + ? MediaQuery.of(context).size.height * 0.19 + : MediaQuery.of(context).size.height * 0.35, decoration: BoxDecoration( color: !hasBorder ? color != null - ? color - : HexColor('#050705').withOpacity(opacity) + ? color + : HexColor('#050705').withOpacity(opacity) : Colors.white, borderRadius: BorderRadius.circular(6.0), - border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent), + border: hasBorder + ? Border.all(width: 1.0, color: const Color(0xffcccccc)) + : Border.all(width: 0.0, color: Colors.transparent), image: imageName != null ? DecorationImage( - image: ExactAssetImage('assets/images/$imageName'), - fit: BoxFit.cover, - colorFilter: hasColorFilter ? new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn) : null, - ) + image: ExactAssetImage('assets/images/$imageName'), + fit: BoxFit.cover, + colorFilter: hasColorFilter ? new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn) : null, + ) : null, ), child: Center( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 7625bcf6..f45b3780 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -1,6 +1,4 @@ -import 'dart:convert'; import 'dart:io'; -import 'dart:typed_data'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; @@ -17,6 +15,8 @@ import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' + as family; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; import 'package:diplomaticquarterapp/uitl/HMGNetworkConnectivity.dart'; @@ -24,6 +24,7 @@ import 'package:diplomaticquarterapp/uitl/HMG_Geofence.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; @@ -36,7 +37,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; - +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import '../../locator.dart'; import '../../routes.dart'; import 'home_page.dart'; @@ -57,23 +58,30 @@ class _LandingPageState extends State with WidgetsBindingObserver { PageController pageController; ProjectViewModel projectViewModel; var notificationCount = ''; + var themeNotifier; ///inject the user data - AuthenticatedUserObject authenticatedUserObject = locator(); + AuthenticatedUserObject authenticatedUserObject = locator< + AuthenticatedUserObject>(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final authService = new AuthProvider(); var event = RobotProvider(); + var familyFileProvider = family.FamilyFilesProvider(); void _requestIOSPermissions() { - flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.requestPermissions( - alert: true, - badge: true, - sound: true, - ); + flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + IOSFlutterLocalNotificationsPlugin>() + ?.requestPermissions( + alert: true, + badge: true, + sound: true, + ); } bool isPageNavigated = false; + LocationUtils locationUtils; _changeCurrentTab(int tab) { setState(() { @@ -101,7 +109,13 @@ class _LandingPageState extends State with WidgetsBindingObserver { if (LandingPage.isOpenCallPage) { if (!isPageNavigated) { isPageNavigated = true; - Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + IncomingCall( + incomingCallData: LandingPage.incomingCallData))) + .then((value) { isPageNavigated = false; }); } @@ -127,7 +141,6 @@ class _LandingPageState extends State with WidgetsBindingObserver { @override void initState() { super.initState(); - WidgetsBinding.instance.addObserver(this); //setState(() { AppGlobal.context = context; @@ -139,7 +152,10 @@ class _LandingPageState extends State with WidgetsBindingObserver { // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] HMGNetworkConnectivity(context, () { GifLoaderDialogUtils.showMyDialog(context); - PlatformBridge().connectHMGGuestWifi().then((value) => {GifLoaderDialogUtils.hideDialog(context)}); + PlatformBridge().connectHMGGuestWifi().then((value) => + { + GifLoaderDialogUtils.hideDialog(context) + }); }).checkAndConnectIfNoInternet(); @@ -158,15 +174,15 @@ class _LandingPageState extends State with WidgetsBindingObserver { checkUserStatus(token); } }); - - if (results[Permission.locationAlways].isGranted) ; - if (results[Permission.storage].isGranted) ; - if (results[Permission.camera].isGranted) ; - if (results[Permission.photos].isGranted) ; - if (results[Permission.accessMediaLocation].isGranted) ; - if (results[Permission.calendar].isGranted) ; + if (results[Permission.location].isGranted); + if (results[Permission.storage].isGranted); + if (results[Permission.camera].isGranted); + if (results[Permission.photos].isGranted); + if (results[Permission.accessMediaLocation].isGranted); + if (results[Permission.calendar].isGranted); }); - + requestPermissions(); + // }); // // //_firebase Background message handler // _firebaseMessaging.configure( @@ -287,7 +303,16 @@ class _LandingPageState extends State with WidgetsBindingObserver { showDialogs(String message) { ConfirmDialog dialog = new ConfirmDialog( - context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {}); + context: context, + confirmMessage: message, + okText: TranslationBase + .of(context) + .confirm, + cancelText: TranslationBase + .of(context) + .cancel_nocaps, + okFunction: () => {}, + cancelFunction: () => {}); dialog.showAlertDialog(context); } @@ -311,6 +336,156 @@ class _LandingPageState extends State with WidgetsBindingObserver { return permissionResults; } + setTheme() async { + // + // defaultTheme = + // ThemeData( + // fontFamily:projectViewModel.isArabic ? 'Cairo' : 'WorkSans', + // primarySwatch: Colors.blue, + // visualDensity: VisualDensity.adaptivePlatformDensity, + // brightness: Brightness.light, + // pageTransitionsTheme: const PageTransitionsTheme( + // builders: { + // TargetPlatform.android: ZoomPageTransitionsBuilder(), + // TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + // }, + // ), + // hintColor: Colors.grey[400], + // disabledColor: Colors.grey[300], + // errorColor: Color.fromRGBO(235, 80, 60, 1.0), + // scaffoldBackgroundColor: Color(0xffEEEEEE), + // textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), + // textSelectionHandleColor: Colors.grey, + // canvasColor: Colors.white, + // backgroundColor: Colors.white, + // highlightColor: Colors.grey[100].withOpacity(0.4), + // splashColor: Colors.transparent, + // primaryColor: Color(0xff40ACC9), + // bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + // cursorColor: Colors.grey, + // cardColor: Colors.white, + // iconTheme: IconThemeData(), + // appBarTheme: AppBarTheme( + // color: Color(0xff40ACC9), + // brightness: Brightness.dark, + // elevation: 10.0, + // actionsIconTheme: IconThemeData( + // color: Color(0xff40ACC9), + // ), + // ), + // ); + // themeNotifier.setTheme(defaultTheme); + } + + static Future myBackgroundMessageHandler( + Map message) async { + Map myMap = new Map.from(message['data']); + if (message.containsKey('data')) { + print("myBackgroundMessageHandler Inside"); + LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + print(LandingPage.incomingCallData.doctorname); + LandingPage.isOpenCallPage = true; + } + + if (message.containsKey('notification')) { + final dynamic notification = message['notification']; + print(notification); + } + } + + void setUserValues(value) async { + if (value != null) sharedPref.setObject(IMEI_USER_DATA, value); + } + + Future getUserInformation() async { + var userInfoJson = sharedPref.getObject(IMEI_USER_DATA); + return userInfoJson; + } + + checkValue(projectProvider) { + if (projectProvider.searchValue != null) { + _changeCurrentTab(2); + } + } + + registerGeofences() async { + await locator().getAllGeoZones(GeoZonesRequestModel()); + + void doIt() { + getUserInformation().then((value) { + if (value != null) projectViewModel.platformBridge() + .registerHmgGeofences(); + }); + } + + if (await Permission.location.isGranted) { + doIt(); + } else { + [Permission.location].request().then((value) async { + if (await Permission.location.isGranted) { + doIt(); + } + }); + } + + } + + login() async { + var data = await sharedPref.getObject(IMEI_USER_DATA); + sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); + if (data != null) { + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + GifLoaderDialogUtils.showMyDialog(context); + authService + .selectDeviceImei(DEVICE_TOKEN) + .then((SelectDeviceIMEIRES value) { + GifLoaderDialogUtils.hideDialog(context); + if (value != null) { + setUserValues(value); + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + }); + } + } + + getNotificationCount(token) async { + if (await sharedPref.getObject(USER_PROFILE) != null) { + var data = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + if (data != null) { + authService + .registeredAuthenticatedUser(data, token, 0, 0) + .then((res) => {print(res)}); + authService.getDashboard().then((value) => + { + setState(() { + notificationCount = value['List_PatientDashboard'][0] + ['UnreadPatientNotificationCount'] > + 99 + ? '99+' + : value['List_PatientDashboard'][0] + ['UnreadPatientNotificationCount'] + .toString(); + + sharedPref.setString(NOTIFICATION_COUNT, notificationCount); + }) + }); + familyFileProvider.getSharedRecordByStatus(); + } + } + } + + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -319,11 +494,15 @@ class _LandingPageState extends State with WidgetsBindingObserver { appBar: AppBar( elevation: 0, textTheme: TextTheme( - headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + headline6: TextStyle( + color: Colors.white, fontWeight: FontWeight.bold), ), title: Text( getText(currentTab).toUpperCase(), - style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), // bold: true, // color: Colors.white, ), @@ -338,28 +517,28 @@ class _LandingPageState extends State with WidgetsBindingObserver { ), notificationCount != '' ? new Positioned( - right: projectViewModel.isArabic ? 35 : 0, - top: 5, - child: new Container( - padding: EdgeInsets.all(4), - decoration: new BoxDecoration( - color: Colors.red, - borderRadius: BorderRadius.circular(20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - notificationCount, - style: new TextStyle( - color: Colors.white, - fontSize: projectViewModel.isArabic ? 8 : 9, - ), - textAlign: TextAlign.center, - ), - ), - ) + right: projectViewModel.isArabic ? 35 : 0, + top: 5, + child: new Container( + padding: EdgeInsets.all(4), + decoration: new BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + notificationCount, + style: new TextStyle( + color: Colors.white, + fontSize: projectViewModel.isArabic ? 8 : 9, + ), + textAlign: TextAlign.center, + ), + ), + ) : SizedBox() ], ); @@ -378,9 +557,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { SETTINGS, ); else - Navigator.of(context).pushNamed( - WELCOME_LOGIN, - ); + login(); }, //do something, ) ], @@ -400,7 +577,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { MedicalProfilePage(), BookingOptions(), MyFamily(isAppbarVisible: false), - ToDo(), + ToDo(isShowAppBar: false), ], // Please do not remove the BookingOptions from this array ), bottomNavigationBar: BottomNavBar( @@ -410,10 +587,10 @@ class _LandingPageState extends State with WidgetsBindingObserver { floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButton: currentTab == 0 ? FloatingButton( - elevation: true, - onTap: () { - _changeCurrentTab(2); - }) + elevation: true, + onTap: () { + _changeCurrentTab(2); + }) : null); } @@ -428,7 +605,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { case 1: return TranslationBase.of(context).medicalProfile; case 2: - return TranslationBase.of(context).mySchedule; + return TranslationBase.of(context).bookAppo; case 3: return TranslationBase.of(context).services; case 4: @@ -452,47 +629,4 @@ class _LandingPageState extends State with WidgetsBindingObserver { } } } - - static Future myBackgroundMessageHandler(Map message) async { - Map myMap = new Map.from(message['data']); - if (message.containsKey('data')) { - print("myBackgroundMessageHandler Inside"); - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - print(LandingPage.incomingCallData.doctorname); - LandingPage.isOpenCallPage = true; - } - - if (message.containsKey('notification')) { - final dynamic notification = message['notification']; - print(notification); - } - } - - void setUserValues(value) async { - if (value != null) sharedPref.setObject(IMEI_USER_DATA, value); - } - - Future getUserInformation() async { - var userInfoJson = await sharedPref.getObject(IMEI_USER_DATA); - return userInfoJson; - } - - checkValue(projectProvider) { - if (projectProvider.searchValue != null) { - _changeCurrentTab(2); - } - } - - registerGeofences() async { - await locator().getAllGeoZones(GeoZonesRequestModel()); - if (await Permission.location.isGranted) { - PlatformBridge().registerHmgGeofences(); - } else { - [Permission.location].request().then((results) async { - if (results[Permission.locationAlways].isGranted){ - PlatformBridge().registerHmgGeofences(); - } - }); - } - } } diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart new file mode 100644 index 00000000..fda83fc2 --- /dev/null +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -0,0 +1,175 @@ +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/profile/profile.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 'package:diplomaticquarterapp/pages/pharmacies/wishlist.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 InkWell( + onTap: (){ + setState(() { + currentTab = 0; + pageController.jumpToPage(0); + }); + }, + child: Container( + height: 2.0, + width: 10.0, + child: Image.asset( + 'assets/images/pharmacy_logo.png', + ), + ), + ); + }, + ), + actions: [ + // IconButton( + // iconSize: 70, + // icon: 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: [ + // TODO mosa_comeback + PharmacyPage(), + PharmacyCategorisePage(), +// OffersCategorisePage(), + WishlistPage(), + PharmacyProfilePage(), +// 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/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index d2e52b72..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( @@ -285,6 +279,9 @@ class _clinic_listState extends State { "12", authenticatedUser.emailAddress, paymentMethod, + authenticatedUser.patientType, + authenticatedUser.firstName, + authenticatedUser.patientID, authenticatedUser, browser); } @@ -317,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']; @@ -333,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 { @@ -363,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(() { @@ -381,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(() { @@ -408,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() { @@ -602,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) { @@ -647,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 e016776e..646158db 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -4,12 +4,16 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.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'; @@ -20,13 +24,14 @@ import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:intl/intl.dart'; import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; +// import 'package:smart_progress_bar/smart_progress_bar.dart'; class ConfirmLogin extends StatefulWidget { @override @@ -69,11 +74,12 @@ class _ConfirmLogin extends State { int fingrePrintBefore; AuthenticatedUserObject authenticatedUserObject = - locator(); + locator(); AppointmentRateViewModel appointmentRateViewModel = - locator(); + locator(); ProjectViewModel projectViewModel; + ToDoCountProviderModel toDoProvider; @override void initState() { @@ -85,6 +91,7 @@ class _ConfirmLogin extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); + toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).confirm, isShowAppBar: true, @@ -96,127 +103,132 @@ class _ConfirmLogin extends State { width: SizeConfig.realScreenWidth, child: Column( children: [ - Expanded( - flex: 3, - child: user != null && isMoreOption == false - ? Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset( - 'assets/images/DQ/dq_logo_icon.png', - height: 90, - width: 90, - ), - AppText( - TranslationBase.of(context).welcomeBack + - ' ' + - user.name, - fontSize: SizeConfig.textMultiplier * 3.5, - ), - AppText( - TranslationBase.of(context).accountInfo, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - Card( - color: Colors.grey[300], - child: Row( - children: [ - Expanded( - child: ListTile( - title: Text( - TranslationBase.of(context).lastLoginAt, - textAlign: TextAlign.center, - ), - subtitle: Text( - user.editedOn != null + user != null && isMoreOption == false + ? Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/DQ/dq_logo_icon.png', + height: 90, + width: 90, + ), + AppText( + TranslationBase.of(context).welcomeBack + + ' ' + + user.name, + fontSize: SizeConfig.textMultiplier * 3.5, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).accountInfo, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 20, + ), + Card( + color: Colors.grey[300], + child: Row( + children: [ + Flexible( + child: ListTile( + title: Text( + TranslationBase.of(context).lastLoginAt, + textAlign: TextAlign.center, + overflow: TextOverflow.ellipsis, + ), + subtitle: Text( + user.editedOn != null + ? formatDate( + DateUtil.convertStringToDate( + user.editedOn)) + : user.createdOn != null ? formatDate( DateUtil.convertStringToDate( - user.editedOn)) + user.createdOn)) : '--', - textAlign: TextAlign.center), - )), - Expanded( - child: ListTile( - title: Text( - TranslationBase.of(context) - .lastLoginWith, - textAlign: TextAlign.center), - subtitle: Text( - getType(user.logInType, context), - textAlign: TextAlign.center), - )) - ], + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.center), + )), + Flexible( + child: ListTile( + title: Text( + TranslationBase.of(context).lastLoginWith, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.center), + subtitle: Text( + getType(user.logInType, context), + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.center), )) - ], - ) - : Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset( - 'assets/images/DQ/dq_logo_icon.png', - height: 90, - width: 90, - ), - this.onlySMSBox == false - ? AppText( - TranslationBase.of(context) - .verifyLoginWith, - fontSize: SizeConfig.textMultiplier * 3.5, - textAlign: TextAlign.left, - ) - : AppText( - TranslationBase.of(context) - .verifyFingerprint2, - fontSize: SizeConfig.textMultiplier * 2.5, - textAlign: TextAlign.start, - ), - ])), + ], + )), + ], + ) + : Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/DQ/dq_logo_icon.png', + height: 90, + width: 90, + ), + this.onlySMSBox == false + ? AppText( + TranslationBase.of(context).verifyLoginWith, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.left, + ) + : AppText( + TranslationBase.of(context) + .verifyFingerprint2, + fontSize: SizeConfig.textMultiplier * 2.5, + textAlign: TextAlign.start, + ), + ]), user != null && isMoreOption == false - ? Expanded( - flex: 2, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: InkWell( - onTap: () => { - authenticateUser( - 3, BiometricType.face.index) - }, - child: getButton(user.logInType))), - Expanded(child: getButton(5)) - ]) - ])) - : Expanded( - flex: 4, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - onlySMSBox == false - ? Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded(child: getButton(3)), - Expanded(child: getButton(2)) - ], - ) - : SizedBox(), - Row( + ? Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Expanded(child: getButton(1)), - Expanded(child: getButton(4)) - ], - ), - ]), - ), + Expanded( + child: InkWell( + onTap: () => { + authenticateUser( + 3, BiometricType.face.index) + }, + child: getButton(user.logInType))), + Expanded(child: getButton(5)) + ]) + ]) + : Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + onlySMSBox == false + ? Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded(child: getButton(3)), + Expanded(child: getButton(2)) + ], + ) + : SizedBox(), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded(child: getButton(1)), + Expanded(child: getButton(4)) + ], + ), + ]), Expanded( flex: 1, child: Column( @@ -262,6 +274,7 @@ class _ConfirmLogin extends State { } authenticateUser(type, isActive) { + GifLoaderDialogUtils.showMyDialog(context); if (type == 2 || type == 3) { fingrePrintBefore = type; } @@ -308,7 +321,6 @@ class _ConfirmLogin extends State { req.logInTokenID = ""; var request = CheckPatientAuthenticationReq.fromJson(req.toJson()); - GifLoaderDialogUtils.showMyDialog(context); sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); authService @@ -353,8 +365,11 @@ class _ConfirmLogin extends State { context, type, this.mobileNumber, - (value) => {this.checkActivationCode(value: value)}, + (value) { + this.checkActivationCode(value: value); + }, () => { + Navigator.pop(context), print('Faild..'), }, ).displayDialog(context); @@ -367,68 +382,47 @@ class _ConfirmLogin extends State { localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true); - - if (authenticated == true) { - if(user.logInType==2 || user.logInType ==3){ - this.checkActivationCode(); - }else{ - var request = this.getCommonRequest(type: type); - this.getMobileInfo(request); - } - + if (authenticated == true) { + if (user != null && (user.logInType == 2 || user.logInType == 3)) { + this.checkActivationCode(); + } else { + var request = this.getCommonRequest(type: type); + this.getMobileInfo(request); + } } } } getMobileInfo(request) { - this - .authService - .getLoginInfo(request) - .then((result) => { - if (result['SMSLoginRequired'] == false) - { - this.loginTokenID = result.logInTokenID, - this.patientOutSA = result.patientOutSA, - // sms for register the biometric - if (result.isSMSSent) - { - this.onlySMSBox = false, - //this.button(); - } - else - {checkActivationCode()} - } - else - { - if (result['IsAuthenticated'] == true) - { - setState(() { - isMoreOption = true; - this.onlySMSBox = true; - // this.fingrePrintBefore = true; - }), - - //sharedPref.setBool(ONLY_SMS, true), - // this.cs.sharedService.setSharedData(true, AuthenticationService.ONLY_SMS); - //this.cs.sharedService.setSharedData(this.selectedOption, AuthenticationService.FINGUREPRINT_BEFORE); - // this.cs.confirmLogin(); - //this.button(); - } - // else - // { - // // this.cs.presentAlert(result.ErrorEndUserMessage); - // } - } - }) - .catchError((err) { + // GifLoaderDialogUtils.showMyDialog(context); + this.authService.getLoginInfo(request).then((result) { + GifLoaderDialogUtils.hideDialog(context); + if (result['SMSLoginRequired'] == false) { + this.loginTokenID = result.logInTokenID; + this.patientOutSA = result.patientOutSA; + // sms for register the biometric + if (result.isSMSSent) { + this.onlySMSBox = false; + //this.button(); + } else { + checkActivationCode(); + } + } else { + if (result['IsAuthenticated'] == true) { + setState(() { + isMoreOption = true; + this.onlySMSBox = true; + // this.fingrePrintBefore = true; + }); + } + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } - setUser() async {} - setDefault() async { if (await sharedPref.getObject(IMEI_USER_DATA) != null) user = SelectDeviceIMEIRES.fromJson( @@ -460,7 +454,9 @@ class _ConfirmLogin extends State { this.deviceToken = await sharedPref.getString(PUSH_TOKEN); this.lastLogin = await sharedPref.getInt(LAST_LOGIN) != null ? await sharedPref.getInt(LAST_LOGIN) - : user.logInType !=null ? user.logInType : null; + : user != null + ? user.logInType + : null; //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); } @@ -514,8 +510,8 @@ class _ConfirmLogin extends State { .then((result) => { if (result is Map) { - - result = CheckActivationCode.fromJson(result), + projectViewModel.setPrivilege(privilegeList: result), + result = CheckActivationCode.fromJson(result), if (this.registerd_data != null && this.registerd_data.isRegister == true) { @@ -525,8 +521,11 @@ class _ConfirmLogin extends State { } else { + sharedPref.remove(FAMILY_FILE), result.list.isFamily = false, userData = result.list, + // sharedPref.setString( + // BLOOD_TYPE, result['PatientBloodType']), sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(USER_PROFILE, result.list), loginTokenID = result.logInTokenID, @@ -547,11 +546,13 @@ class _ConfirmLogin extends State { .catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); + Future.delayed(Duration(seconds: 1), () { + AppToast.showErrorToast(message: err); + }); }); } checkIfUserAgreedBefore(CheckActivationCode result) { - print(result); if (result.isNeedUserAgreement == true) { //move to agreement page. } else { @@ -568,12 +569,57 @@ class _ConfirmLogin extends State { }); } - goToHome() { + getToDoCount() { + toDoProvider.setState(0, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } else {} + }).catchError((err) { + print(err); + }); + } + goToHome() async { + await authenticatedUserObject.getUser(getUser: true); authenticatedUserObject.isLogin = true; appointmentRateViewModel.isLogin = true; projectViewModel.isLogin = true; - Navigator.of(context).pushNamed(HOME); + projectViewModel.user = authenticatedUserObject.user; + Provider.of(context, listen: false) + .setUser(authenticatedUserObject.user); + getToDoCount(); + appointmentRateViewModel + .getIsLastAppointmentRatedList() + .then((value) => { + getToDoCount(), + // GifLoaderDialogUtils.hideDialog(context), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false) + } + }) + .catchError((err) { + print(err); + //GifLoaderDialogUtils.hideDialog(context); + }); + // SMSOTP.showLoadingDialog(context, false), } loading(flag) { @@ -588,10 +634,11 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(4, true)}, child: RoundedContainer( + height: 140, borderColor: Colors.grey, showBorder: true, child: Padding( - padding: EdgeInsets.fromLTRB(25, 10, 25, 10), + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), child: Column( children: [ Image.asset( @@ -614,10 +661,11 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(1, true)}, child: RoundedContainer( + height: 140, borderColor: Colors.grey, showBorder: true, child: Padding( - padding: EdgeInsets.fromLTRB(20, 10, 20, 10), + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -626,12 +674,19 @@ class _ConfirmLogin extends State { height: SizeConfig.imageSizeMultiplier * 13, width: SizeConfig.imageSizeMultiplier * 16, ), - SizedBox( - height: 20, - ), + projectViewModel.isArabic + ? SizedBox( + height: 20, + ) + : SizedBox( + height: 20, + ), AppText( TranslationBase.of(context).verifySMS, - fontSize: SizeConfig.textMultiplier * 2, + fontSize: projectViewModel.isArabic + ? SizeConfig.textMultiplier * 1.8 + : SizeConfig.textMultiplier * 2, + textAlign: TextAlign.center, ) ], ), @@ -641,13 +696,14 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(2, BiometricType.fingerprint.index)}, child: RoundedContainer( + height: 140, backgroundColor: BiometricType.fingerprint.index == 1 ? Colors.white : Colors.white.withOpacity(.7), borderColor: Colors.grey, showBorder: true, child: Padding( - padding: EdgeInsets.fromLTRB(25, 10, 25, 10), + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), child: Column( children: [ Image.asset( @@ -670,13 +726,14 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(3, BiometricType.face.index)}, child: RoundedContainer( + height: 140, backgroundColor: checkIfBiometricAvailable(BiometricType.face) ? Colors.white : Colors.white.withOpacity(.7), borderColor: Colors.grey, showBorder: true, child: Padding( - padding: EdgeInsets.fromLTRB(20, 10, 20, 10), + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -705,13 +762,14 @@ class _ConfirmLogin extends State { }) }, child: RoundedContainer( + height: 140, backgroundColor: BiometricType.fingerprint.index == 1 ? Colors.white : Colors.white.withOpacity(.7), borderColor: Colors.grey, showBorder: true, child: Padding( - padding: EdgeInsets.fromLTRB(0, 0, 0, 5), + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), child: Column( children: [ Image.asset( @@ -719,9 +777,13 @@ class _ConfirmLogin extends State { height: SizeConfig.imageSizeMultiplier * 13, width: SizeConfig.imageSizeMultiplier * 16, ), - SizedBox( - height: 20, - ), + projectViewModel.isArabic + ? SizedBox( + height: 15, + ) + : SizedBox( + height: 10, + ), AppText( TranslationBase.of(context).moreVerification, fontSize: SizeConfig.textMultiplier * 2, @@ -755,7 +817,7 @@ class _ConfirmLogin extends State { bool checkIfBiometricAvailable(BiometricType biometricType) { bool isAvailable = false; - if(_availableBiometrics != null) { + if (_availableBiometrics != null) { for (var i = 0; i < _availableBiometrics.length; i++) { if (biometricType == _availableBiometrics[i]) isAvailable = true; } diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index dcd58b9d..69a66d9e 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -14,159 +14,168 @@ class LoginType extends StatelessWidget { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).login, + appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, isShowDecPage: false, - body: Padding( - padding: EdgeInsets.all(20), - child: Column( - children: [ - Expanded( - flex: 4, - child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset( - 'assets/images/DQ/dq_logo_icon.png', - height: 90, - width: 90, - ), - AppText( - TranslationBase.of(context).logintypeRadio, - fontSize: SizeConfig.textMultiplier * 3.5, - textAlign: TextAlign.start, - marginBottom: 20.0, - marginTop: 20.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, + body: SingleChildScrollView( + child: Container( + padding: + EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), + height: SizeConfig.realScreenHeight * .9, + width: SizeConfig.realScreenWidth, + child: Column( + children: [ + Expanded( + flex: 4, + child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: InkWell( - onTap: () => { - LoginType.loginType = 1, - Navigator.of(context) - .pushNamed(LOGIN_PAGE) - }, - child: RoundedContainer( - borderColor: Colors.grey, - showBorder: true, - child: Padding( - padding: EdgeInsets.fromLTRB( - 20, 10, 20, 10), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/id_card_icon.png', - height: SizeConfig - .imageSizeMultiplier * - 12, - width: SizeConfig - .imageSizeMultiplier * - 15, - ), - SizedBox( - height: 20, + Image.asset( + 'assets/images/DQ/logo.png', + height: 90, + width: 90, + ), + AppText( + TranslationBase.of(context).logintypeRadio, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.start, + marginBottom: 20.0, + marginTop: 20.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () => { + LoginType.loginType = 1, + Navigator.of(context) + .pushNamed(LOGIN_PAGE) + }, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB( + 20, 10, 20, 10), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/id_card_icon.png', + height: SizeConfig + .imageSizeMultiplier * + 12, + width: SizeConfig + .imageSizeMultiplier * + 15, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .idNo, + fontSize: SizeConfig + .textMultiplier * + 2, + fontWeight: FontWeight.bold, + ) + ], ), - AppText( - TranslationBase.of(context) - .idNo, - fontSize: - SizeConfig.textMultiplier * + )))), + Expanded( + child: InkWell( + onTap: () => { + LoginType.loginType = 2, + Navigator.of(context) + .pushNamed(LOGIN_PAGE) + }, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB( + 25, 10, 25, 10), + child: Column( + children: [ + Image.asset( + 'assets/images/my_file_white_icon.png', + height: SizeConfig + .imageSizeMultiplier * + 12, + width: SizeConfig + .imageSizeMultiplier * + 15, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .fileNo, + fontSize: SizeConfig + .textMultiplier * 2, - fontWeight: FontWeight.bold, - ) - ], - ), - )))), - Expanded( + fontWeight: FontWeight.bold, + ) + ], + ), + )))) + ], + ), + SizedBox( + height: 25, + ), + Divider( + color: Colors.grey, + height: 2, + ), + Center( child: InkWell( onTap: () => { - LoginType.loginType = 2, Navigator.of(context) - .pushNamed(LOGIN_PAGE) + .pushNamed(FORGOT_PASSWORD) }, - child: RoundedContainer( - borderColor: Colors.grey, - showBorder: true, - child: Padding( - padding: EdgeInsets.fromLTRB( - 25, 10, 25, 10), - child: Column( - children: [ - Image.asset( - 'assets/images/my_file_white_icon.png', - height: SizeConfig - .imageSizeMultiplier * - 12, - width: SizeConfig - .imageSizeMultiplier * - 15, - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context) - .fileNo, - fontSize: - SizeConfig.textMultiplier * - 2, - fontWeight: FontWeight.bold, - ) - ], - ), - )))) - ], - ), - SizedBox(height: 25,), - Divider( - color: Colors.grey, - height: 2, - ), - Center( - child: InkWell( - onTap: () => { - Navigator.of(context) - .pushNamed(FORGOT_PASSWORD) - }, - child: AppText( - TranslationBase.of(context).forgotPassword, - fontSize: SizeConfig.textMultiplier * 2.5, - marginTop: 20.0, - underline: true))) - ]), - ), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Divider( - color: Colors.grey, - height: 2, - ), - SizedBox(height: 10,), - Row( + child: AppText( + TranslationBase.of(context) + .forgotPassword, + fontSize: + SizeConfig.textMultiplier * 2.5, + marginTop: 20.0, + underline: true))) + ]), + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, children: [ - - Expanded( - child: DefaultButton( - TranslationBase.of(context).registerNow, - () => { - Navigator.of(context).pushNamed( - REGISTER, - ) - }, - )), + Divider( + color: Colors.grey, + height: 2, + ), + SizedBox( + height: 10, + ), + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).registerNow, + () => { + Navigator.of(context).pushNamed( + REGISTER, + ) + }, + )), + ], + ), ], - ), - ], - )) - ], - ))); + )) + ], + )))); } } diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 28961843..c2a943d2 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; @@ -11,6 +12,7 @@ import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -26,7 +28,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.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 Login extends StatefulWidget { @override @@ -43,11 +44,14 @@ class _Login extends State { final authService = new AuthProvider(); var sharedPref = new AppSharedPreferences(); bool isLoading = false; - AppointmentRateViewModel appointmentRateViewModel = locator(); + AppointmentRateViewModel appointmentRateViewModel = + locator(); - AuthenticatedUserObject authenticatedUserObject = locator(); + AuthenticatedUserObject authenticatedUserObject = + locator(); ProjectViewModel projectViewModel; + ToDoCountProviderModel toDoProvider; @override void initState() { @@ -64,6 +68,7 @@ class _Login extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); + toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, @@ -88,15 +93,25 @@ class _Login extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ MobileNo(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( + keyboardType: TextInputType.number, + 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, + ))) ], ), ), @@ -118,7 +133,9 @@ class _Login extends State { child: DefaultButton( TranslationBase.of(context).login, () => {this.startLogin()}, - color: isButtonDisabled == true ? Colors.grey : Colors.grey[900], + color: isButtonDisabled == true + ? Colors.grey + : Colors.grey[900], textColor: Colors.white, )) ], @@ -139,17 +156,14 @@ class _Login extends State { } void validateForm() { - //TODO fix login - if (util.validateIDBox(nationalIDorFile.text, loginType) == true /*&& - mobileNo.length >= 9 */ - && + if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { setState(() { isButtonDisabled = false; }); } else { setState(() { - isButtonDisabled = false; + isButtonDisabled = true; }); } } @@ -225,24 +239,27 @@ class _Login extends State { request['PatientID'] = int.parse(nationalIDorFile.text); } // request.isRegister = false; - this.authService.checkActivationCode(request, code).then((result) => { - // Register GeoZones after login - registerGeoZones(), - - result = CheckActivationCode.fromJson(result), - result.list.isFamily = false, - this.sharedPref.setObject(USER_PROFILE, result.list), - this.sharedPref.setObject(MAIN_USER, result.list), - this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - this.sharedPref.setString(TOKEN, result.authenticationTokenID), - authenticatedUserObject.getUser(), - // authenticatedUserObject.user = AuthenticatedUser.fromJson(result.list), - authenticatedUserObject.isLogin = true, - appointmentRateViewModel.isLogin = true, - projectViewModel.isLogin = true, + this.authService.checkActivationCode(request, code).then((result) async { + sharedPref.remove(FAMILY_FILE); + // Register GeoZones after login + registerGeoZones(); + projectViewModel.setPrivilege(privilegeList: result); + result = CheckActivationCode.fromJson(result); + result.list.isFamily = false; + // this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']), + this.sharedPref.setObject(USER_PROFILE, result.list); + this.sharedPref.setObject(MAIN_USER, result.list); + this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); + this.sharedPref.setString(TOKEN, result.authenticationTokenID); + await authenticatedUserObject.getUser(getUser: true); + authenticatedUserObject.isLogin = true; + appointmentRateViewModel.isLogin = true; + projectViewModel.isLogin = true; + projectViewModel.user = authenticatedUserObject.user; appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { + getToDoCount(), GifLoaderDialogUtils.hideDialog(context), if (appointmentRateViewModel.isHaveAppointmentNotRate) { @@ -266,11 +283,24 @@ class _Login extends State { .catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); - }), - // SMSOTP.showLoadingDialog(context, false), + }); + }); } + getToDoCount() { + toDoProvider.setState(0, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } else {} + }).catchError((err) { + print(err); + }); + } + void registerGeoZones() { projectViewModel.platformBridge().registerHmgGeofences(); } diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index ea47a4fa..131db748 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -72,112 +72,113 @@ class _Register extends State { onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), - Container( - child: TextFields( - controller: nationalIDorFile, - onChanged: (value) => validateForm(), - prefixIcon: - Icon(Icons.chrome_reader_mode, color: Color(0xFF40ACC9)), - padding: EdgeInsets.only( - top: 20, bottom: 20, left: 10, right: 10), - hintText: TranslationBase.of(context).nationalID, - )), - Row( + Container( + child: TextFields( + controller: nationalIDorFile, + onChanged: (value) => validateForm(), + keyboardType: TextInputType.number, + prefixIcon: Icon(Icons.chrome_reader_mode, + color: Color(0xFF40ACC9)), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + hintText: TranslationBase.of(context).nationalID, + )), + Row( + children: [ + Expanded( + child: Row( children: [ - Expanded( - child: Row( - children: [ - Radio( - value: 1, - groupValue: isHijri, - onChanged: (value) { - setState(() { - isHijri = value; - }); - validateForm(); - }, - ), - Text(TranslationBase.of(context).hijriDate), - ], - ), + Radio( + value: 1, + groupValue: isHijri, + onChanged: (value) { + setState(() { + isHijri = value; + }); + validateForm(); + }, ), - Expanded( - child: Row( - children: [ - Radio( - value: 0, - groupValue: isHijri, - onChanged: (value) { - setState(() { - isHijri = value; - }); - validateForm(); - }, - ), - Text(TranslationBase.of(context) - .gregorianDate), - ], - ), + Text(TranslationBase.of(context).hijriDate), + ], + ), + ), + Expanded( + child: Row( + children: [ + Radio( + value: 0, + groupValue: isHijri, + onChanged: (value) { + setState(() { + isHijri = value; + }); + validateForm(); + }, ), + Text(TranslationBase.of(context).gregorianDate), ], ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( width: SizeConfig.realScreenWidth * .9, - height:60, - child: isHijri == 1 - ? TextFields( - onChanged: (value) => {dob = value}, - hintText: 'DD/MM/YYYY', - prefixIcon: Icon(Icons.date_range), - ) - : RaisedButton.icon( - shape: RoundedRectangleBorder( + height: 60, + child: isHijri == 1 + ? TextFields( + onChanged: (value) => {dob = value}, + hintText: 'DD/MM/YYYY', + prefixIcon: Icon(Icons.date_range), + ) + : RaisedButton.icon( + shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(15.0), - - ), - color:Colors.white, - onPressed: () => { - if (isHijri != null) - _selectDate(context) - }, - icon: Icon(Icons.date_range), - label: Text(selectedDate != null - ? "${selectedDate.toLocal()}" - .split(' ')[0] - : TranslationBase.of(context).dob))) - ]) + ), + color: Colors.white, + onPressed: () => { + if (isHijri != null) + _selectDate(context) + }, + icon: Icon(Icons.date_range), + label: Text(selectedDate != null + ? "${selectedDate.toLocal()}" + .split(' ')[0] + : TranslationBase.of(context).dob))) + ]) + ], + ), + ), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Divider( + color: Colors.grey, + height: 2, + ), + SizedBox( + height: 10, + ), + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).registerNow, + () => {startRegistration()}, + textColor: Colors.white, + color: isButtonDisabled == true + ? Colors.grey + : Colors.grey[900])) ], ), - ), - Expanded( - flex: 2, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Divider( - color: Colors.grey, - height: 2, - ), - SizedBox(height: 10,), - Row( - children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context).registerNow, - () => {startRegistration()}, - textColor: Colors.white, - color: isButtonDisabled == true - ? Colors.grey - : Colors.grey[900])) - ], - ), - ], - )) - ]), - ))); + ], + )) + ]), + ))); } Future _selectDate(BuildContext context) async { @@ -215,7 +216,8 @@ class _Register extends State { this .authService .checkPatientForRegisteration(request) - .then((response) => {checkUserStatus(response, request)}).catchError((err) { + .then((response) => {checkUserStatus(response, request)}) + .catchError((err) { GifLoaderDialogUtils.hideDialog(context); ConfirmDialog dialog = new ConfirmDialog( context: context, @@ -223,15 +225,13 @@ class _Register extends State { okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => { - ConfirmDialog.closeAlertDialog(context), - Navigator.of(context).pushNamed( - REGISTER, - ), - - }, + ConfirmDialog.closeAlertDialog(context), + Navigator.of(context).pushNamed( + REGISTER, + ), + }, cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); dialog.showAlertDialog(context); - }); } @@ -256,7 +256,7 @@ class _Register extends State { var nRequest = request.toJson(); nRequest['LogInTokenID'] = response['LogInTokenID']; if (response['hasFile'] == true) { - // AppToast.showErrorToast(message: response['ErrorEndUserMessage']); + // AppToast.showErrorToast(message: response['ErrorEndUserMessage']); AlertDialogBox( context: context, confirmMessage: response['ErrorEndUserMessage'], @@ -298,7 +298,7 @@ class _Register extends State { // DOB: this.dateOption === '1' ? this.dateOfBirth : moment(this.dateOfBirth).format('DD/MM/YYYY'), // IsHijri: Number(this.dateOption) // } - showLoader(true); + GifLoaderDialogUtils.showMyDialog(context); var request = CheckUserStatusRequest(); request.patientIdentificationID = nationalIDorFile.text; request.dOB = isHijri == 1 @@ -307,7 +307,7 @@ class _Register extends State { request.isHijri = isHijri; request.patientOutSA = countryCode == '966' ? 0 : 1; this.authService.checkUserStatus(request).then((result) => { - showLoader(false), + GifLoaderDialogUtils.hideDialog(context), if (result is Map) { result = CheckUserStatusResponse.fromJson(result), diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index 419df302..4b8e90ae 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -36,7 +37,7 @@ class _WelcomeLogin extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset('assets/images/DQ/dq_logo_icon.png', + Image.asset('assets/images/DQ/logo.png', height: 90, width: 90), Text( TranslationBase.of(context).welcome, @@ -75,7 +76,7 @@ class _WelcomeLogin extends State { LOGIN_TYPE, ), }, - color: Color(0xFF40ACC9), + color: Color(0xFFc5272c), textColor: Colors.white, )) ], 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_home_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart index 5f1938fd..902225b1 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart @@ -77,8 +77,6 @@ class _AskDoctorHomPageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - //indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), unselectedLabelColor: Colors.grey[800], diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index f19b03ed..a3005db5 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'; @@ -29,7 +31,6 @@ import 'new_text_Field.dart'; enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } - class AdvancePaymentPage extends StatefulWidget { @override _AdvancePaymentPageState createState() => _AdvancePaymentPageState(); @@ -50,10 +51,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 @@ -62,7 +70,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( @@ -102,13 +112,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), @@ -140,17 +150,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'); }, @@ -206,6 +215,7 @@ class _AdvancePaymentPageState extends State { SizedBox( height: 12, ), + if(model.user!=null) NewTextFields( hintText: TranslationBase.of(context).depositorEmail, initialValue: model.user.emailAddress, @@ -228,7 +238,7 @@ class _AdvancePaymentPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery.of(context).size.height * 0.13, width: double.infinity, padding: EdgeInsets.all(12), child: SecondaryButton( @@ -238,13 +248,36 @@ class _AdvancePaymentPageState extends State { _fileTextController.text.isEmpty || _selectedHospital == null, onTap: () { + var mobileNum; + var patientName; + + if (beneficiaryType == BeneficiaryType.MyFamilyFiles) { + mobileNum = selectedPatientFamily.mobileNumber; + patientName = selectedPatientFamily.patientName; + } + + if (beneficiaryType == BeneficiaryType.MyAccount) { + mobileNum = model.user.mobileNumber; + patientName = model.user.firstName; + } + + if (beneficiaryType == BeneficiaryType.OtherAccount) { + mobileNum = _selectedPatientInfo.mobileNumber; + patientName = _selectedPatientInfo.fullName; + } + advanceModel.fileNumber = _fileTextController.text; advanceModel.hospitalsModel = _selectedHospital; advanceModel.note = _notesTextController.text; advanceModel.email = email ?? model.user.emailAddress; advanceModel.amount = amount; - - model.getPatientInfoByPatientIDAndMobileNumber().then((value) { + 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); @@ -268,9 +301,7 @@ class _AdvancePaymentPageState extends State { }, ); } - }).showProgressBar( - text: "Loading", - backgroundColor: Colors.blue.withOpacity(0.6)); + }); }, ), )), @@ -331,22 +362,22 @@ class _AdvancePaymentPageState extends State { void confirmSelectFamilyDialog( List getAllSharedRecordsByStatusList) { - if(getAllSharedRecordsByStatusList.isNotEmpty) - showDialog( - context: context, - child: SelectPatientFamilyDialog( - getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList, - selectedPatientFamily: selectedPatientFamily, - onValueSelected: (value) { - setState(() { - selectedPatientFamily = value; - _fileTextController.text = - selectedPatientFamily.patientID.toString(); - advanceModel.depositorName = value.patientName; - }); - }, - ), - ); + if (getAllSharedRecordsByStatusList.isNotEmpty) + showDialog( + context: context, + child: SelectPatientFamilyDialog( + getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList, + selectedPatientFamily: selectedPatientFamily, + onValueSelected: (value) { + setState(() { + selectedPatientFamily = value; + _fileTextController.text = + selectedPatientFamily.responseID.toString(); + advanceModel.depositorName = value.patientName; + }); + }, + ), + ); } String getBeneficiaryType() { diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index dbc2537f..8a69bf5d 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'; @@ -137,7 +136,11 @@ class ConfirmPaymentPage extends StatelessWidget { ), NewTextFields( hintText: TranslationBase.of(context).depositorName, - initialValue: advanceModel.depositorName, + initialValue: model.user.firstName + + " " + + model.user.middleName + + " " + + model.user.lastName, isEnabled: false, ), SizedBox( @@ -153,24 +156,25 @@ class ConfirmPaymentPage extends StatelessWidget { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery.of(context).size.height * 0.13, width: double.infinity, padding: EdgeInsets.all(12), child: SecondaryButton( textColor: Colors.white, + color: Theme.of(context).primaryColor, 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)); + }); }, ), ), @@ -217,6 +221,9 @@ class ConfirmPaymentPage extends StatelessWidget { advanceModel.hospitalsModel.iD.toString(), advanceModel.email, paymentMethod, + patientInfoAndMobileNumber.patientType, + advanceModel.patientName, + advanceModel.fileNumber, authenticatedUser, browser); } @@ -276,6 +283,9 @@ class ConfirmPaymentPage extends StatelessWidget { res['Amount'], res['Fort_id'], res['PaymentMethod'], + patientInfoAndMobileNumber.patientType, + advanceModel.patientName, + advanceModel.fileNumber, AppGlobal.context) .then((res) { print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); diff --git a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart index 10d61f68..380f250c 100644 --- a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart +++ b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart @@ -175,7 +175,7 @@ class _ConfirmSMSDialogState extends State { fontSize: SizeConfig.textMultiplier * 3, ), focusNode: focusD1, - maxLength: 1, + //maxLength: 1, controller: digit1, textAlign: TextAlign.center, keyboardType: TextInputType.number, @@ -200,7 +200,7 @@ class _ConfirmSMSDialogState extends State { focusNode: focusD2, controller: digit2, textInputAction: TextInputAction.next, - maxLength: 1, + //maxLength: 1, textAlign: TextAlign.center, style: TextStyle( fontSize: SizeConfig.textMultiplier * 3, @@ -227,7 +227,7 @@ class _ConfirmSMSDialogState extends State { focusNode: focusD3, controller: digit3, textInputAction: TextInputAction.next, - maxLength: 1, + //maxLength: 1, textAlign: TextAlign.center, style: TextStyle( fontSize: SizeConfig.textMultiplier * 3, @@ -253,7 +253,7 @@ class _ConfirmSMSDialogState extends State { child: TextFormField( focusNode: focusD4, controller: digit4, - maxLength: 1, + // maxLength: 1, textAlign: TextAlign.center, style: TextStyle( fontSize: SizeConfig.textMultiplier * 3, diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index 421e2bed..1edbcbf6 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,83 +13,95 @@ 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, - body: Container( - margin: EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).balanceAmount, - color: Colors.black, - bold: true, - ), - SizedBox( - height: 15, - ), - Container( - padding: EdgeInsets.all(8), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - color: HexColor('#B61422'), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(7), + imagesInfo: imagesInfo, + description: TranslationBase.of(context).infoMyBalance, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).balanceAmount, + color: Colors.black, + bold: true, ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - TranslationBase.of(context).totalBalance, - color: Colors.white, - ), - Texts( - '${model.totalAdvanceBalanceAmount ?? 0} SAR', - color: Colors.white, - bold: true, - ), - ], + SizedBox( + height: 15, ), - ), - SizedBox( - height: 9, - ), - ...List.generate( - model.patientAdvanceBalanceAmountList.length, - (index) => Container( + Container( padding: EdgeInsets.all(8), + width: double.infinity, height: 65, - margin: EdgeInsets.only(top: 8), decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context).primaryColor, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(7), ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(model.patientAdvanceBalanceAmountList[index] - .projectDescription), + Texts( - '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} SAR', + '${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar, + color: Colors.white, bold: true, ), + Texts( + TranslationBase.of(context).totalBalance, + color: Colors.white, + ), ], ), ), - ), - ], + SizedBox( + height: 9, + ), + ...List.generate( + model.patientAdvanceBalanceAmountList.length, + (index) => Container( + padding: EdgeInsets.all(8), + height: 65, + margin: EdgeInsets.only(top: 8), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + + Texts( + '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} '+TranslationBase.of(context).sar, + bold: true, + ), + Texts(model.patientAdvanceBalanceAmountList[index] + .projectDescription), + ], + ), + ), + ), + SizedBox(height: MediaQuery.of(context).size.height * 0.13 ,) + ], + ), ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery.of(context).size.height * 0.12, + color: Colors.white, width: double.infinity, padding: EdgeInsets.all(12), child: SecondaryButton( diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart index 9687b931..c8fad3ce 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( @@ -43,7 +48,6 @@ class DoctorHomePage extends StatelessWidget { leading: Radio( value: FilterType.Clinic, groupValue: model.filterType, - activeColor: Colors.red[800], onChanged: (FilterType value) { model.setFilterType(value); }, @@ -60,7 +64,6 @@ class DoctorHomePage extends StatelessWidget { leading: Radio( value: FilterType.Hospital, groupValue: model.filterType, - activeColor: Colors.red[800], onChanged: (FilterType value) => model.setFilterType(value), ), diff --git a/lib/pages/medical/eye/ContactLensPage.dart b/lib/pages/medical/eye/ContactLensPage.dart index 26503c89..373c3c79 100644 --- a/lib/pages/medical/eye/ContactLensPage.dart +++ b/lib/pages/medical/eye/ContactLensPage.dart @@ -1,10 +1,12 @@ import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class ContactLensPage extends StatelessWidget { final ListHISGetContactLensPerscription listHISGetContactLensPerscription; @@ -14,6 +16,7 @@ class ContactLensPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( body: SingleChildScrollView( child: Container( @@ -82,6 +85,7 @@ class ContactLensPage extends StatelessWidget { SizedBox( height: 17, ), + if(projectViewModel.havePrivilege(15)) Container( width: double.infinity, child: SecondaryButton( diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index 18cc9b77..3f4df55f 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -75,7 +75,6 @@ class _EyeHomePageState extends State controller: _tabController, indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 01cb6725..a251a1ce 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -1,36 +1,50 @@ 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/widgets/data_display/medical/laboratory_result_widget.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/data_display/medical/LabResult/laboratory_result_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class LaboratoryResultPage extends StatelessWidget { +class LaboratoryResultPage extends StatefulWidget { final PatientLabOrders patientLabOrders; LaboratoryResultPage({Key key, this.patientLabOrders}); + @override + _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); +} + +class _LaboratoryResultPageState extends State { + + @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getLaboratoryResult( - invoiceNo: patientLabOrders.invoiceNo, - clinicID: patientLabOrders.clinicID, - projectID: patientLabOrders.projectID, - orderNo: patientLabOrders.orderNo), - builder: (_, model, widget) => AppScaffold( + invoiceNo: widget.patientLabOrders.invoiceNo, + clinicID: widget.patientLabOrders.clinicID, + projectID: widget.patientLabOrders.projectID, + orderNo: widget.patientLabOrders.orderNo), + builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Laboratory result', + appBarTitle: TranslationBase.of(context).labResults, baseViewModel: model, body: Scaffold( body: ListView.builder( itemBuilder: (context, index) => LaboratoryResultWidget( - onTap: () => model.sendLabReportEmail(patientLabOrder: patientLabOrders), - billNo: patientLabOrders.invoiceNo, + onTap: ()async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders,mes: TranslationBase.of(context).sendSuc); + GifLoaderDialogUtils.hideDialog(context); + }, + billNo: widget.patientLabOrders.invoiceNo, details: model.patientLabSpecialResult[index].resultDataHTML, - orderNo: patientLabOrders.orderNo, - patientLabOrder: patientLabOrders, + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, ), itemCount: model.patientLabSpecialResult.length, ), diff --git a/lib/pages/medical/labs/labs_home_page.dart b/lib/pages/medical/labs/labs_home_page.dart index 68dc180e..ce78a7dc 100644 --- a/lib/pages/medical/labs/labs_home_page.dart +++ b/lib/pages/medical/labs/labs_home_page.dart @@ -1,5 +1,7 @@ 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/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -9,12 +11,17 @@ 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:provider/provider.dart'; import 'laboratory_result_page.dart'; class LabsHomePage extends StatelessWidget { + List imagesInfo =List(); + @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(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 +29,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( @@ -40,7 +48,6 @@ class LabsHomePage extends StatelessWidget { leading: Radio( value: FilterType.Clinic, groupValue: model.filterType, - activeColor: Colors.red[800], onChanged: (FilterType value) { model.setFilterType(value); }, @@ -57,7 +64,6 @@ class LabsHomePage extends StatelessWidget { leading: Radio( value: FilterType.Hospital, groupValue: model.filterType, - activeColor: Colors.red[800], onChanged: (FilterType value) => model.setFilterType(value), ), @@ -86,10 +92,11 @@ class LabsHomePage extends StatelessWidget { ), ),isInOutPatient: labOrder.isInOutPatient, name: labOrder.doctorName, + billNo: ' ${labOrder.invoiceNo}', profileUrl: labOrder.doctorImageURL, - subName: TranslationBase.of(context).billNo+' ${labOrder.invoiceNo}', - date: DateUtil.getMonthDayYearDateFormatted( - labOrder.orderDate), + subName: labOrder.projectName, + isLiveCareAppointment: labOrder.isLiveCareAppointment, + date: projectViewModel.isArabic?DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate):DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate), ); }).toList(), ), diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 3260303c..ade69f45 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -7,6 +7,9 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.dart'; import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart'; @@ -17,6 +20,7 @@ import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -50,12 +54,15 @@ class MedicalProfilePage extends StatefulWidget { class _MedicalProfilePageState extends State { var authProvider = new AuthProvider(); - + List medical=List(); + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); var appoCountProvider = Provider.of(context); - return BaseView( + + List myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel,context: context,count: appoCountProvider.count,isLogin: projectViewModel.isLogin); + return BaseView( onModelReady: (model) => model.getAppointmentHistory(), builder: (_, model, widget) => AppScaffold( isShowDecPage: false, @@ -81,403 +88,44 @@ class _MedicalProfilePageState extends State { ), if (model.isLogin) ListView.builder( - itemBuilder: (context, index) => TimeLineWidget( + itemBuilder: (context, index) => + TimeLineWidget( isUp: index % 2 == 1, - appoitmentAllHistoryResul: model.appoitmentAllHistoryResultList[index], + appoitmentAllHistoryResul: model + .appoitmentAllHistoryResultList[index], ), - itemCount: model.appoitmentAllHistoryResultList.length, + itemCount: model + .appoitmentAllHistoryResultList.length, scrollDirection: Axis.horizontal, reverse: !projectViewModel.isArabic, ), ], ), ), + SizedBox(height: 50,), Padding( padding: EdgeInsets.symmetric(vertical: 5.0), - child: Column( - children: [ - if (model.isLogin) - Container( - width: double.infinity, - height: 55, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: MyAppointments(), - ), - ); - }, - child: authProvider.isLogin - ? Stack(children: [ - MedicalProfileItem( - title: TranslationBase.of(context).myAppointments, - imagePath: 'my_appointment_icon.png', - subTitle: TranslationBase.of(context).myAppointmentsList, - hasBadge: true, - ), - Positioned( - right: 0.0, - child: Badge( - toAnimate: false, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, - badgeColor: Color(0xFF40ACC9).withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(appoCountProvider.count.toString(), style: TextStyle(color: Colors.white, fontSize: 16.0)), - ), - ), - ), - ]) - : MedicalProfileItem( - title: TranslationBase.of(context).myAppointments, - imagePath: 'my_appointment_icon.png', - subTitle: TranslationBase.of(context).myAppointmentsList, - hasBadge: true, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).lab, - imagePath: 'lab_result_icon.png', - subTitle: TranslationBase.of(context).labSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => Navigator.push(context, FadePage(page: RadiologyHomePage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).radiology, - imagePath: 'radiology_icon.png', - subTitle: TranslationBase.of(context).radiologySubtitle, - ), - ), - ), - ], - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: HomePrescriptionsPage(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).medicines, - imagePath: 'prescription_icon.png', - subTitle: TranslationBase.of(context).medicinesSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: VitalSignDetailsScreen(), - ), - ), - child: MedicalProfileItem( - title: TranslationBase.of(context).vitalSigns, - imagePath: 'vital_signs.png', - subTitle: TranslationBase.of(context).vitalSignsSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => Navigator.push(context, FadePage(page: ActiveMedicationsPage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).myMedical, - imagePath: 'active_medications.png', - subTitle: TranslationBase.of(context).myMedicalSubtitle, - ), - ), - ), - ], - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: DoctorHomePage(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).myDoctor, - imagePath: 'doctor_icon.png', - subTitle: TranslationBase.of(context).myDoctorSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: EyeMeasurementsPage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).eye, - imagePath: 'eye_measurement_icon.png', - subTitle: TranslationBase.of(context).eyeSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: InsuranceCard())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).insurance, - imagePath: 'insurance_card_icon.png', - subTitle: TranslationBase.of(context).insuranceSubtitle, - ), - ), - ), - ], - ), - Row(children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: InsuranceUpdate())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).updateInsurance, - imagePath: 'insurance_update_icon_.png', - subTitle: TranslationBase.of(context).updateInsuranceSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: InsuranceApproval())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).insuranceApproval, - imagePath: 'insurance_approvals_icon.png', - subTitle: TranslationBase.of(context).insuranceApprovalSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => Navigator.push(context, FadePage(page: AllergiesPage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).allergies, - imagePath: 'my_allergies_icon.png', - subTitle: TranslationBase.of(context).allergiesSubtitle, - ), - ), - ), - ]), - Row(children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MyVaccines())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).myVaccines, - imagePath: 'my_vaccines_icon.png', - subTitle: TranslationBase.of(context).myVaccinesSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: HomeReportPage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).medical, - imagePath: 'medical_reports_icon.png', - subTitle: TranslationBase.of(context).medicalSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MonthlyReportsPage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).monthly, - imagePath: 'monthly_reports_icon.png', - subTitle: TranslationBase.of(context).monthlySubtitle, - ), - ), - ), - ]), - Row(children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: PatientSickLeavePage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).sick, - imagePath: 'sick_leaves_icons.png', - subTitle: TranslationBase.of(context).sickSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MyBalancePage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).myBalance, - imagePath: 'check-in.png', - subTitle: TranslationBase.of(context).myBalanceSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: MedicalProfileItem( - title: TranslationBase.of(context).patientCall, - imagePath: 'medical_history_icon.png', - subTitle: TranslationBase.of(context).patientCallSubtitle, - ), - ), - ]), - Row(children: [ - Expanded( - flex: 1, - child: InkWell( - //TODO - onTap: () { - Navigator.push(context, FadePage(page: SmartWatchInstructions())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).smartWatches, - imagePath: 'smartwatch_icon.png', - subTitle: TranslationBase.of(context).smartWatchesSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MyTrackers())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).myTrackers, - imagePath: 'my_tracker_icon.png', - subTitle: TranslationBase.of(context).myTrackersSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: AskDoctorHomPage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).askYour, - imagePath: 'ask_doctor_icon.png', - subTitle: TranslationBase.of(context).askYourSubtitle, - ), - ), - ), - ]), - Row(children: [ - Expanded( - flex: 1, - child: InkWell( - //TODO - onTap: () { - if (projectViewModel.isLogin) { - String patientID = authProvider.getAuthenticatedUser().patientID.toString(); - GifLoaderDialogUtils.showMyDialog(context); - projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}); - } else { - AlertDialogBox( - context: context, - confirmMessage: "Please login with your account first to use this feature", - okText: "OK", - okFunction: () { - AlertDialogBox.closeAlertDialog(context); - }).showAlertDialog(context); - } - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).internet, - imagePath: 'insurance_card_icon.png', - subTitle: TranslationBase.of(context).internetSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( -// onTap: () { -// Navigator.push( -// context, FadePage(page: InsuranceApproval())); -// }, - child: MedicalProfileItem( - title: TranslationBase.of(context).chatbot, - imagePath: 'insurance_approvals_icon.png', - subTitle: TranslationBase.of(context).chatbotSubtitle, - ), - ), - ), - Expanded( - flex: 1, - child: Container(), - ), - ]), - SizedBox( - height: MediaQuery.of(context).size.height * 0.12, - ) - ], + child: GridView.builder( + shrinkWrap: true, + primary: false, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + childAspectRatio: MediaQuery.of(context).size.width / (MediaQuery.of(context).size.height / 2.40), + ), + itemCount: myMedicalList.length, + itemBuilder: (BuildContext context, int index) { + + return myMedicalList[index]; + }, ), ) ], ), + SizedBox( + height: + MediaQuery.of(context).size.height * 0.12, + ), if (model.user != null && model.isLogin) Positioned( top: 185, @@ -489,9 +137,14 @@ class _MedicalProfilePageState extends State { decoration: BoxDecoration( color: Theme.of(context).primaryColor, shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(9)), - image: DecorationImage(image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)), + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover)), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -500,7 +153,9 @@ class _MedicalProfilePageState extends State { height: 8, ), Texts( - model.user.firstName + " " + model.user.lastName, + model.user.firstName + + " " + + model.user.lastName, color: Colors.white, bold: true, ), @@ -532,4 +187,20 @@ class _MedicalProfilePageState extends State { ), ); } + + fullMedicalData(){ + if(projectViewModel.havePrivilege(5)) + {} + } +} + +class Medical{ + + final String title; + final String imagePath; + final String subTitle; + final Widget page; + + Medical({this.title, this.imagePath, this.subTitle, this.page}); + } diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart index d2bcde47..e6bb3ed4 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -74,7 +74,6 @@ class _BloodPressureHomePageState extends State controller: _tabController, indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart index c8c7fa4a..9259e286 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart @@ -75,7 +75,6 @@ class _BloodSugarHomePageState extends State controller: _tabController, indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index dcb6eea3..196b5d79 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -1,10 +1,16 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/model/sick_leave/sick_leave.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class PatientSickLeavePage extends StatefulWidget { @override @@ -12,8 +18,19 @@ class PatientSickLeavePage extends StatefulWidget { } class _PatientSickLeavePageState extends State { + List imagesInfo = List(); + + @override + void initState() { + 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')); + super.initState(); + } + @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getSickLeave(), builder: (_, model, w) => AppScaffold( @@ -21,28 +38,22 @@ 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), child: ListView.builder( itemCount: model.sickLeaveList.length, itemBuilder: (context, index) => DoctorCard( + isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment, name: model.sickLeaveList[index].doctorName, - date: DateUtil.getMonthDayYearDateFormatted( - model.sickLeaveList[index].requestDate), + date:projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.sickLeaveList[index].requestDate):DateUtil.getMonthDayYearDateFormatted(model.sickLeaveList[index].requestDate), profileUrl: model.sickLeaveList[index].doctorImageURL, rat: model.sickLeaveList[index].actualDoctorRate.toDouble(), subName: model.sickLeaveList[index].projectName, - isInOutPatient: - model.sickLeaveList[index].isInOutPatient, + isInOutPatient: model.sickLeaveList[index].isInOutPatient, onEmailTap: () { - model.sendSickLeaveEmail( - message: TranslationBase.of(context).emailSentSuccessfully, - requestNo: model.sickLeaveList[index].requestNo, - doctorName: model.sickLeaveList[index].doctorName, - projectName: model.sickLeaveList[index].projectName, - setupID: model.sickLeaveList[index].setupID, - projectID: model.sickLeaveList[index].projectID); + showConfirmMessage(model, index); }, ), ), @@ -50,4 +61,22 @@ class _PatientSickLeavePageState extends State { ), ); } + + void showConfirmMessage(PatientSickLeaveViewMode model, int index) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () { + model.sendSickLeaveEmail( + message: TranslationBase.of(context).emailSentSuccessfully, + requestNo: model.sickLeaveList[index].requestNo, + doctorName: model.sickLeaveList[index].doctorName, + projectName: model.sickLeaveList[index].projectName, + setupID: model.sickLeaveList[index].setupID, + projectID: model.sickLeaveList[index].projectID); + }, + ), + ); + } } diff --git a/lib/pages/medical/prescriptions/prescription_details_page.dart b/lib/pages/medical/prescriptions/prescription_details_page.dart index 4416b9fa..d59bc06d 100644 --- a/lib/pages/medical/prescriptions/prescription_details_page.dart +++ b/lib/pages/medical/prescriptions/prescription_details_page.dart @@ -105,22 +105,29 @@ class PrescriptionDetailsPage extends StatelessWidget { color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts(TranslationBase.of(context).way))), + child: Center( + child: Texts(TranslationBase.of(context).way))), Container( color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts(TranslationBase.of(context).average))), + child: Center( + child: + Texts(TranslationBase.of(context).average))), Container( color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts(TranslationBase.of(context).dailyDoses))), + child: Center( + child: Texts( + TranslationBase.of(context).dailyDoses))), Container( color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts(TranslationBase.of(context).period))), + child: Center( + child: + Texts(TranslationBase.of(context).period))), ], ), TableRow( @@ -136,7 +143,8 @@ class PrescriptionDetailsPage extends StatelessWidget { height: 50, width: double.infinity, child: Center( - child: Text(prescriptionReport.frequencyN))), + child: + Text(prescriptionReport.frequencyN ?? ''))), Container( color: Colors.white, height: 50, @@ -174,7 +182,7 @@ class PrescriptionDetailsPage extends StatelessWidget { SizedBox( height: 5, ), - Texts(prescriptionReport.remarks), + Texts(prescriptionReport.remarks ?? ''), ], ), ), diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index d2fdae0b..6fb07f68 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -1,6 +1,8 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -10,6 +12,8 @@ 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:provider/provider.dart'; +import '../../../widgets/dialogs/confirm_send_email_dialog.dart'; class PrescriptionItemsPage extends StatelessWidget { final Prescriptions prescriptions; @@ -18,97 +22,210 @@ class PrescriptionItemsPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => - model.getPrescriptionReport(dischargeNo: prescriptions.dischargeNo,setupID:prescriptions.setupID,clinicID: prescriptions.clinicID,projectId: prescriptions.projectID,episodeID: prescriptions.episodeID), + model.getPrescriptionReport(prescriptions: prescriptions), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).prescriptions, baseViewModel: model, body: Container( height: MediaQuery.of(context).size.height * 0.8, - child: ListView.builder( - itemBuilder: (context, index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport: model.prescriptionReportList[index], - ), - ), - ), - child: Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.prescriptionReportList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, + child: Column( + children: [ + if (!prescriptions.isInOutPatient) + ...List.generate( + model.prescriptionReportList.length, + (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: + model.prescriptionReportList[index], + ), + ), + ), + child: Container( + width: double.infinity, + margin: + EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], width: 0.5), + ), + child: Row( + children: [ + ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(5)), + child: Image.network( + model.prescriptionReportList[index] + .imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts(model + .prescriptionReportList[index] + .itemDescription + .isNotEmpty + ? model.prescriptionReportList[index] + .itemDescription + : model.prescriptionReportList[index] + .itemDescriptionN)), + )), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), + ), + )) + else + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => InkWell( + onTap: () { + PrescriptionReport prescriptionReport = + PrescriptionReport( + imageSRCUrl: model + .prescriptionReportEnhList[index].imageSRCUrl, + itemDescription: model + .prescriptionReportEnhList[index] + .itemDescription, + itemDescriptionN: model + .prescriptionReportEnhList[index] + .itemDescription, + routeN: + model.prescriptionReportEnhList[index].route, + frequency: model + .prescriptionReportEnhList[index].frequency, + frequencyN: model + .prescriptionReportEnhList[index].frequency, + doseDailyQuantity: model + .prescriptionReportEnhList[index] + .doseDailyQuantity, + days: model.prescriptionReportEnhList[index].days, + itemID: + model.prescriptionReportEnhList[index].itemID, + remarks: model + .prescriptionReportEnhList[index].remarks); + Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: prescriptionReport, + ), + ), + ); + }, + child: Container( + margin: EdgeInsets.all(8.0), + color: Colors.white, + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + model + .prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(model.prescriptionReportEnhList[index] + .itemDescription), + ], + ), + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], ), ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts(model.prescriptionReportList[index].itemDescription.isNotEmpty? - model.prescriptionReportList[index].itemDescription :model - .prescriptionReportList[index].itemDescriptionN)), - )), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], - ), - ), - ), - itemCount: model.prescriptionReportList.length, + ), + ) + ], ), ), bottomSheet: Container( width: double.infinity, - height: MediaQuery.of(context).size.height * 0.23, + height: MediaQuery.of(context).size.height * 0.14, color: Colors.grey[100], child: Column( children: [ Divider(), + if(projectViewModel.havePrivilege(13)) Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( label: TranslationBase.of(context).sendCopy, - onTap: () => model.sendPrescriptionEmail( - appointmentDate: prescriptions.appointmentDate, - patientID: prescriptions.patientID, - clinicName: prescriptions.companyName, - doctorName: prescriptions.doctorName, - projectID: prescriptions.projectID), + onTap: () { + showConfirmMessage(context,model); + }, loading: model.state == ViewState.BusyLocal, ), ), - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - label:TranslationBase.of(context).resendOrder, - backgroundColor: Colors.green[200], - )) + if (false) + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: TranslationBase.of(context).resendOrder, + backgroundColor: Colors.green[200], + )) ], ), ), ), ); } + + void showConfirmMessage(BuildContext context, PrescriptionsViewModel model) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () { + model.sendPrescriptionEmail( + appointmentDate: prescriptions.appointmentDate, + patientID: prescriptions.patientID, + clinicName: prescriptions.companyName, + doctorName: prescriptions.doctorName, + mes: TranslationBase.of(context).sendSuc, + projectID: prescriptions.projectID); + }, + ), + ); + } } diff --git a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart index 5061a8ba..30bfa13e 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart @@ -24,7 +24,6 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget { appBarTitle: TranslationBase.of(context).orderDetails, baseViewModel: model, body: SingleChildScrollView( - physics: BouncingScrollPhysics(), child: Container( margin: EdgeInsets.all(15.0), child: Column( @@ -33,9 +32,17 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget { SizedBox( height: 5, ), - Texts(TranslationBase.of(context).orderStatus +' : ${prescriptionsOrder.descriptionN}'), + Container( + width: double.infinity, + decoration: BoxDecoration( + color: prescriptionsOrder.status == 3 ?Colors.green : prescriptionsOrder.status ==2 ? Colors.grey: Colors.red, + borderRadius: BorderRadius.circular(5)), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts(TranslationBase.of(context).orderStatus +' : ${prescriptionsOrder.descriptionN}',color: Colors.white,), + )), SizedBox( - height: 5, + height: 15, ), Table( border: TableBorder.symmetric( @@ -60,17 +67,17 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget { ]), TableRow(children: [ Container( - height: 50, + height: 70, color: Colors.white, child: Center( child: Texts('${prescriptionsOrder.iD}'), ), ), Container( - height: 50, + height: 70, color: Colors.white, child: Center( - child: Texts('${prescriptionsOrder.createdOn}'), + child: Texts('${prescriptionsOrder.createdOn.year}-${prescriptionsOrder.createdOn.day}-${prescriptionsOrder.createdOn.day} ${prescriptionsOrder.createdOn.hour}:${prescriptionsOrder.createdOn.minute}'), ), ), ]) @@ -110,7 +117,8 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget { ], ), ), - ) + ), + SizedBox(height: 120,) ], ), ), diff --git a/lib/pages/medical/prescriptions/prescriptions_history_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_page.dart index 9d63bf7d..84691773 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_details_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -7,6 +8,7 @@ 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:provider/provider.dart'; class PrescriptionsHistoryPage extends StatelessWidget { final PrescriptionsViewModel prescriptionsViewModel; @@ -15,6 +17,8 @@ class PrescriptionsHistoryPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( baseViewModel: prescriptionsViewModel, body: ListView.builder( @@ -41,9 +45,7 @@ class PrescriptionsHistoryPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - DateUtil.getDayMonthYearHourMinuteDateFormatted( - prescriptionsViewModel - .prescriptionsHistory[index].createdOn), + DateUtil.getDayMonthYearHourMinuteDateFormatted(prescriptionsViewModel.prescriptionsHistory[index].createdOn), fontWeight: FontWeight.w300, ), SizedBox( diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index dad6fd17..96d4aba0 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'; @@ -10,6 +11,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../../Constants.dart'; + class HomePrescriptionsPage extends StatefulWidget { @override _HomePrescriptionsPageState createState() => _HomePrescriptionsPageState(); @@ -18,11 +21,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 +46,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( @@ -78,7 +85,6 @@ class _HomePrescriptionsPageState extends State controller: _tabController, indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), diff --git a/lib/pages/medical/prescriptions/prescriptions_page.dart b/lib/pages/medical/prescriptions/prescriptions_page.dart index 6b852db9..abf68328 100644 --- a/lib/pages/medical/prescriptions/prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_page.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_items_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -9,6 +10,7 @@ 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:provider/provider.dart'; class PrescriptionsPage extends StatelessWidget { final PrescriptionsViewModel prescriptionsViewModel; @@ -18,6 +20,7 @@ class PrescriptionsPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( baseViewModel: prescriptionsViewModel, body: FractionallySizedBox( @@ -37,7 +40,6 @@ class PrescriptionsPage extends StatelessWidget { leading: Radio( value: FilterType.Clinic, groupValue: prescriptionsViewModel.filterType, - activeColor: Colors.red[800], onChanged: (FilterType value) { prescriptionsViewModel.setFilterType(value); }, @@ -55,7 +57,6 @@ class PrescriptionsPage extends StatelessWidget { leading: Radio( value: FilterType.Hospital, groupValue: prescriptionsViewModel.filterType, - activeColor: Colors.red[800], onChanged: (FilterType value) { prescriptionsViewModel.setFilterType(value); }, @@ -88,9 +89,9 @@ class PrescriptionsPage extends StatelessWidget { profileUrl: prescriptions.doctorImageURL, rat: prescriptions.actualDoctorRate.toDouble(), subName: prescriptions.name, - isInOutPatient: prescriptions.isInOutPatient, - date: DateUtil.getMonthDayYearDateFormatted( - prescriptions.dischargeDate), + isInOutPatient: prescriptions.isInOutPatient, + isLiveCareAppointment: prescriptions.isLiveCareAppointment, + date:projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)), ), ); }).toList(), diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index cb98fb81..742e3ddf 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -1,11 +1,17 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.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/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { @@ -15,53 +21,93 @@ class RadiologyDetailsPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getRadImageURL( projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( - appBarTitle: 'Radiology Report', + appBarTitle: TranslationBase.of(context).report, isShowAppBar: true, baseViewModel: model, body: SingleChildScrollView( child: Column( + mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text('${finalRadiology.reportData}',textAlign: TextAlign.center,), + Texts( + '${finalRadiology.reportData}', + textAlign: TextAlign.center, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + '${finalRadiology.reportData}', + textAlign: TextAlign.start, + fontSize: 17, + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.2, + ) ], ), ), - bottomSheet: Container( + bottomSheet: (projectViewModel.havePrivilege(9) || + projectViewModel.havePrivilege(8)) + ? Container( width: double.infinity, - height: MediaQuery.of(context).size.height * 0.2, + height: finalRadiology.dIAPACSURL != "" + ? MediaQuery.of(context).size.height * 0.25 + : MediaQuery.of(context).size.height * 0.14, color: Colors.grey[100], child: Column( + mainAxisSize: MainAxisSize.min, children: [ Divider(), + if (finalRadiology.dIAPACSURL != "" && projectViewModel.havePrivilege(9)) + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { + launch(model.radImageURL); + }, + label: TranslationBase.of(context).openRad, + backgroundColor: Colors.grey[800], + ), + ), + if (projectViewModel.havePrivilege(8)) Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( onTap: () { - launch(model.radImageURL); + showConfirmMessage( + finalRadiology: finalRadiology, model: model); }, - label: 'Open Radio Image', - backgroundColor: Colors.grey[800], - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - onTap: () => model.sendRadReportEmail( - finalRadiology: finalRadiology), - label: 'Send Copy', + label: TranslationBase.of(context).sendCopyRad, loading: model.state == ViewState.BusyLocal, - backgroundColor: Colors.red[800], + backgroundColor: Theme.of(context).primaryColor, ), ) ], ), - )), + ):Container()), + ); + } + + void showConfirmMessage( + {FinalRadiology finalRadiology, RadiologyViewModel model}) { + showDialog( + context: AppGlobal.context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () { + model.sendRadReportEmail( + mes: TranslationBase.of(AppGlobal.context).sendSuc, + finalRadiology: finalRadiology); + }, + ), ); } } diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 995ac485..2123172a 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -1,5 +1,7 @@ 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/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -10,10 +12,15 @@ 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:provider/provider.dart'; class RadiologyHomePage extends StatelessWidget { + List imagesInfo = List(); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(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 +28,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( @@ -38,7 +46,6 @@ class RadiologyHomePage extends StatelessWidget { leading: Radio( value: FilterType.Clinic, groupValue: model.filterType, - activeColor: Colors.red[800], onChanged: (FilterType value) { model.setFilterType(value); }, @@ -56,7 +63,6 @@ class RadiologyHomePage extends StatelessWidget { leading: Radio( value: FilterType.Hospital, groupValue: model.filterType, - activeColor: Colors.red[800], onChanged: (FilterType value) { model.setFilterType(value); }, @@ -85,11 +91,13 @@ class RadiologyHomePage extends StatelessWidget { ), ), child: DoctorCard( + isInOutPatient: radiology.isInOutPatient, + isLiveCareAppointment: radiology.isLiveCareAppointment, name: radiology.doctorName, profileUrl: radiology.doctorImageURL, - subName: '${radiology.projectName} \n${TranslationBase.of(context).billNo} ${radiology.invoiceNo}', - date: DateUtil.getMonthDayYearDateFormatted( - radiology.orderDate), + billNo: '${radiology.invoiceNo}', + subName: '${radiology.projectName}', + date: projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(radiology.orderDate):DateUtil.getMonthDayYearDateFormatted(radiology.orderDate), ), ); }).toList(), diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 5c6812e2..d3c818ff 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -1,6 +1,8 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart'; @@ -11,6 +13,7 @@ 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:provider/provider.dart'; class HomeReportPage extends StatefulWidget { @override @@ -20,6 +23,7 @@ class HomeReportPage extends StatefulWidget { class _HomeReportPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; + List imagesInfo = List(); @override void initState() { @@ -35,15 +39,31 @@ class _HomeReportPageState extends State @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(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( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).monthReport, + appBarTitle: TranslationBase.of(context).newMedReport, + title: TranslationBase.of(context).medReport, description: TranslationBase.of(context).infoMonthReport, baseViewModel: model, - //bottomSheet: Container(), - + imagesInfo: imagesInfo, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -82,32 +102,33 @@ class _HomeReportPageState extends State controller: _tabController, indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.22, + width: MediaQuery.of(context).size.width * 0.15, child: Center( - child: Texts('Requested'), + child: Texts(TranslationBase.of(context).requested,fontSize: 11,), ), ), Container( - width: MediaQuery.of(context).size.width * 0.22, + width: MediaQuery.of(context).size.width * 0.15, child: Center( - child: Texts('Ready'), + child: Texts(TranslationBase.of(context).ready,fontSize: 11,), ), ), Container( - width: MediaQuery.of(context).size.width * 0.22, + width: MediaQuery.of(context).size.width * 0.15, child: Center( - child: Texts('Completed'), + child: + Texts(TranslationBase.of(context).completed,fontSize: 11,), ), ), Container( - width: MediaQuery.of(context).size.width * 0.22, + width: MediaQuery.of(context).size.width * 0.15, child: Center( - child: Texts('Cancelled'), + child: + Texts(TranslationBase.of(context).cancelled,fontSize: 11,), ), ), ], @@ -120,6 +141,7 @@ class _HomeReportPageState extends State ), body: Column( children: [ + if(model.user!=null) Expanded( child: TabBarView( physics: BouncingScrollPhysics(), @@ -127,28 +149,34 @@ class _HomeReportPageState extends State children: [ ReportListWidget( reportList: model.reportsOrderRequestList, + emailAddress: model.user.emailAddress ), ReportListWidget( reportList: model.reportsOrderReadyList, + emailAddress: model.user.emailAddress ), ReportListWidget( reportList: model.reportsOrderCompletedList, + emailAddress: model.user.emailAddress ), ReportListWidget( reportList: model.reportsOrderCanceledList, + emailAddress: model.user.emailAddress ), ], ), ), - SizedBox(height: 110,) + SizedBox( + height: 110, + ) ], ), - bottomSheet: Container( + bottomSheet: projectViewModel.havePrivilege(21) ?Container( width: double.infinity, 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, @@ -157,7 +185,7 @@ class _HomeReportPageState extends State ), ), ), - ), + ):null, ), ), ); diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 6408074a..72d0422b 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -1,13 +1,22 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; +import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart'; +import 'package:diplomaticquarterapp/locator.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/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ReportListWidget extends StatelessWidget { final List reportList; + final String emailAddress; - ReportListWidget({@required this.reportList}); + ReportListWidget({@required this.reportList, this.emailAddress}); @override Widget build(BuildContext context) { @@ -16,7 +25,8 @@ class ReportListWidget extends StatelessWidget { itemBuilder: (context, index) => Padding( padding: const EdgeInsets.all(8.0), child: Container( - width: double.infinity,margin: EdgeInsets.only(left: 8,right: 8,top: 3), + width: double.infinity, + margin: EdgeInsets.only(left: 8, right: 8, top: 3), decoration: BoxDecoration( color: Colors.white, border: Border.all(color: Colors.white, width: 2), @@ -40,15 +50,39 @@ class ReportListWidget extends StatelessWidget { flex: 4, child: Padding( padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 12,), - Texts(reportList[index].projectName), - Texts(reportList[index].clinicDescription), - Texts('invoice No: ${reportList[index].invoiceNo}'), - SizedBox(height: 12,), - + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts(reportList[index].projectName), + Texts(reportList[index].clinicDescription), + Texts(TranslationBase.of(context).invoiceNo + + ': ${reportList[index].invoiceNo}'), + SizedBox(height: 12), + ], + ), + reportList[index].status == 2 + ? Container( + margin: + EdgeInsets.only(left: 15.0, right: 15.0), + child: InkWell( + onTap: () { + showConfirmMessage(reportList[index]); + // sendReportEmail(reportList[index]); + }, + child: Icon( + Icons.email, + color: Theme.of(context).primaryColor, + size: 35.0, + ), + ), + ) + : Container(), ], ), ), @@ -61,4 +95,39 @@ class ReportListWidget extends StatelessWidget { ), ); } + + void showConfirmMessage(Reports report) { + showDialog( + context: AppGlobal.context, + child: ConfirmSendEmailDialog( + email: emailAddress, + onTapSendEmail: () { + sendReportEmail(report); + }, + ), + ); + } + + sendReportEmail(Reports report) { + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + ReportsService _reportsService = locator(); + _reportsService + .sendEmailForMedicalReport( + report.projectName, + report.clinicDescription, + report.doctorName, + DateUtil.convertDateToString(report.requestDate), + report.invoiceNo.toString(), + report.projectID, + DateUtil.convertDateToString(report.requestDate), + report.setupId) + .then((value) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showSuccessToast( + message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + print(err); + }); + } } diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index be4195d9..d8cb2ca0 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -1,33 +1,37 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class MedicalReports extends StatelessWidget { @override Widget build(BuildContext context) { - void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) { + void confirmBox( + AppointmentHistory model, ReportsViewModel reportsViewModel) { showDialog( context: context, child: ConfirmDialog( appointmentHistory: model, - onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model), + onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model,TranslationBase.of(context).successSendReport), ), ); } - + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPatentAppointmentHistory(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: 'Medical Reports', + appBarTitle: TranslationBase.of(context).medReport, body: ListView.builder( itemCount: model.appointHistoryList.length, itemBuilder: (context, index) => Padding( @@ -68,8 +72,12 @@ class MedicalReports extends StatelessWidget { ), Texts(model.appointHistoryList[index].projectName), Texts(model.appointHistoryList[index].clinicName), - Texts(DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)), - StarRating(totalAverage: model.appointHistoryList[index].actualDoctorRate.toDouble(), forceStars: true), + Texts(projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.appointHistoryList[index].appointmentDate):DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)), + StarRating( + totalAverage: model + .appointHistoryList[index].actualDoctorRate + .toDouble(), + forceStars: true), SizedBox( height: 12, ), @@ -80,13 +88,15 @@ class MedicalReports extends StatelessWidget { Expanded( flex: 1, child: InkWell( - onTap: () => confirmBox(model.appointHistoryList[index], model), + onTap: () => + confirmBox(model.appointHistoryList[index], model), child: Container( - width: 80, + width: 85, height: 50, decoration: BoxDecoration( color: Colors.black54, - border: Border.all(color: Colors.transparent, width: 2), + border: + Border.all(color: Colors.transparent, width: 2), shape: BoxShape.rectangle, borderRadius: BorderRadius.all( Radius.circular(8.0), @@ -94,7 +104,7 @@ class MedicalReports extends StatelessWidget { ), child: Center( child: Texts( - 'Request', + TranslationBase.of(context).requestReport, fontSize: 12, color: Colors.white, ), @@ -129,13 +139,13 @@ class _ConfirmDialogState extends State { @override Widget build(BuildContext context) { return SimpleDialog( - title: Text('Confirm'), + title: Texts(TranslationBase.of(context).confirm), children: [ Container( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Texts('Request a medical report'), + Texts(TranslationBase.of(context).confirmMsgReport), SizedBox( height: 5.0, ), @@ -158,7 +168,7 @@ class _ConfirmDialogState extends State { child: Container( child: Center( child: Texts( - 'cancel', + TranslationBase.of(context).cancel, color: Colors.red, ), ), @@ -182,7 +192,7 @@ class _ConfirmDialogState extends State { padding: const EdgeInsets.all(8.0), child: Center( child: Texts( - 'ok', + TranslationBase.of(context).ok, fontWeight: FontWeight.w400, ), ), diff --git a/lib/pages/medical/vital_sign/LineChartCurved.dart b/lib/pages/medical/vital_sign/LineChartCurved.dart new file mode 100644 index 00000000..7b7449a8 --- /dev/null +++ b/lib/pages/medical/vital_sign/LineChartCurved.dart @@ -0,0 +1,217 @@ +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartCurved extends StatelessWidget { + final String title; + final List timeSeries; + final int indexes; + + LineChartCurved({this.title, this.timeSeries, this.indexes}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + getYaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + Text( + title, + style: TextStyle( + color: Colors.black, + fontSize: 15, + letterSpacing: 2), + textAlign: TextAlign.center, + ), + SizedBox(height: 10,), + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 18.0, left: 16.0), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + const SizedBox( + height: 10, + ), + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries.length) { + xAxixs.add(mIndex); + } + } + } + getYaxix() { + int indexess= (timeSeries.length*0.30).toInt(); + for (int index = 0; index < timeSeries.length; index++) { + int mIndex = indexess * index; + if (mIndex < timeSeries.length) { + yAxixs.add(timeSeries[mIndex].sales); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + rotateAngle:-65, + //rotateAngle:-65, + margin: 22, + getTitles: (value) { + if (timeSeries.length < 15) { + if (timeSeries.length > value.toInt()) { + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (value.toInt() == timeSeries.length - 1) + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + getTitles: (value) { + // if (timeSeries.length < 10) { + // return '${value.toInt()}'; + // } else { + // if (value == getMinY()) + // return '${value.toInt()}'; + // if (value == getMaxY()) + // return '${value.toInt()}'; + // if (yAxixs.contains(value)) { + // return '${value.toInt()}'; + // } + // return ''; + // } + return '${value.toInt()}'; + }, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries.length - 1).toDouble(), + maxY: getMaxY()+0.3, + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble() ; + } + + double getMinY() { + double min = timeSeries[0].sales; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [ + lineChartBarData1, + ]; + } +} diff --git a/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart new file mode 100644 index 00000000..e8cb8b24 --- /dev/null +++ b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart @@ -0,0 +1,257 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartCurvedBloodPressure extends StatelessWidget { + final String title; + final List timeSeries1; + final List timeSeries2; + final int indexes; + + LineChartCurvedBloodPressure( + {this.title, this.timeSeries1, this.indexes, this.timeSeries2}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 15, + ), + Text( + title, + style: TextStyle( + color: Colors.black, fontSize: 15, letterSpacing: 2), + textAlign: TextAlign.center, + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + SizedBox( + height: 10, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Theme.of(context).primaryColor), + ), + SizedBox(width: 5,), + Texts(TranslationBase.of(context).systolicLng) + ], + ), + SizedBox(width: 15,), + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.grey), + ), + SizedBox(width: 5,), + Texts(TranslationBase.of(context).diastolicLng) + ], + ), + ], + ) + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries1.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries1.length) { + xAxixs.add(mIndex); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + rotateAngle: -65, + //rotateAngle:-65, + margin: 22, + getTitles: (value) { + if (timeSeries1.length < 15) { + if (timeSeries1.length > value.toInt()) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == timeSeries1.length - 1) + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + getTitles: (value) { + return '${value.toInt()}'; + }, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries1.length - 1).toDouble(), + maxY: getMaxY() + 0.3, + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = timeSeries1[0].sales; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries1.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); + } + + List spots2 = List(); + for (int index = 0; index < timeSeries2.length; index++) { + spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + final LineChartBarData lineChartBarData2 = LineChartBarData( + spots: spots2, + isCurved: true, + colors: [Colors.grey], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [lineChartBarData1, lineChartBarData2]; + } +} diff --git a/lib/pages/medical/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/pages/medical/vital_sign/vital_sign_details_blood_pressurewideget.dart new file mode 100644 index 00000000..e28b52e1 --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class VitalSignBloodPressureWidget extends StatefulWidget { + final List vitalList; + final String title1; + final String title2; + final String title3; + final String viewKey1; + final String viewKey2; + + VitalSignBloodPressureWidget( + {Key key, this.vitalList, this.title1, this.title2, this.viewKey1, this.title3, this.viewKey2}); + + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), + border: Border.all(color: Colors.grey, width: 1), + ), + margin: EdgeInsets.all(20), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(projectViewModel), + ), + ], + ), + ), + ); + } + + List fullData(ProjectViewModel projectViewModel) { + List tableRow = []; + tableRow.add(TableRow(children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).date, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + + ), + child: Center( + child: Texts(widget.title2, color: Colors.white), + ), + height: 60), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ), + child: Center( + child: Texts(widget.title3, color: Colors.white), + ), + height: 60), + ), + ])); + widget.vitalList.forEach((vital) { + var data = vital.toJson()[widget.viewKey1]; + if (data != 0) + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${projectViewModel.isArabic ? DateUtil.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtil.getMonthArabic(vital.vitalSignDate.month) : DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${vital.toJson()[widget.viewKey1]}', + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${vital.toJson()[widget.viewKey2]}', + textAlign: TextAlign.center, + ), + ), + ), + ), + ])); + }); + return tableRow; + } +} 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..4d141b5f 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'; @@ -16,19 +17,26 @@ class VitalSignDetailsScreen extends StatelessWidget { int appointmentNo; int projectID; - VitalSignDetailsScreen({this.appointmentNo, this.projectID}); + bool isNotOneAppointment; + VitalSignDetailsScreen({this.appointmentNo, this.projectID,this.isNotOneAppointment=true}); + 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( + ? (model) => model.getPatientVitalSign( appointmentNo: appointmentNo, projectID: projectID) - : (model) => model.getPatientRadOrders(), + : (model) => model.getPatientVitalSign(), builder: (_, mode, widget) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).vitalSigns, baseViewModel: mode, + description: TranslationBase.of(context).infoSigns, + imagesInfo: imagesInfo, body: mode.vitalSignResModelList.length > 0 ? Container( child: ListView( @@ -36,7 +44,7 @@ class VitalSignDetailsScreen extends StatelessWidget { Row( children: [ InkWell( - onTap: () => Navigator.push( + onTap: () =>isNotOneAppointment? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -45,22 +53,18 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ):null, child: Container( child: VitalSignItem( des: TranslationBase.of(context).height, icon: DQIcons.height, - lastVal: mode - .vitalSignResModelList[ - mode.vitalSignResModelList.length - 1] - .heightCm - .toString(), + lastVal: mode.heightCm, unit: TranslationBase.of(context).cm, ), ), ), InkWell( - onTap: () => Navigator.push( + onTap: () => isNotOneAppointment ? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -69,16 +73,12 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ):null, child: VitalSignItem( des: TranslationBase.of(context).weight, icon: DQIcons.weight_scale, unit: TranslationBase.of(context).kg, - lastVal: mode - .vitalSignResModelList[ - mode.vitalSignResModelList.length - 1] - .weightKg - .toString(), + lastVal: mode.weightKg, ), ), ], @@ -86,7 +86,7 @@ class VitalSignDetailsScreen extends StatelessWidget { Row( children: [ InkWell( - onTap: () => Navigator.push( + onTap: () => isNotOneAppointment ? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -96,18 +96,16 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ): null, child: VitalSignItem( des: TranslationBase.of(context).body, icon: DQIcons.bmi, - lastVal: mode - .vitalSignResModelList[0].pulseBeatPerMinute - .toString(), + lastVal: mode.bodyMax, unit: TranslationBase.of(context).mass, ), ), InkWell( - onTap: () => Navigator.push( + onTap: () => isNotOneAppointment ? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -117,14 +115,12 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ):null, child: Container( child: VitalSignItem( des: TranslationBase.of(context).temperature, icon: DQIcons.thermometer, - lastVal: mode - .vitalSignResModelList[0].temperatureCelcius - .toString(), + lastVal: mode.temperatureCelcius, unit: TranslationBase.of(context).tempC, ), ), @@ -134,7 +130,7 @@ class VitalSignDetailsScreen extends StatelessWidget { Row( children: [ InkWell( - onTap: () => Navigator.push( + onTap: () => isNotOneAppointment ? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -143,20 +139,16 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ):null, child: VitalSignItem( des: TranslationBase.of(context).heart, icon: DQIcons.heart, - lastVal: mode - .vitalSignResModelList[ - mode.vitalSignResModelList.length - 1] - .pulseBeatPerMinute - .toString(), + lastVal: mode.hartRat, unit: TranslationBase.of(context).bpm, ), ), InkWell( - onTap: () => Navigator.push( + onTap: () => isNotOneAppointment ? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -166,15 +158,11 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ):null, child: VitalSignItem( des: TranslationBase.of(context).respirationRate, icon: DQIcons.outline, - lastVal: mode - .vitalSignResModelList[ - mode.vitalSignResModelList.length - 1] - .respirationBeatPerMinute - .toString(), + lastVal: mode.respirationBeatPerMinute, unit: TranslationBase.of(context).respirationSigns, ), ), @@ -184,24 +172,20 @@ class VitalSignDetailsScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ InkWell( - onTap: () => Navigator.push( + onTap: () => isNotOneAppointment ? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.BloodPressure, - pageTitle: TranslationBase.of(context).pulse, + pageTitle: TranslationBase.of(context).bloodPressure, vitalList: mode.vitalSignResModelList, ), ), - ), + ):null, child: VitalSignItem( - des: TranslationBase.of(context).pulse, + des: TranslationBase.of(context).bloodPressure, icon: DQIcons.blood_pressure, - lastVal: mode - .vitalSignResModelList[ - mode.vitalSignResModelList.length - 1] - .bloodPressure - .toString(), + lastVal: mode.bloodPressure, unit: TranslationBase.of(context).sysDias, ), ), diff --git a/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart b/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart index 589284a1..113e29a6 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart @@ -1,9 +1,12 @@ import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class VitalSignDetailsWidget extends StatefulWidget { final List vitalList; @@ -21,6 +24,7 @@ class VitalSignDetailsWidget extends StatefulWidget { class _VitalSignDetailsWidgetState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return Container( decoration: BoxDecoration( color: Colors.transparent, @@ -38,7 +42,7 @@ class _VitalSignDetailsWidgetState extends State { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(projectViewModel), ), ], ), @@ -46,20 +50,21 @@ class _VitalSignDetailsWidgetState extends State { ); } - List fullData() { + List fullData(ProjectViewModel projectViewModel) { List tableRow = []; tableRow.add(TableRow(children: [ Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) ), ), child: Center( child: Texts( - widget.title1, + TranslationBase.of(context).date, color: Colors.white, ), ), @@ -69,9 +74,10 @@ class _VitalSignDetailsWidgetState extends State { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) ), ), child: Center( @@ -81,32 +87,34 @@ class _VitalSignDetailsWidgetState extends State { ) ])); widget.vitalList.forEach((vital) { - tableRow.add(TableRow(children: [ - Container( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', - textAlign: TextAlign.center, + var data = vital.toJson()[widget.viewKey]; + if (data != 0) + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${projectViewModel.isArabic ? DateUtil.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtil.getMonthArabic(vital.vitalSignDate.month) : DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + textAlign: TextAlign.center, + ), ), ), ), - ), - Container( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${vital.toJson()[widget.viewKey]}', - textAlign: TextAlign.center, + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${vital.toJson()[widget.viewKey]}', + textAlign: TextAlign.center, + ), ), ), ), - ), - ])); + ])); }); return tableRow; } diff --git a/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart index 802aae38..6db865b6 100644 --- a/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart @@ -1,8 +1,11 @@ import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart'; import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sing_chart_and_detials.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class VitalSignItemDetailsScreen extends StatelessWidget { final VitalSignDetails pageKey; @@ -15,45 +18,19 @@ class VitalSignItemDetailsScreen extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); switch (pageKey) { case VitalSignDetails.BodyMeasurements: VSchart = [ { - 'name': 'Height', + 'name': 'BMI', + 'nameAr': 'مؤشر الكتلة', 'title1': 'Date', - 'title2': 'Cm', - 'viewKey': 'HeightCm', - }, - { - 'name': 'Weight Kg', - 'title1': 'Date', - 'title2': 'Kg', - 'viewKey': 'WeightKg', - }, - { - 'name': 'BodyMassIndex', - 'title1': 'Date', - 'title2': 'BodyMass', + 'title2': 'BMI', + 'title2Ar': 'الكتلة', 'viewKey': 'BodyMassIndex', }, - { - 'name': 'HeadCircumCm', - 'title1': 'Date', - 'title2': 'Cm', - 'viewKey': 'HeadCircumCm', - }, - { - 'name': 'Ideal Body Weight (Lbs)', - 'title1': 'Date', - 'title2': 'Ideal Weight', - 'viewKey': 'IdealBodyWeightLbs', - }, - { - 'name': 'LeanBodyWeightLbs (Lbs)', - 'title1': 'Date', - 'title2': 'Lean Weight', - 'viewKey': 'LeanBodyWeightLbs', - } + ]; break; @@ -61,9 +38,11 @@ class VitalSignItemDetailsScreen extends StatelessWidget { case VitalSignDetails.Temperature: VSchart = [ { - 'name': 'Temperature In Celcius', + 'name': 'Temperature In Celsius', + 'nameAr': 'درجة الحرارة بالدرجة المئوية', 'title1': 'Date', 'title2': 'C', + 'title2Ar': 'ْس', 'viewKey': 'TemperatureCelcius', }, ]; @@ -73,8 +52,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Pulse Beat Per Minute', + 'nameAr': 'نبضة نبضة في الدقيقة', 'title1': 'Date', 'title2': 'Minute', + 'title2Ar': 'دقيقة', 'viewKey': 'PulseBeatPerMinute', }, ]; @@ -84,8 +65,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Respiration Beat Per Minute', + 'nameAr': 'ضربات التنفس في الدقيقة', 'title1': 'Date', 'title2': 'Beat Per Minute', + 'title2Ar': 'نفس في الدقيقة', 'viewKey': 'RespirationBeatPerMinute', }, ]; @@ -94,17 +77,16 @@ class VitalSignItemDetailsScreen extends StatelessWidget { case VitalSignDetails.BloodPressure: VSchart = [ { - 'name': 'Blood Pressure Higher', + 'name': 'Blood Pressure Systolic Diastolic', + 'nameAr': 'ضغط الدم الإنقباض الإنبساط', 'title1': 'Date', - 'title2': 'Minute', - 'viewKey': 'BloodPressureHigher', + 'title2': 'systolic', + 'title3': 'Diastolic', + 'title2Ar': 'الإنقباض', + 'title3Ar': 'الإنبساط', + 'viewKey': 'BloodPressure', }, - { - 'name': 'Blood Pressure Lower', - 'title1': 'Date', - 'title2': 'Minute', - 'viewKey': 'BloodPressureLower', - } + ]; break; @@ -112,8 +94,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Respiration Rate', + 'nameAr': 'معدل التنفس', 'title1': 'Date', 'title2': 'bpm', + 'title2Ar': 'نفس', 'viewKey': 'RespirationBeatPerMinute', }, ]; @@ -122,9 +106,11 @@ class VitalSignItemDetailsScreen extends StatelessWidget { case VitalSignDetails.heart: VSchart = [ { - 'name': 'FIO2', + 'name': 'Heart rate', + 'nameAr': 'معدل النبض بالدقيقة', 'title1': 'Date', 'title2': 'bpm', + 'title2Ar': 'نبضة', 'viewKey': 'PulseBeatPerMinute', }, ]; @@ -134,8 +120,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'PainScore', + 'nameAr': 'نقاط الألم', 'title1': 'Date', 'title2': 'Cm', + 'title2Ar': 'سم', 'viewKey': 'PainScore', }, ]; @@ -145,8 +133,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Weight Kg', + 'nameAr': 'الوزن كجم', 'title1': 'Date', 'title2': 'Kg', + 'title2Ar': 'كجم', 'viewKey': 'WeightKg', }, ]; @@ -157,8 +147,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Height Cm', + 'nameAr': 'الطول سم', 'title1': 'Date', 'title2': 'Cm', + 'title2Ar': 'سم', 'viewKey': 'HeightCm', }, ]; @@ -174,12 +166,26 @@ class VitalSignItemDetailsScreen extends StatelessWidget { var vitalListTemp = vitalList.where( (element) => element.toJson()[chartInfo['viewKey']] != null, ); + + if(vitalListTemp.length != 0 && chartInfo['viewKey']=='BloodPressure'){ + return VitalSingChartBloodPressure( + vitalList: vitalList, + name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'], + title1: chartInfo['title1'], + title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'], + title3:projectViewModel.isArabic?chartInfo['title3Ar']: chartInfo['title3'], + viewKey1: 'BloodPressureHigher', + viewKey2: 'BloodPressureLower', + + ); + } + return vitalListTemp.length != 0 ? VitalSingChartAndDetials( vitalList: vitalList, - name: chartInfo['name'], + name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'], title1: chartInfo['title1'], - title2: chartInfo['title2'], + title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'], viewKey: chartInfo['viewKey']) : Container(); }).toList(), diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart index 299605ef..43bc9f0a 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart @@ -6,6 +6,8 @@ import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; +import 'LineChartCurved.dart'; + class VitalSingChartAndDetials extends StatelessWidget { VitalSingChartAndDetials({ Key key, @@ -21,31 +23,18 @@ class VitalSingChartAndDetials extends StatelessWidget { final String viewKey; final String title1; final String title2; - List timeSeriesData = []; + List timeSeriesData = []; @override Widget build(BuildContext context) { + generateData(); return Column( children: [ AppExpandableNotifier( - headerWidget: AppTimeSeriesChart( - seriesList: generateData(), - chartName: name, - startDate: DateTime( - vitalList[vitalList.length - 1] - .vitalSignDate - .year, - vitalList[vitalList.length - 1] - .vitalSignDate - .month + - 3, - vitalList[vitalList.length - 1] - .vitalSignDate - .day), - endDate: vitalList[0].vitalSignDate, - ), + isExpand: true, + headerWidget: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/5.5,), bodyWidget: VitalSignDetailsWidget( - vitalList: vitalList.reversed.toList(), + vitalList: vitalList, title1: title1, title2: title2, viewKey: viewKey, @@ -57,26 +46,18 @@ class VitalSingChartAndDetials extends StatelessWidget { generateData() { if (vitalList.length > 0) { - vitalList.forEach( + vitalList.reversed.toList().forEach( (element) { + if( element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0) timeSeriesData.add( - TimeSeriesSales( - new DateTime(element.vitalSignDate.year, - element.vitalSignDate.month, element.vitalSignDate.day), - element.toJson()[viewKey]?.toInt(), + TimeSeriesSales2( + new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey].toDouble(), ), ); }, ); } - return [ - new charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, - domainFn: (TimeSeriesSales sales, _) => sales.time, - measureFn: (TimeSeriesSales sales, _) => sales.sales, - data: timeSeriesData, - ) - ]; + return timeSeriesData.reversed.toList(); } } diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart new file mode 100644 index 00000000..84a2eb51 --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart @@ -0,0 +1,85 @@ +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_blood_pressurewideget.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_wideget.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:flutter/material.dart'; + +import 'package:charts_flutter/flutter.dart' as charts; + +import 'LineChartCurved.dart'; +import 'LineChartCurvedBloodPressure.dart'; + +class VitalSingChartBloodPressure extends StatelessWidget { + VitalSingChartBloodPressure({ + Key key, + @required this.vitalList, + @required this.name, + @required this.viewKey1, + @required this.viewKey2, + @required this.title1, + @required this.title2, + @required this.title3, + }) : super(key: key); + + final List vitalList; + final String name; + final String viewKey1; + final String viewKey2; + final String title1; + final String title2; + final String title3; + List timeSeriesData1 = []; + List timeSeriesData2 = []; + + @override + Widget build(BuildContext context) { + generateData(); + return Column( + children: [ + AppExpandableNotifier( + isExpand: true, + headerWidget: LineChartCurvedBloodPressure( + title: name, + timeSeries1: timeSeriesData1, + timeSeries2: timeSeriesData2, + indexes: timeSeriesData1.length ~/ 5.5, + ), + bodyWidget: VitalSignBloodPressureWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + title3: title3, + viewKey1: viewKey1, + viewKey2: viewKey2, + ), + ), + ], + ); + } + + generateData() { + if (vitalList.length > 0) { + vitalList.reversed.toList().forEach( + (element) { + if (element.toJson()[viewKey1]?.toInt() != 0) + timeSeriesData1.add( + TimeSeriesSales2( + new DateTime(element.vitalSignDate.year, + element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey1].toDouble(), + ), + ); + if (element.toJson()[viewKey2]?.toInt() != 0) + timeSeriesData2.add( + TimeSeriesSales2( + new DateTime(element.vitalSignDate.year, + element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey2].toDouble(), + ), + ); + }, + ); + } + } +} diff --git a/lib/pages/offers_categorise_page.dart b/lib/pages/offers_categorise_page.dart new file mode 100644 index 00000000..782ea018 --- /dev/null +++ b/lib/pages/offers_categorise_page.dart @@ -0,0 +1,620 @@ +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 new file mode 100644 index 00000000..414106b1 --- /dev/null +++ b/lib/pages/parent_categorise_page.dart @@ -0,0 +1,1074 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +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: Container( + child: ListView( + scrollDirection: Axis.vertical, + children: [ + Container( + 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: SizeConfig.screenHeight * 7.8, + 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..c3a19917 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -1,6 +1,9 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.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'; @@ -11,9 +14,13 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class PaymentService extends StatelessWidget { + ToDoCountProviderModel model; + ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + model = Provider.of(context); return AppScaffold( isShowAppBar: true, isShowDecPage: false, @@ -50,53 +57,67 @@ class PaymentService extends StatelessWidget { fontSize: 14, fontWeight: FontWeight.normal, ), - Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', - fit: BoxFit.fill, - height: 55, - width: double.infinity, + SizedBox( + height: 12, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + child: Image.asset( + 'assets/images/online_payment_icon.png', + fit: BoxFit.fill, + height: 55, + width: double.infinity, + ), ), ], ), ), ), ), + if(!projectViewModel.havePrivilege(33)) Expanded( - child: Container( - margin: EdgeInsets.all(5.0), - padding: EdgeInsets.all(9), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8.0), - shape: BoxShape.rectangle), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).onlineCheckIn, - color: HexColor('#B61422'), - bold: true, - ), - Texts( - TranslationBase.of(context).appointment, - fontSize: 14, - fontWeight: FontWeight.normal, - ), - Align( - alignment: projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', - height: 55, + child: InkWell( + onTap: () => navigateToToDoPage(context), + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).onlineCheckIn, + color: HexColor('#B61422'), + bold: true, + ), + Texts( + TranslationBase.of(context).appointment, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + SizedBox( + height: 12, + ), + Align( + alignment: !projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Image.asset( + 'assets/images/device_icon.png', + height: 55, + ), ), - ), - ], + ], + ), ), ), ) ], ), + if(!projectViewModel.havePrivilege(33)) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -124,12 +145,15 @@ class PaymentService extends StatelessWidget { fontSize: 14, fontWeight: FontWeight.normal, ), + SizedBox( + height: 12, + ), Align( - alignment: projectViewModel.isArabic + alignment: !projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, child: Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', + 'assets/images/new-design/check-in.png', height: 55, ), ), @@ -149,4 +173,17 @@ class PaymentService extends StatelessWidget { ), ); } + + navigateToToDoPage(BuildContext context) { + if (projectViewModel.isLogin) { + if (model.count != 0) { + Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + } else { + AppToast.showErrorToast( + message: TranslationBase.of(context).upcomingEmpty); + } + } else { + Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + } + } } diff --git a/lib/pages/pharmacies/ProductCheckTypeWidget.dart b/lib/pages/pharmacies/ProductCheckTypeWidget.dart new file mode 100644 index 00000000..878544e1 --- /dev/null +++ b/lib/pages/pharmacies/ProductCheckTypeWidget.dart @@ -0,0 +1,70 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/widgets/pharmacy/product_tile.dart'; +import 'package:flutter/material.dart'; + +AppSharedPreferences sharedPref = AppSharedPreferences(); +var languageID; +class ProductCheckTypeWidget extends StatelessWidget { + final List wishlist; + final bool isTrue; + + ProductCheckTypeWidget(this.isTrue, this.wishlist); + + + void initState() { + getLanguageID(); + } + + @override + Widget build(BuildContext context) { + return isTrue + ? ListView.builder( + itemCount: wishlist.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + Container( + child: isTrue + ? productTile( + productName: languageID == 'ar' ? wishlist[index].product.namen : wishlist[index].product.name, + productPrice: wishlist[index].subtotal, + productRate: + double.parse(wishlist[index].subtotalVatRate), + productImage: wishlist[index].product.images[0].src, + showLine: isTrue, + productID: wishlist[index].product.id, + ) + : productTile( + productName: languageID == 'ar' ? wishlist[index].product.namen : wishlist[index].product.name, + productPrice: wishlist[index].subtotal, + productRate: + double.parse(wishlist[index].subtotalVatRate), + productImage: wishlist[index].product.images[0].src, + showLine: isTrue, + ), + ), + Divider(height: 1, color: Colors.grey) + ], + ); + }) + : GridView.count( + crossAxisCount: 2, + children: List.generate( + wishlist.length, + (index) => productTile( + productName: wishlist[index].product.name, + productPrice: wishlist[index].subtotal, + productRate: + double.parse(wishlist[index].subtotalVatRate), + productImage: wishlist[index].product.images[0].src, + showLine: isTrue, + )), + ); + } +} + +getLanguageID() async { + languageID = await sharedPref.getString(APP_LANGUAGE); +} + diff --git a/lib/pages/pharmacies/compare-list.dart b/lib/pages/pharmacies/compare-list.dart new file mode 100644 index 00000000..37e2fc8c --- /dev/null +++ b/lib/pages/pharmacies/compare-list.dart @@ -0,0 +1,36 @@ +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; + +class CompareList with ChangeNotifier { + List _product = []; + + List get productListItems => _product; + + void addItem(data) { + if (_product.length == 0) { + _product.add(data); + AppToast.showSuccessToast(message: 'You have added a product to the Compare list'); + } else { + for (int i = 0; i < _product.length; i++) { + if (_product.length <= 4 && _product[i].id != data.id) { + _product.add(data); + AppToast.showSuccessToast(message: 'You have added a product to the Compare list'); + break; + } else if(_product[i].id == data.id){ + AppToast.showErrorToast(message: 'the item is already in the list'); + } else if(_product.length == 4){ + AppToast.showErrorToast(message: 'your compare list is full'); + } + } + } + notifyListeners(); + } + + void deleteItem(data) { + for (int i = 0; i < _product.length; i++) { + if (_product[i].id == data) _product.remove(_product[i]); + } + notifyListeners(); + } +} diff --git a/lib/pages/pharmacies/compare.dart b/lib/pages/pharmacies/compare.dart new file mode 100644 index 00000000..d1872187 --- /dev/null +++ b/lib/pages/pharmacies/compare.dart @@ -0,0 +1,328 @@ +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; +import 'package:provider/provider.dart'; + +int counter = 0; + +class ComparePage extends StatefulWidget { + @override + _ComparePageState createState() => _ComparePageState(); +} + +//CompareList compareItems = CompareList(); +class _ComparePageState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: 'Reviews page', + isShowAppBar: true, + isPharmacy: true, + body: Container( + child: compareList(), + ), + ); + } +} + +class compareList extends StatelessWidget { + @override + Widget build(BuildContext context) { + final productItemData = Provider.of(context); + final productItem = productItemData.productListItems; + return productItem.length == 0 + ? Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + 'assets/images/new-design/empty_box.png', + width: 100, + height: 100, + fit: BoxFit.cover, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + 'There is no data', + style: TextStyle(fontSize: 30), + ), + ) + ], + ), + ), + ) + : CarouselSlider( + options: CarouselOptions( + height: 800.0, + viewportFraction: 0.87, + enableInfiniteScroll: false), + items: productItem.map((i) { + return Builder( + builder: (BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 8), + child: Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.symmetric(horizontal: 10.0), + child: productItem.length != 0 + ? slideDetail(productItem) + : Container(), + ), + ); + }, + ); + }).toList(), + ); + } +} + +class slideDetail extends StatefulWidget { + final List data; + + slideDetail(this.data); + + @override + _slideDetailState createState() => _slideDetailState(); +} + +class _slideDetailState extends State { + @override + Widget build(BuildContext context) { + return ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: widget.data.length, + itemBuilder: (BuildContext contx, int index) { + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 550, + width: 150, + margin: EdgeInsets.symmetric(horizontal: 10.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + border: Border( + top: BorderSide(width: 0.5, color: Colors.grey), + left: BorderSide(width: 0.5, color: Colors.grey), + right: BorderSide(width: 0.5, color: Colors.grey), + bottom: BorderSide(width: 0.5, color: Colors.grey), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Container( + child: Align( + alignment: Alignment.topRight, + child: IconButton( + icon: Icon(FontAwesomeIcons.trashAlt, size: 15), + onPressed: () { + setState(() { + Provider.of(context, listen: false) + .deleteItem(widget.data[index].id); + }); + }, + ), + ), + ), + SizedBox( + height: 20, + ), + Image.network( + widget.data[index].images[0].src.trim(), + fit: BoxFit.cover, + width: 100, + height: 60, + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color: Colors.grey, + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].name, + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].price.toString(), + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color: Colors.grey, + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications[0].name, + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications[1].name, + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color: Colors.grey, + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications[2].name, + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications[3].name, + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color: Colors.grey, + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications[4].name, + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications[5].name, + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(top: 8.0), + child: Container( + height: 1.0, + width: 300.0, + color: Colors.grey, + ), + ), + ], + ), + ), + ), + ], + ); + }, + ); + } +} + +String returnString(data) { + for (int i = 0; i < data.length; i++) { + print(data[i]); +// if(data[i] == null){ +// if(counter == i){ +// +// } +// } + } + return "ENAD HILAL"; +} diff --git a/lib/pages/pharmacies/medicine_search_screen.dart b/lib/pages/pharmacies/medicine_search_screen.dart index a41fde16..7a61dabe 100644 --- a/lib/pages/pharmacies/medicine_search_screen.dart +++ b/lib/pages/pharmacies/medicine_search_screen.dart @@ -21,6 +21,8 @@ class MedicineSearch extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( + allowAny: true, + onModelReady: (model) => model.clearMedicineSearch(), builder: (BuildContext context, PharmacyViewModel model, Widget child) => AppScaffold( baseViewModel: model, diff --git a/lib/pages/pharmacies/my_reviews.dart b/lib/pages/pharmacies/my_reviews.dart new file mode 100644 index 00000000..7b17a359 --- /dev/null +++ b/lib/pages/pharmacies/my_reviews.dart @@ -0,0 +1,248 @@ +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/review_view_model.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:rating_bar/rating_bar.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; + +class MyReviewsPage extends StatefulWidget { + @override + _MyReviewsPageState createState() => _MyReviewsPageState(); +} + +var languageID; + +class _MyReviewsPageState extends State { + void initState() { + getLanguageID(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getReviewData(), + builder: (_, model, wi) => AppScaffold( + appBarTitle: 'My Reviews', + isShowAppBar: true, + isPharmacy: true, + baseViewModel: model, + body: model.reviewListList.length == 0 + ? Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + 'assets/images/new-design/empty_box.png', + width: 100, + height: 100, + fit: BoxFit.cover, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + 'There is no data', + style: TextStyle(fontSize: 30), + ), + ) + ], + ), + ), + ) + : Container( + child: ListView.builder( + itemCount: model.reviewListList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + Container( + child: reviewDetails( + model.reviewListList[index], + double.parse(model.reviewListList[index].product + .approvedTotalReviews + .toString()), + double.parse(model.reviewListList[index].rating + .toString()), + ), + ), + Divider(height: 1, color: Colors.grey) + ], + ); + }), + ), + ), + ); + } +} + +reviewDetails(data, rate, myRate) { + return Container( + child: Padding( + padding: EdgeInsets.only(bottom: 10.0), + child: Container( + height: 200, + width: double.infinity, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + children: [ + Container( + margin: languageID == 'ar' + ? EdgeInsets.only(top: 10, right: 10) + : EdgeInsets.only(top: 10, left: 10), + child: Image.network( + data.product.images[0].src.trim(), + fit: BoxFit.cover, + width: 80, + height: 80, + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: languageID == 'ar' + ? Alignment.topRight + : Alignment.topLeft, + child: RichText( + text: TextSpan( + text: languageID == 'ar' + ? data.product.namen + : data.product.name, + style: TextStyle( + color: Colors.black54, + fontSize: languageID == 'ar' ? 7 : 13, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + Column( + children: [ + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: languageID == 'ar' + ? Alignment.topRight + : Alignment.topLeft, + child: RichText( + text: TextSpan( + text: data.product.price.toString() + + " " + + data.product.currency, + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + ], + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: languageID == 'ar' + ? Alignment.topRight + : Alignment.topLeft, + child: RatingBar.readOnly( + initialRating: rate, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ), + ], + ), + ], + ), + SizedBox( + height: 20, + ), + Container( + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + padding: languageID == 'ar' + ? EdgeInsets.only(right: 10) + : EdgeInsets.only(left: 10), + child: Text(data.createdOnUtc.toString())), + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: languageID == 'ar' + ? EdgeInsets.only(right: 60) + : EdgeInsets.only(left: 60), + child: RatingBar.readOnly( + initialRating: myRate, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ], + ), + ), + ], + ), + ), + SizedBox( + height: 15, + ), + Expanded( + child: Container( + padding: languageID == 'ar' + ? EdgeInsets.only(right: 10) + : EdgeInsets.only(left: 10), + child: Text(fixingString(data.reviewText.toString())), + ), + ), + ], + ), + ), + ), + ); +} + +fixingString(txt) { + String stringTxt; + String newTxt; + stringTxt = txt.toString(); + newTxt = stringTxt.split('.')[1]; + + return newTxt; +} + +getLanguageID() async { + languageID = await sharedPref.getString(APP_LANGUAGE); +} diff --git a/lib/pages/pharmacies/pharmacies_list_screen.dart b/lib/pages/pharmacies/pharmacies_list_screen.dart index 040e5bee..a35a77c9 100644 --- a/lib/pages/pharmacies/pharmacies_list_screen.dart +++ b/lib/pages/pharmacies/pharmacies_list_screen.dart @@ -1,20 +1,19 @@ -import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:flutter/material.dart'; +import 'dart:convert'; +import 'dart:typed_data'; + import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:maps_launcher/maps_launcher.dart'; -import '../base/base_view.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; -import 'dart:typed_data'; -import 'dart:convert'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; -import 'package:map_launcher/map_launcher.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:maps_launcher/maps_launcher.dart'; import 'package:url_launcher/url_launcher.dart'; +import '../base/base_view.dart'; + class PharmaciesList extends StatelessWidget { final int medicineID; final String imageURL; @@ -25,11 +24,14 @@ class PharmaciesList extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( + allowAny: true, onModelReady: (model) => model.getPharmacies(id: medicineID), builder: (BuildContext context, PharmacyViewModel model, Widget child) => AppScaffold( appBarTitle: TranslationBase.of(context).pharmaciesList, baseViewModel: model, + isShowAppBar: true, + isShowDecPage: false, body: Container( height: SizeConfig.screenHeight, child: ListView( @@ -146,7 +148,7 @@ class PharmaciesList extends StatelessWidget { child: InkWell( child: Icon( Icons.phone, - color: Colors.red, + color: Theme.of(context).primaryColor, ), onTap: () => launch("tel://" + model.pharmacyList[index].phoneNumber), @@ -157,7 +159,7 @@ class PharmaciesList extends StatelessWidget { child: InkWell( child: Icon( Icons.local_pharmacy, - color: Colors.red, + color: Theme.of(context).primaryColor, ), onTap: () { MapsLauncher.launchCoordinates( diff --git a/lib/pages/pharmacies/product-brands.dart b/lib/pages/pharmacies/product-brands.dart new file mode 100644 index 00000000..b9e6db95 --- /dev/null +++ b/lib/pages/pharmacies/product-brands.dart @@ -0,0 +1,254 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/pages/login/register-info.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/search_brands_page.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:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; + +class ProductBrandsPage extends StatefulWidget { + @override + _ProductBrandsPageState createState() => _ProductBrandsPageState(); +} + +var languageID; +class _ProductBrandsPageState extends State { + + @override + void initState() { + super.initState(); + getLanguageID(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getBrandsData(), + builder: (_, model, wi) => AppScaffold( + appBarTitle: 'Brands page', + isShowAppBar: true, + isPharmacy: true, + isShowDecPage: false, + body: Container( + child: Column( + children: [ + Container( + color: Colors.white, + alignment: languageID == 'ar'? + Alignment.topRight : + Alignment.topLeft, + padding: languageID == 'ar' ? + EdgeInsets.only( + right: 10.0, + top: 10.0 + ): + EdgeInsets.only( + left: 10.0, + top: 10.0 + ), + child: Text( + TranslationBase.of(context).topBrands, + style: TextStyle( + fontWeight: FontWeight.bold, + ), + ), + ), + Container( + height: 220, + width: double.infinity, + color: Colors.white, + child: topBrand(), + ), + SizedBox( + height: 10, + ), + 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) => SearchBrandsPage()), + ); + }, + ), + ), + SizedBox( + height: 10, + ), + Container( + height: 230, + width: double.infinity, + color: Colors.white, + child: ListView.builder( + itemCount: model.brandsListList.length, + itemBuilder: (BuildContext context, int index) { + return InkWell( + child: Container( + margin: EdgeInsets.only(top: 50, left: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + languageID == 'ar' ? Text(model.brandsListList[index].namen):Text(model.brandsListList[index].name), + SizedBox( + height: 3, + ), + Divider(height: 1, color: Colors.grey) + ], + ), + ), + onTap: (){ + print("ENAD"); + }, + ); + }), + ), + ], + ), + ), + ), + ); + } +} + + +topBrand() { + return BaseView( + onModelReady: (model) => model.getTopBrandsData(), + builder: (_, model, wi) => GridView.count( + crossAxisCount: 4, + children: List.generate( + model.topBrandsListList.length, + (index) => Column( + children: [ + InkWell( + child: Container( + margin: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 0.0), + child: Container( + child: Container( + child: Container( +// padding: EdgeInsets.only(left: 5), + child: Container( + padding: EdgeInsets.symmetric( + horizontal: 10.0, vertical: 10.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + border: Border( + top: BorderSide(width: 1.0, color: Colors.grey), + left: BorderSide(width: 1.0, color: Colors.grey), + right: BorderSide(width: 1.0, color: Colors.grey), + bottom: BorderSide(width: 1.0, color: Colors.grey), + ), + color: Colors.white, + ), + child: model.topBrandsListList[index].image != null ?Image.network( + model.topBrandsListList[index].image.src, + fit: BoxFit.cover, + width: 60, + height: 40, + ): Text(model.topBrandsListList[index].name) + ), + ), + ), + ), + ), + onTap: (){ + print("ENAD"); + }, + ), + ], + ), + ), + ), + ); +} + +brandSearch() { + return Text('ENAD'); +} + +class SearchBar extends SearchDelegate { + @override + List buildActions(BuildContext context) { + return [ + IconButton( + icon: Icon(Icons.clear), + onPressed: () { + query = ""; + }, + ) + ]; + } + + @override + Widget buildLeading(BuildContext context) { + return IconButton( + icon: AnimatedIcon( + icon: AnimatedIcons.menu_arrow, + progress: transitionAnimation, + ), + onPressed: () { + close(context, null); + }, + ); + } + + @override + Widget buildResults(BuildContext context) { + return Container( + height: 100, + width: 100, + child: Card( + color: Colors.red, + child: Center( + child: Text(query), + ), + ), + ); + } + + @override + Widget buildSuggestions(BuildContext context) { + return ListView.builder( + itemCount: 5, + itemBuilder: (context, index) => ListTile( + leading: Icon(Icons.location_city), + title: Text("Enad"), + onTap: () { + showResults(context); + }, + ), + ); + } +} + +getLanguageID() async { + languageID = await sharedPref.getString(APP_LANGUAGE); +} diff --git a/lib/pages/pharmacies/product_detail.dart b/lib/pages/pharmacies/product_detail.dart new file mode 100644 index 00000000..2040db11 --- /dev/null +++ b/lib/pages/pharmacies/product_detail.dart @@ -0,0 +1,1862 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scafold_detail_page.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; +import 'package:rating_bar/rating_bar.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'screens/cart-order-page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart'; + +int price = 0; +var languageID; +bool isOverQuantity = false; +bool isInWishlit = false; +var itemID; +var product; +var customerId; +CompareList compareItems = new CompareList(); +PharmacyProduct specificationData; + +class ProductDetailPage extends StatefulWidget { + final PharmacyProduct product; + ProductDetailPage(this.product); + @override + __ProductDetailPageState createState() => __ProductDetailPageState(); +} + +class __ProductDetailPageState extends State { + bool isTrue = true; + bool isDetails = true; + bool isReviews = false; + bool isAvailabilty = false; + dynamic wishlistItems; + + void initState() { + price = 0; + specificationData = widget.product; + setState(() { + customerId = userInfo(widget.product.id, widget.product); + }); + super.initState(); + } + + Widget build(BuildContext context) { + return customerId != null + ? DetailPageScafold( + appBarTitle: 'product detail page', + isShowAppBar: true, + isPharmacy: true, + isShowDecPage: false, + body: SingleChildScrollView( + child: Column( + children: [ + Container( + width: double.infinity, + color: Colors.white, + child: Column( + children: [ + Image.network( + widget.product.images[0].src.trim(), + ), + widget.product.discountDescription != null + ? Container( + width: double.infinity, + height: 50, + color: Colors.yellowAccent, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Container( + alignment: Alignment.centerRight, + child: languageID == 'ar' + ? Text( + widget.product + .discountDescriptionn, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 17), + ) + : Text( + widget.product + .discountDescription, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 17), + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + flex: 0, + child: Container( + child: Image( + image: AssetImage( + 'assets/images/offer.png'), + ), + ), + ), + ], + ), + ) + : Container(), + ], + ), + ), + SizedBox( + height: 4, + ), + Container( + width: 500, + height: 150, + color: Colors.white, + child: productNameAndPrice(context, widget.product), + ), + SizedBox( + height: 6, + ), + Container( + width: 500, + height: 120, + color: Colors.white, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Text( + TranslationBase.of(context).specification, + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + ), + Divider(color: Colors.grey), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Text( + "there is no data", + ), + ), + ), + ], + ), + ), + SizedBox( + height: 6, + ), + Container( + width: 500, + margin: EdgeInsets.only(bottom: 100), +// height: 350, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Column( + children: [ + FlatButton( + onPressed: () { + setState(() { + isDetails = true; + isReviews = false; + isAvailabilty = false; + }); + }, + child: Text( + TranslationBase.of(context).details, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold), + ), + color: Colors.white, + ), + isDetails + ? Container( + width: 100, + height: 5, + color: Colors.green, + ) + : Container() + ], + ), + SizedBox( + width: 20, + ), + Column( + children: [ + FlatButton( + onPressed: () { + setState(() { + isDetails = false; + isReviews = true; + isAvailabilty = false; + }); + }, + child: Text( + TranslationBase.of(context).reviews, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold), + ), + color: Colors.white, + ), + isReviews + ? Container( + width: 100, + height: 5, + color: Colors.green, + ) + : Container(), + ], + ), + SizedBox( + width: 20, + ), + Column( + children: [ + FlatButton( + onPressed: () { + setState(() { + isDetails = false; + isReviews = false; + isAvailabilty = true; + }); + }, + child: Text( + TranslationBase.of(context).availability, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold), + ), + color: Colors.white, + ), + isAvailabilty + ? Container( + width: 100, + height: 5, + color: Colors.green, + ) + : Container(), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + isDetails + ? Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Text( + TranslationBase.of(context).description, + style: TextStyle( + fontSize: 17, + color: Colors.grey, + fontWeight: FontWeight.w600), + ), + ), + SizedBox( + height: 10, + ), + Container( + child: Text( + languageID == 'ar' + ? widget.product.fullDescriptionn + : widget.product.fullDescription, + style: TextStyle( + fontSize: 16, + fontFamily: 'WorkSans-Regular'), + ), + ), + ], + ), + ) + : isReviews + ? BaseView( + onModelReady: (model) => + model.getProductReviewsData( + widget.product.id), + builder: (_, model, wi) => model + .productDetailService + .length != + 0 && + model.productDetailService[0] + .reviews.length != + 0 + ? ListView.builder( + physics: ScrollPhysics(), + itemCount: model + .productDetailService[0] + .reviews + .length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemBuilder: (BuildContext context, + int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + child: Row( + children: [ + Container( + child: Text( + model + .productDetailService[ + 0] + .reviews[ + index] + .customerId + .toString(), + style: TextStyle( + fontSize: 17, + color: Colors + .grey, + fontWeight: + FontWeight + .w600), + ), + ), + Container( + margin: + EdgeInsets.only( + left: 210), + child: RatingBar + .readOnly( + initialRating: model + .productDetailService[ + 0] + .reviews[ + index] + .rating + .toDouble(), + size: 15.0, + filledColor: + Colors.yellow[ + 700], + emptyColor: Colors + .grey[500], + isHalfAllowed: + true, + halfFilledIcon: + Icons + .star_half, + filledIcon: + Icons.star, + emptyIcon: + Icons.star, + ), + ), + ], + ), + ), + SizedBox( + height: 10, + ), + Container( + child: Text( + model + .productDetailService[ + 0] + .reviews[index] + .reviewText, + style: TextStyle( + fontSize: 20), + ), + ), + SizedBox( + height: 50, + ), + Divider( + height: 1, + color: Colors.grey), + ], + ), + ); + }, + ) + : Container( + padding: EdgeInsets.all(15), + alignment: Alignment.center, + child: Text('No Reviews Available'), + ), + ) + : isAvailabilty + ? BaseView( + onModelReady: (model) => + model.getProductLocationData(), + builder: (_, model, wi) => model + .productLocationService + .length == + 0 + ? Container( + padding: EdgeInsets.all(15), + alignment: Alignment.center, + child: Text( + 'No location Available'), + ) + : ListView.builder( + physics: ScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .productLocationService + .length, + itemBuilder: + (BuildContext context, + int index) { + return Padding( + padding: + EdgeInsets.all(8.0), + child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( +// crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment + .start, + children: [ + Expanded( + flex: 1, + child: Image.network(model + .productLocationService[ + index] + .projectImageUrl), + ), + SizedBox( + width: 10, + ), + Expanded( + flex: 4, + child: Text( + model + .productLocationService[ + index] + .locationDescription + + "\n" + + fixingString(model + .productLocationService[ + 0] + .cityName + .toString()), + style: TextStyle( + fontSize: + 12), + ), + ), + Expanded( + flex: 1, + child: IconButton( + icon: Icon(Icons + .location_on), + color: + Colors.red, + onPressed: + () {}, + ), + ), + Expanded( + flex: 1, + child: IconButton( + icon: Icon(Icons + .phone), + color: + Colors.red, + onPressed: + () {}, + ), + ), + ], + ), + Divider( + height: 1.2, + color: Colors.grey) + ], + ), + ); + }, + ), + ) + : Container(), + ], + ), + ), +// ListView(scrollDirection: Axis.vertical, shrinkWrap: true, children: [Text('ENAD')]), + ], + ), + ), + bottomSheet: footerWidget( + widget.product.stockAvailability != 'Out of stock', + widget.product.orderMaximumQuantity, + widget.product.orderMinimumQuantity, + widget.product.stockQuantity, + widget.product), + ) + : AppScaffold( + appBarTitle: 'product detail page', + isShowAppBar: true, + isPharmacy: true, + isShowDecPage: false, + body: SingleChildScrollView( + child: Column( + children: [ + Container( + width: double.infinity, + color: Colors.white, + child: Column( + children: [ + Image.network( + widget.product.images[0].src.trim(), + ), + widget.product.discountDescription != null + ? Container( + width: double.infinity, + height: 50, + color: Colors.yellowAccent, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Container( + alignment: Alignment.centerRight, + child: languageID == 'ar' + ? Text( + widget.product + .discountDescriptionn, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 17), + ) + : Text( + widget.product + .discountDescription, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 17), + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + flex: 0, + child: Container( + child: Image( + image: AssetImage( + 'assets/images/offer.png'), + ), + ), + ), + ], + ), + ) + : Container(), + ], + ), + ), + SizedBox( + height: 4, + ), + Container( + width: 500, + height: 150, + color: Colors.white, + child: productNameAndPrice(context, widget.product), + ), + SizedBox( + height: 6, + ), + Container( + width: 500, + height: 120, + color: Colors.white, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Text( + TranslationBase.of(context).specification, + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + ), + Divider(color: Colors.grey) + ], + ), + ), + SizedBox( + height: 6, + ), + Container( + width: 500, + margin: EdgeInsets.only(bottom: 100), +// height: 350, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Column( + children: [ + FlatButton( + onPressed: () { + setState(() { + isDetails = true; + isReviews = false; + isAvailabilty = false; + }); + }, + child: Text( + TranslationBase.of(context).details, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold), + ), + color: Colors.white, + ), + isDetails + ? Container( + width: 100, + height: 5, + color: Colors.green, + ) + : Container() + ], + ), + SizedBox( + width: 20, + ), + Column( + children: [ + FlatButton( + onPressed: () { + setState(() { + isDetails = false; + isReviews = true; + isAvailabilty = false; + }); + }, + child: Text( + TranslationBase.of(context).reviews, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold), + ), + color: Colors.white, + ), + isReviews + ? Container( + width: 100, + height: 5, + color: Colors.green, + ) + : Container(), + ], + ), + SizedBox( + width: 20, + ), + Column( + children: [ + FlatButton( + onPressed: () { + setState(() { + isDetails = false; + isReviews = false; + isAvailabilty = true; + }); + }, + child: Text( + TranslationBase.of(context).availability, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold), + ), + color: Colors.white, + ), + isAvailabilty + ? Container( + width: 100, + height: 5, + color: Colors.green, + ) + : Container(), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + isDetails + ? Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Text( + TranslationBase.of(context).description, + style: TextStyle( + fontSize: 17, + color: Colors.grey, + fontWeight: FontWeight.w600), + ), + ), + SizedBox( + height: 10, + ), + Container( + child: Text( + languageID == 'ar' + ? widget.product.fullDescriptionn + : widget.product.fullDescription, + style: TextStyle( + fontSize: 16, + fontFamily: 'WorkSans-Regular'), + ), + ), + ], + ), + ) + : isReviews + ? BaseView( + onModelReady: (model) => + model.getProductReviewsData( + widget.product.id), + builder: (_, model, wi) => model + .productDetailService + .length != + 0 && + model.productDetailService[0] + .reviews.length != + 0 + ? ListView.builder( + physics: ScrollPhysics(), + itemCount: model + .productDetailService[0] + .reviews + .length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemBuilder: (BuildContext context, + int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + child: Row( + children: [ + Container( + child: Text( + model + .productDetailService[ + 0] + .reviews[ + index] + .customerId + .toString(), + style: TextStyle( + fontSize: 17, + color: Colors + .grey, + fontWeight: + FontWeight + .w600), + ), + ), + Container( + margin: + EdgeInsets.only( + left: 210), + child: RatingBar + .readOnly( + initialRating: model + .productDetailService[ + 0] + .reviews[ + index] + .rating + .toDouble(), + size: 15.0, + filledColor: + Colors.yellow[ + 700], + emptyColor: Colors + .grey[500], + isHalfAllowed: + true, + halfFilledIcon: + Icons + .star_half, + filledIcon: + Icons.star, + emptyIcon: + Icons.star, + ), + ), + ], + ), + ), + SizedBox( + height: 10, + ), + Container( + child: Text( + model + .productDetailService[ + 0] + .reviews[index] + .reviewText, + style: TextStyle( + fontSize: 20), + ), + ), + SizedBox( + height: 50, + ), + Divider( + height: 1, + color: Colors.grey), + ], + ), + ); + }, + ) + : Container( + padding: EdgeInsets.all(15), + alignment: Alignment.center, + child: Text('No Reviews Available'), + ), + ) + : isAvailabilty + ? BaseView( + onModelReady: (model) => + model.getProductLocationData(), + builder: (_, model, wi) => + ListView.builder( + physics: ScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .productLocationService.length, + itemBuilder: (BuildContext context, + int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( +// crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Image.network(model + .productLocationService[ + index] + .projectImageUrl), + ), + SizedBox( + width: 10, + ), + Expanded( + flex: 4, + child: Text( + model + .productLocationService[ + index] + .locationDescription + + "\n" + + fixingString(model + .productLocationService[ + 0] + .cityName + .toString()), + style: TextStyle( + fontSize: 12), + ), + ), + Expanded( + flex: 1, + child: IconButton( + icon: Icon(Icons + .location_on), + color: Colors.red, + onPressed: () {}, + ), + ), + Expanded( + flex: 1, + child: IconButton( + icon: + Icon(Icons.phone), + color: Colors.red, + onPressed: () {}, + ), + ), + ], + ), + Divider( + height: 1.2, + color: Colors.grey) + ], + ), + ); + }, + ), + ) + : Container(), + ], + ), + ), +// ListView(scrollDirection: Axis.vertical, shrinkWrap: true, children: [Text('ENAD')]), + ], + ), + ), + bottomSheet: footerWidget( + widget.product.stockAvailability != 'Out of stock', + widget.product.orderMaximumQuantity, + widget.product.orderMinimumQuantity, + widget.product.stockQuantity, + widget.product), + ); + } +} + +class footerWidget extends StatefulWidget { + final bool isAvailble; + final int maxQuantity; + final int minQuantity; + final int quantityLimit; + final PharmacyProduct item; + footerWidget(this.isAvailble, this.maxQuantity, this.minQuantity, + this.quantityLimit, this.item); + @override + _footerWidgetState createState() => _footerWidgetState(); +} + +class _footerWidgetState extends State { + double quantityUI = 70; + bool showUI = false; + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height: quantityUI, + color: Colors.white, + child: Column( + children: [ + showUI + ? Container( + width: double.infinity, + height: 90, + color: Colors.white, + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + TranslationBase.of(context).quantity, + style: TextStyle( + fontSize: 15, fontWeight: FontWeight.bold), + ), + ), +// ListView( +// scrollDirection: Axis.horizontal, +// children: [ +// itemQuantity(), +// ], +// ), + Container( +// margin: EdgeInsets.symmetric(vertical: 20.0), + height: 50.0, + child: ListView( + scrollDirection: Axis.horizontal, + children: [ + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '1', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 1; + if (price >= widget.quantityLimit) { + isOverQuantity = true; + } else { + isOverQuantity = false; + return price; + } + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '2', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 2; + if (price >= widget.quantityLimit) { + isOverQuantity = true; + } else { + isOverQuantity = false; + return price; + } + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '3', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 3; + if (price >= widget.quantityLimit) { + isOverQuantity = true; + } else { + isOverQuantity = false; + return price; + } + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '4', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 4; + if (price >= widget.quantityLimit) { + isOverQuantity = true; + } else { + isOverQuantity = false; + return price; + } + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '5', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 5; + if (price >= widget.quantityLimit) { + isOverQuantity = true; + } else { + isOverQuantity = false; + return price; + } + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '6', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 6; + if (price >= widget.quantityLimit) { + isOverQuantity = true; + } else { + isOverQuantity = false; + return price; + } + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '7', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 7; + if (price >= widget.quantityLimit) { + isOverQuantity = true; + } else { + isOverQuantity = false; + return price; + } + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '8', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 8; + if (price >= widget.quantityLimit) { + isOverQuantity = true; + } else { + isOverQuantity = false; + return price; + } + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '9', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 9; + if (price >= widget.quantityLimit) { + isOverQuantity = true; + } else { + isOverQuantity = false; + return price; + } + }); + }, + ), + SizedBox( + width: 5, + ), + InkWell( + child: Container( + alignment: Alignment.center, + width: 50.0, + color: Colors.white, + child: Text( + '10', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + ), + onTap: () { + setState(() { + price = 10; + if (price >= widget.quantityLimit) { + isOverQuantity = true; + } else { + isOverQuantity = false; + return price; + } + }); + }, + ), + SizedBox( + width: 5, + ), + Container( + width: 50.0, + child: TextField( + decoration: + InputDecoration(labelText: 'quantity #'), + onChanged: (text) { + print(price); + print(widget.quantityLimit); + if (int.tryParse(text) == null) { + text = ''; + } else { + setState(() { + price = int.parse(text); + if (price >= widget.quantityLimit) { + isOverQuantity = true; + } else { + isOverQuantity = false; + } + }); + } + }, + ), + ), + ], + ), + ) + ], + ), + ), + ) + : Container( + height: 20, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 70, + height: 50, + child: FlatButton( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 4, + child: Text( + price.toString(), + style: TextStyle(fontSize: 20), + ), + ), + Expanded( + flex: 5, + child: Text( + TranslationBase.of(context).quantityShortcut, + style: TextStyle(fontSize: 16), + ), + ), + ], + ), + onPressed: () { + setState(() { + if (showUI) { + quantityUI = 70; + showUI = false; + } else { + quantityUI = 150; + showUI = true; + } + }); + }, + ), + ), + !widget.isAvailble && price > 0 || price > widget.quantityLimit + ? Container( + width: 190, + height: 46, + color: Colors.grey, + child: Align( + alignment: Alignment.center, + child: Text( + TranslationBase.of(context).addToCart, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15), + ), + ), + ) + : InkWell( + onTap: () { + addToCartFunction(price, widget.item.id); + }, + child: Container( + alignment: Alignment.center, + width: 190, + height: 46, + color: Colors.green, + child: Text( + TranslationBase.of(context).addToCart, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15), + ), + ), + ), + SizedBox( + width: 5, + ), + !widget.isAvailble && price > 0 || price > widget.quantityLimit + ? Container( + width: 120, + height: 46, + color: Colors.grey, + child: Align( + alignment: Alignment.center, + child: Text( + TranslationBase.of(context).buyNow, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15), + ), + ), + ) + : InkWell( + onTap: () { + print('buy now'); + addToCartFunction(price, widget.item.id); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CartOrderPage()), + ); + }, + child: Container( + alignment: Alignment.center, + width: 120, + height: 46, + color: Colors.blue, + child: Text( + TranslationBase.of(context).buyNow, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 15), + ), + ), + ), + ], + ), + ], + ), + ); + } +} + +class productNameAndPrice extends StatefulWidget { + BuildContext context; + PharmacyProduct item; + productNameAndPrice(this.context, this.item); + @override + _productNameAndPriceState createState() => _productNameAndPriceState(); +} + +class _productNameAndPriceState extends State { + @override + Widget build(BuildContext context) { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Text( + widget.item.price.toString(), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), + ), + SizedBox( + width: 40, + ), + Text( + widget.item.stockAvailability, + style: widget.item.stockAvailability == 'Out of stock' + ? TextStyle(fontWeight: FontWeight.bold, color: Colors.red) + : TextStyle( + fontWeight: FontWeight.bold, color: Colors.green), + ), + SizedBox(width: 20), + widget.item.stockAvailability == 'Out of stock' + ? Text( + TranslationBase.of(context).notifyMe, + style: TextStyle( + color: Colors.blue, + decoration: TextDecoration.underline, + ), + ) + : Container(), + widget.item.stockAvailability == 'Out of stock' + ? Icon( + FontAwesomeIcons.bell, + color: Colors.blue, + size: 15.0, + ) + : Container(), + Container( + margin: languageID == 'ar' + ? EdgeInsets.only(right: 25) + : EdgeInsets.only(left: 25), + width: 40, + height: 40, + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(30), + ), + child: !isInWishlit + ? IconButton( + icon: Icon(Icons.favorite_border), + color: Colors.white, + onPressed: () { + setState(() { + addToWishlistFunction(widget.item.id); + }); +// MyStatelessWidget(); + }, + ) + : IconButton( + icon: Icon(Icons.favorite), + color: Colors.red, + onPressed: () { + setState(() { + deleteFromWishlistFunction(widget.item.id); + }); +// MyStatelessWidget(); + }, + )), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + margin: EdgeInsets.only(left: 5), + child: Align( + alignment: + languageID == 'ar' ? Alignment.topRight : Alignment.topLeft, + child: Text( + languageID == 'ar' + ? widget.item.fullDescriptionn + : widget.item.fullDescription, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15), + ), + ), + ), + ), + Row( + children: [ + Expanded( + flex: 2, + child: Container( + margin: EdgeInsets.only(right: 150), + child: Align( + alignment: Alignment.bottomLeft, + 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, + ), + ), + ), + ), + Expanded( + flex: 1, + child: Container( + child: widget.item.rxMessage != null + ? Text( + languageID == 'ar' + ? widget.item.rxMessagen.toString() + : widget.item.rxMessage.toString(), + style: TextStyle(color: Colors.red, fontSize: 10), + ) + : Container()), + ), + widget.item.rxMessage != null + ? Icon( + FontAwesomeIcons.questionCircle, + color: Colors.red, + size: 15.0, + ) + : Container(), + ], + ), + ], + ); + } +} + +//productNameAndPrice(BuildContext context, item) { +// return Column( +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Padding( +// padding: const EdgeInsets.all(8.0), +// child: Row( +// children: [ +// Text( +// item.price.toString(), +// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), +// ), +// SizedBox( +// width: 40, +// ), +// Text( +// item.stockAvailability, +// style: item.stockAvailability == 'Out of stock' +// ? TextStyle(fontWeight: FontWeight.bold, color: Colors.red) +// : TextStyle(fontWeight: FontWeight.bold, color: Colors.green), +// ), +// SizedBox(width: 20), +// item.stockAvailability == 'Out of stock' +// ? Text( +// TranslationBase.of(context).notifyMe, +// style: TextStyle( +// color: Colors.blue, +// decoration: TextDecoration.underline, +// ), +// ) +// : Container(), +// item.stockAvailability == 'Out of stock' +// ? Icon( +// FontAwesomeIcons.bell, +// color: Colors.blue, +// size: 15.0, +// ) +// : Container(), +// +// Container( +// margin: languageID=='ar' ? EdgeInsets.only(right: 25) : EdgeInsets.only(left: 25), +// width: 40, +// height: 40, +// decoration: BoxDecoration( +// color: Colors.grey, +// borderRadius: BorderRadius.circular(30), +// ), +// child: !isInWishlit ?IconButton( +// icon: Icon(Icons.favorite_border), +// color: Colors.white, +// onPressed: () { +// addToWishlistFunction(item.id); +//// MyStatelessWidget(); +// +// }, +// ):IconButton( +// icon: Icon(Icons.favorite), +// color: Colors.red, +// onPressed: () { +// deleteFromWishlistFunction(item.id); +//// MyStatelessWidget(); +// +// }, +// ) +// ), +// +// ], +// ), +// ), +// Padding( +// padding: const EdgeInsets.all(8.0), +// child: Container( +// margin: EdgeInsets.only(left: 5), +// child: Align( +// alignment: +// languageID == 'ar' ? Alignment.topRight : Alignment.topLeft, +// child: Text( +// languageID == 'ar' ? item.fullDescriptionn : item.fullDescription, +// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15), +// ), +// ), +// ), +// ), +// Row( +// children: [ +// Expanded( +// flex: 2, +// child: Container( +// margin: EdgeInsets.only(right: 150), +// child: Align( +// alignment: Alignment.bottomLeft, +// 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, +// ), +// ), +// ), +// ), +// Expanded( +// flex: 1, +// child: Container( +// child: item.rxMessage != null +// ? Text( +// languageID == 'ar' +// ? item.rxMessagen.toString() +// : item.rxMessage.toString(), +// style: TextStyle(color: Colors.red, fontSize: 10), +// ) +// : Container()), +// ), +// item.rxMessage != null +// ? Icon( +// FontAwesomeIcons.questionCircle, +// color: Colors.red, +// size: 15.0, +// ) +// : Container(), +// ], +// ), +// ], +// ); +//} + +slideDetail() { + return Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 14.0, vertical: 15.0), + decoration: const BoxDecoration( + border: Border( + top: BorderSide(width: 0.5, color: Colors.grey), + left: BorderSide(width: 0.5, color: Colors.grey), + right: BorderSide(width: 0.5, color: Colors.grey), + bottom: BorderSide(width: 0.5, color: Colors.grey), + ), + color: Colors.white, + ), + child: const Text('1', + textAlign: TextAlign.center, + style: TextStyle(color: Color(0xFF000000))), + ), + ) + ], + ); +} + +fixingString(txt) { + String stringTxt; + String newTxt; + stringTxt = txt.toString(); + newTxt = stringTxt.split('.')[1]; + + return newTxt; +} + +getLanguageID() async { + languageID = await sharedPref.getString(APP_LANGUAGE); +} + +getSpecificationData(itemID) async { + ProductDetailViewModel x = new ProductDetailViewModel(); + specificationData = await x.productSpecificationData(itemID); +} + +addToCartFunction(quantity, itemID) async { + ProductDetailViewModel x = new ProductDetailViewModel(); + await x.addToCartData(quantity, itemID); +} + +addToWishlistFunction(itemID) async { + ProductDetailViewModel x = new ProductDetailViewModel(); + isInWishlit = true; + await x.addToWishlistData(itemID); +} + +deleteFromWishlistFunction(itemID) async { + ProductDetailViewModel x = new ProductDetailViewModel(); + isInWishlit = false; + await x.addToWishlistData(itemID); +} + +checkWishlist() async { + ProductDetailViewModel x = new ProductDetailViewModel(); + await x.checkWishlistData(); + for (int i = 0; i < x.wishListItems.length; i++) { +// print(itemID); +// print(x.wishListItems[i].product.id); + if (itemID == x.wishListItems[i].product.id) { + isInWishlit = true; +// print('in wishlist'); + break; + } else { + isInWishlit = false; +// print('not in wishlist'); + } + } +} + +class sttingModalBottomSheet extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container(); + } +} + +settingModalBottomSheet(context) { + showModalBottomSheet( + context: context, + builder: (BuildContext bc) { + return Container( + child: new Wrap( + children: [ + new ListTile( + leading: new Icon(Icons.shopping_cart), + title: new Text('Add to cart'), + onTap: () => { + if (price > 0) + {addToCartFunction(price, itemID)} + else + { + AppToast.showErrorToast( + message: "you should add quantity") + } + }), + new ListTile( + leading: new Icon(Icons.favorite_border), + title: new Text('Add to wishlist'), + onTap: () => {addToWishlistFunction(itemID)}, + ), + new ListTile( + leading: new Icon(Icons.compare), + title: new Text('Compare'), + onTap: () => { + Provider.of(context, listen: false) + .addItem(specificationData), + }, + ), + ], + ), + ); + }); +} + +userInfo(id, product) async { + customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + if (customerId != null) { + itemID = id; + product = product; + checkWishlist(); + } + return customerId; +// getSpecificationData(itemID); +} diff --git a/lib/pages/pharmacies/screens/address-select-page.dart b/lib/pages/pharmacies/screens/address-select-page.dart new file mode 100644 index 00000000..6c39ba3f --- /dev/null +++ b/lib/pages/pharmacies/screens/address-select-page.dart @@ -0,0 +1,34 @@ +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 new file mode 100644 index 00000000..51d93d71 --- /dev/null +++ b/lib/pages/pharmacies/screens/cart-order-page.dart @@ -0,0 +1,383 @@ +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/core/viewModels/project_view_model.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); + + final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; + + return BaseView( + onModelReady: (model) => model.getOrderPreviewData(), + builder: (_, model, wi) => ChangeNotifierProvider.value( + value: model.cartResponse, + child: AppScaffold( + appBarTitle: TranslationBase.of(context).shoppingCart, + isShowAppBar: true, + isShowDecPage: false, + isPharmacy: true, + baseViewModel: model, + 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( + TranslationBase.of(context).subtotal, + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + Texts( + "${TranslationBase.of(context).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( + "${TranslationBase.of(context).vat}", + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + Texts( + "${TranslationBase.of(context).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( + "${TranslationBase.of(context).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, + ) + ], + ), + ), + ), + ), + ), + ) + : Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + 'assets/images/new-design/empty_box.png', + width: 100, + height: 100, + fit: BoxFit.cover, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + 'There is no data', + style: TextStyle(fontSize: 30), + ), + ) + ], + ), + ), + 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) { + ProjectViewModel projectProvider = Provider.of(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( + TranslationBase.of(context) + .pharmacyServiceTermsCondition, + 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: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.symmetric( + horizontal: 0, vertical: 0), + child: Row( + children: [ + Texts( + "${TranslationBase.of(context).sar} ${(cart.subtotal).toStringAsFixed(2)}", + fontSize: + projectProvider.isArabic ? 12 : 14, + fontWeight: FontWeight.bold, + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 4), + child: Texts( + "${TranslationBase.of(context).inclusiveVat}", + fontSize: 8, + color: Colors.grey, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + Texts( + "${cart.quantityCount} ${TranslationBase.of(context).items}", + fontSize: 10, + color: Colors.grey, + fontWeight: FontWeight.bold, + ), + ], + ), + ), + RaisedButton( + onPressed: isAgree + ? () => { + Navigator.push( + context, + FadePage( + page: OrderPreviewPage( + widget.addresses))) + } + : null, + child: new Text( + "${TranslationBase.of(context).checkOut}", + style: new TextStyle( + color: isAgree + ? Colors.white + : Colors.grey.shade300, + fontSize: 14), + ), + color: Color(0xff005aff), + disabledColor: Color(0xff005aff), + ), + ], + ), + ), + ], + ) + : Container(), + )); + } +} diff --git a/lib/pages/pharmacies/screens/cart-order-preview.dart b/lib/pages/pharmacies/screens/cart-order-preview.dart new file mode 100644 index 00000000..9d819c1c --- /dev/null +++ b/lib/pages/pharmacies/screens/cart-order-preview.dart @@ -0,0 +1,832 @@ +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/core/viewModels/project_view_model.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/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.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) { + final mediaQuery = MediaQuery.of(context); + final height = mediaQuery.size.height - + 60 - + mediaQuery.padding.top; + + return BaseView( + onModelReady: (model) => model.getShoppingCart(), + builder: (_, model, wi) => ChangeNotifierProvider.value( + value: model.paymentCheckoutData, + child: AppScaffold( + appBarTitle: "${TranslationBase.of(context).checkOut}", + isShowAppBar: true, + isPharmacy: true, + isShowDecPage: false, + 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( + "${TranslationBase.of(context).subtotal}", + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + Texts( + "${TranslationBase.of(context).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( + "${TranslationBase.of(context).shipping}", + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + Texts( + "${TranslationBase.of(context).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( + "${TranslationBase.of(context).vat}", + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + Texts( + "${TranslationBase.of(context).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( + "${TranslationBase.of(context).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: PharmacyAddressesPage())) + .then((result) { + if (result != null) { + 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( + "${TranslationBase.of(context).shipBy}", + 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) { + ProjectViewModel projectProvider = Provider.of(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( + "${TranslationBase.of(context).lakumPoints}", + 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( + "${TranslationBase.of(context).riyal}", + fontSize: 12, + fontWeight: FontWeight.bold, + ), + Container( + margin: projectProvider.isArabic + ? EdgeInsets.only(right: 4) + : EdgeInsets.only(left: 4), + width: 60, + height: 50, + child: TextField( + decoration: InputDecoration( + border: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.black, width: 0.2), + gapPadding: 0, + borderRadius: projectProvider.isArabic + ? BorderRadius.only( + topRight: Radius.circular(8), + bottomRight: Radius.circular(8)) + : 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: 50, + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12), + decoration: new BoxDecoration( + color: Color(0xff3666E0), + shape: BoxShape.rectangle, + borderRadius: projectProvider.isArabic + ? BorderRadius.only( + topLeft: Radius.circular(6), + bottomLeft: Radius.circular(6)) + : BorderRadius.only( + topRight: Radius.circular(6), + bottomRight: Radius.circular(6)), + border: Border.fromBorderSide(BorderSide( + color: Color(0xff3666E0), + width: 0.8, + )), + ), + child: Texts( + "${TranslationBase.of(context).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( + "${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}", + fontSize: 14, + fontWeight: FontWeight.bold, + color: Color(0xff929295), + ), + Padding( + padding: + const EdgeInsets.symmetric(horizontal: 4), + child: Texts( + "${TranslationBase.of(context).inclusiveVat}", + fontSize: 8, + color: Color(0xff929295), + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ), + Texts( + "${model.cartResponse.quantityCount} ${TranslationBase.of(context).items}", + 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( + "${TranslationBase.of(context).proceedPay}", + 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 new file mode 100644 index 00000000..fc1270c0 --- /dev/null +++ b/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart @@ -0,0 +1,101 @@ +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 new file mode 100644 index 00000000..c40771b8 --- /dev/null +++ b/lib/pages/pharmacies/screens/lacum-registration-page.dart @@ -0,0 +1,234 @@ +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); + 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( + appBarTitle: + "${TranslationBase.of(context).register} ${TranslationBase.of(context).lakum}", + isShowAppBar: true, + isShowDecPage: false, + backgroundColor: Colors.white, + baseViewModel: model, + body: Container( + width: double.infinity, + child: SingleChildScrollView( + child: SizedBox( + height: + mediaQuery.size.height - 60 - 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 new file mode 100644 index 00000000..861279f3 --- /dev/null +++ b/lib/pages/pharmacies/screens/lacum-setting-page.dart @@ -0,0 +1,238 @@ +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); + + return BaseView( + onModelReady: (model) => model.setLakumData( + widget.lacumInformation, widget.lacumGroupInformation), + builder: (_, model, wi) => AppScaffold( + appBarTitle: "${TranslationBase.of(context).lakum}", + isShowAppBar: true, + isShowDecPage: false, + backgroundColor: Colors.white, + baseViewModel: model, + body: Container( + width: double.infinity, + child: SingleChildScrollView( + child: SizedBox( + height: mediaQuery.size.height - + 60 - + 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 new file mode 100644 index 00000000..9103b646 --- /dev/null +++ b/lib/pages/pharmacies/screens/lacum-transfer-page.dart @@ -0,0 +1,315 @@ +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); + + return BaseView( + onModelReady: (model) => model.setLakumData( + widget.lacumInformation, widget.lacumGroupInformation), + builder: (_, model, wi) => AppScaffold( + appBarTitle: "${TranslationBase.of(context).lakum}", + isShowAppBar: true, + isShowDecPage: false, + backgroundColor: Colors.white, + 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 new file mode 100644 index 00000000..adbb07c2 --- /dev/null +++ b/lib/pages/pharmacies/screens/lakum-main-page.dart @@ -0,0 +1,555 @@ +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 new file mode 100644 index 00000000..47270eee --- /dev/null +++ b/lib/pages/pharmacies/screens/lakum-points-month-page.dart @@ -0,0 +1,271 @@ +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 new file mode 100644 index 00000000..f7b6d9e6 --- /dev/null +++ b/lib/pages/pharmacies/screens/lakum-points-year-page.dart @@ -0,0 +1,201 @@ +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 new file mode 100644 index 00000000..228b0874 --- /dev/null +++ b/lib/pages/pharmacies/screens/lakum-terms-conditions-page.dart @@ -0,0 +1,77 @@ +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); + + return BaseView( + onModelReady: (model) => model.getUserTermsAndConditionsForEPharmcy(), + builder: (_, model, wi) => AppScaffold( + appBarTitle: "${TranslationBase.of(context).register} ${TranslationBase.of(context).lakum}", + isShowAppBar: true, + isShowDecPage: false, + 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.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/payment-method-select-page.dart b/lib/pages/pharmacies/screens/payment-method-select-page.dart new file mode 100644 index 00000000..8cdbaf3c --- /dev/null +++ b/lib/pages/pharmacies/screens/payment-method-select-page.dart @@ -0,0 +1,202 @@ +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 new file mode 100644 index 00000000..87c1b97c --- /dev/null +++ b/lib/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart @@ -0,0 +1,51 @@ +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 2ae2be65..fd51d6ef 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -2,27 +2,32 @@ 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/pharmacies/screens/order-preview-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/widgets/BannerPager.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/manufacturerItem.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.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 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart'; -class PharmacyPage extends StatelessWidget { +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: true, + isShowAppBar: false, isShowDecPage: false, baseViewModel: model, backgroundColor: Colors.white, @@ -33,8 +38,7 @@ class PharmacyPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ BannerPager(model), - GridViewButtons(), - /*BannerPager(model.getBannerImagesUrl()),*/ + GridViewButtons(model), Container( margin: EdgeInsets.fromLTRB(10, 0, 10, 0), child: Row( @@ -48,9 +52,12 @@ class PharmacyPage extends StatelessWidget { TranslationBase.of(context).viewAll, hasBorder: true, vPadding: 6, + hPadding: 4, borderColor: Colors.green, - color: Colors.green, - handler: () {}, + textColor: Colors.green, + handler: () =>{ + Navigator.push(context,FadePage(page: ProductBrandsPage())), + }, ), ], ), @@ -77,15 +84,18 @@ class PharmacyPage extends StatelessWidget { TranslationBase.of(context).viewAll, hasBorder: true, vPadding: 6, + hPadding: 4, borderColor: Colors.green, - color: Colors.green, + textColor: Colors.green, handler: () {}, ), ], ), ), Container( - height: model.lastVisitedProducts.length > 0 ? MediaQuery.of(context).size.height / 4 : 0, + height: model.lastVisitedProducts.length > 0 + ? MediaQuery.of(context).size.height / 4 + 20 + : 0, child: ListView.builder( itemBuilder: (ctx, i) => ProductTileItem(model.lastVisitedProducts[i]), @@ -106,15 +116,18 @@ class PharmacyPage extends StatelessWidget { TranslationBase.of(context).viewAll, hasBorder: true, borderColor: Colors.green, - color: Colors.green, + textColor: Colors.green, vPadding: 6, - handler: () {}, + hPadding: 4, + handler: () =>{ + Navigator.push(context,FadePage(page: ProductBrandsPage())), + }, ), ], ), ), Container( - height: MediaQuery.of(context).size.height / 4, + height: MediaQuery.of(context).size.height / 4 + 20, child: ListView.builder( itemBuilder: (ctx, i) => ProductTileItem(model.bestSellerProduct[i]), @@ -132,6 +145,10 @@ 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; @@ -153,24 +170,34 @@ 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: OrderPreviewPage())); - }), + 'assets/images/pharmacy_module/offer_icon.png', () { + Navigator.push(context, FadePage(page: OffersCategorisePage())); + }), ), DashboardItem( imageName: 'pharmacy_module/bg_2.png', opacity: 0, hasColorFilter: false, child: GridViewCard(TranslationBase.of(context).medicationRefill, - 'assets/images/pharmacy_module/medication_icon.png', () {}), + '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())); + } + }); + }), ), DashboardItem( imageName: 'pharmacy_module/bg_3.png', opacity: 0, hasColorFilter: false, child: GridViewCard(TranslationBase.of(context).myPrescriptions, - 'assets/images/pharmacy_module/prescription_icon.png', () {}), + 'assets/images/pharmacy_module/prescription_icon.png', () { + Navigator.push(context, FadePage(page: PharmacyAddressesPage())); + }), ), DashboardItem( imageName: 'pharmacy_module/bg_4.png', @@ -179,7 +206,7 @@ class GridViewButtons extends StatelessWidget { child: GridViewCard( TranslationBase.of(context).searchAndScanMedication, 'assets/images/pharmacy_module/search_scan_icon.png', - () {}), + () {}), ), ], ), @@ -219,11 +246,16 @@ class GridViewCard extends StatelessWidget { ), ), ), - Expanded( - child: BorderedButton( - TranslationBase.of(context).viewAll, - handler: handler, - ), + Row( + children: [ + BorderedButton( + TranslationBase.of(context).viewAll, + handler: handler, + tPadding: 0, + bPadding: 0, + ), + Expanded(child: Container()), + ], ), ], ), diff --git a/lib/pages/pharmacies/search_brands_page.dart b/lib/pages/pharmacies/search_brands_page.dart new file mode 100644 index 00000000..8f771490 --- /dev/null +++ b/lib/pages/pharmacies/search_brands_page.dart @@ -0,0 +1,145 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.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'; + +class SearchBrandsPage extends StatefulWidget { + @override + _SearchBrandsPageState createState() => _SearchBrandsPageState(); +} + +class _SearchBrandsPageState extends State { + final textController = TextEditingController(); + final _formKey = GlobalKey(); + String msg = ''; + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.searchProducts(), + builder: (BuildContext context, 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, + // ), + ], + ), + ), + model.searchList.length == 0 + ? Container( + child: Text( + 'no data' + model.searchList.length.toString()), + ) + : Expanded( + child: Container( + child: ListView.builder( + itemCount: model.searchList.length, + itemBuilder: (BuildContext ctx, index) { + return Padding( + padding:EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Text( + model.searchList[index].name, + style: TextStyle(fontSize: 20), + ), + ), + ), + Divider(height: 1, color: Colors.grey) + ],), + ); + }, + ), + ), + ), + ], + ), + ), + ), + ), + ); + } + + searchMedicine(model, BuildContext context) { + Utils.hideKeyboard(context); + if (_formKey.currentState.validate()) + model.searchProducts(productName: textController.text); + } +} diff --git a/lib/pages/pharmacies/widgets/ProductOrderItem.dart b/lib/pages/pharmacies/widgets/ProductOrderItem.dart index 81b6068a..92e2c39d 100644 --- a/lib/pages/pharmacies/widgets/ProductOrderItem.dart +++ b/lib/pages/pharmacies/widgets/ProductOrderItem.dart @@ -1,13 +1,239 @@ +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) { - return ListTile( - leading: Icon( - Icons.delete_outline_sharp, - color: Colors.grey.shade800, - ), + 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, + ), + ], ); } + + _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 new file mode 100644 index 00000000..d38f437c --- /dev/null +++ b/lib/pages/pharmacies/widgets/ProductOrderPreviewItem.dart @@ -0,0 +1,111 @@ +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 62493387..20d6b730 100644 --- a/lib/pages/pharmacies/widgets/ProductTileItem.dart +++ b/lib/pages/pharmacies/widgets/ProductTileItem.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/phramacy-product-detail-page.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -17,7 +18,7 @@ class ProductTileItem extends StatelessWidget { void productOnClick(BuildContext ctx) { _saveLastVisitProducts(); - Navigator.push(ctx, FadePage(page: ProductDetailScreen(item))); + Navigator.push(ctx, FadePage(page: ProductDetailPage(item))); } void _saveLastVisitProducts() async { @@ -69,11 +70,17 @@ class ProductTileItem extends StatelessWidget { Container( margin: EdgeInsets.fromLTRB(0, 16, 0, 0), alignment: Alignment.center, - child: Image.network( - item.images[0].src, - fit: BoxFit.cover, - height: 80, - ), + 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, + ), ), Container( width: item.rxMessage != null @@ -104,7 +111,7 @@ class ProductTileItem extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - projectProvider.isArabic ? item.name : item.namen, + projectProvider.isArabic ? item.namen : item.name, regular: true, fontSize: 12, fontWeight: FontWeight.w400, @@ -119,19 +126,21 @@ class ProductTileItem extends StatelessWidget { ), Row( children: [ - StarRating( - totalAverage: item.approvedTotalReviews > 0 - ? (item.approvedRatingSum.toDouble() / - item.approvedTotalReviews.toDouble()) - .toDouble() - : 0, - forceStars: true), - Texts( + Expanded( + child: 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 new file mode 100644 index 00000000..14a53e72 --- /dev/null +++ b/lib/pages/pharmacies/widgets/lacum-banner-widget.dart @@ -0,0 +1,289 @@ +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-banner-widget.dart b/lib/pages/pharmacies/widgets/lakum-banner-widget.dart new file mode 100644 index 00000000..14a53e72 --- /dev/null +++ b/lib/pages/pharmacies/widgets/lakum-banner-widget.dart @@ -0,0 +1,289 @@ +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 new file mode 100644 index 00000000..6e4e2309 --- /dev/null +++ b/lib/pages/pharmacies/widgets/lakum-point-table-row-widget.dart @@ -0,0 +1,116 @@ +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/widgets/lakum_point_table_row_widget.dart b/lib/pages/pharmacies/widgets/lakum_point_table_row_widget.dart new file mode 100644 index 00000000..bddd2e3b --- /dev/null +++ b/lib/pages/pharmacies/widgets/lakum_point_table_row_widget.dart @@ -0,0 +1,116 @@ +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 new file mode 100644 index 00000000..822dfe89 --- /dev/null +++ b/lib/pages/pharmacies/wishlist.dart @@ -0,0 +1,69 @@ +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/wishlist_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/ProductCheckTypeWidget.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + +class WishlistPage extends StatefulWidget { + @override + _WishlistPageState createState() => _WishlistPageState(); +} + +class _WishlistPageState extends State { + bool isTrue = true; + + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getWishlistData(), + builder: (_, model, wi) => AppScaffold( + appBarTitle: 'Wishlist page', + isShowAppBar: false, + isShowDecPage: false, + isPharmacy: false, + baseViewModel: model, + body: model.wishListList.length == 0 + ? Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + 'assets/images/new-design/empty_box.png', + width: 100, + height: 100, + fit: BoxFit.cover, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + 'There is no data', + style: TextStyle(fontSize: 30), + ), + ) + ], + ), + ), + ) + : Container( + child: Column( + children: [ + Expanded( + flex: 20, + child: Container( + width: double.infinity, + height: + MediaQuery.of(context).size.height * 0.85, //250, + child: + ProductCheckTypeWidget(isTrue, model.wishListList), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart new file mode 100644 index 00000000..576bf2a0 --- /dev/null +++ b/lib/pages/pharmacy/order/Order.dart @@ -0,0 +1,1148 @@ +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.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'; +import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; + +dynamic languageID; +class OrderPage extends StatefulWidget { + +// orderList({this.customerId, this.pageId}); + + String customerID; + + OrderPage({@required this.customerID}); + + @override + _OrderPageState createState() => _OrderPageState(); +} + +class _OrderPageState extends State with SingleTickerProviderStateMixin{ + + String pageID= "1"; + String customerId = ""; + String order =""; + + List orderList = [] ; + List deliveredOrderList = [] ; + List processingOrderList = []; + List cancelledOrderList = []; + List pendingOrderList = []; + + TabController _tabController; +// AppSharedPreferences sharedPref = AppSharedPreferences(); + getLanguageID() async { + languageID = await sharedPref.getString(APP_LANGUAGE); + } + + @override + void initState() { + getLanguageID(); + super.initState(); + + + _tabController = new TabController(length: 4, vsync: this,); + } + + @override + Widget build(BuildContext context) { + print( "customerID" + widget.customerID); + return BaseView( + onModelReady: (model) => model.getOrder(widget.customerID, pageID), + builder: (_,model, wi )=> AppScaffold( + appBarTitle:TranslationBase.of(context).order, + baseViewModel: model, + isShowAppBar: true, + isPharmacy:true , + body: Container( + child: Column( + children: [ + TabBar( + tabs: [ + Tab(text: TranslationBase.of(context).delivered), + 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){ + for(int i=0 ; i< model.order.length; i++){ + if( model.order[i].orderStatusId == 30 || model.order[i].orderStatusId == 997 + || model.order[i].orderStatusId == 994 + ){ + deliveredOrderList.add(model.order[i]); + } + } + return Container( + width: MediaQuery.of(context).size.width, + child: model.order.length != 0 + ? SingleChildScrollView( + child: Column( + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: deliveredOrderList.length, + 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(deliveredOrderList[index].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(deliveredOrderList[index].createdOnUtc.toString().substring(0,11), + style: TextStyle(fontSize: 14.0, + ), + ), + ), + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:deliveredOrderList[index]))); + }, + child: SvgPicture.asset( + languageID == "ar" + ? 'assets/images/pharmacy/arrow_left.svg' + :'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: [ + 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: deliveredOrderList[index].orderStatusId == 30 + ? Text( +// deliveredOrderList[0].orderStatus.toString().substring(12), + TranslationBase.of(context).deliveredOrder, + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ) + : Text( + languageID == "ar" + ? deliveredOrderList[index].orderStatusn.toString(): + deliveredOrderList[index].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(deliveredOrderList[index].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(deliveredOrderList[index].orderItems.length.toString(), + 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: [ + SvgPicture.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){ + for(int i=0 ; i< model.order.length; i++){ + if( model.order[i].orderStatusId == 20 || model.order[i].orderStatusId == 995 || + model.order[i].orderStatusId == 998 || model.order[i].orderStatusId == 999){ + processingOrderList.add(model.order[i]); + } + } + return Container( + width: MediaQuery.of(context).size.width, + child: model.order.length != 0 + ? SingleChildScrollView( + child: Column( + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: processingOrderList.length, + 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(processingOrderList[index].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(processingOrderList[index].createdOnUtc.toString().substring(0,11), + style: TextStyle(fontSize: 14.0, + ), + ), + ), + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:processingOrderList[index]))); + }, + child: SvgPicture.asset( + languageID == "ar" + ? 'assets/images/pharmacy/arrow_left.svg' + :'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: [ + 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: processingOrderList[index].orderStatusId == 20 + ? Text( +// deliveredOrderList[0].orderStatus.toString().substring(12), + TranslationBase.of(context).processingOrder, + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ) + : Text( + languageID == "ar" + ? processingOrderList[index].orderStatusn.toString(): + processingOrderList[index].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(processingOrderList[index].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(processingOrderList[index].orderItems.length.toString(), + 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: [ + SvgPicture.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, + )), + ), + ], + ), + ), + ), + ); +// return Container( +// child: model.order.length != 0 +// ? SingleChildScrollView( +// child: Column( +// children: [ +// ListView.builder( +// child: 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(processingOrderList[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(processingOrderList[0].createdOnUtc.toString().substring(0,11), +// style: TextStyle(fontSize: 14.0, +// ), +// ), +// ), +// ], +// ), +// ], +// ), +// ), +// Container( +// margin: EdgeInsets.all(8), +// child: InkWell( +// onTap: () { +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:processingOrderList[0]))); +// }, +// 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: [ +// 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( widget.languageID == "ar" +// ? processingOrderList[0].orderStatusn.toString() +// : processingOrderList[0].orderStatus.toString().substring(12), +//// 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(processingOrderList[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(processingOrderList[0].orderItems[0].quantity.toString(), +// 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: [ +// SvgPicture.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){ + for(int i=0 ; i< model.order.length; i++){ + if( model.order[i].orderStatusId == 10){ + pendingOrderList.add(model.order[i]); + } + } + return Container( + child: model.order.length != 0 + ? SingleChildScrollView( + child: Column( + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: pendingOrderList.length , + 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(pendingOrderList[index].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(pendingOrderList[index].createdOnUtc.toString().substring(0,11), + style: TextStyle(fontSize: 14.0, + ), + ), + ), + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.all( 8.0), + child: InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:pendingOrderList[index]))); + }, + child: SvgPicture.asset( + languageID == "ar" + ? 'assets/images/pharmacy/arrow_left.svg' + :'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: [ + 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: pendingOrderList[index].orderStatusId == 10 + ? Text( +// deliveredOrderList[0].orderStatus.toString().substring(12), + TranslationBase.of(context).pendingOrder, + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ) + : Text( + languageID == "ar" + ? pendingOrderList[index].orderStatusn.toString(): + pendingOrderList[index].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(pendingOrderList[index].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(pendingOrderList[index].orderItems.length.toString(), + 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: [ + SvgPicture.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){ + for(int i=0 ; i< model.order.length; i++){ + if( model.order[i].orderStatusId == 40 || model.order[i].orderStatusId == 996 + || model.order[i].orderStatusId == 200){ + cancelledOrderList.add(model.order[i]); + } + } + return Container( + child: model.order.length != 0 + ? SingleChildScrollView( + child: Column( + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: cancelledOrderList.length, + 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(cancelledOrderList[index].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(cancelledOrderList[index].createdOnUtc.toString().substring(0,11), + style: TextStyle(fontSize: 14.0, + ), + ), + ), + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:cancelledOrderList[index]))); + }, + child: SvgPicture.asset( + languageID == "ar" + ? 'assets/images/pharmacy/arrow_left.svg' + :'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: [ + 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: cancelledOrderList[index].orderStatusId == 40 + ? Text( +// deliveredOrderList[0].orderStatus.toString().substring(12), + TranslationBase.of(context).cancelledOrder, + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ) + : Text( + languageID == "ar" + ? cancelledOrderList[index].orderStatusn.toString(): + cancelledOrderList[index].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(cancelledOrderList[index].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(cancelledOrderList[index].orderItems.length.toString(), + 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: [ + SvgPicture.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, + )), + ), + ], + ), + ), + ), + ); + } + + +} + + + + + + diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart new file mode 100644 index 00000000..5438663d --- /dev/null +++ b/lib/pages/pharmacy/order/OrderDetails.dart @@ -0,0 +1,650 @@ +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:flutter/src/widgets/image.dart' as flutterImage; + +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:provider/provider.dart'; + + + + +dynamic languageID; +class OrderDetailsPage extends StatefulWidget { + OrderModel orderModel; + + OrderDetailsPage({@required this.orderModel}); + + @override + _OrderDetailsPageState createState() => _OrderDetailsPageState(); +} + +class _OrderDetailsPageState extends State { + getLanguageID() async { + languageID = await sharedPref.getString(APP_LANGUAGE); + } + +// AppSharedPreferences sharedPref = AppSharedPreferences(); + String orderId = ""; + String customerId; + List orderList = []; + + List cancelledOrderList = []; + +// String orderId="3516"; + var model; + var isCancel = false; + var isRefund = false; + var dataIsCancel; + var dataIsRefund; + + @override + void initState() { + getLanguageID(); + super.initState(); + print(widget.orderModel.orderItems.length); + getCancelOrder(widget.orderModel.id); +// cancelOrderDetail(order) + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getOrderDetails(widget.orderModel.id), + builder: (_, model, wi) => AppScaffold( + appBarTitle: TranslationBase.of(context).orderDetail, + 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: getStatusBackgroundColor(), + style: BorderStyle.solid, + width: 5.0, + ), + color: getStatusBackgroundColor(), + borderRadius: BorderRadius.circular(30.0)), + child: Text( + languageID == "ar" + ? widget.orderModel.orderStatusn.toString(): + widget.orderModel.orderStatus.toString().substring(12) , +// 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( + widget.orderModel.shippingAddress.firstName + .toString() + .substring(10) + + ' ' + + widget.orderModel.shippingAddress.lastName + .toString() + .substring(9), + 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( + widget.orderModel.shippingAddress.address1 + .toString() + .substring(9), + style: TextStyle( + fontSize: 10.0, + fontWeight: FontWeight.bold, + color: Colors.grey, + ), + ),] + ), + ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.orderModel.shippingAddress.address2 + .toString() + .substring(9) + + ' ' + + widget.orderModel.shippingAddress.country + .toString() + + ' ' + + widget.orderModel.shippingAddress.zipPostalCode + .toString(), + style: TextStyle( + fontSize: 10.0, + fontWeight: FontWeight.bold, + color: Colors.grey, + ), + ), + ]), + ), + Container( + child: 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( + widget.orderModel.shippingAddress.phoneNumber + .toString(), + 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( + child: flutterImage.Image.asset( + widget.orderModel.shippingRateComputationMethodSystemName != + "Shipping.Aramex" + ? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png" + : "assets/images/pharmacy_module/payment/aramex_shipping_logo.png", + fit: BoxFit.contain, +// height: 100, + width: 100, + ), + ), +// Container( +// child: widget.orderModel +// .shippingRateComputationMethodSystemName == +// "Shipping.FixedOrByWeight" +// ? Container( +// margin: EdgeInsets.only(bottom: 10.0, top: 10.0), +// child: SvgPicture.asset( +// 'assets/images/pharmacy_module/payment/hmg_shipping_logo.png', +// height: 25, +// width: 25, +// ), +// ) +// : Container( +// margin: EdgeInsets.only(bottom: 10.0, top: 10.0), +// child: SvgPicture.asset( +// 'assets/images/pharmacy_module/payment/aramex_shipping_logo.png', +// height: 25, +// width: 25, +// ), +// ), +// ), + ], + ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 8, + indent: 0, + endIndent: 0, + ), + Row( + children: [ + 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( + widget.orderModel.paymentName.toString().substring(12), + 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, + ), + ), + ], + ), + ), + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount:widget.orderModel.orderItems.length, + itemBuilder: (context, index){ + return Container( + child: productTile(productName: widget.orderModel.orderItems[index].product.name.toString(), + productPrice: widget.orderModel.orderItems[index].product.price.toString(), + productRate: widget.orderModel.orderItems[index].product.approvedRatingSum.toDouble(), + productReviews:widget.orderModel.orderItems[index].product.approvedTotalReviews, + totalPrice: "${(widget.orderModel.orderItems[index].product.price + * widget.orderModel.orderItems[index].quantity).toStringAsFixed(2)}", + qyt: widget.orderModel.orderItems[index].quantity.toString(), + isOrderDetails:true, + imgs: widget.orderModel.orderItems[index].product.images != null && + widget.orderModel.orderItems[index].product.images.length != 0 + ? widget.orderModel.orderItems[index].product.images [0].src.toString() + : null, + status: widget.orderModel.orderStatusId, + product: widget.orderModel.orderItems[index].product, + ), + ); + }), + + 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( + widget.orderModel.orderSubtotalExclTax.toString(), + 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( + widget.orderModel.orderShippingExclTax.toString(), + 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( + widget.orderModel.orderTax.toString(), + 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( + widget.orderModel.orderTotal.toString(), + style: TextStyle( + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + ], + ), + widget.orderModel.orderStatusId == 10 + ? InkWell( + onTap: () { + model.makeOrder(); + }, + child: Container( +// margin: EdgeInsets.only(top: 20.0), + height: 50.0, + color: Colors.transparent, + child: Container( + padding: EdgeInsets.only(left: 130.0, right: 130.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.green, + style: BorderStyle.solid, + width: 4.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, + ), + ), + ), + ), + ), + ) + : Container(), +// getCancelOrder(canCancel, canRefund), + isCancel + ? InkWell( + onTap: () { + presentConfirmDialog(model, + widget.orderModel.id); //(widget.orderModel.id)); +// + }, + child: Container( +// padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), + 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), + ), + ), + ), + ) + : Container(), + ], + ), + ), + ), + ), + ); + } + + Color getStatusBackgroundColor() { + print(widget.orderModel.orderStatusId); +// if(orderStatus == 'delivered') + if (widget.orderModel.orderStatusId == 30 || + widget.orderModel.orderStatusId == 997 || + widget.orderModel.orderStatusId == 994) + return Colors.blue[700]; + else if (widget.orderModel.orderStatusId == 20 || + widget.orderModel.orderStatusId == 995 || + widget.orderModel.orderStatusId == 998 || + widget.orderModel.orderStatusId == 999) + return Colors.green; + else if (widget.orderModel.orderStatusId == 10) + return Colors.orange[300]; + else if (widget.orderModel.orderStatusId == 40 || + widget.orderModel.orderStatusId == 996 || + widget.orderModel.orderStatusId == 200) return Colors.red[900]; + } + + getCancelOrder(dataIsCancel) { + if (widget.orderModel.canCancel && widget.orderModel.canRefund) { + setState(() { + isCancel = true; + isRefund = false; + }); + } else if (widget.orderModel.canCancel) { + setState(() { + isCancel = true; + isRefund = false; + }); + } else if (widget.orderModel.canRefund) { + setState(() { + isCancel = false; + isRefund = true; + }); + } else { + setState(() { + isCancel = false; + isRefund = false; + }); + } + } + +// .getCanceledOrder + presentConfirmDialog(cancelFunction, id) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).confirmCancellation, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => + cancelFunction.getCanceledOrder(id, context).then((value) { + print(":D"); + print(value); +// Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => OrderPage( + customerID: widget.orderModel.customerId.toString())), + ); + }), + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + + getCanceledOrder(order) { + Navigator.pop(context); + if (widget.orderModel.canCancel && widget.orderModel.canRefund == false) { +// getCanceledOrder(order); +// AppToast.showSuccessToast(message: "Request Sent Successfully"); +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => OrderPage())); + + } + } +} diff --git a/lib/pages/pharmacy/order/ProductReview.dart b/lib/pages/pharmacy/order/ProductReview.dart new file mode 100644 index 00000000..4d09191c --- /dev/null +++ b/lib/pages/pharmacy/order/ProductReview.dart @@ -0,0 +1,367 @@ +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:intl/intl.dart'; +import 'package:rating_bar/rating_bar.dart'; +import 'package:flutter/src/widgets/image.dart' as flutterImage; + +class ProductReviewPage extends StatefulWidget { + final Product product; + + ProductReviewPage(this.product); + + @override + _ProductReviewPageState createState() => _ProductReviewPageState(); +} + +class _ProductReviewPageState extends State { + AppSharedPreferences sharedPref = AppSharedPreferences(); + double currentRating = 0; + String reviewText = ""; + TextEditingController _reviewController = new TextEditingController(); + bool finishReview = false; + + @override + Widget build(BuildContext context) { + double ratingValue = double.parse("${widget.product.approvedRatingSum}"); + return BaseView( + builder: (_, model, wi) => AppScaffold( + appBarTitle: TranslationBase.of(context).writeReview, + isShowAppBar: true, + isPharmacy: true, + body: Container( + color: Colors.white, + child: !finishReview ? SingleChildScrollView( + child: Column( + children: [ + Container( + margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + widget.product.images != null + ? flutterImage.Image.network( + widget.product.images[0].src, + fit: BoxFit.cover, + height: 80, + ) + : flutterImage.Image.asset( + "assets/images/no_image.png", + fit: BoxFit.cover, + height: 80, + ), + Expanded( + child: Container( + child: Column( + children: [ + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.product.name, + style: TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.normal), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + '${widget.product.price} ${TranslationBase.of(context).sar}', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), + ), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: Align( + alignment: Alignment.topLeft, + child: RatingBar.readOnly( + initialRating: ratingValue, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ), + SizedBox( + width: 20, + ), + Container( + child: Align( + child: RichText( + text: TextSpan( + text: + '(${widget.product.approvedTotalReviews} reviews)', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.grey, + fontSize: 13), + ), + ), + ), + ), + ], + ), + ], + ), + ), + ), + ]), + ), + 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( + size: 40.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + onRatingChanged: (rating) { + currentRating = rating; + }, + ), + ], + ), + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: Column( + children: [ + TextFormField( + controller: _reviewController, + maxLines: 6, + minLines: 4, + decoration: InputDecoration( + 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), + ), + ), + onChanged: (value) { + setState(() { + reviewText = value; + }); + }, + textAlign: TextAlign.start, + textAlignVertical: TextAlignVertical.top, + ), + ], + ), + ), + InkWell( + onTap: reviewText != null && reviewText != "" + ? () { + model + .makeReview( + widget.product, ratingValue, reviewText) + .then((value) { + setState(() { + finishReview = true; + }); + }); + } + : null, + child: Container( + margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16), + height: 50.0, + width: 400.0, + color: Colors.transparent, + child: Container( + decoration: BoxDecoration( + border: Border.all( + color: _reviewController.value.text != null && + _reviewController.value.text != "" + ? Colors.yellow[700] + : Color(0xFFf5d69c), + style: BorderStyle.solid, + width: 1.0), + color: _reviewController.value.text != null && + _reviewController.value.text != "" + ? Colors.yellow[700] + : Color(0xFFf5d69c), + borderRadius: BorderRadius.circular(5.0)), + child: Center( + child: Text( + TranslationBase.of(context).shareReview, + style: TextStyle( + color: Colors.white, + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ), + ), + ], + ), + ) : getReviewedProduct(), + ), + ), + ); + } + + //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.symmetric(horizontal: 8), + child: Text( + TranslationBase.of(context).reviewSuccessful, + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 8), + 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.symmetric(horizontal: 16), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/quote_start.svg', + width: 15, + height: 15, + ), + ], + ), + 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 new file mode 100644 index 00000000..7569ed43 --- /dev/null +++ b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart @@ -0,0 +1,79 @@ +import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; + +class AddAddressPage extends StatefulWidget { + final Addresses editedAddress; + final Function(PickResult) onPick; + + AddAddressPage(this.editedAddress, this.onPick); + + @override + _AddAddressPageState createState() => _AddAddressPageState(); +} + +class _AddAddressPageState extends State { + double _latitude; + double _longitude; + + @override + void initState() { + super.initState(); + if (widget.editedAddress != null && + widget.editedAddress.latLong != null && + widget.editedAddress.latLong != "") { + List latLng = widget.editedAddress.latLong.split(","); + _latitude = double.parse(latLng[0]); + _longitude = double.parse(latLng[1]); + } else { + _getCurrentLocation(); + } + } + + _getCurrentLocation() async { + await Geolocator.getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } + + @override + Widget build(BuildContext context) { + final mediaQuery = MediaQuery.of(context); + final height = mediaQuery.size.height - + 60 - + mediaQuery.padding.top; + + return BaseView( + builder: (_, model, wi) => AppScaffold( + appBarTitle: TranslationBase.of(context).changeAddress, + isShowAppBar: true, + isPharmacy: true, + backgroundColor: Colors.white, + body: Container( + height: height * 1, + child: PickupLocationFromMap( + latitude: _latitude, + longitude: _longitude, + isWithAppBar: false, + buttonColor: Color(0xFF5AB145), + buttonLabel: TranslationBase.of(context).save, + onPick: (value) { + widget.onPick(value); + }, + ), + ), + ), + ); + } +} diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart new file mode 100644 index 00000000..340e2bd8 --- /dev/null +++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart @@ -0,0 +1,313 @@ +import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart'; + +class PharmacyAddressesPage extends StatefulWidget { + @override + _PharmacyAddressesState createState() => _PharmacyAddressesState(); +} + +class _PharmacyAddressesState extends State { + void navigateToAddressPage( + BuildContext ctx, PharmacyAddressesViewModel model, Addresses address) { + Navigator.push( + ctx, + FadePage( + page: AddAddressPage(address, (pickResult) { + model.addEditAddress(pickResult, address); + }))); + } + + Widget build(BuildContext context) { + final mediaQuery = MediaQuery.of(context); + final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; + + return BaseView( + onModelReady: (model) => model.getAddressesList(), + builder: (_, model, wi) => AppScaffold( + appBarTitle: TranslationBase.of(context).changeAddress, + isShowAppBar: true, + isPharmacy: true, + baseViewModel: model, + backgroundColor: Colors.white, + body: Container( + height: height * 0.90, + child: SingleChildScrollView( + child: Column( + children: [ + ...List.generate( + model.addresses != null ? model.addresses.length : 0, + (index) => AddressItemWidget( + model, + model.addresses[index], + () { + setState(() { + model.setSelectedAddressIndex(index); + }); + }, + model.selectedAddressIndex == index, + (address) { + navigateToAddressPage(context, model, address); + }), + ), + Container( + color: Colors.white, + margin: EdgeInsets.all(8), + child: BorderedButton( + TranslationBase.of(context).addAddress, + hasBorder: true, + borderColor: Color(0xFF0fca6d), + textColor: Color(0xFF0fca6d), + fontWeight: FontWeight.bold, + backgroundColor: Colors.white, + fontSize: 14, + vPadding: 12, + hasShadow: true, + handler: () { + navigateToAddressPage(context, model, null); + }, + ), + ), + ], + ), + ), + ), + bottomSheet: Container( + height: height * 0.10, + color: Colors.white, + child: Column( + children: [ + Divider( + color: Colors.grey.shade300, + height: 1, + thickness: 1, + indent: 0, + endIndent: 0, + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 8), + child: BorderedButton( + TranslationBase.of(context).confirmAddress, + hasBorder: true, + borderColor: Color(0xFF5AB145), + textColor: Colors.white, + fontWeight: FontWeight.bold, + backgroundColor: Color(0xFF5AB145), + fontSize: 14, + vPadding: 12, + handler: () { + model.saveSelectedAddressLocally( + model.addresses[model.selectedAddressIndex]); + Navigator.pop( + context, model.addresses[model.selectedAddressIndex]); + }, + ), + ), + ], + ), + ), + ), + ); + } +} + +class AddressItemWidget extends StatelessWidget { + final PharmacyAddressesViewModel model; + final Addresses address; + final Function selectAddress; + final bool isSelected; + final Function(Addresses) onTabEditAddress; + + AddressItemWidget(this.model, this.address, this.selectAddress, + this.isSelected, this.onTabEditAddress); + + @override + Widget build(BuildContext context) { + return Container( + color: Colors.white, + child: Padding( + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 0), + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + InkWell( + onTap: selectAddress, + child: Container( + margin: EdgeInsets.only(left: 16, right: 16), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Container( + decoration: new BoxDecoration( + color: !isSelected ? Colors.white : Colors.green, + shape: BoxShape.circle, + border: Border.all( + color: Colors.grey, + style: BorderStyle.solid, + width: 1.0), + ), + child: Padding( + padding: const EdgeInsets.all(0.0), + child: Icon( + Icons.check, + color: isSelected + ? Colors.white + : Colors.transparent, + size: 25, + ), + ), + ), + ), + ), + ), + ], + ), + Expanded( + child: Container( + child: Container( + margin: + EdgeInsets.symmetric(vertical: 12, horizontal: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 0), + child: Texts( + "${address.firstName} ${address.lastName}", + fontSize: 14, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 4), + 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, + ), + ], + ), + SizedBox( + height: 10, + ), + Container( + height: 25, + child: Row( + children: [ + BorderedButton( + TranslationBase.of(context).edit, + backgroundColor: Colors.transparent, + hasBorder: true, + borderColor: Colors.transparent, + textColor: Color(0x990000FF), + handler: () { + onTabEditAddress(address); + }, + icon: Icon( + Icons.edit, + size: 15, + color: Color(0x990000FF), + ), + ), + Padding( + padding: + const EdgeInsets.symmetric(horizontal: 8), + child: SizedBox( + child: Container( + width: 1, + color: Colors.grey.shade400, + ), + ), + ), + BorderedButton( + TranslationBase.of(context).delete, + backgroundColor: Colors.transparent, + hasBorder: true, + borderColor: Colors.transparent, + textColor: Color(0x99FF0000), + handler: () { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + title: "Are you sure want to delete", + confirmMessage: + "${address.address1} ${address.address2}", + okText: + TranslationBase.of(context).delete, + cancelText: TranslationBase.of(context) + .cancel_nocaps, + okFunction: () => { + model + .deleteAddresses(address) + .then((_) { + ConfirmDialog.closeAlertDialog( + context); + AppToast.showErrorToast( + message: + "Address has been deleted"); + }) + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + }, + icon: Icon( + Icons.delete, + size: 15, + color: Color(0x99FF0000), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ), + ], + ), + Divider( + color: Colors.grey.shade200, + height: 10, + thickness: 10, + indent: 0, + endIndent: 0, + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart new file mode 100644 index 00000000..ba742179 --- /dev/null +++ b/lib/pages/pharmacy/profile/profile.dart @@ -0,0 +1,626 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; +import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; +import 'package:diplomaticquarterapp/pages/login/welcome.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-terms-conditions-page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; + +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/my_reviews.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/compare.dart'; + +dynamic languageID ; +class PharmacyProfilePage extends StatefulWidget { + @override + _ProfilePageState createState() => _ProfilePageState(); +} + +class _ProfilePageState extends State { + AppSharedPreferences sharedPref = AppSharedPreferences(); + String page_id = ""; + + AuthenticatedUser user; + bool isLogin = false; + String firstName; + String customerId; + String lastName, mobileNo, identificationNo; + int languageId; + + _ProfilePageState({this.customerId }); + + getLanguageID() async { + languageID = await sharedPref.getString(APP_LANGUAGE); + } + getCustomer() async { + String custID; + custID = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + setState(() { + customerId = custID; + }); + print("customer Id is"+ customerId); + return customerId; + } + + getUser() async { + var userData = await sharedPref.getObject(USER_PROFILE); + if (userData != null){ user = AuthenticatedUser.fromJson(userData); + setState(() { + firstName = user.firstName.toString(); + print("this is user" + user.firstName.toString()); + print("this is user" + user.firstNameN.toString()); + }); + } else{ + if(userData == null){ + Navigator.push(context, + MaterialPageRoute(builder: (context) => + WelcomeLogin()), + ); + } + } + +// this.isLogin = user != null; + } + void initState() { + getCustomer(); + getLanguageID(); + super.initState(); + getUser(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getOrder(customerId, page_id), + builder: (_, model, wi) => AppScaffold( + appBarTitle: TranslationBase.of(context).myAccount, + isShowAppBar:false, + isShowDecPage: false, + isPharmacy: true, + body: user != null ? 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( + languageID == "ar" + ? user.firstNameN.toString()+ " " + user.lastNameN.toString() + : user.firstName.toString()+ " " + user.lastName.toString(), + style: TextStyle( + fontSize: 14.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( + onTap: () { + if(customerId == null){ + AppToast.showErrorToast(message: "Customer not found"); + return; + } + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => OrderPage(customerID: customerId))); + }, + child: Column( + children: [ +// Image(image: AssetImage('assets/images/pharmacy/orders_icon.svg')), + 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( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LakumMainPage())); + }, + 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( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => WishlistPage())); + }, + 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( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MyReviewsPage())); + },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( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => HomePrescriptionsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/my_prescription_icon.svg', + width: 28, + height: 28, + ), + SizedBox( + width: 15, + ), + Text( + TranslationBase.of(context).myPrescription, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ComparePage())); + }, + child: Row( + children: [ + Image.asset('assets/images/pharmacy/compare.png', + width: 35, height: 35), + SizedBox( + width: 15, + ), + Text( + TranslationBase.of(context).compare, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => HomePrescriptionsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/medication_refill_icon.svg', + width: 30, + height: 30, + ), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).medicationsRefill, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MyFamily())); + }, + 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( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PharmacyAddressesPage())); + }, + 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: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PharmacyTermsConditions())); + }, + child: Row( + children: [ + Image.asset('assets/images/pharmacy/terms.png', + width: 25, + height: 25, + ), + + SizedBox( + width: 10, + ), + Text( + TranslationBase.of(context).conditionsHMG, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LakumTermsConditions(this.identificationNo, this.firstName, this.lastName, + this.mobileNo, this.languageId))); + }, + child: Row( + children: [ + Image.asset('assets/images/pharmacy/terms.png', + width: 25, + height: 25, + ), +// IconButton(icon: Icon(Icons.error_outline), iconSize: 30, +// color: Colors.black,), + SizedBox( + width: 10, + ), + Text( + TranslationBase.of(context).conditions, + 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( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LiveChatPage())); + }, + 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( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => FindUsPage())); + }, + 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), + ), + ], + ), + ) + ], + ), + ) + ], + ), + ), + ) : Container(), + )); + }} + + + + diff --git a/lib/pages/pharmacy_categorise.dart b/lib/pages/pharmacy_categorise.dart new file mode 100644 index 00000000..06bba8c3 --- /dev/null +++ b/lib/pages/pharmacy_categorise.dart @@ -0,0 +1,239 @@ +import 'dart:convert'; + +import 'package:barcode_scan_fix/barcode_scan.dart'; +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: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 { + //TODO fix it + /// When give qr we will change this method to get data + /// var result = await BarcodeScanner.scan(); + /// int patientID = get from qr result + String result = await BarcodeScanner.scan(); + var data = json.decode(result); + if (data!=null) { + var qRParkingID = data['QRParkingID']; + 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/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index 38fdd008..f5ec34c3 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; @@ -72,7 +73,7 @@ class _RateAppointmentClinicState extends State { height: 25, ), Texts( - 'How would you rate your last visit to the Clinic', + TranslationBase.of(context).lastAppointment, bold: true, color: Colors.black, ), @@ -122,7 +123,7 @@ class _RateAppointmentClinicState extends State { ), Center( child: Texts( - 'Please rate the Clinic', + TranslationBase.of(context).rateClinic, textAlign: TextAlign.center, )), SizedBox( @@ -145,7 +146,7 @@ class _RateAppointmentClinicState extends State { child: Container( key: ValueKey(rating), child: IconButton( - iconSize: 55.0, + iconSize: 45.0, onPressed: () { setState(() { rating = index + 1; @@ -206,7 +207,7 @@ class _RateAppointmentClinicState extends State { message: 'please rate the clinic'); } }, - label: "Rate", + label: TranslationBase.of(context).submit, disabled: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal, textColor: Theme.of(context).backgroundColor), @@ -224,7 +225,7 @@ class _RateAppointmentClinicState extends State { ); }, child: Texts( - 'Later', + TranslationBase.of(context).later, decoration: TextDecoration.underline, color: HexColor('#151DFE'), fontSize: 18, diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 7a128b10..b3349704 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_clinic.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -39,7 +40,7 @@ class _RateAppointmentDoctorState extends State { headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), - title: Text('Rate'), + title: Text(TranslationBase.of(context).rate), leading: Builder( builder: (BuildContext context) { return IconButton( @@ -60,10 +61,10 @@ class _RateAppointmentDoctorState extends State { child: Column( children: [ SizedBox( - height: 25, + height: 25, //5598 ), Texts( - 'How would you rate your last visit to the doctor', + TranslationBase.of(context).lastVisit, bold: true, color: Colors.black, ), @@ -93,7 +94,7 @@ class _RateAppointmentDoctorState extends State { height: 22, ), Texts( - model.appointmentDetails.doctorName, + TranslationBase.of(context).dr + " " + model.appointmentDetails.doctorName, bold: true, ), SizedBox( @@ -114,7 +115,7 @@ class _RateAppointmentDoctorState extends State { ), Center( child: Texts( - 'Please rate the doctor', + TranslationBase.of(context).tapTitle, textAlign: TextAlign.center, )), SizedBox( @@ -137,7 +138,7 @@ class _RateAppointmentDoctorState extends State { child: Container( key: ValueKey(rating), child: IconButton( - iconSize: 55.0, + iconSize: 45.0, onPressed: () { setState(() { rating = index + 1; @@ -161,15 +162,15 @@ class _RateAppointmentDoctorState extends State { Form( key: formKey, child: TextFields( - hintText: "Notes", + hintText: TranslationBase.of(context).notes, minLines: 4, maxLines: 4, - validator: (value) { - if (value.isEmpty) - return 'Please enter your note'; - else if (rating == 0) return 'Rating cannot be \"0\"'; - return null; - }, + // validator: (value) { + // if (value.isEmpty) + // return 'Please enter your note'; + // else if (rating == 0) return 'Rating cannot be \"0\"'; + // return null; + // }, onChanged: (value) { setState(() { note = value; @@ -189,7 +190,7 @@ class _RateAppointmentDoctorState extends State { child: SecondaryButton( onTap: () async { final form = formKey.currentState; - if (form.validate()) { + if (form.validate() && rating>0 ) { form.save(); Navigator.push( context, @@ -204,8 +205,8 @@ class _RateAppointmentDoctorState extends State { ); } }, - label: "Next", - disabled: model.state == ViewState.BusyLocal, + label: TranslationBase.of(context).next, + disabled: model.state == ViewState.BusyLocal|| rating==0, loading: model.state == ViewState.BusyLocal, textColor: Theme.of(context).backgroundColor), ), @@ -222,7 +223,7 @@ class _RateAppointmentDoctorState extends State { ); }, child: Texts( - 'Later', + TranslationBase.of(context).later, decoration: TextDecoration.underline, color: HexColor('#151DFE'), fontSize: 18, diff --git a/lib/pages/search_products_page.dart b/lib/pages/search_products_page.dart new file mode 100644 index 00000000..45cafd35 --- /dev/null +++ b/lib/pages/search_products_page.dart @@ -0,0 +1,287 @@ +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/settings/profile_setting.dart b/lib/pages/settings/profile_setting.dart index 0658e2e6..dcfdb8a8 100644 --- a/lib/pages/settings/profile_setting.dart +++ b/lib/pages/settings/profile_setting.dart @@ -1,196 +1,263 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:provider/provider.dart'; class ProfileSettings extends StatefulWidget { + @override _ProfileSettings createState() => _ProfileSettings(); } class _ProfileSettings extends State with TickerProviderStateMixin { + bool smsAlert = true; + bool emailAlert = true; + int language = 1; + final authService = new AuthProvider(); + TextEditingController emergencyContact = new TextEditingController(); + TextEditingController emailController = new TextEditingController(); + TextEditingController emergencyContactName = new TextEditingController(); + @override + void initState() { + Future.delayed(new Duration(seconds: 0), () { + ProjectViewModel projectProvider; + projectProvider = Provider.of(context); + if (projectProvider.isLogin == true) getSettings(context); + }); + super.initState(); + } + Widget build(BuildContext context) { - bool isVibration = true; - var language = 1; return BaseView( - onModelReady: (model) => model.getPatientRadOrders(), + onModelReady: (model) => {}, builder: (_, model, wi) => Container( - child: - ListView(scrollDirection: Axis.vertical, children: [ - Container( - padding: EdgeInsets.all(15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context).fileNo, - color: Colors.black, + child: model.user != null + ? ListView(scrollDirection: Axis.vertical, children: [ + Container( + padding: EdgeInsets.all(15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + TranslationBase.of(context).fileNo, + color: Colors.black, + ), + AppText( + model.user.patientID.toString(), + color: Colors.black, + ), + ], + ), + ), + SizedBox( + height: 1, + width: MediaQuery.of(context).size.width, + child: Container( + color: Colors.grey[300], + ), + ), + Padding( + child: AppText( + TranslationBase.of(context).languageSetting, + fontWeight: FontWeight.bold), + padding: EdgeInsets.all(10), + ), + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).english), + new Radio( + value: 2, + groupValue: language, + onChanged: (value) { + setState(() { + language = value; + }); + }, + ) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).arabic), + new Radio( + value: 1, + groupValue: language, + onChanged: (value) { + setState(() { + language = value; + }); + }, + ) + ], + )), + Padding( + child: AppText(TranslationBase.of(context).alert), + padding: EdgeInsets.all(10), ), - AppText( - model.user.patientID.toString(), - color: Colors.black, + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).emailAlert), + Switch( + value: emailAlert, + onChanged: (value) { + setState(() { + emailAlert = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(TranslationBase.of(context).smsAlert), + Switch( + value: smsAlert, + onChanged: (value) { + setState(() { + smsAlert = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Padding( + child: AppText(TranslationBase.of(context).contactInfo), + padding: EdgeInsets.all(10), ), - ], - ), - ), - SizedBox( - height: 1, - width: MediaQuery.of(context).size.width, - child: Container( - color: Colors.grey[300], - ), - ), - Padding( - child: AppText(TranslationBase.of(context).languageSetting, - fontWeight: FontWeight.bold), - padding: EdgeInsets.all(10), - ), - Container( - color: Colors.white, - padding: - EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(TranslationBase.of(context).english), - new Radio( - value: 2, - groupValue: language, - onChanged: (value) { - language = value; - }, - ) - ], - )), - Container( - color: Colors.white, - padding: - EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(TranslationBase.of(context).arabic), - new Radio( - value: 1, - groupValue: language, - onChanged: (value) { - language = value; - }, - ) - ], - )), - Padding( - child: AppText(TranslationBase.of(context).alert), - padding: EdgeInsets.all(10), - ), - Container( - color: Colors.white, - padding: - EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(TranslationBase.of(context).emailAlert), - Switch( - value: isVibration, - onChanged: (value) { - setState(() { - isVibration = value; - }); - }, - activeTrackColor: Colors.lightGreenAccent, - activeColor: Colors.green, - ) - ], - )), - Container( - color: Colors.white, - padding: - EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(TranslationBase.of(context).smsAlert), - Switch( - value: isVibration, - onChanged: (value) { - setState(() { - isVibration = value; - }); - }, - activeTrackColor: Colors.lightGreenAccent, - activeColor: Colors.green, - ) - ], - )), - Padding( - child: AppText(TranslationBase.of(context).contactInfo), - padding: EdgeInsets.all(10), - ), - Container( - color: Colors.white, - padding: - EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText(TranslationBase.of(context).email), - TextField( - style: TextStyle(color: Colors.red), - decoration: InputDecoration( - suffixIcon: Icon(Icons.edit), - )) - ], - )), - Container( - color: Colors.white, - padding: - EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText(TranslationBase.of(context).emergencyName), - TextField( - style: TextStyle(color: Colors.red), - decoration: InputDecoration( - suffixIcon: Icon(Icons.edit), - )) - ], - )), - Container( - color: Colors.white, - padding: - EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText(TranslationBase.of(context).emergencyContact), - TextField( - style: TextStyle(color: Colors.red), - decoration: InputDecoration( - suffixIcon: Icon(Icons.edit), - ), - ) - ], - )), - Container( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context).submit, - () { -// print(mobileNo.text); - }, - )), - ], - )) - ]))); + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).email), + TextField( + controller: emailController, + decoration: InputDecoration( + suffixIcon: Icon(Icons.edit), + )) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).emergencyName), + TextField( + controller: emergencyContactName, + decoration: InputDecoration( + suffixIcon: Icon(Icons.edit), + )) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: 0, left: 10, right: 10, bottom: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).emergencyContact), + TextField( + controller: emergencyContact, + decoration: InputDecoration( + suffixIcon: Icon(Icons.edit), + ), + ) + ], + )), + Container( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).save, + () { + saveSettings(); + }, + )), + ], + )) + ]) + : Center( + child: + AppText(TranslationBase.of(context).loginToUseService), + ))); + } + + getSettings(context) { + GifLoaderDialogUtils.showMyDialog(context); + authService.getSettings().then((result) => { + GifLoaderDialogUtils.hideDialog(context), + setValue(result["PateintInfoForUpdateList"][0]) + }); + } + + setValue(value) { + setState(() { + this.language = int.parse(value["PreferredLanguage"]); + this.emailAlert = value["IsEmailAlertRequired"]; + this.smsAlert = value["IsSMSAlertRequired"]; + this.emailController.text = value["EmailAddress"]; + this.emergencyContact.text = value["EmergencyContactNo"]; + this.emergencyContactName.text = value["EmergencyContactName"]; + }); + } + + saveSettings() { + GifLoaderDialogUtils.showMyDialog(context); + Map request = {}; + request["EmailAddress"] = this.emailController.text; + request["EmergencyContactName"] = this.emergencyContactName.text; + request["EmergencyContactNo"] = this.emergencyContact.text; + request["IsEmailAlertRequired"] = this.emailAlert; + request["IsSMSAlertRequired"] = this.smsAlert; + request["PreferredLanguage"] = this.language.toString(); + authService.saveSettings(request).then((result) => { + AppToast.showSuccessToast( + message: TranslationBase.of(context).profileUpdate), + GifLoaderDialogUtils.hideDialog(context) + }); } } diff --git a/lib/pages/settings/settings.dart b/lib/pages/settings/settings.dart index abdac118..0c63b900 100644 --- a/lib/pages/settings/settings.dart +++ b/lib/pages/settings/settings.dart @@ -21,6 +21,10 @@ class _Settings extends State with TickerProviderStateMixin { _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type); + if(widget.type==1){ + _tabController.animateTo(1); + } + super.initState(); } @@ -30,6 +34,14 @@ class _Settings extends State with TickerProviderStateMixin { return Scaffold( appBar: AppBar( bottom: TabBar( + // isScrollable: true, + + indicatorWeight: 5.0, + //indicatorSize: TabBarIndicatorSize.label, + // indicatorSize: TabBarIndicatorSize.tab, + + indicatorColor: Theme.of(context).primaryColor, + // labelColor: Theme.of(context).primaryColor, tabs: [ Tab(text: TranslationBase.of(context).general), Tab( diff --git a/lib/pages/sub_categorise_page.dart b/lib/pages/sub_categorise_page.dart new file mode 100644 index 00000000..45c9fd6c --- /dev/null +++ b/lib/pages/sub_categorise_page.dart @@ -0,0 +1,944 @@ +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/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart index 02d67cac..169e5cd5 100644 --- a/lib/pages/vaccine/my_vaccines_screen.dart +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; @@ -6,6 +7,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; +import 'package:provider/provider.dart'; import '../base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; @@ -14,6 +16,7 @@ import 'package:popup_box/popup_box.dart'; import 'my_vaccines_item_screen.dart'; +//TODO fix by jammal we have a static data class MyVaccines extends StatefulWidget { @override _MyVaccinesState createState() => _MyVaccinesState(); @@ -22,6 +25,7 @@ class MyVaccines extends StatefulWidget { class _MyVaccinesState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getVaccine(), builder: (BuildContext context, VaccineViewModel model, Widget child) => @@ -171,6 +175,7 @@ class _MyVaccinesState extends State { Navigator.push(context, FadePage(page: MyVaccinesItemPage())), ), ), + if(projectViewModel.havePrivilege(27)) Container( width: double.infinity, // height: 80.0, diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index eb1ab98f..d26c74ad 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; @@ -1021,6 +1087,44 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "AppointmentNo": appoNo, + "ProjectID": projID, + "ClinicID": clinicID, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + await baseAppClient.post(GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future getPatientPrescriptionReports( AppoitmentAllHistoryResultList appo, BuildContext context) async { Map request; @@ -1168,6 +1272,9 @@ class DoctorsListService extends BaseService { double payedAmount, String paymentReference, String paymentMethodName, + dynamic patientType, + String patientName, + dynamic patientID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -1179,12 +1286,12 @@ class DoctorsListService extends BaseService { Request req = appGlobal.getPublicRequest(); request = { - "CustName": authUser.firstName + " " + authUser.lastName, - "CustID": authUser.patientID, + "CustName": patientName, + "CustID": patientID, "SetupID": "010266", "ProjectID": projectID, - "PatientID": authUser.patientID, - "AccountID": authUser.patientID, + "PatientID": patientID, + "AccountID": patientID, "PaymentAmount": payedAmount, "NationalityID": null, "DepositorName": authUser.firstName + " " + authUser.lastName, @@ -1201,8 +1308,8 @@ class DoctorsListService extends BaseService { "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, "TokenID": "@dm!n", - "PatientTypeID": authUser.patientType, - "PatientType": authUser.patientType + "PatientTypeID": patientType, + "PatientType": patientType }; dynamic localRes; await baseAppClient.post(HIS_CREATE_ADVANCE_PAYMENT, diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 8bdfa09b..8f0ea470 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -24,27 +24,39 @@ enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } AppSharedPreferences sharedPref = new AppSharedPreferences(); AppGlobal appGlobal = new AppGlobal(); -const String INSERT_DEVICE_IMEI = 'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI'; -const String SELECT_DEVICE_IMEI = 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI'; -const String CHECK_PATIENT_AUTH = 'Services/Authentication.svc/REST/CheckPatientAuthentication'; +const String INSERT_DEVICE_IMEI = + 'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI'; +const String SELECT_DEVICE_IMEI = + 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI'; +const String CHECK_PATIENT_AUTH = + 'Services/Authentication.svc/REST/CheckPatientAuthentication'; const GET_MOBILE_INFO = 'Services/Authentication.svc/REST/GetMobileLoginInfo'; -const SEND_ACTIVATION_CODE = 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType'; -const CHECK_ACTIVATION_CODE = 'Services/Authentication.svc/REST/CheckActivationCode'; -const FORGOT_PASSWORD = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo'; -const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration"; +const SEND_ACTIVATION_CODE = + 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType'; +const CHECK_ACTIVATION_CODE = + 'Services/Authentication.svc/REST/CheckActivationCode'; +const FORGOT_PASSWORD = + 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo'; +const CHECK_PATIENT_FOR_REGISTRATION = + "Services/Authentication.svc/REST/CheckPatientForRegisteration"; const CHECK_USER_STATUS = "Services/NHIC.svc/REST/GetPatientInfo"; const REGISTER_USER = 'Services/Authentication.svc/REST/PatientRegistration'; -const LOGGED_IN_USER_URL = 'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo'; +const LOGGED_IN_USER_URL = + 'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo'; -const FORGOT_PATIENT_ID = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber'; +const FORGOT_PATIENT_ID = + 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber'; 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; dynamic authenticatedUser; - AuthenticatedUserObject authenticatedUserObject = locator(); + AuthenticatedUserObject authenticatedUserObject = + locator(); AuthProvider() { getUserAuthentication(); @@ -98,7 +110,8 @@ class AuthProvider with ChangeNotifier { var lastLogin = lstLogin; //await sharedPref.getInt( // LAST_LOGIN); //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); //this.cs.sharedService.getSharedData(AuthenticationService.LAST_LOGIN, false); - var request = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + var request = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); var newRequest = INSERTDeviceIMEIRequest(); var imei = await sharedPref.getString(PUSH_TOKEN); @@ -120,7 +133,8 @@ class AuthProvider with ChangeNotifier { newRequest.tokenID = await sharedPref.getString(TOKEN); // } - await new BaseAppClient().post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(INSERT_DEVICE_IMEI, + onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -137,33 +151,40 @@ class AuthProvider with ChangeNotifier { dynamic localRes; Map request = {}; request['IMEI'] = imei; - await new BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { - localRes = SelectDeviceIMEIRES.fromJson(response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); + await new BaseAppClient().post(SELECT_DEVICE_IMEI, + onSuccess: (dynamic response, int statusCode) { + localRes = SelectDeviceIMEIRES.fromJson( + response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); }, onFailure: (String error, int statusCode) { throw error; }, body: request); return Future.value(localRes); } catch (error) { - print(error); - //throw error; + return Future.value(null); } } - Future checkPatientAuthentication(CheckPatientAuthenticationReq request) async { + Future checkPatientAuthentication( + CheckPatientAuthenticationReq request) async { request.versionID = VERSION_ID; request.channel = CHANNEL; request.iPAdress = IP_ADDRESS; request.generalid = GENERAL_ID; request.languageID = LANGUAGE_ID; request.patientOutSA = request.zipCode == '966' ? 0 : 1; - - dynamic localRes; - await new BaseAppClient().post(CHECK_PATIENT_AUTH, onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { + try { + dynamic localRes; + await new BaseAppClient().post(CHECK_PATIENT_AUTH, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request.toJson()); + return Future.value(localRes); + } catch (error) { throw error; - }, body: request.toJson()); - return Future.value(localRes); + //throw error; + } } Future getLoginInfo(request) async { @@ -177,7 +198,8 @@ class AuthProvider with ChangeNotifier { request.isDentalAllowedBackend = false; dynamic localRes; - await new BaseAppClient().post(GET_MOBILE_INFO, onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(GET_MOBILE_INFO, + onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -196,7 +218,8 @@ class AuthProvider with ChangeNotifier { request.isDentalAllowedBackend = false; dynamic localRes; - await new BaseAppClient().post(SEND_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(SEND_ACTIVATION_CODE, + onSuccess: (dynamic response, int statusCode) { localRes = response; authenticatedUser = CheckActivationCode.fromJson(localRes); }, onFailure: (String error, int statusCode) { @@ -213,37 +236,40 @@ 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; neRequest.isDentalAllowedBackend = false; neRequest.deviceToken = null; - neRequest.forRegisteration = neRequest.isRegister != null ? neRequest.isRegister : false; + neRequest.forRegisteration = + neRequest.isRegister != null ? neRequest.isRegister : false; neRequest.isRegister = false; dynamic localRes; try { - await new BaseAppClient().post(CHECK_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(CHECK_ACTIVATION_CODE, + onSuccess: (dynamic response, int statusCode) { localRes = response; //CheckActivationCode.fromJson(); }, onFailure: (String error, int statusCode) { localRes = error; return Future.value(error); // throw error; }, body: neRequest.toJson()); + sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']); return Future.value(localRes); } catch (error) { - throw error; + throw localRes; //return Future.value(error); } } AuthenticatedUser getAuthenticatedUser() { this.isLogin = true; - authenticatedUser = authenticatedUserObject.user; return authenticatedUser; } - Future checkPatientForRegisteration(CheckPatientForRegistration request) async { + Future checkPatientForRegisteration( + CheckPatientForRegistration request) async { request.versionID = VERSION_ID; request.channel = CHANNEL; request.iPAdress = IP_ADDRESS; @@ -254,7 +280,8 @@ class AuthProvider with ChangeNotifier { // request.tokenID = ''; dynamic localRes; try { - await new BaseAppClient().post(CHECK_PATIENT_FOR_REGISTRATION, onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(CHECK_PATIENT_FOR_REGISTRATION, + onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { localRes = error; @@ -277,7 +304,8 @@ class AuthProvider with ChangeNotifier { // request.tokenID = ''; dynamic localRes; try { - await new BaseAppClient().post(CHECK_USER_STATUS, onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(CHECK_USER_STATUS, + onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { localRes = error; @@ -300,7 +328,8 @@ class AuthProvider with ChangeNotifier { // request.tokenID = ''; dynamic localRes; try { - await new BaseAppClient().post(REGISTER_USER, onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(REGISTER_USER, + onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { localRes = error; @@ -312,17 +341,21 @@ class AuthProvider with ChangeNotifier { } } - Future registeredAuthenticatedUser(AuthenticatedUser user, deviceToken, lat, long) async { + Future registeredAuthenticatedUser( + AuthenticatedUser user, deviceToken, lat, long) async { var request = new RegisteredAuthenticatedUserRequest(); request.deviceToken = deviceToken; - request.voipToken = ""; //this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false); + request.voipToken = + ""; //this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false); request.deviceType = DeviceTypeID.toString(); request.patientMobileNumber = '0' + user.mobileNumber; request.nationalID = user.patientIdentificationNo; request.gender = user.gender; request.patientID = user.patientID; request.patientOutSA = user.outSA; - request.loginType = await sharedPref.getInt(LAST_LOGIN) != null ? await sharedPref.getInt(LAST_LOGIN) : 1; + request.loginType = await sharedPref.getInt(LAST_LOGIN) != null + ? await sharedPref.getInt(LAST_LOGIN) + : 1; request.mACAddress = '00:00:00:00:00:00'; request.latitude = lat; request.longitude = long; @@ -330,7 +363,8 @@ class AuthProvider with ChangeNotifier { request.patientTypeID = 2; dynamic localRes; try { - await new BaseAppClient().post(LOGGED_IN_USER_URL, onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(LOGGED_IN_USER_URL, + onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { localRes = error; @@ -344,7 +378,8 @@ class AuthProvider with ChangeNotifier { Future sendPatientIDSMS(mobileNo, context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -365,7 +400,8 @@ class AuthProvider with ChangeNotifier { dynamic localRes; - await new BaseAppClient().post(FORGOT_PATIENT_ID, onSuccess: (response, statusCode) async { + await new BaseAppClient().post(FORGOT_PATIENT_ID, + onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -386,7 +422,8 @@ class AuthProvider with ChangeNotifier { dynamic localRes; try { - await new BaseAppClient().post(FORGOT_PASSWORD, onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(FORGOT_PASSWORD, + onSuccess: (dynamic response, int statusCode) { localRes = response; //CheckActivationCode.fromJson(); }, onFailure: (String error, int statusCode) { localRes = error; @@ -412,7 +449,44 @@ class AuthProvider with ChangeNotifier { request["PatientType"] = 1; dynamic localRes; try { - await new BaseAppClient().post(DASHBOARD, onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(DASHBOARD, + onSuccess: (dynamic response, int statusCode) { + 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; + //return Future.value(error); + } + } + + getSettings() async { + dynamic localRes; + try { + await new BaseAppClient().post(PROFILE_SETTING, + onSuccess: (dynamic response, int statusCode) { + localRes = response; //CheckActivationCode.fromJson(); + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + // throw error; + }, body: {}); + return Future.value(localRes); + } catch (error) { + throw error; + //return Future.value(error); + } + } + + 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; diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index 79ea67d0..7a2dec81 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -37,6 +37,10 @@ const String SENT_REQUEST_URL = 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus'; const String RECEVIED_REQUEST_URL = 'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId'; +const ACCEPT_REJECT_FAMILY = + 'Services/Authentication.svc/REST/Update_FileStatus'; +const DEACTIVATE_FAMILY = + 'Services/Authentication.svc/REST/DeactivateRequestByRensponse'; class FamilyFilesProvider with ChangeNotifier { bool isLogin = false; @@ -47,7 +51,9 @@ class FamilyFilesProvider with ChangeNotifier { try { dynamic localRes; var request = GetAllSharedRecordsByStatusReq(); + var result = await sharedPref.getObject(MAIN_USER); request.status = 0; + request.patientID = result["PatientID"]; await new BaseAppClient().post(GET_SHARED_RECORD_BY_STATUS, onSuccess: (dynamic response, int statusCode) { localRes = response; @@ -55,7 +61,7 @@ class FamilyFilesProvider with ChangeNotifier { AppToast.showErrorToast(message: error); throw error; }, body: request.toJson()); - + sharedPref.setObject(FAMILY_FILE, localRes); return Future.value( GetAllSharedRecordsByStatusResponse.fromJson(localRes)); @@ -78,7 +84,7 @@ class FamilyFilesProvider with ChangeNotifier { return Future.error(error); }, body: request); if (localRes != null) { - sharedPref.setObject(FAMILY_FILE, localRes); + // sharedPref.setObject(FAMILY_FILE, localRes); allSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(localRes); return Future.value(allSharedRecordsByStatusResponse); @@ -103,7 +109,7 @@ class FamilyFilesProvider with ChangeNotifier { //AppToast.showErrorToast(message: error); //throw error; }, body: request); - sharedPref.setObject(FAMILY_FILE, localRes); + //sharedPref.setObject(FAMILY_FILE, localRes); return Future.value( GetAllSharedRecordsByStatusResponse.fromJson(localRes)); } catch (error) { @@ -249,9 +255,9 @@ class FamilyFilesProvider with ChangeNotifier { Future silentLoggin(GetAllSharedRecordsByStatusList switchUser, {onSuccess, mainUser}) async { Map request = {}; - if(mainUser ==true){ + if (mainUser == true) { var currentUser = - AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER)); + AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER)); //const request = new SwitchUserRequest(); request['LogInTokenID'] = ''; request['PatientOutSA'] = currentUser.outSA; //? 1 : 0; @@ -265,9 +271,9 @@ class FamilyFilesProvider with ChangeNotifier { request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; request['activationCode'] = '0000'; request['isRegister'] = false; - }else { + } else { var currentUser = - AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); //const request = new SwitchUserRequest(); request['LogInTokenID'] = ''; @@ -293,6 +299,44 @@ class FamilyFilesProvider with ChangeNotifier { AppToast.showErrorToast(message: error); throw error; }, body: request); + sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']); + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } + + Future acceptRejectFamily(request) async { + try { + dynamic localRes; + + await new BaseAppClient().post(ACCEPT_REJECT_FAMILY, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request); + + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } + + Future deactivateFamily(request) async { + try { + dynamic localRes; + + await new BaseAppClient().post(DEACTIVATE_FAMILY, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request); return Future.value(localRes); } catch (error) { diff --git a/lib/services/permission/permission_service.dart b/lib/services/permission/permission_service.dart index 6f01f3c8..ea408ce2 100644 --- a/lib/services/permission/permission_service.dart +++ b/lib/services/permission/permission_service.dart @@ -8,7 +8,8 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:localstorage/localstorage.dart'; - +import 'package:permission_handler/permission_handler.dart'; +import 'package:vibration/vibration.dart'; class PermissionService extends BaseService { final LocalStorage storage = new LocalStorage("permission"); @@ -19,11 +20,19 @@ class PermissionService extends BaseService { } isVibrationEnabled() { - return storage.getItem('isVibration') ==null ? false :true; + return (storage.getItem('isVibration') ==null) || (storage.getItem('isVibration')) ==false ? false :true; } - vibrate(){ + vibrate(callback, context) async{ + + if (callback == null) + return null; if(isVibrationEnabled() ==true){ - HapticFeedback.vibrate(); + if (await Vibration.hasVibrator()) { + Vibration.vibrate(duration: 100); + callback(); + } + }else{ + callback(); } } @@ -35,5 +44,23 @@ class PermissionService extends BaseService { isThemeEnabled() { return storage.getItem('isTheme'); } - + cameraPermission() async{ + Map statuses = await [ + Permission.camera, + ].request(); + } + isCameraEnabled() async{ + print(await Permission.camera.status); + return await Permission.camera.status == PermissionStatus.granted ? true : false; + } + setCameraLocationPermission(context) async{ + Navigator.pop(context); + openAppSettings(); + } + isLocationEnabled() async{ + return await Permission.location.status == PermissionStatus.granted ? true : false; + } + openSettings() async{ + openAppSettings(); + } } diff --git a/lib/services/pharmacy_services/brands_service.dart b/lib/services/pharmacy_services/brands_service.dart new file mode 100644 index 00000000..32024f2f --- /dev/null +++ b/lib/services/pharmacy_services/brands_service.dart @@ -0,0 +1,73 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; + +class BrandsService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + bool isLogin = false; + + List _brandsList = List(); + List get brandsList => _brandsList; + + List _topBrandsList = List(); + List get topBrandsList => _topBrandsList; + + List _searchList = List(); + List get searchList => _searchList; + + clearSearchList() { + _searchList.clear(); + } + + Future getBrands() async { + hasError = false; + await baseAppClient.getPharmacy(GET_BRANDS, + onSuccess: (dynamic response, int statusCode) { + _brandsList.clear(); + response['manufacturer'].forEach((item) { + _brandsList.add(Brand.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } + + Future getTopBrands() async { + hasError = false; + await baseAppClient.getPharmacy(GET_TOP_BRANDS, + onSuccess: (dynamic response, int statusCode) { + _topBrandsList.clear(); + response['manufacturer'].forEach((item) { + _topBrandsList.add(TopBrand.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } + + Future searchProducts({String productName}) async { + RegExp exp = new RegExp(productName.toUpperCase()); + hasError = false; + _searchList.clear(); + await baseAppClient.getPharmacy( + GET_BRANDS, + onSuccess: (dynamic response, int statusCode) { + response['manufacturer'].forEach((item) { + if(exp.hasMatch(item['name'])){ + _searchList.add(Brand.fromJson(item)); + }else{ + } + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + ); + } + +} diff --git a/lib/services/pharmacy_services/cancelOrder_service.dart b/lib/services/pharmacy_services/cancelOrder_service.dart new file mode 100644 index 00000000..f848c2ff --- /dev/null +++ b/lib/services/pharmacy_services/cancelOrder_service.dart @@ -0,0 +1,44 @@ + +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 CancelOrderService extends BaseService{ + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + List _cancelOrderList = List(); + List get cancelOrderList => _cancelOrderList; + String url =""; + + + Future getCanceledOrder(order) async { + print("step 1"); + hasError = false; + + dynamic res; + + await baseAppClient.getPharmacy(GET_Cancel_ORDER+order, + onSuccess: (dynamic response, int statusCode) { + res = response; + print(res); +// _cancelOrderList.clear(); +// response['success'].forEach((item) { +// _cancelOrderList.add(OrderModel.fromJson(item)); +// }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + return res; + } +} \ No newline at end of file diff --git a/lib/services/pharmacy_services/orderDetails_service.dart b/lib/services/pharmacy_services/orderDetails_service.dart new file mode 100644 index 00000000..a3bb9976 --- /dev/null +++ b/lib/services/pharmacy_services/orderDetails_service.dart @@ -0,0 +1,75 @@ + +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 2" + orderId); + 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; + }); + } + + Future makeReview(Product product, double rating, String reviewText) async { + hasError = false; + super.error = ""; + + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + + + Map body = Map(); + Map reviewBody = Map(); + reviewBody["created_on_utc"] = DateTime.now().toString(); + reviewBody["customer_id"] = customerId; + reviewBody["helpful_no_total"] = 0; + reviewBody["helpful_yes_total"] = 0; + reviewBody["id"] = 0; + reviewBody["is_approved"] = false; + reviewBody["position"] = 0; + reviewBody["product_id"] = product.id; + reviewBody["rating"] = rating; + reviewBody["reply_text"] = reviewText; + reviewBody["store_id"] = 2; + reviewBody["title"] = ""; + body['review'] = reviewBody; + await baseAppClient.post("$PHARMACY_MAKE_REVIEW", + onSuccess: (response, statusCode) async { + /* + "success": { + "SuccessEndUserMsg": "Your request has been completed successfuly.", + "SuccessEndUserMsgN": "تمت العملية بنجاح" + } + */ + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} \ No newline at end of file diff --git a/lib/services/pharmacy_services/order_service.dart b/lib/services/pharmacy_services/order_service.dart new file mode 100644 index 00000000..e426b801 --- /dev/null +++ b/lib/services/pharmacy_services/order_service.dart @@ -0,0 +1,81 @@ +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(customerId, pageId) async { + 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=$pageId&limit=200&customer_id=$customerId"; + print(url); + + await baseAppClient.getPharmacy(url, + onSuccess: (dynamic response, int statusCode) { + _orderList.clear(); + response['orders'].forEach((item) { + _orderList.add(OrderModel.fromJson(item)); + }); + print(_orderList.length); + print(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } + + + Future getProductReview(orderId) 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(_orderList.length); + 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 new file mode 100644 index 00000000..1bb6571c --- /dev/null +++ b/lib/services/pharmacy_services/pharmacyAddress_service.dart @@ -0,0 +1,102 @@ +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/Country.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; + +class PharmacyAddressService extends BaseService { + List addresses = List(); + CountryData country; + int selectedAddressIndex = 0; + + Future getAddresses() async { + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + Map queryParams = {'fields': 'addresses'}; + hasError = false; + Addresses selectedAddress; + try { + await baseAppClient.get("$GET_CUSTOMERS_ADDRESSES$customerId", + onSuccess: (dynamic response, int statusCode) async { + addresses.clear(); + var savedAddress = + await sharedPref.getObject(PHARMACY_SELECTED_ADDRESS); + if (savedAddress != null) { + selectedAddress = Addresses.fromJson(savedAddress); + } + int index = 0; + response['customers'][0]['addresses'].forEach((item) { + Addresses address = Addresses.fromJson(item); + if (selectedAddress != null && selectedAddress.id == item["id"]) { + selectedAddressIndex = index; + } + addresses.add(address); + index++; + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, queryParams: queryParams); + } catch (error) { + throw error; + } + } + + Future getCountries(String countryName) async { + hasError = false; + try { + await baseAppClient.get("$PHARMACY_GET_COUNTRY", + onSuccess: (dynamic response, int statusCode) { + // countries.clear(); + response['countries'].forEach((item) { + if (CountryData.fromJson(item).name == countryName || + CountryData.fromJson(item).namen == countryName) { + country = CountryData.fromJson(item); + } + // countries.add(CountryData.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } catch (error) { + throw error; + } + } + + Future addCustomerAddress(Addresses address) async { + makeCustomerAddress(address, ADD_CUSTOMER_ADDRESS); + } + + Future editCustomerAddress(Addresses address) async { + makeCustomerAddress(address, EDIT_CUSTOMER_ADDRESS); + } + + Future deleteCustomerAddress(Addresses address) async { + makeCustomerAddress(address, DELETE_CUSTOMER_ADDRESS); + } + + Future makeCustomerAddress(Addresses address, String url) async { + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + hasError = false; + super.error = ""; + + Map customerObject = Map(); + customerObject["addresses"] = [address]; + customerObject["id"] = customerId; + customerObject["email"] = address.email; + customerObject["role_ids"] = [3]; + Map body = Map(); + body["customer"] = customerObject; + + await baseAppClient.post("$url", onSuccess: (response, statusCode) async { + addresses.clear(); + response['customers'][0]['addresses'].forEach((item) { + addresses.add(Addresses.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/services/pharmacy_services/product_detail_service.dart b/lib/services/pharmacy_services/product_detail_service.dart new file mode 100644 index 00000000..7a2947b0 --- /dev/null +++ b/lib/services/pharmacy_services/product_detail_service.dart @@ -0,0 +1,178 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/addToCartModel.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/specification.dart'; + +class ProductDetailService extends BaseService { + bool isLogin = false; + + List _productDetailList = List(); + List get productDetailList => _productDetailList; + + List _productLocationList = List(); + List get productLocationList => _productLocationList; + + List _addToCartModel = List(); + List get addToCartModel => _addToCartModel; + + List _wishListProducts = List(); + List get wishListProducts => _wishListProducts; + + List _productSpecification = List(); + List get productSpecification => _productSpecification; + + + + Future getProductReviews(productID) async { + hasError = false; + await baseAppClient.getPharmacy(GET_PRODUCT_DETAIL+productID+"?fields=reviews", + onSuccess: (dynamic response, int statusCode) { + _productDetailList.clear(); + response['products'].forEach((item) { + _productDetailList.add(ProductDetail.fromJson(item)); + print(response); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } + + Future getProductAvailabiltyDetail() async { + hasError = false; + Map request; + + request = { + "Channel": 3, + "DeviceTypeID": 2, + "IPAdress": "10.20.10.20", + "LanguageID": 2, + "PatientOutSA": 0, + "SKU": "6720020025", + "SessionID": null, + "VersionID": 5.6, + "generalid": "Cs2020@2016\$2958", + "isDentalAllowedBackend": false + }; + await baseAppClient.post(GET_LOCATION, + onSuccess: (dynamic response, int statusCode) { + _productLocationList.clear(); + response['PharmList'].forEach((item) { + _productLocationList.add(LocationModel.fromJson(item)); + print(_productLocationList); + print(response); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: request); + } + + Future addToCart(quantity, itemID) async { + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + hasError = false; + Map request; + + request = { + "shopping_cart_item": + { + "quantity": quantity, + "shopping_cart_type": "1", + "product_id": itemID, + "customer_id": customerId, + "language_id": 1 + } + }; + await baseAppClient.post(GET_SHOPPING_CART, + onSuccess: (dynamic response, int statusCode) { + _addToCartModel.clear(); + response['shopping_carts'].forEach((item) { + _addToCartModel.add(Wishlist.fromJson(item)); + }); + AppToast.showSuccessToast(message: 'You have added a product to the cart'); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + AppToast.showErrorToast(message: 'something went wrong please try again'); + }, body: request); + } + + Future addToWishlist(itemID) async { + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + hasError = false; + Map request; + + request = { + "shopping_cart_item": + { + "quantity": 1, + "shopping_cart_type": "Wishlist", + "product_id": itemID, + "customer_id": customerId, + "language_id": 1 + } + }; + await baseAppClient.post(GET_SHOPPING_CART, + onSuccess: (dynamic response, int statusCode) { + _wishListProducts.clear(); + response['shopping_carts'].forEach((item) { + _wishListProducts.add(Wishlist.fromJson(item)); + AppToast.showSuccessToast(message: 'You have added a product to the Wishlist'); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + AppToast.showErrorToast(message: 'something went wrong please try again'); + }, body: request); + } + + Future getWishlistItems() async { + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + hasError = false; + await baseAppClient.getPharmacy(GET_WISHLIST+customerId+"?shopping_cart_type=2", + onSuccess: (dynamic response, int statusCode) { + _wishListProducts.clear(); + response['shopping_carts'].forEach((item) { + _wishListProducts.add(Wishlist.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } + Future delteItemFromWishlist(itemID) async { + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + hasError = false; + await baseAppClient.getPharmacy(DELETE_WISHLIST+customerId+"+&product_id="+itemID+"&cart_type=Wishlist", + onSuccess: (dynamic response, int statusCode) { + _wishListProducts.clear(); + response['shopping_carts'].forEach((item) { + _wishListProducts.add(Wishlist.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } + + Future productSpecificationData(itemID) async { + hasError = false; + + await baseAppClient.getPharmacy(GET_SPECIFICATION+itemID, + onSuccess: (dynamic response, int statusCode) { + _productSpecification.clear(); + response['specification'].forEach((item) { + _productSpecification.add(SpecificationModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } + +} diff --git a/lib/services/pharmacy_services/review_service.dart b/lib/services/pharmacy_services/review_service.dart new file mode 100644 index 00000000..44839955 --- /dev/null +++ b/lib/services/pharmacy_services/review_service.dart @@ -0,0 +1,38 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/reviewModel.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; + + +class ReviewService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + bool isLogin = false; + List _reviewList = List(); + List get reviewList => _reviewList; + + + Future getReview() async { + + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + + hasError = false; + await baseAppClient.getPharmacy(GET_REVIEW+customerId, + onSuccess: (dynamic response, int statusCode) { + _reviewList.clear(); + response['reviews'].forEach((item) { + _reviewList.add(Review.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } + +} diff --git a/lib/services/pharmacy_services/wishList_service.dart b/lib/services/pharmacy_services/wishList_service.dart new file mode 100644 index 00000000..5404a2bd --- /dev/null +++ b/lib/services/pharmacy_services/wishList_service.dart @@ -0,0 +1,72 @@ +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/models/pharmacy/Wishlist.dart'; +import 'package:diplomaticquarterapp/models/pharmacy/products.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(); + bool isLogin = false; + List _wishListProducts = List(); + List get wishListProducts => _wishListProducts; + +// Future getWishlist() async { +// var isLogin = await sharedPref.getString(LOGIN_TOKEN_ID); +// this.isLogin = isLogin != null; +//// if (!isLogin) { +//// // if not login +//// } else { +//// try { +//// await baseAppClient.get( +//// GET_WISHLIST +'/productsbyids/5308,3608,2316,963,5045,2714,1480,',//+ "272843" + "?shopping_cart_type=2", +//// onSuccess: (dynamic response, int statusCode) { +//// wishListProducts.clear(); +//// response['shopping_carts'].forEach((item) { +//// wishListProducts.add(Product.fromJson(item)); +//// }); +//// }, onFailure: (String error, int statusCode) { +//// hasError = true; +//// super.error = error; +//// }); +//// } catch (error) { +//// throw error; +//// } +//// } +// hasError = false; +// try { +// await baseAppClient.getPharmacy(GET_WISHLIST+"1367368?shopping_cart_type=2", +// onSuccess: (dynamic response, int statusCode) { +// wishListProducts.clear(); +// response.forEach((item) { +// wishListProducts.add(Wishlist.fromJson(response)); +// }); +// }, onFailure: (String error, int statusCode) { +// hasError = true; +// super.error = error; +// }); +// } catch (error) { +// throw error; +// } +// } + + Future getWishlist() async { + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + hasError = false; + await baseAppClient.getPharmacy(GET_WISHLIST+customerId+"?shopping_cart_type=2", + onSuccess: (dynamic response, int statusCode) { + _wishListProducts.clear(); + response['shopping_carts'].forEach((item) { + _wishListProducts.add(Wishlist.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } + +} diff --git a/lib/services/pharmacy_services/writeReview_service.dart b/lib/services/pharmacy_services/writeReview_service.dart new file mode 100644 index 00000000..573095eb --- /dev/null +++ b/lib/services/pharmacy_services/writeReview_service.dart @@ -0,0 +1,40 @@ + +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 writeReviewService extends BaseService{ + + + + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + List get writeReview => writeReview; + List _writeReviewList = List(); + List get orderList => _writeReviewList; + + + Future getProductReview() async { + hasError = false; + await baseAppClient.getPharmacy(WRITE_REVIEW, + onSuccess: (dynamic response, int statusCode) { + _writeReviewList.clear(); + response[''].forEach((item) { + _writeReviewList.add(OrderModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } +} \ No newline at end of file diff --git a/lib/splashPage.dart b/lib/splashPage.dart index d367d3ec..20da2ba6 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -1,14 +1,19 @@ import 'dart:async'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'config/shared_pref_kay.dart'; +import 'config/size_config.dart'; import 'core/service/AuthenticatedUserObject.dart'; +import 'core/service/privilege_service.dart'; import 'core/viewModels/project_view_model.dart'; import 'locator.dart'; import 'models/Authentication/authenticated_user.dart'; +import 'widgets/transitions/slide_up_page.dart'; AppSharedPreferences sharedPref = new AppSharedPreferences(); AuthenticatedUserObject authenticatedUserObject = @@ -20,44 +25,36 @@ class SplashScreen extends StatefulWidget { } class _SplashScreenState extends State { - //Provider.of(context, listen: false).isLogin + PrivilegeService _privilegeService = locator(); @override void initState() { super.initState(); Timer( Duration(seconds: 1, milliseconds: 500), - () { - getUserData().then((value) { - Navigator.of(context).pushReplacement( - MaterialPageRoute( - builder: (BuildContext context) => LandingPage(), - ), - ); - }); + () { + loadPrivilege().then((value) { + Navigator.of(context).pushReplacement( + MaterialPageRoute( + builder: (BuildContext context) => LandingPage(), + ), + ); + }); + }, ); } - Future getUserData() async { - var data = await sharedPref.getObject(USER_PROFILE); - if (data != null) { - AuthenticatedUser userData = AuthenticatedUser.fromJson(data); - Provider.of(context, listen: false).isLogin = true; - authenticatedUserObject.isLogin = true; - authenticatedUserObject.user = userData; - } + /// load the Privilege from service + Future loadPrivilege() async { + await _privilegeService.getPrivilege(); + Provider.of(context, listen: false).setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, - body: Center( - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Image.asset('assets/images/DQ/DQ_logo.png'), - ), - ), + body: Image.asset('assets/images/powerd-by.jpg',fit: BoxFit.fitWidth,width: MediaQuery.of(context).size.width,), ); } } diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart index 0b148f49..e0367ba3 100644 --- a/lib/uitl/LocalNotification.dart +++ b/lib/uitl/LocalNotification.dart @@ -19,9 +19,10 @@ class LocalNotification { _instance._onNotificationClick = onNotificationClick; _instance._initialize(); }else{ - assert(false,(){ - "LocalNotification Already Initialized"; - }); + // assert(false,(){ + // //TODO fix it + // "LocalNotification Already Initialized"; + // }); } } diff --git a/lib/uitl/app_toast.dart b/lib/uitl/app_toast.dart index 8e45e3ce..5c917009 100644 --- a/lib/uitl/app_toast.dart +++ b/lib/uitl/app_toast.dart @@ -64,7 +64,7 @@ class AppToast { FlutterFlexibleToast.showToast( message: message, toastLength: toastLength, - timeInSeconds: timeInSeconds, + timeInSeconds: timeInSeconds=2, fontSize: fontSize, toastGravity: toastGravity, backgroundColor: Colors.green, @@ -87,7 +87,7 @@ class AppToast { static void showErrorToast({ @required String message, Toast toastLength = Toast.LENGTH_LONG, - int timeInSeconds, + int timeInSeconds=2, double fontSize = 16, ToastGravity toastGravity = ToastGravity.TOP, Color textColor = Colors.white, diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 1068dc74..460a4066 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -19,6 +19,23 @@ class DateUtil { return DateTime.now(); } + static DateTime convertStringToDateTime(String date) { + if (date != null) { + try { + var dateT = date.split('/'); + var year = dateT[2].substring(0, 4); + var dateP = + DateTime(int.parse(year), int.parse(dateT[1]), int.parse(dateT[0])); + return dateP; + } catch (e) { + print(e); + } + + return DateTime.now(); + } else + return DateTime.now(); + } + static String convertDateToString(DateTime date) { const start = "/Date("; const end = "+0300)"; @@ -236,6 +253,18 @@ class DateUtil { else return ""; } + /// get data formatted like Apr 26,2020 + /// [dateTime] convert DateTime to data formatted Arabic + static String getMonthDayYearDateFormattedAr(DateTime dateTime) { + if (dateTime != null) + return getMonthArabic(dateTime.month) + + " " + + dateTime.day.toString() + + ", " + + dateTime.year.toString(); + else + return ""; + } /// get data formatted like Thursday, Apr 26,2020 /// [dateTime] convert DateTime to date formatted @@ -261,6 +290,24 @@ class DateUtil { return ""; } + static String getMonthDayYearLangDateFormatted( + DateTime dateTime, String lang) { + if (dateTime != null) + return lang == 'en' + ? getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + " " + + dateTime.year.toString() + : dateTime.day.toString() + + " " + + getMonthArabic(dateTime.month) + + " " + + dateTime.year.toString(); + else + return ""; + } + /// get data formatted like 26/4/2020 /// [dateTime] convert DateTime to data formatted static String getDayMonthYearDateFormatted(DateTime dateTime) { @@ -310,6 +357,11 @@ 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 e3012734..c3799425 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -15,12 +15,13 @@ class LocationUtils { void getCurrentLocation() async { print("current location"); - isLocationServiceEnabled().then((value) { + Geolocator.isLocationServiceEnabled().then((value) { if (value) { - checkPermission().then((permission) { + Geolocator.checkPermission().then((permission) { if (permission == LocationPermission.always || permission == LocationPermission.whileInUse) { - getLastKnownPosition().then((value) => setLocation(value)); + Geolocator.getLastKnownPosition() + .then((value) => setLocation(value)); } if (permission == LocationPermission.denied || @@ -48,18 +49,21 @@ class LocationUtils { okFunction: () => { ConfirmDialog.closeAlertDialog(context), if (isPermissionError) - openAppSettings() + Geolocator.openAppSettings() else - openLocationSettings() + Geolocator.openLocationSettings() }, cancelFunction: () => {}); return dialog.showAlertDialog(context); } 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 != null ? position.latitude : 0.0); + this + .sharedPref + .setDouble(USER_LONG, position != null ? position.longitude : 0.0); } void setZeroLocation() { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 6a81a4b5..63cf8a44 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -58,9 +58,11 @@ class TranslationBase { String get nearestAppo => localizedValues['nearestAppo'][locale.languageCode]; - String get searchByDocText => localizedValues['searchByDocText'][locale.languageCode]; + String get searchByDocText => + localizedValues['searchByDocText'][locale.languageCode]; - String get enterDocName => localizedValues['enterDocName'][locale.languageCode]; + String get enterDocName => + localizedValues['enterDocName'][locale.languageCode]; String get search => localizedValues['search'][locale.languageCode]; @@ -70,15 +72,18 @@ class TranslationBase { String get appoInfo => localizedValues['appoInfo'][locale.languageCode]; - String get availableAppo => localizedValues['availableAppo'][locale.languageCode]; + String get availableAppo => + localizedValues['availableAppo'][locale.languageCode]; String get gender => localizedValues['gender'][locale.languageCode]; String get nationality => localizedValues['nationality'][locale.languageCode]; - String get docQualifications => localizedValues['docQualifications'][locale.languageCode]; + String get docQualifications => + localizedValues['docQualifications'][locale.languageCode]; - String get confirmAppoHeading => localizedValues['confirmAppoHeading'][locale.languageCode]; + String get confirmAppoHeading => + localizedValues['confirmAppoHeading'][locale.languageCode]; String get patientInfo => localizedValues['patientInfo'][locale.languageCode]; @@ -118,7 +123,8 @@ class TranslationBase { String get welcome => localizedValues['welcome'][locale.languageCode]; - String get welcomeText => localizedValues['welcome_text'][locale.languageCode]; + String get welcomeText => + localizedValues['welcome_text'][locale.languageCode]; String get welcomeText2 => localizedValues['welcome_text2'][locale.languageCode]; @@ -126,8 +132,10 @@ class TranslationBase { String get no => localizedValues['no'][locale.languageCode]; - String get logintypeRadio => localizedValues['logintyperadio'][locale.languageCode]; - String get registerInfoFamily => localizedValues['register-info-family'][locale.languageCode]; + String get logintypeRadio => + localizedValues['logintyperadio'][locale.languageCode]; + String get registerInfoFamily => + localizedValues['register-info-family'][locale.languageCode]; String get registerNow => localizedValues['registernow'][locale.languageCode]; @@ -137,13 +145,17 @@ class TranslationBase { String get fileNo => localizedValues['fileNo'][locale.languageCode]; String get fileno => localizedValues['fileno'][locale.languageCode]; - String get forgotPassword => localizedValues['forgotFileNo'][locale.languageCode]; + String get forgotPassword => + localizedValues['forgotFileNo'][locale.languageCode]; - String get forgotFileNoTitle => localizedValues['forgotFileNoTitle'][locale.languageCode]; + String get forgotFileNoTitle => + localizedValues['forgotFileNoTitle'][locale.languageCode]; - String get enterNationalId => localizedValues['enter-national-id'][locale.languageCode]; + String get enterNationalId => + localizedValues['enter-national-id'][locale.languageCode]; - String get profileInfo => localizedValues['profile-info'][locale.languageCode]; + String get profileInfo => + localizedValues['profile-info'][locale.languageCode]; String get submit => localizedValues['submit'][locale.languageCode]; @@ -153,31 +165,42 @@ class TranslationBase { String get hijriDate => localizedValues['hijri-date'][locale.languageCode]; - String get gregorianDate => localizedValues['gregorian-date'][locale.languageCode]; + String get gregorianDate => + localizedValues['gregorian-date'][locale.languageCode]; - String get verifyLoginWith => localizedValues['verify-login-with'][locale.languageCode]; + String get verifyLoginWith => + localizedValues['verify-login-with'][locale.languageCode]; String get register => localizedValues['register-user'][locale.languageCode]; - String get verifyFingerprint => localizedValues['verify-with-fingerprint'][locale.languageCode]; + String get verifyFingerprint => + localizedValues['verify-with-fingerprint'][locale.languageCode]; - String get verifyFaceID => localizedValues['verify-with-faceid'][locale.languageCode]; + String get verifyFaceID => + localizedValues['verify-with-faceid'][locale.languageCode]; - String get verifySMS => localizedValues['verify-with-sms'][locale.languageCode]; + String get verifySMS => + localizedValues['verify-with-sms'][locale.languageCode]; - String get verifyWhatsApp => localizedValues['verify-with-whatsapp'][locale.languageCode]; + String get verifyWhatsApp => + localizedValues['verify-with-whatsapp'][locale.languageCode]; String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; - String get lastLoginWith => localizedValues['last-login-with'][locale.languageCode]; + String get lastLoginWith => + localizedValues['last-login-with'][locale.languageCode]; - String get verifyFingerprint2 => localizedValues['verify-fingerprint'][locale.languageCode]; + String get verifyFingerprint2 => + localizedValues['verify-fingerprint'][locale.languageCode]; - String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; + String get searchMedicine => + localizedValues['searchMedicine'][locale.languageCode]; - String get searchMedicineHere => localizedValues['searchMedicineHere'][locale.languageCode]; + String get searchMedicineHere => + localizedValues['searchMedicineHere'][locale.languageCode]; - String get pendingPayment => localizedValues['pendingPayment'][locale.languageCode]; + String get pendingPayment => + localizedValues['pendingPayment'][locale.languageCode]; String get payNow => localizedValues['payNow'][locale.languageCode]; @@ -187,23 +210,33 @@ class TranslationBase { String get livecare => localizedValues['livecare'][locale.languageCode]; - String get upcomingNoAction => localizedValues['upcoming-noAction'][locale.languageCode]; + String get upcomingNoAction => + localizedValues['upcoming-noAction'][locale.languageCode]; - String get upcomingConfirm => localizedValues['upcoming-confirm'][locale.languageCode]; + String get upcomingConfirm => + localizedValues['upcoming-confirm'][locale.languageCode]; - String get upcomingPaymentPending => localizedValues['upcoming-payment-pending'][locale.languageCode]; + String get upcomingPaymentPending => + localizedValues['upcoming-payment-pending'][locale.languageCode]; + String get upcomingConfirmMore => + localizedValues['book-success-confirm-more-24-1-2'][locale.languageCode]; - String get upcomingPaymentNow => localizedValues['upcoming-payment-now'][locale.languageCode]; + String get upcomingPaymentNow => + localizedValues['upcoming-payment-now'][locale.languageCode]; String get upcomingQR => localizedValues['upcoming-QR'][locale.languageCode]; - String get upcomingVirtual => localizedValues['upcoming-virtual'][locale.languageCode]; + String get upcomingVirtual => + localizedValues['upcoming-virtual'][locale.languageCode]; - String get upcomingLivecare => localizedValues['upcoming-livecare'][locale.languageCode]; + String get upcomingLivecare => + localizedValues['upcoming-livecare'][locale.languageCode]; - String get liveCareAppo => localizedValues['livecareAppo'][locale.languageCode]; + String get liveCareAppo => + localizedValues['livecareAppo'][locale.languageCode]; - String get upcomingDetails => localizedValues['upcoming-details'][locale.languageCode]; + String get upcomingDetails => + localizedValues['upcoming-details'][locale.languageCode]; String get reschedule => localizedValues['reschedule'][locale.languageCode]; @@ -221,27 +254,36 @@ class TranslationBase { String get payment => localizedValues['payment'][locale.languageCode]; - String get cancel_nocaps => localizedValues['cancel-nocaps'][locale.languageCode]; + String get cancel_nocaps => + localizedValues['cancel-nocaps'][locale.languageCode]; - String get cancelAppoMsg => localizedValues['cancelAppoMsg'][locale.languageCode]; + String get cancelAppoMsg => + localizedValues['cancelAppoMsg'][locale.languageCode]; - String get pharmaciesList => localizedValues['pharmaciesList'][locale.languageCode]; + String get pharmaciesList => + localizedValues['pharmaciesList'][locale.languageCode]; String get description => localizedValues['description'][locale.languageCode]; String get price => localizedValues['price'][locale.languageCode]; - String get youCanFindItIn => localizedValues['youCanFindItIn'][locale.languageCode]; + String get youCanFindItIn => + localizedValues['youCanFindItIn'][locale.languageCode]; - String get pleaseEnterMedicineName => localizedValues['pleaseEnterMedicineName'][locale.languageCode]; + String get pleaseEnterMedicineName => + localizedValues['pleaseEnterMedicineName'][locale.languageCode]; - String get verificationMessage => localizedValues['verification_message'][locale.languageCode]; + String get verificationMessage => + localizedValues['verification_message'][locale.languageCode]; - String get validationMessage => localizedValues['validation_message'][locale.languageCode]; + String get validationMessage => + localizedValues['validation_message'][locale.languageCode]; - String get arabicChange => localizedValues['arabic-change'][locale.languageCode]; + String get arabicChange => + localizedValues['arabic-change'][locale.languageCode]; - String get notification => localizedValues['notification'][locale.languageCode]; + String get notification => + localizedValues['notification'][locale.languageCode]; String get appsetting => localizedValues['app-settings'][locale.languageCode]; @@ -258,20 +300,29 @@ class TranslationBase { String get moreVerification => localizedValues['more-verify'][locale.languageCode]; - String get welcomeBack => localizedValues['welcome-back'][locale.languageCode]; + String get welcomeBack => + localizedValues['welcome-back'][locale.languageCode]; - String get accountInfo => localizedValues['account-info'][locale.languageCode]; + String get accountInfo => + localizedValues['account-info'][locale.languageCode]; - String get useAnotherAccount => localizedValues['another-acc'][locale.languageCode]; + String get useAnotherAccount => + localizedValues['another-acc'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode]; - String get noNeedToWaitInLine => localizedValues['noNeedToWaitInLine'][locale.languageCode]; - String get useQRAppoAttend => localizedValues['useQRAppoAttend'][locale.languageCode]; - String get passQRAppoAttend => localizedValues['passQRAppoAttend'][locale.languageCode]; - String get sitWaitingQR => localizedValues['sitWaitingQR'][locale.languageCode]; - String get attendRegisterCode => localizedValues['attendRegisterCode'][locale.languageCode]; - String get scanQRHospital => localizedValues['scanQRHospital'][locale.languageCode]; + String get noNeedToWaitInLine => + localizedValues['noNeedToWaitInLine'][locale.languageCode]; + String get useQRAppoAttend => + localizedValues['useQRAppoAttend'][locale.languageCode]; + String get passQRAppoAttend => + localizedValues['passQRAppoAttend'][locale.languageCode]; + String get sitWaitingQR => + localizedValues['sitWaitingQR'][locale.languageCode]; + String get attendRegisterCode => + localizedValues['attendRegisterCode'][locale.languageCode]; + String get scanQRHospital => + localizedValues['scanQRHospital'][locale.languageCode]; String get sendEmail => localizedValues['sendEmail'][locale.languageCode]; String get close => localizedValues['close'][locale.languageCode]; String get booked => localizedValues['booked'][locale.languageCode]; @@ -312,9 +363,11 @@ class TranslationBase { String get myFamily => localizedValues['myFamily'][locale.languageCode]; String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; - String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; + String get respirationRate => + localizedValues['respirationRate'][locale.languageCode]; - String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; + String get bodyMeasurements => + localizedValues['bodyMeasurements'][locale.languageCode]; String get height => localizedValues['height'][locale.languageCode]; String get temperature => localizedValues['temperature'][locale.languageCode]; @@ -323,7 +376,8 @@ class TranslationBase { String get respiration => localizedValues['respiration'][locale.languageCode]; - String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; + String get bloodPressure => + localizedValues['bloodPressure'][locale.languageCode]; String get painScale => localizedValues['painScale'][locale.languageCode]; String get heart => localizedValues['heart'][locale.languageCode]; @@ -332,7 +386,8 @@ class TranslationBase { String get request => localizedValues['request'][locale.languageCode]; String get memberName => localizedValues['member-name'][locale.languageCode]; String get switchUser => localizedValues['switch-login'][locale.languageCode]; - String get removeMember => localizedValues['remove-membe'][locale.languageCode]; + String get removeMember => + localizedValues['remove-membe'][locale.languageCode]; String get allowView => localizedValues['allow-view'][locale.languageCode]; String get rejectView => localizedValues['reject-view'][locale.languageCode]; String get deleteView => localizedValues['delete-view'][locale.languageCode]; @@ -341,32 +396,49 @@ class TranslationBase { String get companyName => localizedValues['companyName'][locale.languageCode]; String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; - String get procedureName => localizedValues['procedureName'][locale.languageCode]; - String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; + String get procedureName => + localizedValues['procedureName'][locale.languageCode]; + String get procedureStatus => + localizedValues['procedureStatus'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; - String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; + String get totalApproval => + localizedValues['totalApproval'][locale.languageCode]; String get category => localizedValues['category'][locale.languageCode]; - String get expirationDate => localizedValues['expirationDate'][locale.languageCode]; + String get expirationDate => + localizedValues['expirationDate'][locale.languageCode]; String get patientCard => localizedValues['patientCard'][locale.languageCode]; - String get policyNumber => localizedValues['policyNumber'][locale.languageCode]; + String get policyNumber => + localizedValues['policyNumber'][locale.languageCode]; String get seeDetails => localizedValues['seeDetails'][locale.languageCode]; - String get insuranceCards => localizedValues['insuranceCards'][locale.languageCode]; + String get insuranceCards => + localizedValues['insuranceCards'][locale.languageCode]; String get requestType => localizedValues['requestType'][locale.languageCode]; - String get addFamilyMember => localizedValues['add-new-member'][locale.languageCode]; - String get removeFamilyMember => localizedValues['remove-family-member'][locale.languageCode]; - - String get myMedicalFile => localizedValues['MyMedicalFile'][locale.languageCode]; - String get myMedicalFileSubTitle => localizedValues['myMedicalFileSubTitle'][locale.languageCode]; + String get addFamilyMember => + localizedValues['add-new-member'][locale.languageCode]; + String get removeFamilyMember => + localizedValues['remove-family-member'][locale.languageCode]; + + String get myMedicalFile => + localizedValues['MyMedicalFile'][locale.languageCode]; + String get myMedicalFileSubTitle => + localizedValues['myMedicalFileSubTitle'][locale.languageCode]; String get viewMore => localizedValues['viewMore'][locale.languageCode]; - String get homeHealthCareService => localizedValues['homeHealthCareService'][locale.languageCode]; - String get onlinePharmacy => localizedValues['OnlinePharmacy'][locale.languageCode]; - String get emergencyService => localizedValues['EmergencyService'][locale.languageCode]; - String get onlinePaymentService => localizedValues['OnlinePaymentService'][locale.languageCode]; - String get offersAndPackages => localizedValues['OffersAndPackages'][locale.languageCode]; - String get comprehensiveMedicalCheckup => localizedValues['ComprehensiveMedicalCheckup'][locale.languageCode]; + String get homeHealthCareService => + localizedValues['homeHealthCareService'][locale.languageCode]; + String get onlinePharmacy => + localizedValues['OnlinePharmacy'][locale.languageCode]; + String get emergencyService => + localizedValues['EmergencyService'][locale.languageCode]; + String get onlinePaymentService => + localizedValues['OnlinePaymentService'][locale.languageCode]; + String get offersAndPackages => + localizedValues['OffersAndPackages'][locale.languageCode]; + String get comprehensiveMedicalCheckup => + localizedValues['ComprehensiveMedicalCheckup'][locale.languageCode]; String get hMGService => localizedValues['HMGService'][locale.languageCode]; - String get viewAllHabibMedicalService => localizedValues['ViewAllHabibMedicalService'][locale.languageCode]; + String get viewAllHabibMedicalService => + localizedValues['ViewAllHabibMedicalService'][locale.languageCode]; String get viewAll => localizedValues['viewAll'][locale.languageCode]; String get view => localizedValues['view'][locale.languageCode]; String get contactUs => localizedValues['ContactUs'][locale.languageCode]; @@ -385,114 +457,182 @@ class TranslationBase { String get emergencyServices => localizedValues['emergencyServices'][locale.languageCode]; String get nearester => localizedValues['nearester'][locale.languageCode]; String get locationa => localizedValues['locationa'][locale.languageCode]; - String get ambulancerequest => localizedValues['ambulancerequest'][locale.languageCode]; + String get ambulancerequest => + localizedValues['ambulancerequest'][locale.languageCode]; String get requestA => localizedValues['requestA'][locale.languageCode]; - String get consultation => localizedValues['consultation'][locale.languageCode]; + String get consultation => + localizedValues['consultation'][locale.languageCode]; String get logs => localizedValues['logs'][locale.languageCode]; - String get textToSpeech => localizedValues['textToSpeech'][locale.languageCode]; - - String get myAppointments => localizedValues['MyAppointments'][locale.languageCode]; - String get noBookedAppointments => localizedValues['NoBookedAppointments'][locale.languageCode]; - String get noConfirmedAppointments => localizedValues['NoConfirmedAppointments'][locale.languageCode]; - String get noArrivedAppointments => localizedValues['noArrivedAppointments'][locale.languageCode]; - String get myAppointmentsList => localizedValues['MyAppointmentsList'][locale.languageCode]; + String get textToSpeech => + localizedValues['textToSpeech'][locale.languageCode]; + + String get myAppointments => + localizedValues['MyAppointments'][locale.languageCode]; + String get noBookedAppointments => + localizedValues['NoBookedAppointments'][locale.languageCode]; + String get noConfirmedAppointments => + localizedValues['NoConfirmedAppointments'][locale.languageCode]; + String get noArrivedAppointments => + localizedValues['noArrivedAppointments'][locale.languageCode]; + String get myAppointmentsList => + localizedValues['MyAppointmentsList'][locale.languageCode]; String get radiology => localizedValues['Radiology'][locale.languageCode]; - String get radiologySubtitle => localizedValues['RadiologySubtitle'][locale.languageCode]; + String get radiologySubtitle => + localizedValues['RadiologySubtitle'][locale.languageCode]; String get lab => localizedValues['Lab'][locale.languageCode]; String get labSubtitle => localizedValues['LabSubtitle'][locale.languageCode]; String get medicines => localizedValues['Medicines'][locale.languageCode]; - String get medicinesSubtitle => localizedValues['MedicinesSubtitle'][locale.languageCode]; + String get medicinesSubtitle => + localizedValues['MedicinesSubtitle'][locale.languageCode]; String get vitalSigns => localizedValues['VitalSigns'][locale.languageCode]; - String get vitalSignsSubtitle => localizedValues['VitalSignsSubTitle'][locale.languageCode]; + String get vitalSignsSubtitle => + localizedValues['VitalSignsSubTitle'][locale.languageCode]; String get myMedical => localizedValues['MyMedical'][locale.languageCode]; - String get myMedicalSubtitle => localizedValues['MyMedicalSubtitle'][locale.languageCode]; + String get myMedicalSubtitle => + localizedValues['MyMedicalSubtitle'][locale.languageCode]; String get myDoctor => localizedValues['MyDoctor'][locale.languageCode]; - String get myDoctorSubtitle => localizedValues['MyDoctorSubtitle'][locale.languageCode]; + String get myDoctorSubtitle => + localizedValues['MyDoctorSubtitle'][locale.languageCode]; String get eye => localizedValues['Eye'][locale.languageCode]; String get eyeSubtitle => localizedValues['EyeSubtitle'][locale.languageCode]; String get insurance => localizedValues['Insurance'][locale.languageCode]; - String get insuranceSubtitle => localizedValues['InsuranceSubtitle'][locale.languageCode]; - String get updateInsurance => localizedValues['UpdateInsurance'][locale.languageCode]; - String get updateInsuranceSubtitle => localizedValues['UpdateInsuranceSubtitle'][locale.languageCode]; - String get insuranceApproval => localizedValues['InsuranceApproval'][locale.languageCode]; - String get insuranceApprovalSubtitle => localizedValues['InsuranceApprovalSubtitle'][locale.languageCode]; + String get insuranceSubtitle => + localizedValues['InsuranceSubtitle'][locale.languageCode]; + String get updateInsurance => + localizedValues['UpdateInsurance'][locale.languageCode]; + String get updateInsuranceSubtitle => + localizedValues['UpdateInsuranceSubtitle'][locale.languageCode]; + String get insuranceApproval => + localizedValues['InsuranceApproval'][locale.languageCode]; + String get insuranceApprovalSubtitle => + localizedValues['InsuranceApprovalSubtitle'][locale.languageCode]; String get allergies => localizedValues['Allergies'][locale.languageCode]; - String get allergiesSubtitle => localizedValues['AllergiesSubtitle'][locale.languageCode]; + String get allergiesSubtitle => + localizedValues['AllergiesSubtitle'][locale.languageCode]; String get myVaccines => localizedValues['MyVaccines'][locale.languageCode]; - String get myVaccinesSubtitle => localizedValues['MyVaccinesSubtitle'][locale.languageCode]; + String get myVaccinesSubtitle => + localizedValues['MyVaccinesSubtitle'][locale.languageCode]; String get medical => localizedValues['Medical'][locale.languageCode]; - String get medicalSubtitle => localizedValues['MedicalSubtitle'][locale.languageCode]; + String get medicalSubtitle => + localizedValues['MedicalSubtitle'][locale.languageCode]; String get monthly => localizedValues['Monthly'][locale.languageCode]; - String get monthlySubtitle => localizedValues['MonthlySubtitle'][locale.languageCode]; + String get monthlySubtitle => + localizedValues['MonthlySubtitle'][locale.languageCode]; String get sick => localizedValues['Sick'][locale.languageCode]; - String get sickSubtitle => localizedValues['SickSubtitle'][locale.languageCode]; + String get sickSubtitle => + localizedValues['SickSubtitle'][locale.languageCode]; String get myBalance => localizedValues['MyBalance'][locale.languageCode]; - String get myBalanceSubtitle => localizedValues['MyBalanceSubtitle'][locale.languageCode]; + String get myBalanceSubtitle => + localizedValues['MyBalanceSubtitle'][locale.languageCode]; String get patientCall => localizedValues['PatientCall'][locale.languageCode]; - String get patientCallSubtitle => localizedValues['PatientCallSubtitle'][locale.languageCode]; - String get smartWatches => localizedValues['SmartWatches'][locale.languageCode]; - String get smartWatchesSubtitle => localizedValues['SmartWatchesSubtitle'][locale.languageCode]; + String get patientCallSubtitle => + localizedValues['PatientCallSubtitle'][locale.languageCode]; + String get smartWatches => + localizedValues['SmartWatches'][locale.languageCode]; + String get smartWatchesSubtitle => + localizedValues['SmartWatchesSubtitle'][locale.languageCode]; String get myTrackers => localizedValues['MyTrackers'][locale.languageCode]; - String get myTrackersSubtitle => localizedValues['MyTrackersSubtitle'][locale.languageCode]; + String get myTrackersSubtitle => + localizedValues['MyTrackersSubtitle'][locale.languageCode]; String get askYour => localizedValues['AskYour'][locale.languageCode]; - String get askYourSubtitle => localizedValues['AskYourSubtitle'][locale.languageCode]; + String get askYourSubtitle => + localizedValues['AskYourSubtitle'][locale.languageCode]; String get internet => localizedValues['Internet'][locale.languageCode]; - String get internetSubtitle => localizedValues['InternetSubtitle'][locale.languageCode]; + String get internetSubtitle => + localizedValues['InternetSubtitle'][locale.languageCode]; String get chatbot => localizedValues['Chatbot'][locale.languageCode]; - String get chatbotSubtitle => localizedValues['ChatbotSubtitle'][locale.languageCode]; + String get chatbotSubtitle => + localizedValues['ChatbotSubtitle'][locale.languageCode]; String get timeLine => localizedValues['TimeLine'][locale.languageCode]; String get labOrders => localizedValues['LabOrders'][locale.languageCode]; String get billNo => localizedValues['BillNo'][locale.languageCode]; - String get prescriptions => localizedValues['Prescriptions'][locale.languageCode]; + String get prescriptions => + localizedValues['Prescriptions'][locale.languageCode]; String get history => localizedValues['History'][locale.languageCode]; String get orderNo => localizedValues['OrderNo'][locale.languageCode]; - String get orderDetails => localizedValues['OrderDetails'][locale.languageCode]; + String get orderDetails => + localizedValues['OrderDetails'][locale.languageCode]; String get vitalSign => localizedValues['VitalSign'][locale.languageCode]; - String get monthlyReports => localizedValues['MonthlyReports'][locale.languageCode]; + String get monthlyReports => + localizedValues['MonthlyReports'][locale.languageCode]; - String get locationDialogMessage => localizedValues['locationDialogMessage'][locale.languageCode]; - String get userViewRequest => localizedValues['user-view-requester'][locale.languageCode]; + String get locationDialogMessage => + localizedValues['locationDialogMessage'][locale.languageCode]; + String get userViewRequest => + localizedValues['user-view-requester'][locale.languageCode]; String get userView => localizedValues['user-view'][locale.languageCode]; - String get sentRequest => localizedValues['sent-requests'][locale.languageCode]; + String get sentRequest => + localizedValues['sent-requests'][locale.languageCode]; String get km => localizedValues['km'][locale.languageCode]; - String get patientHealthSummaryReport => localizedValues['PatientHealthSummaryReport'][locale.languageCode]; - String get toViewTheTermsAndConditions => localizedValues['ToViewTheTermsAndConditions'][locale.languageCode]; + String get patientHealthSummaryReport => + localizedValues['PatientHealthSummaryReport'][locale.languageCode]; + String get toViewTheTermsAndConditions => + localizedValues['ToViewTheTermsAndConditions'][locale.languageCode]; String get clickHere => localizedValues['ClickHere'][locale.languageCode]; - String get iAgreeToTheTermsAndConditions => localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode]; - String get iAgreeToTheTermsAndConditionsSubtitle => localizedValues['IAgreeToTheTermsAndConditionsSubtitle'][locale.languageCode]; + String get iAgreeToTheTermsAndConditions => + localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode]; + String get iAgreeToTheTermsAndConditionsSubtitle => + localizedValues['IAgreeToTheTermsAndConditionsSubtitle'] + [locale.languageCode]; String get save => localizedValues['Save'][locale.languageCode]; - String get userAgreement => localizedValues['UserAgreement'][locale.languageCode]; - String get updateSuccessfully => localizedValues['UpdateSuccessfully'][locale.languageCode]; - String get emailSentSuccessfully => localizedValues['EmailSentSuccessfully'][locale.languageCode]; - String get checkVaccineAvailability => localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode]; - String get myVaccinesAvailability => localizedValues['MyVaccinesAvailability'][locale.languageCode]; - String get paymentService => localizedValues['PaymentService'][locale.languageCode]; - String get paymentOnline => localizedValues['PaymentOnline'][locale.languageCode]; - String get onlineCheckIn => localizedValues['OnlineCheckIn'][locale.languageCode]; + String get userAgreement => + localizedValues['UserAgreement'][locale.languageCode]; + String get updateSuccessfully => + localizedValues['UpdateSuccessfully'][locale.languageCode]; + String get emailSentSuccessfully => + localizedValues['EmailSentSuccessfully'][locale.languageCode]; + String get checkVaccineAvailability => + localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode]; + String get myVaccinesAvailability => + localizedValues['MyVaccinesAvailability'][locale.languageCode]; + String get paymentService => + localizedValues['PaymentService'][locale.languageCode]; + String get paymentOnline => + localizedValues['PaymentOnline'][locale.languageCode]; + String get onlineCheckIn => + localizedValues['OnlineCheckIn'][locale.languageCode]; String get myBalances => localizedValues['MyBalances'][locale.languageCode]; - String get balanceAmount => localizedValues['BalanceAmount'][locale.languageCode]; - String get totalBalance => localizedValues['TotalBalance'][locale.languageCode]; - String get createAdvancedPayment => localizedValues['CreateAdvancedPayment'][locale.languageCode]; - String get advancePayment => localizedValues['AdvancePayment'][locale.languageCode]; - String get advancePaymentLabel => localizedValues['AdvancePaymentLabel'][locale.languageCode]; + String get balanceAmount => + localizedValues['BalanceAmount'][locale.languageCode]; + String get totalBalance => + localizedValues['TotalBalance'][locale.languageCode]; + String get createAdvancedPayment => + localizedValues['CreateAdvancedPayment'][locale.languageCode]; + String get advancePayment => + localizedValues['AdvancePayment'][locale.languageCode]; + String get advancePaymentLabel => + localizedValues['AdvancePaymentLabel'][locale.languageCode]; String get fileNumber => localizedValues['FileNumber'][locale.languageCode]; String get amount => localizedValues['Amount'][locale.languageCode]; - String get depositorEmail => localizedValues['DepositorEmail'][locale.languageCode]; + String get depositorEmail => + localizedValues['DepositorEmail'][locale.languageCode]; String get notes => localizedValues['Notes'][locale.languageCode]; - String get selectPatientName => localizedValues['SelectPatientName'][locale.languageCode]; - String get selectFamilyPatientName => localizedValues['SelectFamilyPatientName'][locale.languageCode]; - String get selectHospital => localizedValues['SelectHospital'][locale.languageCode]; + String get selectPatientName => + localizedValues['SelectPatientName'][locale.languageCode]; + String get selectFamilyPatientName => + localizedValues['SelectFamilyPatientName'][locale.languageCode]; + String get selectHospital => + localizedValues['SelectHospital'][locale.languageCode]; String get myAccount => localizedValues['MyAccount'][locale.languageCode]; - String get otherAccount => localizedValues['OtherAccount'][locale.languageCode]; - String get selectBeneficiary => localizedValues['SelectBeneficiary'][locale.languageCode]; - String get confirmThePayment => localizedValues['ConfirmThePayment'][locale.languageCode]; - String get depositorName => localizedValues['DepositorName'][locale.languageCode]; - String get mobileNumber => localizedValues['MobileNumber'][locale.languageCode]; + String get otherAccount => + localizedValues['OtherAccount'][locale.languageCode]; + String get selectBeneficiary => + localizedValues['SelectBeneficiary'][locale.languageCode]; + String get confirmThePayment => + localizedValues['ConfirmThePayment'][locale.languageCode]; + String get depositorName => + localizedValues['DepositorName'][locale.languageCode]; + String get mobileNumber => + localizedValues['MobileNumber'][locale.languageCode]; String get ok => localizedValues['Ok'][locale.languageCode]; - String get theVerificationCodeExpiresIn => localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; - String get pleaseEnterTheVerificationCode => localizedValues['PleaseEnterTheVerificationCode'][locale.languageCode]; - String get eyeMeasurements => localizedValues['EyeMeasurements'][locale.languageCode]; - String get measurements => localizedValues['Measurements'][locale.languageCode]; + String get theVerificationCodeExpiresIn => + localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; + String get pleaseEnterTheVerificationCode => + localizedValues['PleaseEnterTheVerificationCode'][locale.languageCode]; + String get eyeMeasurements => + localizedValues['EyeMeasurements'][locale.languageCode]; + String get measurements => + localizedValues['Measurements'][locale.languageCode]; String get classes => localizedValues['Classes'][locale.languageCode]; String get contactLens => localizedValues['ContactLens'][locale.languageCode]; String get rightEye => localizedValues['RightEye'][locale.languageCode]; @@ -506,120 +646,286 @@ class TranslationBase { String get power => localizedValues['Power'][locale.languageCode]; String get diameter => localizedValues['Diameter'][locale.languageCode]; String get remarks => localizedValues['Remarks'][locale.languageCode]; - String get activeMedications => localizedValues['ActiveMedications'][locale.languageCode]; + String get activeMedications => + localizedValues['ActiveMedications'][locale.languageCode]; String get expDate => localizedValues['ExpDate'][locale.languageCode]; String get route => localizedValues['Route'][locale.languageCode]; String get frequency => localizedValues['Frequency'][locale.languageCode]; - String get dailyQuantity => localizedValues['DailyQuantity'][locale.languageCode]; + String get dailyQuantity => + localizedValues['DailyQuantity'][locale.languageCode]; String get addReminder => localizedValues['AddReminder'][locale.languageCode]; String get reminderDes => localizedValues['reminderDes'][locale.languageCode]; String get startDay => localizedValues['StartDay'][locale.languageCode]; String get endDay => localizedValues['EndDay'][locale.languageCode]; String get days => localizedValues['Days'][locale.languageCode]; - String get scheduleTime => localizedValues['ScheduleTime'][locale.languageCode]; + String get scheduleTime => + localizedValues['ScheduleTime'][locale.languageCode]; String get askDoctor => localizedValues['AskDoctor'][locale.languageCode]; - String get doctorResponses => localizedValues['DoctorResponses'][locale.languageCode]; + String get doctorResponses => + localizedValues['DoctorResponses'][locale.languageCode]; String get newDes => localizedValues['New'][locale.languageCode]; String get all => localizedValues['All'][locale.languageCode]; - String get questionHere => localizedValues['QuestionHere'][locale.languageCode]; - String get viewDoctorResponses => localizedValues['ViewDoctorResponses'][locale.languageCode]; - String get serviceInformationButton => localizedValues['ServiceInformationButton'][locale.languageCode]; - String get serviceInformationTitle => localizedValues['ServiceInformationTitle'][locale.languageCode]; - String get serviceInformation => localizedValues['ServiceInformation'][locale.languageCode]; - String get homeHealthCare => localizedValues['HomeHealthCare'][locale.languageCode]; - String get homeHealthCareText => localizedValues['HomeHealthCareText'][locale.languageCode]; - String get loginRegister => localizedValues['LoginRegister'][locale.languageCode]; - String get orderLog => localizedValues['OrderLog'][locale.languageCode]; + String get questionHere => + localizedValues['QuestionHere'][locale.languageCode]; + String get viewDoctorResponses => + localizedValues['ViewDoctorResponses'][locale.languageCode]; + String get serviceInformationButton => + 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 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 shipBy => localizedValues['shipBy'][locale.languageCode]; + String get lakumPoints => localizedValues['lakumPoints'][locale.languageCode]; + String get use => localizedValues['use'][locale.languageCode]; + String get proceedPay => localizedValues['proceedPay'][locale.languageCode]; + String get vat => localizedValues['vat'][locale.languageCode]; + String get inclusiveVat => localizedValues['inclusiveVat'][locale.languageCode]; + String get items => localizedValues['items'][locale.languageCode]; + String get checkOut => localizedValues['checkOut'][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 => + localizedValues['HomeHealthCare'][locale.languageCode]; + String get HHCNotAuthMsg => + localizedValues['HHCNotAuthMsg'][locale.languageCode]; + String get homeHealthCareText => + localizedValues['HomeHealthCareText'][locale.languageCode]; + String get loginRegister => + localizedValues['LoginRegister'][locale.languageCode]; + String get orderLog => localizedValues['OrderLog'][locale.languageCode]; + // String get infoLab => localizedValues['info-lab'][locale.languageCode]; + // String get infoRadiology => + + String get orderNumber => localizedValues['orderNumber'][locale.languageCode]; + String get orderDate => localizedValues['orderDate'][locale.languageCode]; + String get itemsNo => localizedValues['itemsNo'][locale.languageCode]; + String get noOrder => localizedValues['noOrder'][locale.languageCode]; + String get review => localizedValues['review'][locale.languageCode]; + String get deliveredOrder => localizedValues['deliveredOrder'][locale.languageCode]; + String get pendingOrder => localizedValues['pendingOrder'][locale.languageCode]; + String get processingOrder => localizedValues['processingOrder'][locale.languageCode]; + String get cancelledOrder => localizedValues['cancelledOrder'][locale.languageCode]; + String get compare => localizedValues['compare'][locale.languageCode]; + String get medicationsRefill => localizedValues['medicationsRefill'][locale.languageCode]; + String get myPrescription => localizedValues['myPrescription'][locale.languageCode]; + String get quantity => localizedValues['quantity'][locale.languageCode]; + String get conditionsHMG => localizedValues['conditionsHMG'][locale.languageCode]; + String get conditions => localizedValues['conditions'][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 => localizedValues['shopByBrands'][locale.languageCode]; - String get recentlyViewed => localizedValues['recentlyViewed'][locale.languageCode]; - String get bestSellers => localizedValues['bestSellers'][locale.languageCode]; - String get deleteAllItems => localizedValues['deleteAllItems'][locale.languageCode]; - String get termsService => localizedValues['TermsService'][locale.languageCode]; + String get offersAndPromotions => + localizedValues['offersAndPromotions'][locale.languageCode]; + + String get searchAndScanMedication => + localizedValues['searchAndScanMedication'][locale.languageCode]; + String get shopByBrands => + localizedValues['shopByBrands'][locale.languageCode]; + String get recentlyViewed => + localizedValues['recentlyViewed'][locale.languageCode]; + 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]; String get beforeUsing => localizedValues['Beforeusing'][locale.languageCode]; String get accept => localizedValues['accept'][locale.languageCode]; - String get dataSafeInfo => localizedValues['data-safe-info'][locale.languageCode]; + String get dataSafeInfo => + localizedValues['data-safe-info'][locale.languageCode]; String get dataSafe => localizedValues['data-safe'][locale.languageCode]; - String get informational => localizedValues['informational'][locale.languageCode]; - String get checkDiagnosis => localizedValues['check-diagnosis'][locale.languageCode]; + String get informational => + localizedValues['informational'][locale.languageCode]; + String get checkDiagnosis => + localizedValues['check-diagnosis'][locale.languageCode]; String get remeberthat => localizedValues['remeberthat'][locale.languageCode]; - String get notUseInEmbergency => localizedValues['not-use-in-emerbency'][locale.languageCode]; - String get notUseInEmbergencyDetails => localizedValues['not-use-in-emerbency-details'][locale.languageCode]; - String get notUseInEmbergencyCall => localizedValues['not-use-in-emerbency-details-call'][locale.languageCode]; - String get selectGender => localizedValues['select-gender'][locale.languageCode]; + String get notUseInEmbergency => + localizedValues['not-use-in-emerbency'][locale.languageCode]; + String get notUseInEmbergencyDetails => + localizedValues['not-use-in-emerbency-details'][locale.languageCode]; + String get notUseInEmbergencyCall => + localizedValues['not-use-in-emerbency-details-call'][locale.languageCode]; + String get selectGender => + localizedValues['select-gender'][locale.languageCode]; String get iAma => localizedValues['i-am-a'][locale.languageCode]; 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 => localizedValues['AppointmentLabel'][locale.languageCode]; + String get appointmentLabel => + localizedValues['AppointmentLabel'][locale.languageCode]; String get bloodType => localizedValues['BloodType'][locale.languageCode]; - String get loginToUseService => localizedValues['loginToUseService'][locale.languageCode]; - String get maritalStatus => localizedValues['marital-status'][locale.languageCode]; + String get loginToUseService => + localizedValues['loginToUseService'][locale.languageCode]; + String get maritalStatus => + localizedValues['marital-status'][locale.languageCode]; String get general => localizedValues['general'][locale.languageCode]; String get profile => localizedValues['profile'][locale.languageCode]; - String get notifications => localizedValues['notifications'][locale.languageCode]; - String get notificationDetails => localizedValues['notificationDetails'][locale.languageCode]; - List get infoMyDoctorPoints => localizedValues['info-my-doctor-points'][locale.languageCode]; - String get infoMyDoctor => localizedValues['info-my-doctor'][locale.languageCode]; - String get infoPrescriptions => localizedValues['info-prescriptions'][locale.languageCode]; - List get infoPrescriptionsPoints => localizedValues['info-my-prescription-points'][locale.languageCode]; - - String get infoInsuranceCards => localizedValues['info-insurance-cards'][locale.languageCode]; - List get infoInsuranceCardsPoints => localizedValues['info-insurance-cards-points'][locale.languageCode]; - - String get infoAllergies => localizedValues['info-allergies'][locale.languageCode]; + String get notifications => + localizedValues['notifications'][locale.languageCode]; + String get notificationDetails => + localizedValues['notificationDetails'][locale.languageCode]; + List get infoMyDoctorPoints => + localizedValues['info-my-doctor-points'][locale.languageCode]; + String get infoMyDoctor => + localizedValues['info-my-doctor'][locale.languageCode]; + String get infoPrescriptions => + localizedValues['info-prescriptions'][locale.languageCode]; + List get infoPrescriptionsPoints => + localizedValues['info-my-prescription-points'][locale.languageCode]; + + String get infoInsuranceCards => + localizedValues['info-insurance-cards'][locale.languageCode]; + List get infoInsuranceCardsPoints => + localizedValues['info-insurance-cards-points'][locale.languageCode]; + + String get infoAllergies => + localizedValues['info-allergies'][locale.languageCode]; String get sickLeaves => localizedValues['sick-leaves'][locale.languageCode]; - String get infoSickLeaves => localizedValues['info-sick-leaves'][locale.languageCode]; - List get infoSickLeavePoints => localizedValues['info-sick-leave-points'][locale.languageCode]; - - String get infoApprovals => localizedValues['info-approvals'][locale.languageCode]; - List get infoApprovalPoints => localizedValues['info-approval-points'][locale.languageCode]; - - String get monthReport => localizedValues['month-report'][locale.languageCode]; - String get infoMonthReport => localizedValues['info-month-report'][locale.languageCode]; - String get languageSetting => localizedValues['language-setting'][locale.languageCode]; + String get infoSickLeaves => + localizedValues['info-sick-leaves'][locale.languageCode]; + List get infoSickLeavePoints => + localizedValues['info-sick-leave-points'][locale.languageCode]; + + String get infoApprovals => + localizedValues['info-approvals'][locale.languageCode]; + List get infoApprovalPoints => + localizedValues['info-approval-points'][locale.languageCode]; + + String get monthReport => + localizedValues['month-report'][locale.languageCode]; + String get infoMonthReport => + localizedValues['info-month-report'][locale.languageCode]; + String get languageSetting => + localizedValues['language-setting'][locale.languageCode]; String get alert => localizedValues['alert'][locale.languageCode]; String get emailAlert => localizedValues['email-alert'][locale.languageCode]; String get smsAlert => localizedValues['sms-alert'][locale.languageCode]; - String get contactInfo => localizedValues['contact-info'][locale.languageCode]; + String get contactInfo => + localizedValues['contact-info'][locale.languageCode]; String get emergencyName => localizedValues['emrg-name'][locale.languageCode]; - String get emergencyContact => localizedValues['emrg-no'][locale.languageCode]; + String get emergencyContact => + localizedValues['emrg-no'][locale.languageCode]; String get modes => localizedValues['modes'][locale.languageCode]; String get vibration => localizedValues['vibration'][locale.languageCode]; String get blindMode => localizedValues['blind-modes'][locale.languageCode]; - String get invertTheme => localizedValues['invert-theme'][locale.languageCode]; + String get invertTheme => + localizedValues['invert-theme'][locale.languageCode]; String get offTheme => localizedValues['off-theme'][locale.languageCode]; String get dimTheme => localizedValues['dim-theme'][locale.languageCode]; String get bwTheme => localizedValues['bw-theme'][locale.languageCode]; String get permissions => localizedValues['permissions'][locale.languageCode]; - String get cameraPermission => localizedValues['camera-permission'][locale.languageCode]; - String get locationPermission => localizedValues['location-permission'][locale.languageCode]; - String get accessibility => localizedValues['accessibility'][locale.languageCode]; - String get selectClinic => localizedValues['selectClinic'][locale.languageCode]; - String get reviews => localizedValues['reviews'][locale.languageCode]; + String get cameraPermission => + localizedValues['camera-permission'][locale.languageCode]; + String get locationPermission => + localizedValues['location-permission'][locale.languageCode]; + String get accessibility => + localizedValues['accessibility'][locale.languageCode]; + String get selectClinic => + localizedValues['selectClinic'][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]; String get service => localizedValues['Service'][locale.languageCode]; - String get hMGServiceLabel => localizedValues['HMGServiceLabel'][locale.languageCode]; - String get healthWeatherIndicators => localizedValues['HealthWeatherIndicators'][locale.languageCode]; - String get healthTipsBasedOnCurrentWeather => localizedValues['HealthTipsBasedOnCurrentWeather'][locale.languageCode]; + String get hMGServiceLabel => + localizedValues['HMGServiceLabel'][locale.languageCode]; + String get healthWeatherIndicators => + localizedValues['HealthWeatherIndicators'][locale.languageCode]; + String get healthTipsBasedOnCurrentWeather => + localizedValues['HealthTipsBasedOnCurrentWeather'][locale.languageCode]; String get moreDetails => localizedValues['MoreDetails'][locale.languageCode]; String get sendCopy => localizedValues['SendCopy'][locale.languageCode]; String get resendOrder => localizedValues['ResendOrder'][locale.languageCode]; @@ -633,7 +939,8 @@ class TranslationBase { String get mass => localizedValues['mass'][locale.languageCode]; String get tempC => localizedValues['temp-c'][locale.languageCode]; String get bpm => localizedValues['bpm'][locale.languageCode]; - String get respirationSigns => localizedValues['respiration-signs'][locale.languageCode]; + String get respirationSigns => + localizedValues['respiration-signs'][locale.languageCode]; String get sysDias => localizedValues['sys-dias'][locale.languageCode]; String get body => localizedValues['body'][locale.languageCode]; String get feedbackTitle => localizedValues['feedback'][locale.languageCode]; @@ -642,26 +949,302 @@ class TranslationBase { String get likeToHear => localizedValues['like-to-hear'][locale.languageCode]; String get subject => localizedValues['subject'][locale.languageCode]; String get message => localizedValues['message'][locale.languageCode]; - String get emptySubject => localizedValues['empty-subject'][locale.languageCode]; - String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; - String get selectAttachment => localizedValues['select-attachment'][locale.languageCode]; - String get complainAppo => localizedValues['complain-appo'][locale.languageCode]; - String get complainWithoutAppo => localizedValues['complain-without-appo'][locale.languageCode]; + String get emptySubject => + localizedValues['empty-subject'][locale.languageCode]; + String get emptyMessage => + localizedValues['empty-message'][locale.languageCode]; + String get selectAttachment => + localizedValues['select-attachment'][locale.languageCode]; + String get complainAppo => + localizedValues['complain-appo'][locale.languageCode]; + String get complainWithoutAppo => + localizedValues['complain-without-appo'][locale.languageCode]; String get question => localizedValues['question'][locale.languageCode]; - String get messageType => localizedValues['message-type'][locale.languageCode]; + String get messageType => + localizedValues['message-type'][locale.languageCode]; String get compliment => localizedValues['compliment'][locale.languageCode]; String get suggestion => localizedValues['suggestion'][locale.languageCode]; - String get yourFeedback => localizedValues['your-feedback'][locale.languageCode]; + String get yourFeedback => + localizedValues['your-feedback'][locale.languageCode]; String get selectPart => localizedValues['select-part'][locale.languageCode]; String get number => localizedValues['number'][locale.languageCode]; - String get notClassified => localizedValues['not-classified'][locale.languageCode]; - String get searchItemError => localizedValues['searchItemError'][locale.languageCode]; + String get notClassified => + localizedValues['not-classified'][locale.languageCode]; + String get searchItemError => + localizedValues['searchItemError'][locale.languageCode]; String get youCanFind => localizedValues['YouCanFind'][locale.languageCode]; String get itemInSearch => localizedValues['ItemInSearch'][locale.languageCode]; String get wantToConnectWithHmgNetwork => localizedValues['wantConnectHmgNetwork'][locale.languageCode]; String get failedToAccessHmgServices => localizedValues['failedToAccessHmgServices'][locale.languageCode]; String get enablingWifi => localizedValues['enablingWifi'][locale.languageCode]; String get offerAndPackages => localizedValues['offerAndPackages'][locale.languageCode]; + String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode]; + String get specialResult => + localizedValues['SpecialResult'][locale.languageCode]; + String get generalResult => + localizedValues['GeneralResult'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; + String get value => localizedValues['value'][locale.languageCode]; + String get range => localizedValues['range'][locale.languageCode]; + String get outpatient => localizedValues['out-patient'][locale.languageCode]; + String get inPatient => localizedValues['in-patient'][locale.languageCode]; + String get liveCare => localizedValues['liveCare'][locale.languageCode]; + String get report => localizedValues['report'][locale.languageCode]; + String get openRad => localizedValues['open-rad'][locale.languageCode]; + String get sendCopyRad => localizedValues['send-copy'][locale.languageCode]; + String get appoSurvey => localizedValues['appoSurvey'][locale.languageCode]; + String get labResults => localizedValues['labResults'][locale.languageCode]; + String get doctorRating => + localizedValues['doctorRating'][locale.languageCode]; + String get good => localizedValues['good'][locale.languageCode]; + String get v_good => localizedValues['v-good'][locale.languageCode]; + String get excellent => localizedValues['excellent'][locale.languageCode]; + String get below_average => + localizedValues['below-average'][locale.languageCode]; + String get infoSigns => localizedValues['info-signs'][locale.languageCode]; + String get infoAdvancePayment => + localizedValues['info-advance-payment'][locale.languageCode]; + String get infoMyBalance => + localizedValues['info-my-balance'][locale.languageCode]; + String get erContant => localizedValues['er-contant'][locale.languageCode]; + String get er => localizedValues['er'][locale.languageCode]; + String get transportationService => + localizedValues['transportation-Service'][locale.languageCode]; + String get infoAmbulance => + localizedValues['info-ambulance'][locale.languageCode]; + String get transportHeading => + localizedValues['RRT-transport-heading'][locale.languageCode]; + String get directionHeading => + localizedValues['RRT-direction-heading'][locale.languageCode]; + String get toHospital => localizedValues['to-hospital'][locale.languageCode]; + String get fromHospital => + localizedValues['from-hospital'][locale.languageCode]; + String get oneDirec => localizedValues['one-direc'][locale.languageCode]; + String get twoDirec => localizedValues['two-direc'][locale.languageCode]; + String get pickupLocation => + localizedValues['pickup-location'][locale.languageCode]; + String get pickupSpot => localizedValues['pickup-spot'][locale.languageCode]; + String get insideHome => localizedValues['inside-home'][locale.languageCode]; + String get haveAppo => localizedValues['have-appo'][locale.languageCode]; + String get dropoffLocation => + localizedValues['dropoff-location'][locale.languageCode]; + String get selectAll => localizedValues['select-all'][locale.languageCode]; + String get selectMap => localizedValues['select-map'][locale.languageCode]; + String get noAppointment => + localizedValues['no-appointment'][locale.languageCode]; + String get patientShareB => + localizedValues['patient-share'][locale.languageCode]; + String get patientShareTax => + localizedValues['patient-share-tax'][locale.languageCode]; + String get patientShareTotal => + localizedValues['patient-share-total'][locale.languageCode]; + String get selectAmbulate => + localizedValues['select-ambulate'][locale.languageCode]; + String get wheelchair => localizedValues['wheelchair'][locale.languageCode]; + String get walker => localizedValues['walker"'][locale.languageCode]; + String get stretcher => localizedValues['stretcher'][locale.languageCode]; + String get none => localizedValues['none'][locale.languageCode]; + String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; + String get billAmount => localizedValues['bill-amount'][locale.languageCode]; + String get transportMethod => + localizedValues['transport-method'][locale.languageCode]; + String get directions => localizedValues['directions'][locale.languageCode]; + + String get infoMyAppointments => + localizedValues['info-my-appointments'][locale.languageCode]; + String get infoTodo => localizedValues['info-todo'][locale.languageCode]; + String get familyInfo => localizedValues['family-info'][locale.languageCode]; + String get profileUpdate => + localizedValues['update-succ'][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 requestMedicalReport => + localizedValues['request-medical-report'][locale.languageCode]; + String get insurCards => localizedValues['insur-cards'][locale.languageCode]; + String get labResult => localizedValues['labResult'][locale.languageCode]; + String get details => localizedValues['details'][locale.languageCode]; + String get age => localizedValues['age'][locale.languageCode]; + String get activeInsurence => + localizedValues['active-insurence'][locale.languageCode]; + String get notActive => localizedValues['not-active'][locale.languageCode]; + String get cardDetail => localizedValues['card-detail'][locale.languageCode]; + String get dr => localizedValues['Dr'][locale.languageCode]; + String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; + String get instructions => + localizedValues['instructions'][locale.languageCode]; + String get instructionsPharmacies => + localizedValues['instructions-pharmacies'][locale.languageCode]; + String get selectHospitalDec => + localizedValues['select-hospital'][locale.languageCode]; + String get start => localizedValues['start'][locale.languageCode]; + String get infoChat => localizedValues['info-chat'][locale.languageCode]; + + String get noRecords => localizedValues['empty'][locale.languageCode]; + String get lastVisit => localizedValues['last-visit'][locale.languageCode]; + String get tapTitle => localizedValues['tap-title'][locale.languageCode]; + String get later => localizedValues['later'][locale.languageCode]; + + String get lastAppointment => + localizedValues['last-appointment'][locale.languageCode]; + String get rateClinic => localizedValues['rate-clinic'][locale.languageCode]; + String get fetchData => localizedValues['fetch-data'][locale.languageCode]; + + String get sendConfEmail => + localizedValues['send-email'][locale.languageCode]; + String get updateEmail => + localizedValues['update-email'][locale.languageCode]; + String get noDataAvailable => + localizedValues['noDataAvailable'][locale.languageCode]; + String get theName => localizedValues['thename'][locale.languageCode]; + String get noSearchResult => + localizedValues['noSearchResult'][locale.languageCode]; + String get selectFileSouse => + localizedValues['selectFileSouse'][locale.languageCode]; + String get rate => localizedValues['rate'][locale.languageCode]; + String get bookedSuccess => + localizedValues['booked-success'][locale.languageCode]; + String get appoReminder30 => + localizedValues['appo-reminder-select-option-30'][locale.languageCode]; + String get appoReminder60 => + localizedValues['appo-reminder-select-option-60'][locale.languageCode]; + String get appoReminder90 => + localizedValues['appo-reminder-select-option-90'][locale.languageCode]; + String get appoReminder120 => + localizedValues['appo-reminder-select-option-120'][locale.languageCode]; + String get gallery => localizedValues['gallery'][locale.languageCode]; + String get camera => localizedValues['camera'][locale.languageCode]; + String get medReport => localizedValues['med-report'][locale.languageCode]; + String get newMedReport => localizedValues['new-med-report'][locale.languageCode]; + String get requestReport => localizedValues['requestReport'][locale.languageCode]; + String get confirmMsgReport => localizedValues['confirm-msg-report'][locale.languageCode]; + String get successSendReport => localizedValues['successSendReport'][locale.languageCode]; + String get pulseTitle => localizedValues['pulseTitle'][locale.languageCode]; + String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; + String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; + String get policyHolder => localizedValues['policy-holder'][locale.languageCode]; + String get policyNo => localizedValues['policy-no'][locale.languageCode]; + String get expiryDateTitle => localizedValues['expiry-date'][locale.languageCode]; + String get classTitle => localizedValues['class'][locale.languageCode]; + String get approval => localizedValues['approval'][locale.languageCode]; + String get agree => localizedValues['agree'][locale.languageCode]; + String get disagree => localizedValues['disagree'][locale.languageCode]; + String get requestSent => localizedValues['request-sent'][locale.languageCode]; + String get attachInsuraceImage => localizedValues['attach-insurace-image'][locale.languageCode]; + String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode]; + String get scanNow => localizedValues['scan-now'][locale.languageCode]; + String get pharmacyServiceTermsCondition => localizedValues['pharmacyServiceTermsCondition'][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 topBrands => localizedValues['topBrands'][locale.languageCode]; + String get notifyMe => localizedValues['notifyMe'][locale.languageCode]; + String get specification => localizedValues['specification'][locale.languageCode]; + String get availability => localizedValues['availability'][locale.languageCode]; + String get quantitySize => localizedValues['quantitySize'][locale.languageCode]; + String get addToCart => localizedValues['addToCart'][locale.languageCode]; + String get buyNow => localizedValues['buyNow'][locale.languageCode]; + String get quantityShortcut => localizedValues['quantityShortcut'][locale.languageCode]; + + String get updatedEmail => + localizedValues['updated-email'][locale.languageCode]; + String get viewListChildren => + localizedValues['view-list-children'][locale.languageCode]; + 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 deletedChildMes => + localizedValues['deleted-child-mes'][locale.languageCode]; + String get visit => localizedValues['visit'][locale.languageCode]; + String get descriptionVaccination => + localizedValues['description-vaccination'][locale.languageCode]; + String get dueDate => localizedValues['due-date'][locale.languageCode]; + String get validEmail => localizedValues['valid-email'][locale.languageCode]; + String get confirmSend => + localizedValues['confirm-send'][locale.languageCode]; + String get emailSuccess => + localizedValues['email-success'][locale.languageCode]; + String get deletedChild => + localizedValues['deleted-child'][locale.languageCode]; + String get addInstructions => + localizedValues['add-instructions'][locale.languageCode]; + String get addedChild => localizedValues['added-child'][locale.languageCode]; + String get appUpdate => localizedValues['appUpdate'][locale.languageCode]; + String get ereferralSaveSuccess => + localizedValues['ereferralSaveSuccess'][locale.languageCode]; + String get 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]; + + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 3e1e4892..fdbb1314 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -2,12 +2,42 @@ import 'dart:convert'; import 'dart:core'; import 'dart:typed_data'; +import 'package:badges/badges.dart'; import 'package:connectivity/connectivity.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/Blood/my_balance_page.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/medical/active_medications/ActiveMedicationsPage.dart'; +import 'package:diplomaticquarterapp/pages/medical/allergies_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/ask_doctor/ask_doctor_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/eye/EyeMeasurementsPage.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_trackers/my_trackers.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/monthly_reports.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.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/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../Constants.dart'; import 'app_shared_preferences.dart'; import 'app_toast.dart'; +import 'gif_loader_dialog_utils.dart'; AppSharedPreferences sharedPref = new AppSharedPreferences(); @@ -160,7 +190,350 @@ class Utils { .hasMatch(email); } + static List myMedicalList({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) { + List medical = List(); + if (projectViewModel.havePrivilege(5)) { + medical.add(InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: MyAppointments(), + ), + ); + }, + child: isLogin + ? Container( + height: 120, + child: Stack(children: [ + MedicalProfileItem( + title: TranslationBase.of(context).myAppointments, + imagePath: 'my_appointment_icon.png', + subTitle: TranslationBase.of(context).myAppointmentsList, + hasBadge: true, + ), + Positioned( + right: 0.0, + child: Badge( + toAnimate: false, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), + style: + TextStyle(color: Colors.white, fontSize: 16.0)), + ), + ), + ), + ]), + ) + : MedicalProfileItem( + title: TranslationBase.of(context).myAppointments, + imagePath: 'my_appointment_icon.png', + subTitle: TranslationBase.of(context).myAppointmentsList, + hasBadge: true, + ), + )); + } + if (projectViewModel.havePrivilege(10)) { + medical.add(InkWell( + onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).lab, + imagePath: 'lab_result_icon.png', + subTitle: TranslationBase.of(context).labSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(7)) { + medical.add(InkWell( + onTap: () => + Navigator.push(context, FadePage(page: RadiologyHomePage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).radiology, + imagePath: 'radiology_icon.png', + subTitle: TranslationBase.of(context).radiologySubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(12)) { + medical.add(InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: HomePrescriptionsPage(), + ), + ); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).medicines, + imagePath: 'prescription_icon.png', + subTitle: TranslationBase.of(context).medicinesSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(25)) { + medical.add(InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: VitalSignDetailsScreen(), + ), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).vitalSigns, + imagePath: 'vital_signs.png', + subTitle: TranslationBase.of(context).vitalSignsSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(48)) { + medical.add(InkWell( + onTap: () => + Navigator.push(context, FadePage(page: ActiveMedicationsPage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).myMedical, + imagePath: 'active_medications.png', + subTitle: TranslationBase.of(context).myMedicalSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(6)) { + medical.add(InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: DoctorHomePage(), + ), + ); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myDoctor, + imagePath: 'doctor_icon.png', + subTitle: TranslationBase.of(context).myDoctorSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(14)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: EyeMeasurementsPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).eye, + imagePath: 'eye_measurement_icon.png', + subTitle: TranslationBase.of(context).eyeSubtitle, + ), + )); + } + if (projectViewModel.havePrivilege(22)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: InsuranceCard())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).insurance, + imagePath: 'insurance_card_icon.png', + subTitle: TranslationBase.of(context).insuranceSubtitle, + ), + )); + } + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: InsuranceUpdate())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).updateInsurance, + imagePath: 'insurance_update_icon_.png', + subTitle: TranslationBase.of(context).updateInsuranceSubtitle, + ), + )); + + if (projectViewModel.havePrivilege(18)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: InsuranceApproval())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).insuranceApproval, + imagePath: 'insurance_approvals_icon.png', + subTitle: TranslationBase.of(context).insuranceApprovalSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(23)) { + medical.add(InkWell( + onTap: () => Navigator.push(context, FadePage(page: AllergiesPage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).allergies, + imagePath: 'my_allergies_icon.png', + subTitle: TranslationBase.of(context).allergiesSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(26)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MyVaccines())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myVaccines, + imagePath: 'my_vaccines_icon.png', + subTitle: TranslationBase.of(context).myVaccinesSubtitle, + ), + )); + } + if (projectViewModel.havePrivilege(20)) + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: HomeReportPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).medical, + imagePath: 'medical_reports_icon.png', + subTitle: TranslationBase.of(context).medicalSubtitle, + ), + )); + + if (projectViewModel.havePrivilege(19)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MonthlyReportsPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).monthly, + imagePath: 'monthly_reports_icon.png', + subTitle: TranslationBase.of(context).monthlySubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(16)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: PatientSickLeavePage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).sick, + imagePath: 'sick_leaves_icons.png', + subTitle: TranslationBase.of(context).sickSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(47)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MyBalancePage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myBalance, + imagePath: 'check-in.png', + subTitle: TranslationBase.of(context).myBalanceSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(61)) { + medical.add(MedicalProfileItem( + title: TranslationBase.of(context).patientCall, + imagePath: 'medical_history_icon.png', + subTitle: TranslationBase.of(context).patientCallSubtitle, + )); + } + + if (projectViewModel.havePrivilege(24)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MyTrackers())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myTrackers, + imagePath: 'my_tracker_icon.png', + subTitle: TranslationBase.of(context).myTrackersSubtitle, + ), + )); + } + if (projectViewModel.havePrivilege(30)) + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: SmartWatchInstructions())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).smartWatches, + imagePath: 'smartwatch_icon.png', + subTitle: TranslationBase.of(context).smartWatchesSubtitle, + ), + )); + + if (projectViewModel.havePrivilege(28)) { + medical.add(InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AskDoctorHomPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).askYour, + imagePath: 'ask_doctor_icon.png', + subTitle: TranslationBase.of(context).askYourSubtitle, + ), + )); + } + if (projectViewModel.havePrivilege(32)) { + medical.add(InkWell( + onTap: () { + if (projectViewModel.isLogin) { + String patientID = AuthProvider().getAuthenticatedUser().patientID.toString(); + GifLoaderDialogUtils.showMyDialog(context); + projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}); + } else { + AlertDialogBox( + context: context, + confirmMessage: "Please login with your account first to use this feature", + okText: "OK", + okFunction: () { + AlertDialogBox.closeAlertDialog(context); + }).showAlertDialog(context); + } + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).internet, + imagePath: 'insurance_card_icon.png', + subTitle: TranslationBase.of(context).internetSubtitle, + ), + )); + } + + if (projectViewModel.havePrivilege(40)) { + medical.add(InkWell( +// onTap: () { +// Navigator.push( +// context, FadePage(page: InsuranceApproval())); +// }, + child: MedicalProfileItem( + title: TranslationBase.of(context).chatbot, + imagePath: 'insurance_approvals_icon.png', + subTitle: TranslationBase.of(context).chatbotSubtitle, + ), + )); + } + + return medical; + } } + // extension function that use in iterations(list.. etc) to iterate items and get index and item it self extension IndexedIterable on Iterable { Iterable mapIndexed(T Function(E e, int i) f) { diff --git a/lib/widgets/Loader/gif_loader_container.dart b/lib/widgets/Loader/gif_loader_container.dart index 06c151c9..b7a20339 100644 --- a/lib/widgets/Loader/gif_loader_container.dart +++ b/lib/widgets/Loader/gif_loader_container.dart @@ -36,7 +36,7 @@ class _GifLoaderContainerState extends State child: GifImage( controller: controller1, image: AssetImage( - "assets/images/progress-loading.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), + "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), ), )); } diff --git a/lib/widgets/avatar/large_avatar.dart b/lib/widgets/avatar/large_avatar.dart index ed904d03..fcfcaa94 100644 --- a/lib/widgets/avatar/large_avatar.dart +++ b/lib/widgets/avatar/large_avatar.dart @@ -37,7 +37,7 @@ class LargeAvatar extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(radius)), child: Image.network( url.trim(), - fit: BoxFit.cover, + fit: BoxFit.fill, width: width, height: height, ), diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 21cbebba..66a83224 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -1,9 +1,15 @@ +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import '../../d_q_icons_icons.dart'; import 'bottom_navigation_item.dart'; @@ -20,12 +26,31 @@ class BottomNavBar extends StatefulWidget { class _BottomNavBarState extends State { int _index = 0; + ToDoCountProviderModel model; + AuthenticatedUserObject authenticatedUserObject = + locator(); + _changeIndex(int index) { - widget.changeIndex(index); + if (index != 4) + widget.changeIndex(index); + else { + if (authenticatedUserObject.isLogin) { + if (model.count != 0) { + widget.changeIndex(index); + } else { + AppToast.showErrorToast( + message: TranslationBase.of(context).upcomingEmpty); + } + } else { + widget.changeIndex(index); + } + } } @override Widget build(BuildContext context) { + model = Provider.of(context); + ProjectViewModel projectViewModel = Provider.of(context); return BottomAppBar( elevation: 4, shape: CircularNotchedRectangle(), @@ -52,7 +77,7 @@ class _BottomNavBarState extends State { currentIndex: 1, name: TranslationBase.of(context).medicalProfile, ), - if(widget.index == 0) + if(widget.index == 0 && projectViewModel.havePrivilege(34)) Expanded( child: SizedBox( height: 50, @@ -65,7 +90,7 @@ class _BottomNavBarState extends State { ), ), ), - if(widget.index != 0) + if(widget.index != 0 && projectViewModel.havePrivilege(34)) BottomNavigationItem( icon: EvaIcons.calendar, activeIcon: EvaIcons.calendar, @@ -83,6 +108,7 @@ class _BottomNavBarState extends State { currentIndex: 3, name: TranslationBase.of(context).myFamily, ), + if(projectViewModel.havePrivilege(51)) BottomNavigationItem( icon: EvaIcons.calendar, activeIcon: EvaIcons.calendar, @@ -103,6 +129,7 @@ class _BottomNavBarState extends State { } Future navigateToToDoList(context) async { - Navigator.push(context, MaterialPageRoute(builder: (context) => ToDo())); + Navigator.push(context, + MaterialPageRoute(builder: (context) => ToDo(isShowAppBar: false))); } } diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index ba35f3c6..391b6a3d 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -8,6 +8,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../Constants.dart'; + class BottomNavigationItem extends StatelessWidget { final IconData icon; final IconData activeIcon; @@ -49,7 +51,7 @@ class BottomNavigationItem extends StatelessWidget { Container( child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index - ? Theme.of(context).primaryColor + ? secondaryColor : Theme.of(context).dividerColor, size: 22.0), ), @@ -60,7 +62,7 @@ class BottomNavigationItem extends StatelessWidget { name, textAlign: TextAlign.center, color: currentIndex == index - ? Theme.of(context).primaryColor + ? secondaryColor : Colors.grey, fontSize: 11, ), @@ -69,7 +71,7 @@ class BottomNavigationItem extends StatelessWidget { ), ], ) - : authenticatedUserObject.isLogin + : (authenticatedUserObject.isLogin && model.isShowBadge) ? Stack( alignment: AlignmentDirectional.center, children: [ @@ -80,7 +82,7 @@ class BottomNavigationItem extends StatelessWidget { toAnimate: false, position: BadgePosition.topEnd(), shape: BadgeShape.circle, - badgeColor: Color(0xFF40ACC9).withOpacity(1.0), + badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( padding: EdgeInsets.all(2.0), @@ -101,7 +103,7 @@ class BottomNavigationItem extends StatelessWidget { child: Icon( currentIndex == index ? activeIcon : icon, color: currentIndex == index - ? Theme.of(context).primaryColor + ? secondaryColor : Theme.of(context).dividerColor, size: 22.0), ), @@ -134,7 +136,7 @@ class BottomNavigationItem extends StatelessWidget { child: Icon( currentIndex == index ? activeIcon : icon, color: currentIndex == index - ? Theme.of(context).primaryColor + ? secondaryColor : Theme.of(context).dividerColor, size: 22.0), ), @@ -145,7 +147,7 @@ class BottomNavigationItem extends StatelessWidget { name, textAlign: TextAlign.center, color: currentIndex == index - ? Theme.of(context).primaryColor + ? secondaryColor : Colors.grey, fontSize: 11, ), diff --git a/lib/widgets/bottom_options/BottomSheet.dart b/lib/widgets/bottom_options/BottomSheet.dart index 66ee36c4..7bbadd8c 100644 --- a/lib/widgets/bottom_options/BottomSheet.dart +++ b/lib/widgets/bottom_options/BottomSheet.dart @@ -1,13 +1,14 @@ import 'dart:convert'; import 'dart:io'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:feather_icons_flutter/feather_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:image_picker/image_picker.dart'; class ImageOptions { - static showImageOptions(BuildContext context, Function(String) image) { + static showImageOptions(BuildContext context, Function(String,File) image,) { showModalBottomSheet( backgroundColor: Colors.transparent, context: context, @@ -15,10 +16,10 @@ class ImageOptions { return _BottomSheet( children: [ _BottomSheetItem( - title: "Select file souse", + title: TranslationBase.of(context).selectFileSouse, ), _BottomSheetItem( - title: "Gallery", + title: TranslationBase.of(context).gallery, icon: FeatherIcons.image, onTap: () async { File _image = @@ -27,12 +28,12 @@ class ImageOptions { final bytes = File(fileName).readAsBytesSync(); String base64Encode = base64.encode(bytes); if (base64Encode != null) { - image(base64Encode); + image(base64Encode,_image); } }, ), _BottomSheetItem( - title: "Camera", + title: TranslationBase.of(context).camera, icon: FeatherIcons.camera, onTap: () async { File _image = @@ -41,13 +42,15 @@ class ImageOptions { final bytes = File(fileName).readAsBytesSync(); String base64Encode = base64.encode(bytes); if (base64Encode != null) { - image(base64Encode); + image(base64Encode,_image); } }, ), _BottomSheetItem( - title: "Cancel", - onTap: (){}, + title: TranslationBase.of(context).cancel, + onTap: (){ + + }, ) ], ); diff --git a/lib/widgets/buttons/borderedButton.dart b/lib/widgets/buttons/borderedButton.dart index 5e05448e..b0bbdaf0 100644 --- a/lib/widgets/buttons/borderedButton.dart +++ b/lib/widgets/buttons/borderedButton.dart @@ -4,55 +4,91 @@ import 'package:flutter/material.dart'; class BorderedButton extends StatelessWidget { final String text; final Function handler; - final Color color; + final Color textColor; 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; + final bool hasShadow; BorderedButton( this.text, { this.handler, - this.color, + this.textColor, 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, + this.hasShadow = false, }); @override Widget build(BuildContext context) { - 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, - 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), + return GestureDetector( + onTap: () { + handler(); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: backgroundColor ?? Colors.white, + borderRadius: BorderRadius.circular(radius), + border: Border.fromBorderSide(BorderSide( + color: hasBorder ? borderColor : Colors.white, + width: 0.8, + )), + boxShadow: [ + BoxShadow( + color: !hasShadow ? Colors.transparent : Colors.grey.withOpacity(0.5), + // spreadRadius: 5, + blurRadius: 15.0, + offset: Offset(0.0, 0.75) // changes position of shadow + ), + ]), + 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)), + ), + ), + ], ), - ), //your original button + ), ), ); } diff --git a/lib/widgets/buttons/button.dart b/lib/widgets/buttons/button.dart index 597106c9..5d7c9257 100644 --- a/lib/widgets/buttons/button.dart +++ b/lib/widgets/buttons/button.dart @@ -1,7 +1,9 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; /// Button widget /// [label] button label @@ -80,6 +82,7 @@ class _ButtonState extends State